Remove i18n_variable for page_content
This commit is contained in:
1 parent
61c1af7316
commit
50813eb57d
7 files changed
+26
-11
No files matched your search
@@ -9,7 +9,7 @@ class PageContext
|
||||
|
||||
is_impressionable :counter_cache => { :column_name => :view_count }
|
||||
|
||||
has_one :context, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
|
||||
field :context, localize: true
|
||||
|
||||
field :create_user_id
|
||||
field :update_user_id
|
||||
@@ -26,7 +26,7 @@ class PageContext
|
||||
ObjectAuthTitlesOptions = %W{Edit}
|
||||
|
||||
def pp_object
|
||||
page.i18n_variable[I18n.locale]
|
||||
page.title
|
||||
end
|
||||
|
||||
def is_top?
|
||||
|
||||
+3
-3
@@ -6,7 +6,7 @@
|
||||
<div id="post-body-content">
|
||||
<div class="title">
|
||||
<%= f.label :name %>
|
||||
<%= @page_context.page.i18n_variable[I18n.locale] %>
|
||||
<%= @page_context.page.title %>
|
||||
</div>
|
||||
|
||||
<ul class="nav nav-tabs">
|
||||
@@ -23,9 +23,9 @@
|
||||
|
||||
<div class="title">
|
||||
<%= f.label :context %>
|
||||
<%= f.fields_for :context, (@page_context.new_record? ? @page_context.build_context : @page_context.context ) do |f| %>
|
||||
<%= f.fields_for :context_translations do |f| %>
|
||||
<%= I18nVariable.from_locale(locale) %>
|
||||
<%= f.text_area locale, :style=>"width:100%", :class => 'tinymce_textarea' %>
|
||||
<%= f.text_area locale, :style=>"width:100%", :class => 'tinymce_textarea':value => (@page_context.context_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<tr id="<%= dom_id page_context %>" class="with_action">
|
||||
<td>
|
||||
<%= page_context.page.path %></br>
|
||||
<%= page_context.page.i18n_variable[I18n.locale] %>
|
||||
<%= page_context.page.title %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<%if is_manager? || is_admin? || page_context.authed_users(:edit).include?(current_user)%>
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
<tr id="<%= dom_id view_page_context %>" class="with_action">
|
||||
<td>
|
||||
<%= view_page_context.page.i18n_variable[I18n.locale] %>
|
||||
<%= view_page_context.page.title %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<li><%= link_to t('view_page_context.show'), panel_page_content_back_end_page_context_path(view_page_context) %></li>
|
||||
|
||||
+2
-2
@@ -9,11 +9,11 @@
|
||||
<ul>
|
||||
<li>
|
||||
<b><%= t('page_content.name') %></b>
|
||||
<%= @page_context.page.i18n_variable[I18n.locale] %>
|
||||
<%= @page_context.page.title %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('page_content.context') %></b>
|
||||
<%= @page_context.context[I18n.locale].html_safe %>
|
||||
<%= @page_context.context.html_safe %>
|
||||
</li>
|
||||
<li>
|
||||
<b><%= t('page_content.張貼者') %></b>
|
||||
|
||||
+2
-2
@@ -4,8 +4,8 @@
|
||||
<p id="notice"><%= flash_messages %></p>
|
||||
|
||||
<div class="view_count pull-right"><%= dislpay_view_count(@page_context) %></div>
|
||||
<h1 class="h1"><%= @page_context.page.i18n_variable[I18n.locale] rescue nil %></h1>
|
||||
<h1 class="h1"><%= @page_context.page.title rescue nil %></h1>
|
||||
|
||||
<div class="page_content"><%= @page_context.context[I18n.locale].html_safe rescue nil %></div>
|
||||
<div class="page_content"><%= @page_context.context.html_safe rescue nil %></div>
|
||||
|
||||
|
||||
Reference in new issue
Block a user