From 09d92ee68ac61901ba8564521d4a18fafe960bbd Mon Sep 17 00:00:00 2001 From: Yannick Francois Date: Mon, 7 Oct 2013 16:02:50 +0200 Subject: [PATCH] Move lang to locales for new cat. Start clean content main page --- app/views/admin/content/_categories.html.erb | 13 +- app/views/admin/content/_form.html.erb | 127 ++++++++++--------- app/views/admin/content/edit.html.erb | 12 +- app/views/admin/content/new.html.erb | 4 +- app/views/admin/shared/_edit.html.erb | 8 +- config/locales/da.yml | 3 + config/locales/de.yml | 3 + config/locales/en.yml | 3 + config/locales/es-MX.yml | 3 + config/locales/fr.yml | 3 + config/locales/he-IL.yml | 3 + config/locales/it.yml | 3 + config/locales/ja.yml | 3 + config/locales/lt.yml | 3 + config/locales/nb-NO.yml | 3 + config/locales/nl.yml | 3 + config/locales/pl.yml | 3 + config/locales/pt-BR.yml | 3 + config/locales/ro.yml | 3 + config/locales/ru.yml | 3 + config/locales/zh-CN.yml | 3 + config/locales/zh-TW.yml | 3 + lang/da_DK.rb | 6 - lang/es_MX.rb | 3 - lang/fr_FR.rb | 3 - lang/he_IL.rb | 3 - lang/it_IT.rb | 3 - lang/ja_JP.rb | 6 - lang/lt_LT.rb | 10 +- lang/nb_NO.rb | 1 - lang/nl_NL.rb | 3 - lang/pl_PL.rb | 6 - lang/pt_BR.rb | 3 - lang/ro_RO.rb | 6 - lang/ru_RU.rb | 1 - lang/zh_CN.rb | 1 - lang/zh_TW.rb | 6 - 37 files changed, 132 insertions(+), 144 deletions(-) diff --git a/app/views/admin/content/_categories.html.erb b/app/views/admin/content/_categories.html.erb index caa65a377b..7aff3dd6b2 100644 --- a/app/views/admin/content/_categories.html.erb +++ b/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' %> - - -<% 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' %> diff --git a/app/views/admin/content/_form.html.erb b/app/views/admin/content/_form.html.erb index 03e81b0042..0eadee2da2 100644 --- a/app/views/admin/content/_form.html.erb +++ b/app/views/admin/content/_form.html.erb @@ -1,4 +1,5 @@ - +<%= hidden_field_tag "user_textfilter", current_user.text_filter_name %> +
<%= set_autosave_tag(@article) %>
@@ -6,7 +7,7 @@ <%= _("#{controller.action_name.to_s.capitalize} article") %> - <%= link_to(_("Preview"), {:controller => '/articles', :action => 'preview', :id => @article.id}, {:target => 'new', :class => 'btn'}) if @article.id %> + <%= link_to(_("Preview"), {controller: '/articles', action: 'preview', id: @article.id}, {target: 'new', class: 'btn'}) if @article.id %> <%= save( _("Publish")) %> @@ -14,71 +15,72 @@ <%= error_messages_for 'article' %>
-
+
- <%= text_field 'article', 'title', :class => 'input-block-level', :placeholder => _('Title') %> -
- - <%= render('images', { :images => @images}) unless @images.empty? %> - -
- <%= toggle_element 'carousel-wrapper', _("Images") %> -
- -
+
+
+ <%= text_field 'article', 'title', :class => 'input-block-level', :placeholder => _('Title') %> +
+ <%= render('images', { :images => @images}) unless @images.empty? %> -
- <%= text_area('article', 'body_and_extended', {:class => 'input-block-level', :height => '360px'}) %> - <%= render 'admin/shared/macros' %> -
-
+
+ <%= toggle_element 'carousel-wrapper', _("Images") %> +
+ +
-
-

<%= _("Excerpt") %>

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

<%= _("Status") %>: <%= _(@article.state.to_s.downcase) %> <%= toggle_element 'status' %>

- -
-

