Remove i18n_variable for views
This commit is contained in:
parent
acb7fe0dea
commit
5713df685d
|
@ -35,7 +35,7 @@ class User
|
||||||
# if(self.cache_dept.nil?)
|
# if(self.cache_dept.nil?)
|
||||||
# self.build_cache_dept key: "dept_cache_user_#{self.id}"
|
# self.build_cache_dept key: "dept_cache_user_#{self.id}"
|
||||||
# end
|
# end
|
||||||
dept_hash[locale] = sub_roles.collect{|sr| sr.i18n_variable[locale]}.join(',')
|
dept_hash[locale] = sub_roles.collect{|sr| sr.title}.join(',')
|
||||||
# self.cache_dept[locale] = sub_roles.collect{|sr| sr.i18n_variable[locale]}.join(',')
|
# self.cache_dept[locale] = sub_roles.collect{|sr| sr.i18n_variable[locale]}.join(',')
|
||||||
end
|
end
|
||||||
self.cache_dept = dept_hash
|
self.cache_dept = dept_hash
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p class="ad_banner_slideshow">
|
<p class="ad_banner_slideshow">
|
||||||
<% preview_block_ad_images_helper(ad_banner).each do |ad_image| -%>
|
<% preview_block_ad_images_helper(ad_banner).each do |ad_image| -%>
|
||||||
<%= image_tag ad_image.file,:alt => (ad_image.title[locale] || " "),:time_to_next => ad_banner.transition_msec,:link_open=> ad_image.link_open, :link_url =>((ad_image.out_link || ad_banner.context || " ")) %>
|
<%= image_tag ad_image.file,:alt => (ad_image.title || " "),:time_to_next => ad_banner.transition_msec,:link_open=> ad_image.link_open, :link_url =>((ad_image.out_link || ad_banner.context || " ")) %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p class="ad_banner_slideshow">
|
<p class="ad_banner_slideshow">
|
||||||
<% preview_block_ad_images_helper(ad_banner).each do |ad_image| -%>
|
<% preview_block_ad_images_helper(ad_banner).each do |ad_image| -%>
|
||||||
<%= image_tag ad_image.file,:alt => (ad_image.title[locale] || ' '),:time_to_next => ad_banner.transition_msec,:link_open=> ad_image.link_open, :link_url =>((ad_image.out_link || ad_banner.context || ' ')) %>
|
<%= image_tag ad_image.file,:alt => (ad_image.title || ' '),:time_to_next => ad_banner.transition_msec,:link_open=> ad_image.link_open, :link_url =>((ad_image.out_link || ad_banner.context || ' ')) %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -142,14 +142,14 @@
|
||||||
<% @site_valid_locales.each do |locale|%>
|
<% @site_valid_locales.each do |locale|%>
|
||||||
<%= content_tag :div,:class => "tab-pane #{active_when_current_locale_eq locale}",:id=>"#{locale}" do%>
|
<%= content_tag :div,:class => "tab-pane #{active_when_current_locale_eq locale}",:id=>"#{locale}" do%>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<%= f.fields_for :title,@ad_image.title do |f| %>
|
<%= f.fields_for :title_translations do |f| %>
|
||||||
<%= f.text_field locale,:class=>"ad_image-title post-title",:placeholder => "輸入標題"%>
|
<%= f.text_field locale, :class=>"ad_image-title post-title", :placeholder => "輸入標題", :value => (@ad_image.title_translations[locale] rescue nil) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
<div class="context editor">
|
<div class="context editor">
|
||||||
<%= f.fields_for :context, @ad_image.context do |f| %>
|
<%= f.fields_for :context_translations, @ad_image.context do |f| %>
|
||||||
<%= f.text_area locale,:style => "width:100%", :class => "tinymce_textarea post-title" %>
|
<%= f.text_area locale, :style => "width:100%", :class => "tinymce_textarea post-title", :value => (@ad_image.context_translations[locale] rescue nil) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,6 @@
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<% @site_valid_locales.each do |locale| %>
|
<% @site_valid_locales.each do |locale| %>
|
||||||
<td><%= asset_category.i18n_variable[locale] rescue nil %></td>
|
<td><%= asset_category.title_translations[locale] rescue nil %></td>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -10,12 +10,12 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="widget-title">
|
<div id="widget-title">
|
||||||
<%= f.fields_for :i18n_variable, (@asset_category.new_record? ? @asset_category.build_i18n_variable : @asset_category.i18n_variable) do |f| %>
|
<%= f.fields_for :title_translations do |f| %>
|
||||||
<% @site_valid_locales.each do |locale| %>
|
<% @site_valid_locales.each do |locale| %>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
|
<%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.text_field locale, :class => 'input-xxlarge' %>
|
<%= f.text_field locale, :class => 'input-xxlarge', :value => (@asset_category.title_translations[locale] rescue nil) %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<tr id="asset_<%= asset.id %>" class="with_action">
|
<tr id="asset_<%= asset.id %>" class="with_action">
|
||||||
<td><%= check_box_tag 'to_delete[]', asset.id, false, :class => "checkbox_in_list" %></td>
|
<td><%= check_box_tag 'to_delete[]', asset.id, false, :class => "checkbox_in_list" %></td>
|
||||||
<td><%= asset.title.i18n_variable[I18n.locale] rescue nil %></td>
|
<td><%= asset.title rescue nil %></td>
|
||||||
<td>
|
<td>
|
||||||
<i class="icons-picture img-peview" rel="popover" data-content="<img src='<%= asset.data.url %>' />" data-original-title="<%= asset.data.filename %>"></i>
|
<i class="icons-picture img-peview" rel="popover" data-content="<img src='<%= asset.data.url %>' />" data-original-title="<%= asset.data.filename %>"></i>
|
||||||
<div class="quick-edit">
|
<div class="quick-edit">
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td><%= asset.data.file.content_type %></td>
|
<td><%= asset.data.file.content_type %></td>
|
||||||
<td><%= number_to_human_size(asset.data.file.file_length) %></td>
|
<td><%= number_to_human_size(asset.data.file.file_length) %></td>
|
||||||
<td><%= asset.description.i18n_variable[I18n.locale] rescue nil %></td>
|
<td><%= asset.description rescue nil %></td>
|
||||||
<td>
|
<td>
|
||||||
<div class="label-group">
|
<div class="label-group">
|
||||||
<div class="label-td">
|
<div class="label-td">
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label for="title" class="control-label"><%= t 'admin.title' %></label>
|
<label for="title" class="control-label"><%= t 'admin.title' %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.fields_for :i18n_variable, (@asset.new_record? ? @asset.build_i18n_variable : @asset.i18n_variable) do |f| %>
|
<%= f.fields_for :title_translations do |f| %>
|
||||||
<% @site_valid_locales.each do |locale| %>
|
<% @site_valid_locales.each do |locale| %>
|
||||||
<%= content_tag :label do -%>
|
<%= content_tag :label do -%>
|
||||||
<div>
|
<div>
|
||||||
<%= I18nVariable.from_locale(locale) %>
|
<%= I18nVariable.from_locale(locale) %>
|
||||||
<%= f.text_field locale, :class => "input-large" %>
|
<%= f.text_field locale, :class => "input-large", :value => (@asset.title_translations[locale] rescue nil) %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label"><%= f.label :category, t('admin.category') %></label>
|
<label class="control-label"><%= f.label :category, t('admin.category') %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.select :asset_category_id, @asset_categories.collect{|t| [ t.i18n_variable[I18n.locale], t.id ]}, {}, :class => "input-large" %>
|
<%= f.select :asset_category_id, @asset_categories.collect{|t| [ t.title, t.id ]}, {}, :class => "input-large" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
|
|
|
@ -11,13 +11,13 @@
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label for="title" class="control-label error"><%= t 'admin.title' %></label>
|
<label for="title" class="control-label error"><%= t 'admin.title' %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.fields_for :title, (@asset.new_record? ? @asset.build_title : @asset.title) do |f| %>
|
<%= f.fields_for :title_translations do |f| %>
|
||||||
<div>
|
<div>
|
||||||
<% @site_valid_locales.each do |locale| %>
|
<% @site_valid_locales.each do |locale| %>
|
||||||
<%= content_tag :label do -%>
|
<%= content_tag :label do -%>
|
||||||
<div>
|
<div>
|
||||||
<%= I18nVariable.from_locale(locale) %>
|
<%= I18nVariable.from_locale(locale) %>
|
||||||
<%= f.text_field locale, :class => "input-large" %>
|
<%= f.text_field locale, :class => "input-large", :value => (@asset.title_translations[locale] rescue nil) %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -28,13 +28,13 @@
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label for="description" class="control-label error"><%= t 'admin.description' %></label>
|
<label for="description" class="control-label error"><%= t 'admin.description' %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.fields_for :description, (@asset.new_record? ? @asset.build_description : @asset.description) do |f| %>
|
<%= f.fields_for :description_translations do |f| %>
|
||||||
<div>
|
<div>
|
||||||
<% @site_valid_locales.each do |locale| %>
|
<% @site_valid_locales.each do |locale| %>
|
||||||
<%= content_tag :label do -%>
|
<%= content_tag :label do -%>
|
||||||
<div>
|
<div>
|
||||||
<%= I18nVariable.from_locale(locale) %>
|
<%= I18nVariable.from_locale(locale) %>
|
||||||
<%= f.text_field locale, :class => "input-large" %>
|
<%= f.text_field locale, :class => "input-large", :value => (@asset.title_translations[locale] rescue nil) %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
<td class='select_mulitlingual' style='text-align:center'>
|
<td class='select_mulitlingual' style='text-align:center'>
|
||||||
<%= f.check_box :locale %>
|
<%= f.check_box :locale %>
|
||||||
</td>
|
</td>
|
||||||
<%= f.fields_for :i18n_variable, (attribute_field.new_record? ? attribute_field.build_i18n_variable : attribute_field.i18n_variable) do |f| %>
|
<%= f.fields_for :title_translations do |f| %>
|
||||||
<% @site_valid_locales.each do |locale| %>
|
<% @site_valid_locales.each do |locale| %>
|
||||||
<td><%= f.text_field locale, :style => "width:130px" %></td>
|
<td><%= f.text_field locale, :style => "width:130px", :value => (attribute_field.title_translations[locale] rescue nil) %></td>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<td class='select_type'>
|
<td class='select_type'>
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @attributes.each do |attribute| %>
|
<% @attributes.each do |attribute| %>
|
||||||
<tr id="attribute_<%= attribute.id %>" class="have <%= "#{attribute.is_disabled? ? 'disable' : ''}" %>">
|
<tr id="attribute_<%= attribute.id %>" class="have <%= "#{attribute.is_disabled? ? 'disable' : ''}" %>">
|
||||||
<td class="<%= @attribute_type %>s <%= attribute.key.downcase %>"><%= attribute.i18n_variable[I18n.locale] %></span>
|
<td class="<%= @attribute_type %>s <%= attribute.key.downcase %>"><%= attribute.title %></span>
|
||||||
<td class="action">
|
<td class="action">
|
||||||
|
|
||||||
<%= link_to t(:edit), eval("edit_admin_#{@attribute_type}_path(attribute)"), :class => 'edit' %>
|
<%= link_to t(:edit), eval("edit_admin_#{@attribute_type}_path(attribute)"), :class => 'edit' %>
|
||||||
|
|
|
@ -514,7 +514,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @recent_updated.each do |object| %>
|
<% @recent_updated.each do |object| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= link_to ((object[0].title[I18n.locale] rescue nil) || (object[0].page.i18n_variable[I18n.locale] rescue nil)), get_link_to_object(object[0]) %></td>
|
<td><%= link_to ((object[0].title rescue nil) || (object[0].page.title rescue nil)), get_link_to_object(object[0]) %></td>
|
||||||
<td class="span2"><%= link_to t("dashboard.#{object[0]._type.underscore}"), get_link(object[0]._type.underscore) %></td>
|
<td class="span2"><%= link_to t("dashboard.#{object[0]._type.underscore}"), get_link(object[0]._type.underscore) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -552,7 +552,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @most_visited.each do |object| %>
|
<% @most_visited.each do |object| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= link_to ((object[0].title[I18n.locale] rescue nil) || (object[0].page.i18n_variable[I18n.locale] rescue nil)), get_link_to_object(object[0]) %></td>
|
<td><%= link_to ((object[0].title rescue nil) || (object[0].page.title rescue nil)), get_link_to_object(object[0]) %></td>
|
||||||
<td class="span2"><%= link_to t("dashboard.#{object[0]._type.underscore}"), get_link(object[0]._type.underscore) %></td>
|
<td class="span2"><%= link_to t("dashboard.#{object[0]._type.underscore}"), get_link(object[0]._type.underscore) %></td>
|
||||||
<td class="span2"><%= object[1] %></td>
|
<td class="span2"><%= object[1] %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr class="list_item">
|
<tr class="list_item">
|
||||||
<td><%= is_new ? (f.text_field :key, {:style => "width:150px"}) : @attribute.key %></td>
|
<td><%= is_new ? (f.text_field :key, {:style => "width:150px"}) : @attribute.key %></td>
|
||||||
<%= f.fields_for :i18n_variable, (@attribute.new_record? ? @attribute.build_i18n_variable : @attribute.i18n_variable) do |f| %>
|
<%= f.fields_for :title_translations do |f| %>
|
||||||
<% @site_valid_locales.each do |locale| %>
|
<% @site_valid_locales.each do |locale| %>
|
||||||
<td><%= f.text_field locale, :style => "width:150px" %></td>
|
<td><%= f.text_field locale, :style => "width:150px", :value => (@attribute.title_translations[locale] rescue nil) %></td>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -6,11 +6,11 @@
|
||||||
<%= f.text_field :name, :class => 'text' %>
|
<%= f.text_field :name, :class => 'text' %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<%= f.fields_for :i18n_variable, (@item.new_record? ? @item.build_i18n_variable : @item.i18n_variable) do |f| %>
|
<%= f.fields_for :title_translations do |f| %>
|
||||||
<% @site_valid_locales.each do |locale| %>
|
<% @site_valid_locales.each do |locale| %>
|
||||||
<p>
|
<p>
|
||||||
<%= f.label :locale, "#{t('admin.title')} #{I18nVariable.from_locale(locale)}" %>
|
<%= f.label :locale, "#{t('admin.title')} #{I18nVariable.from_locale(locale)}" %>
|
||||||
<%= f.text_field locale %>
|
<%= f.text_field locale, :value => (@item.title_translations[locale] rescue nil) %>
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<% @site_valid_locales.each do |locale| %>
|
<% @site_valid_locales.each do |locale| %>
|
||||||
<p>
|
<p>
|
||||||
<b><%= "#{t('admin.title')} #{locale}" %></b>
|
<b><%= "#{t('admin.title')} #{locale}" %></b>
|
||||||
<%= @item.i18n_variable[locale] if @item.i18n_variable %>
|
<%= @item.title_translations[locale] if @item.title %>
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
$('#app_page_url').html("<%= escape_javascript(select 'page', 'app_frontend_url', @module_app.app_pages) %>");
|
$('#app_page_url').html("<%= escape_javascript(select 'page', 'app_frontend_url', @module_app.app_pages) %>");
|
||||||
$('#app_page_category').html("<%= j (select 'page', 'category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, {:include_blank => true}) if @categories %>");
|
$('#app_page_category').html("<%= j (select 'page', 'category', @categories.collect{|category| [category.title, category.id]}, {:include_blank => true}) if @categories %>");
|
||||||
$('#app_page_tag').html("<%= j (select 'page', 'tag', @tags.collect{|tag| [tag[I18n.locale], tag.id]}, {:include_blank => true}) if @tags %>");
|
$('#app_page_tag').html("<%= j (select 'page', 'tag', @tags.collect{|tag| [tag[I18n.locale], tag.id]}, {:include_blank => true}) if @tags %>");
|
|
@ -1,9 +1,9 @@
|
||||||
<div>
|
<div>
|
||||||
<%= f.fields_for :title, @part.title do |f| %>
|
<%= f.fields_for :title_translations do |f| %>
|
||||||
<% @site_valid_locales.each do |locale| %>
|
<% @site_valid_locales.each do |locale| %>
|
||||||
<p>
|
<p>
|
||||||
<%= f.label :locale, "#{t('admin.title')} #{I18nVariable.from_locale(locale)}" %>
|
<%= f.label :locale, "#{t('admin.title')} #{I18nVariable.from_locale(locale)}" %>
|
||||||
<%= f.text_field locale %>
|
<%= f.text_field locale, :value => (@part.title_translations[locale] rescue nil) %>
|
||||||
</p>
|
</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<%= f.fields_for :i18n_variable, (@part.i18n_variable ? @part.i18n_variable : @part.build_i18n_variable) do |f| %>
|
<%= f.fields_for :content_translations do |f| %>
|
||||||
<% @site_valid_locales.each do |locale| %>
|
<% @site_valid_locales.each do |locale| %>
|
||||||
<div>
|
<div>
|
||||||
<%= I18nVariable.from_locale(locale) %>
|
<%= I18nVariable.from_locale(locale) %>
|
||||||
<%= f.text_area locale, :class => 'tinymce_textarea' %>
|
<%= f.text_area locale, :class => 'tinymce_textarea', :value => (@part.content_translations[locale] rescue nil) %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
|
@ -1 +1 @@
|
||||||
<%= select 'page_part', 'category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, :selected => (@part ? @part[:category] : nil), :include_blank => true if @categories && @categories.size > 0 %>
|
<%= select 'page_part', 'category', @categories.collect{|category| [category.title, category.id]}, :selected => (@part ? @part[:category] : nil), :include_blank => true if @categories && @categories.size > 0 %>
|
|
@ -1 +1 @@
|
||||||
<%= select 'page_part', 'tag', @tags.collect{|category| [category[I18n.locale], category.id]}, :selected => (@part ? @part[:tag] : nil), :include_blank => true if @tags && @tags.size > 0 %>
|
<%= select 'page_part', 'tag', @tags.collect{|tag| [tag[I18n.locale], tag.id]}, :selected => (@part ? @part[:tag] : nil), :include_blank => true if @tags && @tags.size > 0 %>
|
|
@ -9,12 +9,12 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= f.fields_for :i18n_variable, (@item.new_record? ? @item.build_i18n_variable : @item.i18n_variable) do |f| %>
|
<%= f.fields_for :title_translations do |f| %>
|
||||||
<% @site_valid_locales.each do |locale| %>
|
<% @site_valid_locales.each do |locale| %>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<%= f.label :locale, "#{t('admin.title')} #{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
|
<%= f.label :locale, "#{t('admin.title')} #{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.text_field locale, :class => 'text input-xlarge' %>
|
<%= f.text_field locale, :class => 'text input-xlarge', :value => (@item.title_translations[locale] rescue nil) %>
|
||||||
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
|
<!-- <p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
<%= select('page','app_frontend_url', @app_frontend_urls, :selected => @item.app_frontend_url ) rescue ''%>
|
<%= select('page','app_frontend_url', @app_frontend_urls, :selected => @item.app_frontend_url ) rescue ''%>
|
||||||
</span>
|
</span>
|
||||||
<span id="app_page_category">
|
<span id="app_page_category">
|
||||||
<%= select('page','category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, :selected => @item[:category], :include_blank => true ) rescue ''%>
|
<%= select('page','category', @categories.collect{|category| [category.title, category.id]}, :selected => @item[:category], :include_blank => true ) rescue ''%>
|
||||||
</span>
|
</span>
|
||||||
<span id="app_page_tag">
|
<span id="app_page_tag">
|
||||||
<%= select('page','tag', @tags.collect{|tag| [tag[I18n.locale], tag.id]}, :selected => @item[:tag], :include_blank => true ) rescue ''%>
|
<%= select('page','tag', @tags.collect{|tag| [tag[I18n.locale], tag.id]}, :selected => @item[:tag], :include_blank => true ) rescue ''%>
|
||||||
|
|
|
@ -14,9 +14,9 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr class="list_item">
|
<tr class="list_item">
|
||||||
<td><%= is_new ? (f.text_field :key, {:style => "width:150px"}) : @attribute.key %></td>
|
<td><%= is_new ? (f.text_field :key, {:style => "width:150px"}) : @attribute.key %></td>
|
||||||
<%= f.fields_for :i18n_variable, (@attribute.new_record? ? @attribute.build_i18n_variable : @attribute.i18n_variable) do |f| %>
|
<%= f.fields_for :title_translations do |f| %>
|
||||||
<% @site_valid_locales.each do |locale| %>
|
<% @site_valid_locales.each do |locale| %>
|
||||||
<td><%= f.text_field locale, :style => "width:150px" %></td>
|
<td><%= f.text_field locale, :style => "width:150px", :value => (@attribute.title_translations[locale] rescue nil) %></td>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -11,9 +11,9 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr class="list_item">
|
<tr class="list_item">
|
||||||
<td><%= sub_role.new_record? ? (f.text_field :key, {:style => "width:150px"}) : sub_role.key %></td>
|
<td><%= sub_role.new_record? ? (f.text_field :key, {:style => "width:150px"}) : sub_role.key %></td>
|
||||||
<%= f.fields_for :i18n_variable, (sub_role.new_record? ? sub_role.build_i18n_variable : sub_role.i18n_variable) do |f| %>
|
<%= f.fields_for :title_translations do |f| %>
|
||||||
<% @site_valid_locales.each do |locale| %>
|
<% @site_valid_locales.each do |locale| %>
|
||||||
<td><%= f.text_field locale, :style => "width:150px" %></td>
|
<td><%= f.text_field locale, :style => "width:150px", :value => (sub_role.title_translations[locale] rescue nil) %></td>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label"><%= t 'admin.site_title' %></label>
|
<label class="control-label"><%= t 'admin.site_title' %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.fields_for :title, @site.title do |f| %>
|
<%= f.fields_for :title_translations do |f| %>
|
||||||
<%= f.text_field locale, :class => "input-xxlarge" %>
|
<%= f.text_field locale, :class => "input-xxlarge", :value => (@site.title_translations[locale] rescue nil) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<p class="help-block"><%= (t 'admin.site_title_help').html_safe %></p>
|
<p class="help-block"><%= (t 'admin.site_title_help').html_safe %></p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -38,6 +38,7 @@
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label"><%= t 'admin.site_keywords' %></label>
|
<label class="control-label"><%= t 'admin.site_keywords' %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
<% #TODO: set keywords into meta %>
|
||||||
<%= f.fields_for :keywords, @site.keywords do |f| %>
|
<%= f.fields_for :keywords, @site.keywords do |f| %>
|
||||||
<%= f.text_area locale, :class => "input-xxlarge textarea-height-s" %>
|
<%= f.text_area locale, :class => "input-xxlarge textarea-height-s" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -47,8 +48,8 @@
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label"><%= t 'admin.site_description' %></label>
|
<label class="control-label"><%= t 'admin.site_description' %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.fields_for :description, @site.description do |f| %>
|
<%= f.fields_for :description_translations do |f| %>
|
||||||
<%= f.text_area locale, :class => "input-xxlarge textarea-height-s" %>
|
<%= f.text_area locale, :class => "input-xxlarge textarea-height-s", :value => (@site.description_translations[locale] %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<p class="help-block"><%= (t 'admin.site_description_help').html_safe %></p>
|
<p class="help-block"><%= (t 'admin.site_description_help').html_safe %></p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -56,8 +57,8 @@
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label"><%= t 'admin.site_footer' %></label>
|
<label class="control-label"><%= t 'admin.site_footer' %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.fields_for :footer, @site.footer do |f| %>
|
<%= f.fields_for :footer_translations do |f| %>
|
||||||
<%= f.text_area locale, :class => "tinymce_textarea input-xxlarge" %>
|
<%= f.text_area locale, :class => "tinymce_textarea input-xxlarge", :value => (@site.footer_translations[locale] %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<p class="help-block"><%= (t 'admin.site_footer_help').html_safe %></p>
|
<p class="help-block"><%= (t 'admin.site_footer_help').html_safe %></p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -65,8 +66,8 @@
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label"><%= t 'admin.site_sub_menu' %></label>
|
<label class="control-label"><%= t 'admin.site_sub_menu' %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.fields_for :sub_menu, @site.sub_menu do |f| %>
|
<%= f.fields_for :sub_menu_translations do |f| %>
|
||||||
<%= f.text_area locale, :class => "tinymce_textarea input-xxlarge" %>
|
<%= f.text_area locale, :class => "tinymce_textarea input-xxlarge", :value => (@site.sub_menu_translations[locale] %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<span><%= t('admin.role') %>:</span>
|
<span><%= t('admin.role') %>:</span>
|
||||||
<%= f.select :role_id, @roles.sort_by{|role| role.key }.collect {|role| [ role.i18n_variable[I18n.locale], role.id ]}, :selected => (@user.role_id || Role.get_role_from_key('student')) %>
|
<%= f.select :role_id, @roles.sort_by{|role| role.key }.collect {|role| [ role.title, role.id ]}, :selected => (@user.role_id || Role.get_role_from_key('student')) %>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
<div id='roles'>
|
<div id='roles'>
|
||||||
<% @roles.each do |role| %>
|
<% @roles.each do |role| %>
|
||||||
<div id="<%= role.id %>_block" class="attributes_block <%= @class %>" <%= raw(' style="display: none;"') unless ((@user.role.id.eql?(role.id) rescue nil) || (role.key.eql?('student') && @user.new_record?)) %>>
|
<div id="<%= role.id %>_block" class="attributes_block <%= @class %>" <%= raw(' style="display: none;"') unless ((@user.role.id.eql?(role.id) rescue nil) || (role.key.eql?('student') && @user.new_record?)) %>>
|
||||||
<h2><%= role.i18n_variable[I18n.locale] %></h2>
|
<h2><%= role.title %></h2>
|
||||||
<hr class="<#%= @user.role.key %>_block">
|
<hr class="<#%= @user.role.key %>_block">
|
||||||
<%= render :partial => 'sub_role_selector', :locals => {:f => f, :role => role} %>
|
<%= render :partial => 'sub_role_selector', :locals => {:f => f, :role => role} %>
|
||||||
<%= render :partial => 'sub_role', :collection => role.sub_roles, :locals => {:f => f, :role => role} %>
|
<%= render :partial => 'sub_role', :collection => role.sub_roles, :locals => {:f => f, :role => role} %>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div id="basic_block" class="attributes_block <%= @class %>">
|
<div id="basic_block" class="attributes_block <%= @class %>">
|
||||||
<h2><%= info.i18n_variable[I18n.locale] %></h2>
|
<h2><%= info.title %></h2>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="info_input">
|
<div class="info_input">
|
||||||
<table border="0" cellspacing="0" cellpadding="0">
|
<table border="0" cellspacing="0" cellpadding="0">
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
<% info.get_enabled_attribute_fields.each do |attr| %>
|
<% info.get_enabled_attribute_fields.each do |attr| %>
|
||||||
<%= f.fields_for :attribute_values, @user.get_value_from_field_id(attr.id) do |f| %>
|
<%= f.fields_for :attribute_values, @user.get_value_from_field_id(attr.id) do |f| %>
|
||||||
<tr class="list_item">
|
<tr class="list_item">
|
||||||
<td><%= attr.i18n_variable[I18n.locale] %></td>
|
<td><%= attr.title %></td>
|
||||||
<% if attr["locale"] && attr["markup"] == 'text_field' %>
|
<% if attr["locale"] && attr["markup"] == 'text_field' %>
|
||||||
<% @site_valid_locales.each do |locale| %>
|
<% @site_valid_locales.each do |locale| %>
|
||||||
<td><%= f.text_field locale %></td>
|
<td><%= f.text_field locale %></td>
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<% show_attribute.get_enabled_attribute_fields.each do |attr| %>
|
<% show_attribute.get_enabled_attribute_fields.each do |attr| %>
|
||||||
<tr class="list_item">
|
<tr class="list_item">
|
||||||
<td><%= attr.i18n_variable[I18n.locale] %></td>
|
<td><%= attr.title %></td>
|
||||||
<% @site_valid_locales.each do |locale| %>
|
<% @site_valid_locales.each do |locale| %>
|
||||||
<td>
|
<td>
|
||||||
<% if attr["locale"] && attr["markup"] == 'text_field' %>
|
<% if attr["locale"] && attr["markup"] == 'text_field' %>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<div id="sub_role_<%= show_sub_role.id %>" class="group">
|
<div id="sub_role_<%= show_sub_role.id %>" class="group">
|
||||||
<h2><%= show_sub_role.i18n_variable[I18n.locale] %></h2>
|
<h2><%= show_sub_role.title %></h2>
|
||||||
<%= render :partial => 'show_attribute', :object => show_sub_role %>
|
<%= render :partial => 'show_attribute', :object => show_sub_role %>
|
||||||
</div>
|
</div>
|
|
@ -1,5 +1,5 @@
|
||||||
<div id="sub_role_<%= sub_role.id %>" class="group" <%= raw(' style="display: none;"') unless @user.sub_role_ids.include?(sub_role.id) %>>
|
<div id="sub_role_<%= sub_role.id %>" class="group" <%= raw(' style="display: none;"') unless @user.sub_role_ids.include?(sub_role.id) %>>
|
||||||
<h2><%= sub_role.i18n_variable[I18n.locale] %></h2>
|
<h2><%= sub_role.title %></h2>
|
||||||
<div class="info_input">
|
<div class="info_input">
|
||||||
<table border="0" cellspacing="0" cellpadding="0">
|
<table border="0" cellspacing="0" cellpadding="0">
|
||||||
<thead class="list_head">
|
<thead class="list_head">
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
<% sub_role.get_enabled_attribute_fields.each do |attr| %>
|
<% sub_role.get_enabled_attribute_fields.each do |attr| %>
|
||||||
<%= f.fields_for :attribute_values, @user.get_value_from_field_id(attr.id) do |f| %>
|
<%= f.fields_for :attribute_values, @user.get_value_from_field_id(attr.id) do |f| %>
|
||||||
<tr class="list_item">
|
<tr class="list_item">
|
||||||
<td><%= attr.i18n_variable[I18n.locale] %></td>
|
<td><%= attr.title %></td>
|
||||||
<% if attr["locale"] && attr["markup"] == 'text_field' %>
|
<% if attr["locale"] && attr["markup"] == 'text_field' %>
|
||||||
<% @site_valid_locales.each do |locale| %>
|
<% @site_valid_locales.each do |locale| %>
|
||||||
<td><%= f.text_field locale %></td>
|
<td><%= f.text_field locale %></td>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<% role.sub_roles.each do |sub_role| %>
|
<% role.sub_roles.each do |sub_role| %>
|
||||||
<%= f.label sub_role.i18n_variable[I18n.locale], :for => "check_sub_role_#{sub_role.id}", :class => 'sub_role_select' %>
|
<%= f.label sub_role.title, :for => "check_sub_role_#{sub_role.id}", :class => 'sub_role_select' %>
|
||||||
<%= check_box_tag "user[sub_role_ids][]", sub_role.id, @user.sub_role_ids.include?(sub_role.id), :id => "check_sub_role_#{sub_role.id}", :class => 'sub_role_select' %>
|
<%= check_box_tag "user[sub_role_ids][]", sub_role.id, @user.sub_role_ids.include?(sub_role.id), :id => "check_sub_role_#{sub_role.id}", :class => 'sub_role_select' %>
|
||||||
<% end %>
|
<% end %>
|
|
@ -20,7 +20,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @users.each do |user| %>
|
<% @users.each do |user| %>
|
||||||
<tr class="have">
|
<tr class="have">
|
||||||
<td class="roles <%= user.role.key.downcase rescue nil %>"><%= user.role.i18n_variable[I18n.locale] rescue nil %></td>
|
<td class="roles <%= user.role.key.downcase rescue nil %>"><%= user.role.title rescue nil %></td>
|
||||||
<td class="name"><%= user.name ? user.name : 'bob' %></td>
|
<td class="name"><%= user.name ? user.name : 'bob' %></td>
|
||||||
<td class="email"><%= user.email %></td>
|
<td class="email"><%= user.email %></td>
|
||||||
<td class="admin"><%= user.admin ? t(:yes_) : t(:no_) %></td>
|
<td class="admin"><%= user.admin ? t(:yes_) : t(:no_) %></td>
|
||||||
|
|
|
@ -14,14 +14,14 @@
|
||||||
</div>
|
</div>
|
||||||
<% @infos.each do |a| %>
|
<% @infos.each do |a| %>
|
||||||
<div id="basic_block" class="roles_block <%= @class %>">
|
<div id="basic_block" class="roles_block <%= @class %>">
|
||||||
<h2><%= a.i18n_variable[I18n.locale] %></h2>
|
<h2><%= a.title %></h2>
|
||||||
<hr>
|
<hr>
|
||||||
<%= render :partial => 'show_attribute', :object => a %>
|
<%= render :partial => 'show_attribute', :object => a %>
|
||||||
</div>
|
</div>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
<div id="basic_block" class="roles_block <%= @class %>">
|
<div id="basic_block" class="roles_block <%= @class %>">
|
||||||
<h2><%= @user.role.i18n_variable[I18n.locale] %></h2>
|
<h2><%= @user.role.title %></h2>
|
||||||
<hr class="<%= @user.role.key %>_block">
|
<hr class="<%= @user.role.key %>_block">
|
||||||
<%= render :partial => 'show_sub_role', :collection => @user.sub_roles %>
|
<%= render :partial => 'show_sub_role', :collection => @user.sub_roles %>
|
||||||
</div>
|
</div>
|
||||||
|
|
Reference in New Issue