Skip to content

Commit

Permalink
Indentation and translation strings
Browse files Browse the repository at this point in the history
  • Loading branch information
CristinaRO committed Jul 18, 2012
1 parent 49d0c78 commit 924fa57
Showing 1 changed file with 127 additions and 126 deletions.
253 changes: 127 additions & 126 deletions app/views/tags/edit.html.erb
Expand Up @@ -10,154 +10,155 @@
<!--main content-->
<%= form_for @tag, :as => :tag, :url => { :action => "update", :id => @tag}, :html => { :method => :put } do |f| %>

<fieldset>
<legend><%= ts("Tag info") %>:</legend>
<dl>
<dt><%= f.label :name, ts('Name') %></dt>
<dd>
<% 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? %>
<p><%= ts("Only changes to capitalization are permitted.") %></p>
<fieldset>
<legend><%= ts("Tag info") %>:</legend>
<dl>
<dt><%= f.label :name, ts('Name') %></dt>
<dd>
<% 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? %>
<p><%= ts("Only changes to capitalization are permitted.") %></p>
<% end %>
<% else %>
<strong><%= @tag.name %></strong>
<% end %>
<% else %>
<strong><%= @tag.name %></strong>
<% end %>
</dd>

<dt><%= ts('Category') %></dt>
<dd>
<% if @tag.can_change_type? %>
<%= f.select :type, options_for_select(%w(Fandom Character Relationship Freeform UnsortedTag), @tag.type.to_s) %>
<% else %>
<strong><%= @tag.type %></strong>
<% end %>
</dd>
</dd>

<% if @wranglers %>
<dt><%= ts('Wranglers') %></dt>
<dd><%= wrangler_list(@wranglers, @tag) %></dd>
<% end %>
<dt><%= ts('Category') %></dt>
<dd>
<% if @tag.can_change_type? %>
<%= f.select :type, options_for_select(%w(Fandom Character Relationship Freeform UnsortedTag), @tag.type.to_s) %>
<% else %>
<strong><%= @tag.type %></strong>
<% end %>
</dd>

<dt><%= f.label :canonical, ts('Canonical') %></dt>
<dd>
<%= f.check_box("canonical", :disabled => !(logged_in_as_admin? || Tag::USER_DEFINED.include?(@tag.class.name)) || !@tag.mergers.empty? || !@tag.children.empty? ) %>&nbsp;
<%= 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?) %>
<p class="navigation actions" role="navigation"><%= link_to ts('Make tag non-canonical and unhook all associations'), {:controller => :tags, :action => :update, 'tag[canonical]' => 0, :id => @tag}, :method => :put, :confirm => "Are you sure?" %></p>
<% if @wranglers %>
<dt><%= ts('Wranglers') %></dt>
<dd><%= wrangler_list(@wranglers, @tag) %></dd>
<% end %>
</dd>

<% if @tag.is_a?(Rating)%>
<dt><%= f.label :adult, ts('Adult') %></dt>
<dd><%= f.check_box("adult", :disabled => !logged_in_as_admin? )%>&nbsp;<%= ts('This tag indicates adult content.') %></dd>
<% end %>
<dt><%= f.label :canonical, ts('Canonical') %></dt>
<dd>
<%= f.check_box("canonical", :disabled => !(logged_in_as_admin? || Tag::USER_DEFINED.include?(@tag.class.name)) || !@tag.mergers.empty? || !@tag.children.empty? ) %>&nbsp;
<%= 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?) %>
<p class="navigation actions" role="navigation"><%= link_to ts('Make tag non-canonical and unhook all associations'), {:controller => :tags, :action => :update, 'tag[canonical]' => 0, :id => @tag}, :method => :put, :confirm => "Are you sure?" %></p>
<% end %>
</dd>

