Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add admin toolbox section to public body list #7867

Merged
merged 1 commit into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
Loading