<%= _("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' %>

- + +
+

<%= _("Excerpt") %>

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

<%= _("Published") %> <%= publish_now_or_already_published @article %> <%= toggle_element 'publish' %>

- diff --git a/app/views/admin/content/edit.html.erb b/app/views/admin/content/edit.html.erb index 829dbb2186..03f9e96fcc 100644 --- a/app/views/admin/content/edit.html.erb +++ b/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 %> diff --git a/app/views/admin/content/new.html.erb b/app/views/admin/content/new.html.erb index 035e50c1fc..3fc099e5e5 100644 --- a/app/views/admin/content/new.html.erb +++ b/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 %> diff --git a/app/views/admin/shared/_edit.html.erb b/app/views/admin/shared/_edit.html.erb index 9777c35957..a37ebec657 100644 --- a/app/views/admin/shared/_edit.html.erb +++ b/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 %> diff --git a/config/locales/da.yml b/config/locales/da.yml index a0ae5db2b4..01b619b7c9 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -1,5 +1,8 @@ da: admin: + content: + categories: + new_category: "New Category" categories: new: categories: "Kategorier" diff --git a/config/locales/de.yml b/config/locales/de.yml index b4be8808f4..0d6a63f60a 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1,5 +1,8 @@ de: admin: + content: + categories: + new_category: "New Category" categories: new: categories: "Categories" diff --git a/config/locales/en.yml b/config/locales/en.yml index 4e8f3eca33..22fc6214fd 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,5 +1,8 @@ en: admin: + content: + categories: + new_category: "New Category" categories: new: categories: "Categories" diff --git a/config/locales/es-MX.yml b/config/locales/es-MX.yml index 9d4f1708ee..1b8e06663e 100644 --- a/config/locales/es-MX.yml +++ b/config/locales/es-MX.yml @@ -1,5 +1,8 @@ es-MX: admin: + content: + categories: + new_category: "New Category" categories: new: categories: "Categories" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 7ddee3bbbf..bfc054bb30 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1,5 +1,8 @@ fr: admin: + content: + categories: + new_category: "Nouvelle catégorie" categories: new: categories: "Catégories" diff --git a/config/locales/he-IL.yml b/config/locales/he-IL.yml index c65502d412..341ca9d1af 100644 --- a/config/locales/he-IL.yml +++ b/config/locales/he-IL.yml @@ -1,5 +1,8 @@ he-IL: admin: + content: + categories: + new_category: "New Category" categories: new: categories: "קטגוריות" diff --git a/config/locales/it.yml b/config/locales/it.yml index af2f81b415..00bf3c0d22 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -1,5 +1,8 @@ it: admin: + content: + categories: + new_category: "New Category" categories: new: categories: "Categories" diff --git a/config/locales/ja.yml b/config/locales/ja.yml index c627328628..b0de144b93 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1,5 +1,8 @@ ja: admin: + content: + categories: + new_category: "New Category" categories: new: categories: "カテゴリ" diff --git a/config/locales/lt.yml b/config/locales/lt.yml index c093a47391..3089174bfa 100644 --- a/config/locales/lt.yml +++ b/config/locales/lt.yml @@ -1,5 +1,8 @@ lt: admin: + content: + categories: + new_category: "New Category" categories: new: categories: "Categories" diff --git a/config/locales/nb-NO.yml b/config/locales/nb-NO.yml index 8551743b25..b3d714e491 100644 --- a/config/locales/nb-NO.yml +++ b/config/locales/nb-NO.yml @@ -1,5 +1,8 @@ nb-NO: admin: + content: + categories: + new_category: "Ny kategori" categories: new: categories: "Kategorier" diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 1ec097c0cf..a4746b6f33 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -1,5 +1,8 @@ nl: admin: + content: + categories: + new_category: "Nieuwe categorie" categories: new: categories: "Categoriën" diff --git a/config/locales/pl.yml b/config/locales/pl.yml index d7e6750930..ffc7a28621 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -1,5 +1,8 @@ pl: admin: + content: + categories: + new_category: "Utwórz nową kategorię" categories: new: categories: "Categories" diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 2f46d3e3fa..ea20ad3d12 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -1,5 +1,8 @@ pt-BR: admin: + content: + categories: + new_category: "Nova Categoria" categories: new: categories: "Categorias" diff --git a/config/locales/ro.yml b/config/locales/ro.yml index 55311a93d4..2aa806bf61 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -1,5 +1,8 @@ ro: admin: + content: + categories: + new_category: "New Category" categories: new: categories: "Categories" diff --git a/config/locales/ru.yml b/config/locales/ru.yml index d46df2ccb5..a39284326e 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -1,5 +1,8 @@ ru: admin: + content: + categories: + new_category: "Новая категория" categories: new: categories: "Категории" diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index 15b455f02d..f63738a1c2 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -1,5 +1,8 @@ zh-CN: admin: + content: + categories: + new_category: "创建分类" categories: new: categories: "分类" diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index 51a693340a..992e117b58 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -1,5 +1,8 @@ zh-TW: admin: + content: + categories: + new_category: "New Category" categories: new: categories: "分類" diff --git a/lang/da_DK.rb b/lang/da_DK.rb index 930e9c6b38..c2cba5792b 100644 --- a/lang/da_DK.rb +++ b/lang/da_DK.rb @@ -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)" diff --git a/lang/es_MX.rb b/lang/es_MX.rb index 8e57ffa2c6..252757b246 100644 --- a/lang/es_MX.rb +++ b/lang/es_MX.rb @@ -163,9 +163,6 @@ l.store "Are you sure you want to delete the category ", "¿Estás seguro que quieres eliminar esta categoría?" l.store "Delete this category", "Eliminar esta categoría" - # app/views/admin/categories/index.html.erb - l.store "New Category", "" - # app/views/admin/categories/new.html.erb l.store "%s Category", "" diff --git a/lang/fr_FR.rb b/lang/fr_FR.rb index b5f1730248..fb55022246 100644 --- a/lang/fr_FR.rb +++ b/lang/fr_FR.rb @@ -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" diff --git a/lang/he_IL.rb b/lang/he_IL.rb index cf62e8d52a..4b7b66e320 100644 --- a/lang/he_IL.rb +++ b/lang/he_IL.rb @@ -161,9 +161,6 @@ l.store "Are you sure you want to delete the category ", "האם אתה בטוח שברצונך למחוק את הקטגורייה ?" l.store "Delete this category", "מחק קטגורייה זו" - # app/views/admin/categories/index.html.erb - l.store "New Category", "" - # app/views/admin/categories/new.html.erb l.store "%s Category", "" diff --git a/lang/it_IT.rb b/lang/it_IT.rb index 8aeeac09e4..cf96ea4f95 100644 --- a/lang/it_IT.rb +++ b/lang/it_IT.rb @@ -161,9 +161,6 @@ l.store "Are you sure you want to delete the category ", "Sei sicuro di voler eliminare questa categoria " l.store "Delete this category", "Elimina questa categoria" - # app/views/admin/categories/index.html.erb - l.store "New Category", "" - # app/views/admin/categories/new.html.erb l.store "%s Category", "" diff --git a/lang/ja_JP.rb b/lang/ja_JP.rb index b305af677c..c883b07256 100644 --- a/lang/ja_JP.rb +++ b/lang/ja_JP.rb @@ -161,12 +161,6 @@ l.store "Are you sure you want to delete the category ", "このカテゴリを削除してもよろしいですか? " l.store "Delete this category", "このカテゴリを削除" - # 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)", "(完了)" diff --git a/lang/lt_LT.rb b/lang/lt_LT.rb index fbdf566b88..9b5aa4cc74 100644 --- a/lang/lt_LT.rb +++ b/lang/lt_LT.rb @@ -161,12 +161,6 @@ l.store "Are you sure you want to delete the category ", "Ar tikrai nori ištrinti šią kategoriją : " l.store "Delete this category", "Trinti šią kategoriją" - # 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)", "(Baigta)" @@ -203,7 +197,7 @@ l.store "SmartyPants", "" l.store "Visual", "" l.store "Edit article", "" - + # app/views/admin/content/destroy.html.erb l.store "Are you sure you want to delete this article", "Ar tikrai norite ištrinti šį straipsnį" @@ -370,7 +364,7 @@ l.store "Global settings", "" l.store "This will display", "" l.store "at the bottom of each post in the RSS feed", "" - l.store "Here you can add anything you want to appear in your application header, such as analytics service tracking code.", "" + l.store "Here you can add anything you want to appear in your application header, such as analytics service tracking code.", "" # app/views/admin/seo/permalinks.html.erb l.store "Publify offers you the ability to create a custom URL structure for your permalinks and archives. This can improve the aesthetics, usability, and forward-compatibility of your links.", "" diff --git a/lang/nb_NO.rb b/lang/nb_NO.rb index c880d20619..a327e62cd7 100644 --- a/lang/nb_NO.rb +++ b/lang/nb_NO.rb @@ -877,7 +877,6 @@ l.store "Markup type", "Markup type" l.store "MetaData", "Metadata" l.store "Name (required)", "Navn (obligatorisk)" - l.store "New Category", "Ny kategori" l.store "Not published by Apple", "Ikke publisert av Apple" l.store "Notification", "Beskjeder" l.store "Notified", "Beskjed sendt" diff --git a/lang/nl_NL.rb b/lang/nl_NL.rb index a94e9ce42e..c5a77525b3 100644 --- a/lang/nl_NL.rb +++ b/lang/nl_NL.rb @@ -160,9 +160,6 @@ l.store "Are you sure you want to delete the category ", "Weet je zeker dat je de categorie wilt verwijderen?" l.store "Delete this category", "Verwijder deze categorie" - # app/views/admin/categories/index.html.erb - l.store "New Category", "Nieuwe categorie" - # app/views/admin/categories/new.html.erb l.store "%s Category", "%s Categorie" diff --git a/lang/pl_PL.rb b/lang/pl_PL.rb index 1b8656724b..58013278c0 100644 --- a/lang/pl_PL.rb +++ b/lang/pl_PL.rb @@ -164,12 +164,6 @@ l.store "Are you sure you want to delete the category ", "Czy na pewno chcesz skasować kategorię " l.store "Delete this category", "Usuń tą kategorię" - # app/views/admin/categories/index.html.erb - l.store "New Category", "Utwórz nową kategorię" - - # app/views/admin/categories/new.html.erb - l.store "%s Category", "" - # app/views/admin/categories/reorder.html.erb l.store "(Done)", "(Zakończono)" diff --git a/lang/pt_BR.rb b/lang/pt_BR.rb index 1fb1e49b74..23eec1f8eb 100644 --- a/lang/pt_BR.rb +++ b/lang/pt_BR.rb @@ -166,9 +166,6 @@ l.store "Are you sure you want to delete the category", "Tem certeza que deseja deletar essa categoria?" l.store "Delete this category", "Eliminar esta categoria" - # app/views/admin/categories/index.html.erb - l.store "New Category", "Nova Categoria" - # app/views/admin/categories/new.html.erb l.store "%s Category", "%s Categoria" diff --git a/lang/ro_RO.rb b/lang/ro_RO.rb index ce917af10d..422c465abe 100644 --- a/lang/ro_RO.rb +++ b/lang/ro_RO.rb @@ -144,12 +144,6 @@ l.store "Are you sure you want to delete the category ", "Ești sigur că dorești să ștergi această categorie" l.store "Delete this category", "Șterge această categorie" - # 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)", "(Gata)" diff --git a/lang/ru_RU.rb b/lang/ru_RU.rb index 7f8b3d3be9..3bd97dbbd2 100644 --- a/lang/ru_RU.rb +++ b/lang/ru_RU.rb @@ -76,7 +76,6 @@ l.store "Delete this category", "Удалить эту категорию" # app/views/admin/categories/index.html.erb - l.store "New Category", "Новая категория" # app/views/admin/content/_form.html.erb l.store "Publish settings", "Настройки публикации" diff --git a/lang/zh_CN.rb b/lang/zh_CN.rb index 8170a1a329..8c73855d10 100644 --- a/lang/zh_CN.rb +++ b/lang/zh_CN.rb @@ -165,7 +165,6 @@ l.store "Delete this category", "删除分类" # app/views/admin/categories/index.html.erb - l.store "New Category", "创建分类" # app/views/admin/categories/new.html.erb l.store "%s Category", "分类%s" diff --git a/lang/zh_TW.rb b/lang/zh_TW.rb index be98d9b785..0d36075326 100644 --- a/lang/zh_TW.rb +++ b/lang/zh_TW.rb @@ -162,12 +162,6 @@ l.store "Are you sure you want to delete the category ", "確認刪除此分類? " l.store "Delete this category", "刪除分類" - # 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)", "(完成)"