diff --git a/app/views/tags/edit.html.erb b/app/views/tags/edit.html.erb index b41cc9cf880..349e0df2915 100644 --- a/app/views/tags/edit.html.erb +++ b/app/views/tags/edit.html.erb @@ -10,154 +10,155 @@ <%= form_for @tag, :as => :tag, :url => { :action => "update", :id => @tag}, :html => { :method => :put } do |f| %> -
- <%= ts("Tag info") %>: -
-
<%= f.label :name, ts('Name') %>
-
- <% if Tag::USER_DEFINED.include?(@tag.class.name) || (@tag[:type] == 'Media' && logged_in_as_admin?) %> - <%= f.text_field :name, :size => (@tag.name.length + 5) %> - <% unless logged_in_as_admin? %> -

<%= ts("Only changes to capitalization are permitted.") %>

+
+ <%= ts("Tag info") %>: +
+
<%= f.label :name, ts('Name') %>
+
+ <% if Tag::USER_DEFINED.include?(@tag.class.name) || (@tag[:type] == 'Media' && logged_in_as_admin?) %> + <%= f.text_field :name, :size => (@tag.name.length + 5) %> + <% unless logged_in_as_admin? %> +

<%= ts("Only changes to capitalization are permitted.") %>

+ <% end %> + <% else %> + <%= @tag.name %> <% end %> - <% else %> - <%= @tag.name %> - <% end %> -
- -
<%= ts('Category') %>
-
- <% if @tag.can_change_type? %> - <%= f.select :type, options_for_select(%w(Fandom Character Relationship Freeform UnsortedTag), @tag.type.to_s) %> - <% else %> - <%= @tag.type %> - <% end %> -
+
- <% if @wranglers %> -
<%= ts('Wranglers') %>
-
<%= wrangler_list(@wranglers, @tag) %>
- <% end %> +
<%= ts('Category') %>
+
+ <% if @tag.can_change_type? %> + <%= f.select :type, options_for_select(%w(Fandom Character Relationship Freeform UnsortedTag), @tag.type.to_s) %> + <% else %> + <%= @tag.type %> + <% end %> +
-
<%= f.label :canonical, ts('Canonical') %>
-
- <%= f.check_box("canonical", :disabled => !(logged_in_as_admin? || Tag::USER_DEFINED.include?(@tag.class.name)) || !@tag.mergers.empty? || !@tag.children.empty? ) %>  - <%= ts("This is the official name for the %{tag_class_name}", :tag_class_name => @tag.class.name) %> - <% if Tag::USER_DEFINED.include?(@tag.class.name) && @tag.canonical? && (!@tag.mergers.empty? || !@tag.children.empty?) %> - + <% if @wranglers %> +
<%= ts('Wranglers') %>
+
<%= wrangler_list(@wranglers, @tag) %>
<% end %> - - <% if @tag.is_a?(Rating)%> -
<%= f.label :adult, ts('Adult') %>
-
<%= f.check_box("adult", :disabled => !logged_in_as_admin? )%> <%= ts('This tag indicates adult content.') %>
- <% end %> +
<%= f.label :canonical, ts('Canonical') %>
+
+ <%= f.check_box("canonical", :disabled => !(logged_in_as_admin? || Tag::USER_DEFINED.include?(@tag.class.name)) || !@tag.mergers.empty? || !@tag.children.empty? ) %>  + <%= ts("This is the official name for the %{tag_class_name}", :tag_class_name => @tag.class.name) %> + <% if Tag::USER_DEFINED.include?(@tag.class.name) && @tag.canonical? && (!@tag.mergers.empty? || !@tag.children.empty?) %> + + <% end %> +
- <% if Tag::USER_DEFINED.include?(@tag[:type]) %> -
<%= f.label :syn_string, ts('Synonym of') %>
-
- <%= f.text_field :syn_string, autocomplete_options("tag?type=#{@tag.type.downcase}", :class => 'autocomplete tags', :autocomplete_token_limit => 1) %> -

