Skip to content

Commit

Permalink
Fix tag lists and forms for several resources
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdeyen committed Jan 12, 2018
1 parent d9cb568 commit 900520f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/views/alchemy/admin/attachments/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
url: {action: :update, q: params[:q], page: params[:page]}) do |f| -%>
<%= f.input :name, input_html: {autofocus: true} %>
<%= f.input :file_name, input_html: {autofocus: true}, hint: Alchemy.t(:attachment_filename_notice) %>
<div class="input string">
<div class="input string autocomplete_tag_list">
<%= f.label :tag_list %>
<%= render 'alchemy/admin/partials/autocomplete_tag_list', f: f %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/alchemy/admin/attachments/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<%= render 'filter_bar' %>

<% if Alchemy::Attachment.tag_counts.any? %>
<div class="<%= params[:tagged_with].present? ? 'tag-list filtered' : 'tag-list' %>">
<div class="tag-list with_filter_bar<%= ' filtered' if params[:tagged_with].present? %>">
<%= render 'tag_list' %>
</div>
<% end %>
Expand Down
10 changes: 7 additions & 3 deletions app/views/alchemy/admin/pictures/_archive.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<div id="library_sidebar">
<%= render 'filter_bar' %>
<div class="tag-list with_filter_bar<%= params[:tagged_with].present? ? ' filtered' : '' %>">
<%= render 'tag_list' %>
</div>

<% if Alchemy::Picture.tag_counts.any? %>
<div class="tag-list with_filter_bar<%= ' filtered' if params[:tagged_with].present? %>">
<%= render 'tag_list' %>
</div>
<% end %>
</div>

<%= form_tag delete_multiple_admin_pictures_path, method: :delete do %>
<div class="selected_item_tools">
<h2><%= Alchemy.t(:edit_selected_pictures) %></h2>
Expand Down
2 changes: 1 addition & 1 deletion app/views/alchemy/admin/resources/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<% end %>
<% end %>
<% if f.object.respond_to?(:tag_list) %>
<div class="input string">
<div class="input string autocomplete_tag_list">
<%= f.label :tag_list %>
<%= render 'alchemy/admin/partials/autocomplete_tag_list', f: f %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/alchemy/admin/resources/_tag_list.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="<%= params[:tagged_with].present? ? 'tag-list filtered' : 'tag-list' %>">
<div class="tag-list<%= ' with_filter_bar' if resource_has_filters %><%= ' filtered' if params[:tagged_with].present? %>">
<h2><%= Alchemy.t("Filter by tag") %></h2>
<%= js_filter_field '.tag-list li' %>
<ul>
Expand Down

0 comments on commit 900520f

Please sign in to comment.