Skip to content

Commit

Permalink
Move lang to locales for new cat.
Browse files Browse the repository at this point in the history
Start clean content main page
  • Loading branch information
Yannick Francois committed Oct 7, 2013
1 parent d4e8caf commit 09d92ee
Show file tree
Hide file tree
Showing 37 changed files with 132 additions and 144 deletions.
13 changes: 7 additions & 6 deletions app/views/admin/content/_categories.html.erb
@@ -1,7 +1,8 @@
<%- article_categories = @article ? @article.categories.map(&:id) : [] -%>
<%- used_categories = @article.categories.map(&:id) %>
<%- Category.all.each do |cat| %>
<%= label_tag"category_#{h(cat.id)}", check_box_tag('categories[]', cat.id, (@article.categories.map(&:id).include? cat.id), :id => "category_#{h(cat.id)}") + h(cat.name), :class => 'checkbox' %>
</li>
</ul>
<% end -%>
<%= link_to _("New Category"), {:controller => 'admin/categories', :action => 'new' }, :class => 'btn btn-info new_category' %>
<%= label_tag do %>
<%= check_box_tag 'categories[]', cat.id, used_categories.include?(cat.id), id: "category_#{cat.id}", class: 'checkbox' %>
<%= cat.name %>
<%- end %>
<%- end %>
<%= link_to t(".new_category"), {controller: 'admin/categories', action: 'new' }, class: 'btn btn-info new_category' %>
127 changes: 64 additions & 63 deletions app/views/admin/content/_form.html.erb
@@ -1,84 +1,86 @@
<input type="hidden" name="user_textfilter" id="user_textfilter" value="<%= current_user.text_filter_name %>" />
<%= hidden_field_tag "user_textfilter", current_user.text_filter_name %>

<div id="autosave"><%= set_autosave_tag(@article) %></div>
<div id="article_keywords_auto_complete" class="auto_complete"></div>

<h2 class='page-header'>
<i class='icon-large icon-article-new'></i>
<%= _("#{controller.action_name.to_s.capitalize} article") %>
<span class='pull-right'>
<span id='preview_link'><%= link_to(_("Preview"), {:controller => '/articles', :action => 'preview', :id => @article.id}, {:target => 'new', :class => 'btn'}) if @article.id %></span>
<span id='preview_link'><%= link_to(_("Preview"), {controller: '/articles', action: 'preview', id: @article.id}, {target: 'new', class: 'btn'}) if @article.id %></span>
<input id='save_draft' type="submit" value="<%= _('Save as draft') %>" name="article[draft]" class='btn' />
<%= save( _("Publish")) %>
</span>
</h2>

<%= error_messages_for 'article' %>
<div>
<div class='span9'>
<div>
<div>
<%= text_field 'article', 'title', :class => 'input-block-level', :placeholder => _('Title') %>
</div>

<%= render('images', { :images => @images}) unless @images.empty? %>

<div id="editor">
<i class='icon icon-media'></i> <span id='image-link'><%= toggle_element 'carousel-wrapper', _("Images") %></span>
<div id='quicktags'>
<script type="text/javascript">edToolbar('article_body_and_extended', '<%= @article.text_filter %>');</script>
</div>
<div class='span9'>
<div>
<%= text_field 'article', 'title', :class => 'input-block-level', :placeholder => _('Title') %>
</div>
<%= render('images', { :images => @images}) unless @images.empty? %>

<div id='simple_editor'>
<%= text_area('article', 'body_and_extended', {:class => 'input-block-level', :height => '360px'}) %>
<%= render 'admin/shared/macros' %>
</div>
</div>
<div id="editor">
<i class='icon icon-media'></i> <span id='image-link'><%= toggle_element 'carousel-wrapper', _("Images") %></span>
<div id='quicktags'>
<script type="text/javascript">edToolbar('article_body_and_extended', '<%= @article.text_filter %>');</script>
</div>

<div class='separator'>
<h4><%= _("Excerpt") %></h4>
<%= text_area 'article', 'excerpt', {:height => '150', :class => 'input-block-level', :rows => '5'} %>
<span class='help-block'><%=_("Excerpts are post summaries that show only on your blog homepage and won’t appear on the post itself") %></span>
</div>