<% if Tag::USER_DEFINED.include?(@tag[:type]) %>
<dt><%= f.label :syn_string, ts('Synonym of') %></dt>
<dd>
<%= f.text_field :syn_string, autocomplete_options("tag?type=#{@tag.type.downcase}", :class => 'autocomplete tags', :autocomplete_token_limit => 1) %>
<p><%= ts("Choose an existing tag or add a new tag name here to create a new canonical and associate this tag with it.") %></p>
<% if @tag.merger %>
<p class="navigation actions" role="navigation"><%= ts("Edit") %> <%= link_to_edit_tag(@tag.merger) %></p>
<% elsif @tag.canonical? %>
<!-- FRONT-END: if we have some sort of ACHTUNG! class, this would be a good place for it. Attention SYSTEM MESSAGES wrangler-->
<p class="important warning"><%= ts("Adding a synonym to a canonical tag will make it non-canonical and move its associations to the other tag. <strong>(Be careful with this!)</strong>") %></p>
<% if @tag.is_a?(Rating)%>
<dt><%= f.label :adult, ts('Adult') %></dt>
<dd><%= f.check_box("adult", :disabled => !logged_in_as_admin? )%>&nbsp;<%= ts('This tag indicates adult content.') %></dd>
<% end %>
</dd>
<% end %>
</dl>
</fieldset>
<% if (Tag::USER_DEFINED + ['Media']).include?(@tag[:type]) %>
<fieldset>
<legend><%= ts("Parent tags") %>:</legend>
<dl>
<% @tag.parent_types.each do |tag_type| %>
<% if tag_type == 'Fandom' && !@suggested_fandoms.blank? %>
<dt><%= ts("Suggested Fandoms") %>:</dt>
<dd>
<% @suggested_fandoms[0..19].in_groups(2, false) do |fandom_list| %>
<ul class="tags commas">
<% for tag in fandom_list %>
<li><%= link_to_edit_tag(tag) %></li>
<% end %>
</ul>
<% if Tag::USER_DEFINED.include?(@tag[:type]) %>
<dt><%= f.label :syn_string, ts('Synonym of') %></dt>
<dd>
<%= f.text_field :syn_string, autocomplete_options("tag?type=#{@tag.type.downcase}", :class => 'autocomplete tags', :autocomplete_token_limit => 1) %>
<p><%= ts("Choose an existing tag or add a new tag name here to create a new canonical and associate this tag with it.") %></p>
<% if @tag.merger %>
<p class="navigation actions" role="navigation"><%= ts("Edit") %> <%= link_to_edit_tag(@tag.merger) %></p>
<% elsif @tag.canonical? %>
<!-- FRONT-END: if we have some sort of ACHTUNG! class, this would be a good place for it. Attention SYSTEM MESSAGES wrangler-->
<p class="important warning"><%= 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!)") %></p>
<% end %>
<% if @suggested_fandoms.length > 20 %>
<p><%= link_to "See all (#{@suggested_fandoms.length})", {:controller => :tags, :action => :wrangle, :id => @tag, :show => :suggested_fandoms} %></p>
<% end %>
</dd>
<% end %>
<dt><%= tag_category_name(tag_type) %></dt>
<dd title="<%= tag_category_name(tag_type) %>">
<fieldset class="tags listbox">
<% if @parents[tag_type].present? %>
<h4 class="heading"><%= ts("Check to remove: ") %></h4>
<%= 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) %>
<h5 class="heading"><%= f.label tag_type.underscore + '_string', ts("Add:") %></h5>
<% else %>
<h4 class="heading"><%= f.label tag_type.underscore + '_string', ts("Add %{catname}:", :catname => tag_category_name(tag_type)) %></h4>
<% end %>
<div title="add tags">
<%= f.text_field tag_type.underscore + '_string', autocomplete_options("tag?type=#{(tag_type.downcase == 'metatag' ? @tag.type.downcase : tag_type.downcase)}", :class => 'tags autocomplete') %>
</div>
</fieldset>
</dd>
<% end %>
</dl>
</fieldset>

<% if @tag.canonical? %>
<fieldset>
<legend><%= ts("Child tags") %>:</legend>
<p class="navigation actions" role="navigation"><%= link_to ts('wrangle all child tags'), {:controller => :tags, :action => :wrangle, :id => @tag} %></p>
<dl>
<% @tag.child_types.each do |tag_type| %>
<dt><%= tag_category_name(tag_type) %></dt>
<dd>
<fieldset class="tags listbox">
<% if @children[tag_type].present? %>
<h4 class="heading"><%= ts("Check to remove: ") %></h4>
<%= 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 %>
<p class="navigation actions" role="navigation">
<%= link_to "See all (#{@tag.send(tag_type.underscore.pluralize).count})", {:controller => :tags, :action => :wrangle, :id => @tag, :show => tag_type.underscore.pluralize} %>
</p>
<% end %>
<h5 class="heading"><%= f.label tag_type.underscore + '_string', ts("Add:") %></h5>
<% else %>
<h4 class="heading"><%= f.label tag_type.underscore + '_string', ts("Add %{catname}:", :catname => tag_category_name(tag_type)) %></h4>
<% end %>
<div title="add tags">
<%= 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') %>
</div>
</fieldset>
</dd>
<% end %>
</dl>
</fieldset>
<% end %>