<%= ts("Choose an existing tag or add a new tag name here to create a new canonical and associate this tag with it.") %>

- <% if @tag.merger %> - - <% elsif @tag.canonical? %> - -

<%= ts("Adding a synonym to a canonical tag will make it non-canonical and move its associations to the other tag. (Be careful with this!)") %>

+ <% if @tag.is_a?(Rating)%> +
<%= f.label :adult, ts('Adult') %>
+
<%= f.check_box("adult", :disabled => !logged_in_as_admin? )%> <%= ts('This tag indicates adult content.') %>
<% end %> - - <% end %> -
-
-<% if (Tag::USER_DEFINED + ['Media']).include?(@tag[:type]) %> -
- <%= ts("Parent tags") %>: -
- <% @tag.parent_types.each do |tag_type| %> - <% if tag_type == 'Fandom' && !@suggested_fandoms.blank? %> -
<%= ts("Suggested Fandoms") %>:
-
- <% @suggested_fandoms[0..19].in_groups(2, false) do |fandom_list| %> -
    - <% for tag in fandom_list %> -
  • <%= link_to_edit_tag(tag) %>
  • - <% end %> -
+ <% if Tag::USER_DEFINED.include?(@tag[:type]) %> +
<%= f.label :syn_string, ts('Synonym of') %>
+
+ <%= f.text_field :syn_string, autocomplete_options("tag?type=#{@tag.type.downcase}", :class => 'autocomplete tags', :autocomplete_token_limit => 1) %> +

<%= ts("Choose an existing tag or add a new tag name here to create a new canonical and associate this tag with it.") %>

+ <% if @tag.merger %> + + <% elsif @tag.canonical? %> + +

<%= ts("Adding a synonym to a canonical tag will make it non-canonical and move its associations to the other tag. (Be careful with this!)") %>

<% end %> - <% if @suggested_fandoms.length > 20 %> -

<%= link_to "See all (#{@suggested_fandoms.length})", {:controller => :tags, :action => :wrangle, :id => @tag, :show => :suggested_fandoms} %>

- <% end %> -
- <% end %> -
<%= tag_category_name(tag_type) %>
-
-
- <% if @parents[tag_type].present? %> -

<%= ts("Check to remove: ") %>

- <%= check_all_none %> - <%= checkbox_section(f, "associations_to_remove", @parents[tag_type], :name_helper_method => "remove_tag_association_label", :extra_info_method => "link_to_edit_tag", - :field_id => "parent_#{tag_type}_associations_to_remove", :concise => true) %> -
<%= f.label tag_type.underscore + '_string', ts("Add:") %>
- <% else %> -

<%= f.label tag_type.underscore + '_string', ts("Add %{catname}:", :catname => tag_category_name(tag_type)) %>

- <% end %> -
- <%= f.text_field tag_type.underscore + '_string', autocomplete_options("tag?type=#{(tag_type.downcase == 'metatag' ? @tag.type.downcase : tag_type.downcase)}", :class => 'tags autocomplete') %> -
-
- <% end %> -
-
- - <% if @tag.canonical? %> -
- <%= ts("Child tags") %>: - -
- <% @tag.child_types.each do |tag_type| %> -
<%= tag_category_name(tag_type) %>
-
-
- <% if @children[tag_type].present? %> -

<%= ts("Check to remove: ") %>

- <%= check_all_none %> - <%= checkbox_section(f, "associations_to_remove", @children[tag_type][0..19], :name_helper_method => "remove_tag_association_label", :extra_info_method => "link_to_edit_tag", - :field_id => "child_#{tag_type}_associations_to_remove", :concise => true) %> - <% if @children[tag_type].length > 20 %> - - <% end %> -
<%= f.label tag_type.underscore + '_string', ts("Add:") %>
- <% else %> -

<%= f.label tag_type.underscore + '_string', ts("Add %{catname}:", :catname => tag_category_name(tag_type)) %>

