Skip to content

Commit

Permalink
Merge branch 'add-admin-toolbox-section' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
garethrees committed Sep 6, 2023
2 parents 1a69464 + 5079207 commit 213695e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 18 deletions.
11 changes: 11 additions & 0 deletions app/assets/stylesheets/admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,17 @@ body.admin {
padding: 2em;
}

/* Toolbox */
.toolbox {
summary {
margin-bottom: 1em;
}

.toolbox-tool {
margin-bottom: 1em;
}
}

/* Bootstrap Extensions */
/* These must come last because we @import bootstrap in .admin */

Expand Down
42 changes: 24 additions & 18 deletions app/views/admin_public_body/_one_list.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,30 @@

<hr />

<div>
<%= form_tag(mass_tag_admin_bodies_path, method: "post", class: "form form-inline" ) do %>
<%= text_field_tag 'tag', params[:tag], { size: 15, id: "mass_tag_tag_" + table_name } %>
<%= hidden_field_tag(:query, params[:query], { id: "mass_tag_query_" + table_name } ) %>
<%= hidden_field_tag(:page, params[:page], { id: "mass_page_" + table_name } ) %>
<%= hidden_field_tag(:table_name, table_name, { id: "mass_tag_table_name_" + table_name } ) %>
<%= submit_tag 'Add tag to all', class: 'btn btn-warning', data: { confirm: 'Are you sure you want to add the new tag to these authorities?' } %>
<% end %>
<div id="extra-tools" class="toolbox">
<details>
<summary>🧰 Extra tools…</summary>

<% if table_name == 'exact' %>
<%= form_tag(mass_tag_admin_bodies_path, method: "delete", class: "form form-inline" ) do %>
<%= hidden_field_tag 'tag', params[:query], { id: "mass_tag_tag_" + table_name } %>
<%= hidden_field_tag(:query, params[:query], { id: "mass_tag_query_" + table_name } ) %>
<%= hidden_field_tag(:page, params[:page], { id: "mass_page_" + table_name } ) %>
<%= hidden_field_tag(:table_name, table_name, { id: "mass_tag_table_name_" + table_name } ) %>
<%= submit_tag "Remove '#{params[:query].html_safe}' tag from all", class: 'btn btn-warning', data: { confirm: 'Are you sure you want to remove the tag from these authorities?' } %>
<% end %>
<% end %>
<div id="mass-change-tag" class="toolbox-tool">
<%= form_tag(mass_tag_admin_bodies_path, method: "post", class: "form form-inline" ) do %>
<%= text_field_tag 'tag', params[:tag], { size: 15, id: "mass_tag_tag_" + table_name } %>
<%= hidden_field_tag(:query, params[:query], { id: "mass_tag_query_" + table_name } ) %>
<%= hidden_field_tag(:page, params[:page], { id: "mass_page_" + table_name } ) %>
<%= hidden_field_tag(:table_name, table_name, { id: "mass_tag_table_name_" + table_name } ) %>
<%= submit_tag 'Add tag to all', class: 'btn btn-warning', data: { confirm: 'Are you sure you want to add the new tag to these authorities?' } %>
<% end %>
<span class="help-inline">(in table just above)</span>
<% if table_name == 'exact' %>
<%= form_tag(mass_tag_admin_bodies_path, method: "delete", class: "form form-inline" ) do %>
<%= hidden_field_tag 'tag', params[:query], { id: "mass_tag_tag_" + table_name } %>
<%= hidden_field_tag(:query, params[:query], { id: "mass_tag_query_" + table_name } ) %>
<%= hidden_field_tag(:page, params[:page], { id: "mass_page_" + table_name } ) %>
<%= hidden_field_tag(:table_name, table_name, { id: "mass_tag_table_name_" + table_name } ) %>
<%= submit_tag "Remove '#{params[:query].html_safe}' tag from all", class: 'btn btn-warning', data: { confirm: 'Are you sure you want to remove the tag from these authorities?' } %>
<% end %>
<% end %>

<span class="help-inline">(in table just above)</span>
</div>
</details>
</div>

0 comments on commit 213695e

Please sign in to comment.