<% if (Tag::USER_DEFINED + ['Media']).include?(@tag[:type]) %>
<fieldset>
<legend><%= ts("Parent tags") %>:</legend>
<dl>
<% @tag.parent_types.each do |tag_type| %>
<% if tag_type == 'Fandom' && !@suggested_fandoms.blank? %>
<dt><%= ts("Suggested Fandoms") %>:</dt>
<dd>
<% @suggested_fandoms[0..19].in_groups(2, false) do |fandom_list| %>
<ul class="tags commas">
<% for tag in fandom_list %>
<li><%= link_to_edit_tag(tag) %></li>
<% end %>
</ul>
<% end %>
<% if @suggested_fandoms.length > 20 %>
<p><%= link_to ts("See all (%{fandoms_len})", :fandoms_len => @suggested_fandoms.length), {:controller => :tags, :action => :wrangle, :id => @tag, :show => :suggested_fandoms} %></p>
<% end %>
</dd>
<% end %>
<dt><%= tag_category_name(tag_type) %></dt>
<dd title="<%= tag_category_name(tag_type) %>">
<fieldset class="tags listbox">
<% if @parents[tag_type].present? %>
<h4 class="heading"><%= ts("Check to remove: ") %></h4>
<%= 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) %>
<h5 class="heading"><%= f.label tag_type.underscore + '_string', ts("Add:") %></h5>
<% else %>
<h4 class="heading"><%= f.label tag_type.underscore + '_string', ts("Add %{catname}:", :catname => tag_category_name(tag_type)) %></h4>
<% end %>
<div title="add tags">
<%= f.text_field tag_type.underscore + '_string', autocomplete_options("tag?type=#{(tag_type.downcase == 'metatag' ? @tag.type.downcase : tag_type.downcase)}", :class => 'tags autocomplete') %>
</div>
</fieldset>
</dd>
<% end %>
</dl>
</fieldset>

<% if @tag.canonical? %>
<fieldset>
<legend><%= ts("Child tags") %>:</legend>
<p class="navigation actions" role="navigation"><%= link_to ts('wrangle all child tags'), {:controller => :tags, :action => :wrangle, :id => @tag} %></p>
<dl>
<% @tag.child_types.each do |tag_type| %>
<dt><%= tag_category_name(tag_type) %></dt>
<dd>
<fieldset class="tags listbox">
<% if @children[tag_type].present? %>
<h4 class="heading"><%= ts("Check to remove: ") %></h4>
<%= 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 %>
<p class="navigation actions" role="navigation">
<%= link_to ts("See all (%{children_count})", :children_count => @tag.send(tag_type.underscore.pluralize).count), {:controller => :tags, :action => :wrangle, :id => @tag, :show => tag_type.underscore.pluralize} %>
</p>
<% end %>
<h5 class="heading"><%= f.label tag_type.underscore + '_string', ts("Add:") %></h5>
<% else %>
<h4 class="heading"><%= f.label tag_type.underscore + '_string', ts("Add %{catname}:", :catname => tag_category_name(tag_type)) %></h4>
<% end %>
<div title="add tags">
<%= 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') %>
</div>
</fieldset>
</dd>
<% end %>
</dl>
</fieldset>
<% end %>
<% elsif @tag.is_a?(Media) %>
<p class="navigation actions" role="navigation"><%= link_to ts('See all fandoms'), {:controller => :tags, :action => :wrangle, :id => @tag, :show => 'fandoms'} %></p>
<% end %>

<fieldset>
<legend><%= ts("Submit") %></legend>
<p class="submit actions">
<%= submit_tag ts("Save changes") %>
</p>
<legend><%= ts("Submit") %></legend>
<p class="submit actions">
<%= submit_tag ts("Save changes") %>
</p>
</fieldset>
<% end %>
<% if logged_in_as_admin? %>
<p>Last updated by <%= @tag.last_wrangler.try(:login) || '---' %> on <%= @tag.updated_at %></p>
<p><%= ts("Last updated by") %> <%= @tag.last_wrangler.try(:login) || '---' %> <%= ts("on") %> <%= @tag.updated_at %></p>
<% end %>
<!--/content-->

Expand Down

0 comments on commit 924fa57

Please sign in to comment.