- <% end %> -
- <%= f.text_field tag_type.underscore + '_string', - autocomplete_options("#{tag_type == 'Merger' ? ('noncanonical_tag?type=' + @tag.type.downcase) : (tag_type == 'SubTag' ? @tag.type.downcase : tag_type.downcase)}", - :class => 'tags autocomplete') %> -
-
-
<% end %>
- <% end %> + + <% if (Tag::USER_DEFINED + ['Media']).include?(@tag[:type]) %> +
+ <%= ts("Parent tags") %>: +
+ <% @tag.parent_types.each do |tag_type| %> + <% if tag_type == 'Fandom' && !@suggested_fandoms.blank? %> +
<%= ts("Suggested Fandoms") %>:
+
+ <% @suggested_fandoms[0..19].in_groups(2, false) do |fandom_list| %> +
    + <% for tag in fandom_list %> +
  • <%= link_to_edit_tag(tag) %>
  • + <% end %> +
+ <% end %> + <% if @suggested_fandoms.length > 20 %> +

<%= link_to ts("See all (%{fandoms_len})", :fandoms_len => @suggested_fandoms.length), {:controller => :tags, :action => :wrangle, :id => @tag, :show => :suggested_fandoms} %>

+ <% end %> +
+ <% end %> +
<%= tag_category_name(tag_type) %>
+
+
+ <% if @parents[tag_type].present? %> +

<%= ts("Check to remove: ") %>

+ <%= check_all_none %> + <%= checkbox_section(f, "associations_to_remove", @parents[tag_type], :name_helper_method => "remove_tag_association_label", :extra_info_method => "link_to_edit_tag", + :field_id => "parent_#{tag_type}_associations_to_remove", :concise => true) %> +
<%= f.label tag_type.underscore + '_string', ts("Add:") %>
+ <% else %> +

<%= f.label tag_type.underscore + '_string', ts("Add %{catname}:", :catname => tag_category_name(tag_type)) %>

+ <% end %> +
+ <%= f.text_field tag_type.underscore + '_string', autocomplete_options("tag?type=#{(tag_type.downcase == 'metatag' ? @tag.type.downcase : tag_type.downcase)}", :class => 'tags autocomplete') %> +
+
+
+ <% end %> +
+
+ + <% if @tag.canonical? %> +
+ <%= ts("Child tags") %>: + +
+ <% @tag.child_types.each do |tag_type| %> +
<%= tag_category_name(tag_type) %>
+
+
+ <% if @children[tag_type].present? %> +

<%= ts("Check to remove: ") %>

+ <%= check_all_none %> + <%= checkbox_section(f, "associations_to_remove", @children[tag_type][0..19], :name_helper_method => "remove_tag_association_label", :extra_info_method => "link_to_edit_tag", + :field_id => "child_#{tag_type}_associations_to_remove", :concise => true) %> + <% if @children[tag_type].length > 20 %> + + <% end %> +
<%= f.label tag_type.underscore + '_string', ts("Add:") %>
+ <% else %> +

<%= f.label tag_type.underscore + '_string', ts("Add %{catname}:", :catname => tag_category_name(tag_type)) %>

+ <% end %> +
+ <%= f.text_field tag_type.underscore + '_string', + autocomplete_options("#{tag_type == 'Merger' ? ('noncanonical_tag?type=' + @tag.type.downcase) : (tag_type == 'SubTag' ? @tag.type.downcase : tag_type.downcase)}", + :class => 'tags autocomplete') %> +
+
+
+ <% end %> +
+
+ <% end %> + <% elsif @tag.is_a?(Media) %> <% end %>
- <%= ts("Submit") %> -

- <%= submit_tag ts("Save changes") %> -

+ <%= ts("Submit") %> +

+ <%= submit_tag ts("Save changes") %> +

<% end %> <% if logged_in_as_admin? %> -

Last updated by <%= @tag.last_wrangler.try(:login) || '---' %> on <%= @tag.updated_at %>

+

<%= ts("Last updated by") %> <%= @tag.last_wrangler.try(:login) || '---' %> <%= ts("on") %> <%= @tag.updated_at %>

<% end %>