<div class='well'>
<fieldset>
<legend><%= _("Publish settings") %></legend>
<div class='control-group'>
<p><%= _("Status") %>: <strong><%= _(@article.state.to_s.downcase) %></strong> <%= toggle_element 'status' %></p>
<div id='status' style='display: none;'>
<label for="article_published" class='checkbox'>
<%= check_box 'article', 'published' %>
<%= _("Published") %>
</label>
<%= ok_button('status') %>
<div id='simple_editor'>
<%= text_area('article', 'body_and_extended', {:class => 'input-block-level', :height => '360px'}) %>
<%= render 'admin/shared/macros' %>
</div>
</div>
<div class='control-group'>
<p><%= _("Comments are %s and trackbacks are %s", content_tag(:strong, get_feedback_status(@article.allow_comments)), content_tag(:strong, get_feedback_status(@article.allow_pings))) %>
<%= toggle_element 'conversation' %></p>
<div id='conversation' style='display: none'>
<label for="article_allow_pings" class='checkbox'>
<%= check_box 'article', 'allow_pings' %>
<%= _("Allow trackbacks") %>
</label>
<label for="article_allow_comments" class='checkbox'>
<%= check_box 'article', 'allow_comments' %>
<%= _("Allow comments") %>
</label>
<p><span class='btn btn-mini'><%= toggle_element 'conversation', "OK" %></span></p>
</div>

<div class='separator'>
<h4><%= _("Excerpt") %></h4>
<%= text_area 'article', 'excerpt', {:height => '150', :class => 'input-block-level', :rows => '5'} %>
<span class='help-block'><%=_("Excerpts are post summaries that show only on your blog homepage and won’t appear on the post itself") %></span>
</div>
<div class='control-group'>
<p><%= _("Published") %> <strong><%= publish_now_or_already_published @article %></strong> <%= toggle_element 'publish' %></p>
<div id='publish' class='input-append' style='display: none;'>
<%= calendar_date_select 'article', 'published_at' %>
<%= ok_button('publish') %>

<div class='well'>
<fieldset>
<legend><%= _("Publish settings") %></legend>
<div class='control-group'>
<p><%= _("Status") %>: <strong><%= _(@article.state.to_s.downcase) %></strong> <%= toggle_element 'status' %></p>
<div id='status' style='display: none;'>
<label for="article_published" class='checkbox'>
<%= check_box 'article', 'published' %>
<%= _("Published") %>
</label>
<%= ok_button('status') %>
</div>
</div>
<div class='control-group'>
<p><%= _("Comments are %s and trackbacks are %s", content_tag(:strong, get_feedback_status(@article.allow_comments)), content_tag(:strong, get_feedback_status(@article.allow_pings))) %>
<%= toggle_element 'conversation' %></p>
<div id='conversation' style='display: none'>
<label for="article_allow_pings" class='checkbox'>
<%= check_box 'article', 'allow_pings' %>
<%= _("Allow trackbacks") %>
</label>
<label for="article_allow_comments" class='checkbox'>
<%= check_box 'article', 'allow_comments' %>
<%= _("Allow comments") %>
</label>
<p><span class='btn btn-mini'><%= toggle_element 'conversation', "OK" %></span></p>
</div>
</div>

</div>
<div class='control-group'>
<p><%= _("Visibility") %>: <strong><%= @article.password.nil? || @article.password.empty? ? _("public") : _("protected") %></strong> <%= toggle_element 'visibility' %></p>
<div id='visibility' style='display: none'>
<label for="article_password"><%= _("Password:") %>
<div class='control-group'>
<p><%= _("Published") %> <strong><%= publish_now_or_already_published @article %></strong> <%= toggle_element 'publish' %></p>
<div id='publish' class='input-append' style='display: none;'>
<%= calendar_date_select 'article', 'published_at' %>
<%= ok_button('publish') %>
</div>

