Skip to content

Commit

Permalink
Move publications colleges to partial, clean up html alignment on pub…
Browse files Browse the repository at this point in the history
…lication forms
  • Loading branch information
Janell-Huyck committed Jan 29, 2024
1 parent a1b2dbf commit 8772650
Show file tree
Hide file tree
Showing 15 changed files with 340 additions and 467 deletions.
54 changes: 20 additions & 34 deletions app/views/artworks/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,33 @@
<% end %>

<%= render partial: "partials/author", locals: {name: "artwork", publication: @artwork} %>
<hr>

<%= render partial: "partials/publications_colleges", locals: {form: form} %>
<hr>

<div class="form-row">
<div class="form-group col-md-6">
<%= form.label(:college_ids, "Author College(s)") %><br />
<%= form.collection_check_boxes :college_ids, College.all, :id, :name do |c| %>
<div class="form-check">
<%= c.check_box class: "form-check-input" %>
<%= c.label class: "form-check-label" %>
</div>
<% end %>
<div class="col-md-6">
<div class="form-group">
<%= form.label(:uc_department, "UC Department(s) or Division(s)") %>
<%= form.text_field :uc_department, class: "form-control" %>
</div>

<div class="col-md-6">
<div class="form-group">
<%= form.label(:uc_department, "UC Department(s) or Division(s)") %>
<%= form.text_field :uc_department, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :work_title, 'Title of Submitted Work', class: "required" %>
<%= form.text_field :work_title, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :other_title, 'Other Title' %>
<%= form.text_field :other_title, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :date, 'Date of Composition' %>
<%= form.text_field :date, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :work_title, 'Title of Submitted Work', class: "required" %>
<%= form.text_field :work_title, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :other_title, 'Other Title' %>
<%= form.text_field :other_title, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :date, 'Date of Composition' %>
<%= form.text_field :date, class: "form-control" %>
</div>
</div>
</div>

<div class="form-row">
<div id="other_college_group" class="form-group col-md-6">
<%= form.label :other_college, 'Other College' %>
<%= form.text_field :other_college, class: "form-control" %>
</div>
</div>

<%= hidden_field_tag "artwork[submitter_id]", session[:submitter_id] || @artwork.submitter_id %>
<%= hidden_field_tag "artwork[submitter_id]", session[:submitter_id] || @artwork.submitter_id %>

<div class="actions">
<%= form.submit "Submit", class: "btn btn-primary" %>
Expand Down
59 changes: 24 additions & 35 deletions app/views/book_chapters/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,37 @@
<% end %>

<%= render partial: "partials/author", locals: {name: "book_chapter", publication: @book_chapter} %>
<hr>

<%= render partial: "partials/publications_colleges", locals: {form: form} %>
<hr>

<div class="form-row">
<div class="form-group col-md-6">
<%= form.label(:college_ids, "UC College") %><br />
<%= form.collection_check_boxes :college_ids, College.all, :id, :name do |c| %>
<div class="form-check">
<%= c.check_box class: "form-check-input" %>
<%= c.label class: "form-check-label" %>
</div>
<% end %>
<div class="col-md-6">
<div class="form-group">
<%= form.label(:uc_department, "UC Department(s) or Division(s)") %>
<%= form.text_field :uc_department, class: "form-control" %>
</div>

<div class="col-md-6">
<div class="form-group">
<%= form.label(:uc_department, "UC Department(s) or Division(s)") %>
<%= form.text_field :uc_department, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :work_title, 'Title of Submitted Work', class: "required" %>
<%= form.text_field :work_title, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :other_title, 'Other Title' %>
<%= form.text_field :other_title, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :publisher %>
<%= form.text_field :publisher, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :city %>
<%= form.text_field :city, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :work_title, 'Title of Submitted Work', class: "required" %>
<%= form.text_field :work_title, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :other_title, 'Other Title' %>
<%= form.text_field :other_title, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :publisher %>
<%= form.text_field :publisher, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :city %>
<%= form.text_field :city, class: "form-control" %>
</div>
</div>
</div>

<div class="form-row">
<div id="other_college_group" class="form-group col-md-6">
<%= form.label :other_college, 'Other College' %>
<%= form.text_field :other_college, class: "form-control" %>
</div>
<div class="form-group col-md-6">
<%= form.label :publication_date, 'Publication Date' %>
<%= form.text_field :publication_date, class: "form-control" %>
Expand All @@ -76,7 +65,7 @@
</div>
</div>

<%= hidden_field_tag "book_chapter[submitter_id]", session[:submitter_id] || @book_chapter.submitter_id %>
<%= hidden_field_tag "book_chapter[submitter_id]", session[:submitter_id] || @book_chapter.submitter_id %>

<div class="actions">
<%= form.submit "Submit", class: "btn btn-primary" %>
Expand Down
56 changes: 22 additions & 34 deletions app/views/books/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,37 @@
<% end %>

<%= render partial: "partials/author", locals: {name: "book", publication: @book} %>
<hr>

<%= render partial: "partials/publications_colleges", locals: {form: form} %>
<hr>