</div>
<div class='control-group'>
<p><%= _("Visibility") %>: <strong><%= @article.password.nil? || @article.password.empty? ? _("public") : _("protected") %></strong> <%= toggle_element 'visibility' %></p>
<div id='visibility' style='display: none'>
<label for="article_password"><%= _("Password:") %>
<%= password_field :article, :password, :class => 'span10' %>
</label>
<%= ok_button('visibility') %>
Expand Down Expand Up @@ -107,7 +109,7 @@
<%= link_to_destroy_with_profiles(@article) unless @article.id.nil? or @article.state.to_s.downcase == 'draft' %>
<span id='destroy_link'><%= link_to_destroy_draft @article %></span>
<input id='save_draft' type="submit" value="<%= _('Save as draft') %>" name="article[draft]" class='btn info' />
<%= save( _("Publish")) %>
<%= save( _("Publish")) %>
</div>
</div>

Expand All @@ -125,8 +127,7 @@
<%= text_field 'article', 'keywords', {:autocomplete => 'off', :class => 'input-block-level'} %>
<p class='alert alert-warning'><%=_("Separate tags with commas. Use double quotes (&quot;) around multi-word tags, e.g. &quot;opera house&quot;.") %></p>
</div>
<%= auto_complete_field 'article_keywords', { :url => { :action => "auto_complete_for_article_keywords"}, :method => 'get', :tokens => ','}%>

<%= auto_complete_field 'article_keywords', { :url => { :action => "auto_complete_for_article_keywords"}, :method => 'get', :tokens => ','}%>
</div>
<%= get_post_types %>
</div>
12 changes: 3 additions & 9 deletions app/views/admin/content/edit.html.erb
@@ -1,9 +1,3 @@
<%= form_tag({:action => 'update',
:id => @article.id},
method: :post,
multipart: true,
id: "article_form",
class: 'autosave') do %>
<%= render :partial => "form" %>
<% end %>
<%= form_tag({action: 'update', id: @article.id}, method: :post, multipart: true, id: "article_form", class: 'autosave') do %>
<%= render partial: "form" %>
<% end %>
4 changes: 3 additions & 1 deletion app/views/admin/content/new.html.erb
@@ -1 +1,3 @@
<%= render "admin/shared/edit", { :form_type => "article", :form_action => { :action => "create", :id => @article.id , :class => ('autosave')} } %>
<%= form_tag(action: "create", id: "article_form", multipart: true, class: 'autosave') do %>
<%= render partial: "form" %>
<% end %>
8 changes: 2 additions & 6 deletions app/views/admin/shared/_edit.html.erb
@@ -1,8 +1,4 @@
<% className = form_action.delete(:class) %>
<%= form_tag(form_action, :id => "#{form_type}_form",
:enctype => "multipart/form-data",
:class => className) do %>
<%= render :partial => "form" %>
<%= form_tag(form_action, id: "#{form_type}_form", enctype: "multipart/form-data", class: className) do %>
<%= render partial: "form" %>
<% end %>
3 changes: 3 additions & 0 deletions config/locales/da.yml
@@ -1,5 +1,8 @@
da:
admin:
content:
categories:
new_category: "New Category"
categories:
new:
categories: "Kategorier"
Expand Down
3 changes: 3 additions & 0 deletions config/locales/de.yml
@@ -1,5 +1,8 @@
de:
admin:
content:
categories:
new_category: "New Category"
categories:
new:
categories: "Categories"
Expand Down
3 changes: 3 additions & 0 deletions config/locales/en.yml
@@ -1,5 +1,8 @@
en:
admin:
content:
categories:
new_category: "New Category"
categories:
new:
categories: "Categories"
Expand Down
3 changes: 3 additions & 0 deletions config/locales/es-MX.yml
@@ -1,5 +1,8 @@
es-MX:
admin:
content:
categories:
new_category: "New Category"
categories:
new:
categories: "Categories"
Expand Down
3 changes: 3 additions & 0 deletions config/locales/fr.yml
@@ -1,5 +1,8 @@
fr:
admin:
content:
categories:
new_category: "Nouvelle catégorie"
categories:
new:
categories: "Catégories"
Expand Down
3 changes: 3 additions & 0 deletions config/locales/he-IL.yml
@@ -1,5 +1,8 @@
he-IL:
admin:
content:
categories:
new_category: "New Category"
categories:
new:
categories: "קטגוריות"
Expand Down
3 changes: 3 additions & 0 deletions config/locales/it.yml
@@ -1,5 +1,8 @@
it:
admin:
content:
categories:
new_category: "New Category"
categories:
new:
categories: "Categories"
Expand Down
3 changes: 3 additions & 0 deletions config/locales/ja.yml
@@ -1,5 +1,8 @@
ja:
admin:
content:
categories:
new_category: "New Category"
categories:
new:
categories: "カテゴリ"
Expand Down
3 changes: 3 additions & 0 deletions config/locales/lt.yml
@@ -1,5 +1,8 @@
lt:
admin:
content:
categories:
new_category: "New Category"
categories:
new:
categories: "Categories"
Expand Down
3 changes: 3 additions & 0 deletions config/locales/nb-NO.yml
@@ -1,5 +1,8 @@
nb-NO:
admin:
content:
categories:
new_category: "Ny kategori"
categories:
new:
categories: "Kategorier"
Expand Down
3 changes: 3 additions & 0 deletions config/locales/nl.yml
@@ -1,5 +1,8 @@
nl:
admin:
content:
categories:
new_category: "Nieuwe categorie"
categories:
new:
categories: "Categoriën"
Expand Down
3 changes: 3 additions & 0 deletions config/locales/pl.yml
@@ -1,5 +1,8 @@
pl:
admin:
content:
categories:
new_category: "Utwórz nową kategorię"
categories:
new:
categories: "Categories"
Expand Down
3 changes: 3 additions & 0 deletions config/locales/pt-BR.yml
@@ -1,5 +1,8 @@
pt-BR:
admin:
content:
categories:
new_category: "Nova Categoria"
categories:
new:
categories: "Categorias"
Expand Down
3 changes: 3 additions & 0 deletions config/locales/ro.yml
@@ -1,5 +1,8 @@
ro:
admin:
content:
categories:
new_category: "New Category"
categories:
new:
categories: "Categories"
Expand Down
3 changes: 3 additions & 0 deletions config/locales/ru.yml
@@ -1,5 +1,8 @@
ru:
admin:
content:
categories:
new_category: "Новая категория"
categories:
new:
categories: "Категории"
Expand Down
3 changes: 3 additions & 0 deletions config/locales/zh-CN.yml
@@ -1,5 +1,8 @@
zh-CN:
admin:
content:
categories:
new_category: "创建分类"
categories:
new:
categories: "分类"
Expand Down
3 changes: 3 additions & 0 deletions config/locales/zh-TW.yml
@@ -1,5 +1,8 @@
zh-TW:
admin:
content:
categories:
new_category: "New Category"
categories:
new:
categories: "分類"
Expand Down
6 changes: 0 additions & 6 deletions lang/da_DK.rb
Expand Up @@ -161,12 +161,6 @@
l.store "Are you sure you want to delete the category ", "Er du sikker på du vil slette kategorien: "
l.store "Delete this category", "Slet denne kategori"

# app/views/admin/categories/index.html.erb
l.store "New Category", ""

# app/views/admin/categories/new.html.erb
l.store "%s Category", ""

# app/views/admin/categories/reorder.html.erb
l.store "(Done)", "(Færdig)"

Expand Down
3 changes: 0 additions & 3 deletions lang/es_MX.rb
Expand Up @@ -163,9 +163,6 @@
l.store "Are you sure you want to delete the category ", "&iquest;Est&aacute;s seguro que quieres eliminar esta categor&iacute;a?"
l.store "Delete this category", "Eliminar esta categor&iacute;a"

# app/views/admin/categories/index.html.erb
l.store "New Category", ""

# app/views/admin/categories/new.html.erb
l.store "%s Category", ""

Expand Down
3 changes: 0 additions & 3 deletions lang/fr_FR.rb
Expand Up @@ -163,9 +163,6 @@
l.store "Really delete attachment", "Voulez-vous vraiment supprimer la pièce jointe"
l.store "Add another attachment", "Ajouter une autre pièce jointe"

# app/views/admin/content/_categories.html.erb
l.store "New Category", "Nouvelle catégorie"

# app/views/admin/content/_form.html.erb
l.store "Change", "Modifier"
l.store "Comments are %s and trackbacks are %s", "Les commentaires sont %s et les rétroliens %s"
Expand Down

0 comments on commit 09d92ee

Please sign in to comment.