<div class="form-row">
<div class="form-group col-md-6">
<%= form.label(:college_ids, "Author College(s)") %><br />
<%= form.collection_check_boxes :college_ids, College.all, :id, :name do |c| %>
<div class="form-check">
<%= c.check_box class: "form-check-input" %>
<%= c.label class: "form-check-label" %>
</div>
<% end %>
<div class="col-md-6">
<div class="form-group">
<%= form.label(:uc_department, "UC Department(s) or Division(s)") %>
<%= form.text_field :uc_department, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :work_title, 'Title of Submitted Work', class: "required" %>
<%= form.text_field :work_title, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :other_title, 'Other Title' %>
<%= form.text_field :other_title, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :publisher %>
<%= form.text_field :publisher, class: "form-control" %>
</div>

<div class="col-md-6">

<div class="form-group">
<%= form.label(:uc_department, "UC Department(s) or Division(s)") %>
<%= form.text_field :uc_department, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :work_title, 'Title of Submitted Work', class: "required" %>
<%= form.text_field :work_title, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :other_title, 'Other Title' %>
<%= form.text_field :other_title, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :publisher %>
<%= form.text_field :publisher, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :city %>
<%= form.text_field :city, class: "form-control" %>
</div>
</div>
</div>
</div>

<div class="form-row">
<div id="other_college_group" class="form-group col-md-6">
<%= form.label :other_college, 'Other College' %>
<%= form.text_field :other_college, class: "form-control" %>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<%= form.label :publication_date, 'Publication Date' %>
<%= form.text_field :publication_date, class: "form-control" %>
Expand All @@ -70,7 +58,7 @@
</div>
</div>

<%= hidden_field_tag "book[submitter_id]", session[:submitter_id] || @book.submitter_id %>
<%= hidden_field_tag "book[submitter_id]", session[:submitter_id] || @book.submitter_id %>

<div class="actions">
<%= form.submit "Submit", class: "btn btn-primary" %>
Expand Down
7 changes: 4 additions & 3 deletions app/views/colleges/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
<h4 class="alert-heading"><%= pluralize(college.errors.count, "error") %> found:</h4>
<hr>
<ul>
<% college.errors.full_messages.each do |message| %>
<p class="mb-0"><%= message %></p>
<% end %>
<% college.errors.full_messages.each do |message| %>
<p class="mb-0"><%= message %></p>
<% end %>
</ul>
</div>
<% end %>

Expand Down
59 changes: 24 additions & 35 deletions app/views/digital_projects/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,37 @@
<% end %>

<%= render partial: "partials/author", locals: {name: "digital_project", publication: @digital_project} %>
<hr>

<%= render partial: "partials/publications_colleges", locals: {form: form} %>
<hr>

<div class="form-row">
<div class="form-group col-md-6">
<%= form.label(:college_ids, "Author College(s)") %><br />
<%= form.collection_check_boxes :college_ids, College.all, :id, :name do |c| %>
<div class="form-check">
<%= c.check_box class: "form-check-input" %>
<%= c.label class: "form-check-label" %>
</div>
<% end %>
<div class="col-md-6">
<div class="form-group">
<%= form.label(:uc_department, "UC Department(s) or Division(s)") %>
<%= form.text_field :uc_department, class: "form-control" %>
</div>

<div class="col-md-6">
<div class="form-group">
<%= form.label(:uc_department, "UC Department(s) or Division(s)") %>
<%= form.text_field :uc_department, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :work_title, 'Title of Submitted Work', class: "required" %>
<%= form.text_field :work_title, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :other_title, 'Other Title' %>
<%= form.text_field :other_title, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :name_of_site, 'Name of Site' %>
<%= form.text_field :name_of_site, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :name_of_affiliated_organization, 'Name of Affiliated Organization' %>
<%= form.text_field :name_of_affiliated_organization, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :work_title, 'Title of Submitted Work', class: "required" %>
<%= form.text_field :work_title, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :other_title, 'Other Title' %>
<%= form.text_field :other_title, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :name_of_site, 'Name of Site' %>
<%= form.text_field :name_of_site, class: "form-control" %>
</div>
<div class="form-group">
<%= form.label :name_of_affiliated_organization, 'Name of Affiliated Organization' %>
<%= form.text_field :name_of_affiliated_organization, class: "form-control" %>
</div>
</div>
</div>

<div class="form-row">
<div id="other_college_group" class="form-group col-md-6">
<%= form.label :other_college, 'Other College' %>
<%= form.text_field :other_college, class: "form-control" %>
</div>
<div class="form-group col-md-6">
<%= form.label :version %>
<%= form.text_field :version, class: "form-control" %>
Expand All @@ -77,7 +66,7 @@
</div>
</div>

<%= hidden_field_tag "digital_project[submitter_id]", session[:submitter_id] || @digital_project.submitter_id %>
<%= hidden_field_tag "digital_project[submitter_id]", session[:submitter_id] || @digital_project.submitter_id %>

<div class="actions">
<%= form.submit "Submit", class: "btn btn-primary" %>
Expand Down
Loading

0 comments on commit 8772650

Please sign in to comment.