diff --git a/app/assets/javascripts/bulletin_form.js.erb b/app/assets/javascripts/bulletin_form.js.erb index 5002cfae7..17f86060c 100644 --- a/app/assets/javascripts/bulletin_form.js.erb +++ b/app/assets/javascripts/bulletin_form.js.erb @@ -1,4 +1,4 @@ -$('.bulletin_urls_block a.delete').live('click', function(){ +$('.bulletin_links_block a.delete').live('click', function(){ $(this).parents('.list_item').remove(); }); @@ -9,4 +9,5 @@ $('.bulletin_files_block a.delete').live('click', function(){ $('.action a.remove_existing_record').live('click', function(){ $(this).next('.should_destroy').attr('value', 1); $("#bulletin_" + $(this).prev().attr('value')).hide(); + $("tr#bulletin_" + $(this).prev().attr('value')).hide(); }); \ No newline at end of file diff --git a/app/views/layouts/_side_bar.html.erb b/app/views/layouts/_side_bar.html.erb index 159485789..61e2c4d84 100644 --- a/app/views/layouts/_side_bar.html.erb +++ b/app/views/layouts/_side_bar.html.erb @@ -16,16 +16,25 @@ <%= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), panel_web_resource_back_end_web_links_path %> <% end -%> -<%= content_tag :li, :class => active_for_controllers(nil) do -%> +<%= content_tag :li, :class => active_for_controllers('page_contexts') do -%> <%= link_to content_tag(:i, nil, :class => 'icons-page') + t('admin.page'), panel_page_content_back_end_page_contexts_path %> + <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('page_contexts')) do -%> + <%= content_tag :li, link_to(t('admin.all_articles'), panel_page_content_back_end_page_contexts_path), :class => active_for_action('page_context', 'index') %> + <% end -%> <% end -%> <%= content_tag :li, :class => active_for_controllers('designs') do -%> <%= link_to content_tag(:i, nil, :class => 'icons-window-block') + t('admin.design'), admin_designs_path %> <% end -%> -<%= content_tag :li, :class => active_for_controllers(nil) do -%> - <%= link_to content_tag(:i, nil, :class => 'icons-link') + t('admin.link'), nil %> +<%= content_tag :li, :class => active_for_controllers('web_links', 'tags', 'web_link_categorys') do -%> + <%= link_to content_tag(:i, nil, :class => 'icons-link') + t('admin.link'), panel_web_resource_back_end_web_links_path %> + <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('web_links', 'tags', 'web_link_categorys')) do -%> + <%= content_tag :li, link_to(t('admin.all_articles'), panel_web_resource_back_end_web_links_path), :class => active_for_action('web_link', 'index') %> + <%= content_tag :li, link_to(t('admin.add_new'), new_panel_web_resource_back_end_web_link_path), :class => active_for_action('web_link', 'new') %> + <%= content_tag :li, link_to(t('admin.categories'), panel_web_resource_back_end_web_link_categorys_path), :class => active_for_action('web_link_categorys', 'index') %> + <%= content_tag :li, link_to(t('admin.tags'), panel_web_resource_back_end_tags_path), :class => active_for_action('tags', 'index') %> + <% end -%> <% end -%> <%= content_tag :li, :class => active_for_controllers(nil) do -%> diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb index 48b9ac884..09e94c2d6 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb @@ -9,6 +9,7 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController # @bulletins = Bulletin.all # @bulletins = Bulletin.desc("postdate desc") get_categorys(params[:bulletin_category_id]) + get_tags # @bulletins = Bulletin.where("bulletin_category_id" => params[:bulletin_category_id]).desc("postdate") if params[:bulletin_category_id] @@ -16,9 +17,6 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController # @bulletins = Bulletin.all.order_by([params[:sort], params[:direction]]) @bulletins = params[:sort] ? get_sorted_bulletins : Bulletin.all @bulletin_categories = BulletinCategory.all - - module_app = ModuleApp.first(:conditions => {:key => 'announcement'}) - @tags = Tag.all(:conditions => {:module_app_id => module_app.id}).order_by(I18n.locale, :asc) respond_to do |format| format.html # index.html.erb @@ -31,6 +29,7 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController # GET /bulletins/1.xml def show @bulletin = Bulletin.find(params[:id]) + get_tags # get_categorys # @bulletin_categorys = BulletinCategory.where("_id" => params[:id]) @@ -51,11 +50,14 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController # GET /bulletins/new.xml def new @bulletin = Bulletin.new + + @link_url = panel_announcement_back_end_bulletins_path # @bulletin.bulletin_files.build # @bulletin.bulletin_files.new get_categorys + get_tags respond_to do |format| format.html # new.html.erb @@ -67,7 +69,11 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController def edit @bulletin = Bulletin.find(params[:id]) # @summary_variable = @bulletin.summary_variable + + @link_url = panel_announcement_back_end_bulletin_path(@bulletin) + get_categorys + get_tags end # POST /bulletins @@ -90,6 +96,32 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController end end + def link_quick_add + # debugger + + @bulletin = Bulletin.find(params[:bulletin_id]) + + @link_url = panel_announcement_back_end_bulletins_path + + respond_to do |format| + format.js + end + + end + + def link_quick_edit + # debugger + + @bulletin = Bulletin.find(params[:bulletin_id]) + + @link_url = panel_announcement_back_end_bulletin_path(@bulletin) + + respond_to do |format| + format.js + end + + end + # PUT /bulletins/1 # PUT /bulletins/1.xml def update @@ -98,11 +130,11 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController @bulletin.update_user_id = current_user.id # @bulletin.image.clear if params[:bulletin][:image_del] == '1' - if params[:bulletin][:image_del] == '1' - @bulletin.remove_image! + # if params[:bulletin][:image_del] == '1' + # @bulletin.remove_image! # @bulletin.image_del = nil - params[:bulletin][:image_del] = nil - end + # params[:bulletin][:image_del] = nil + # end respond_to do |format| if @bulletin.update_attributes(params[:bulletin]) @@ -147,6 +179,11 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController def get_categorys(id = nil) @bulletin_categorys = (id ? BulletinCategory.find(id).to_a : BulletinCategory.excludes('disabled' => true)) end + + def get_tags + module_app = ModuleApp.first(:conditions => {:key => 'announcement'}) + @tags = Tag.all(:conditions => {:module_app_id => module_app.id}).order_by(I18n.locale, :asc) + end def get_sorted_bulletins bulletins = Bulletin.all diff --git a/vendor/built_in_modules/announcement/app/models/bulletin.rb b/vendor/built_in_modules/announcement/app/models/bulletin.rb index 7c258f236..a1141b41f 100644 --- a/vendor/built_in_modules/announcement/app/models/bulletin.rb +++ b/vendor/built_in_modules/announcement/app/models/bulletin.rb @@ -26,10 +26,11 @@ class Bulletin belongs_to :bulletin_category - embeds_many :bulletin_links, :cascade_callbacks => true - embeds_many :bulletin_files, :cascade_callbacks => true + # embeds_many :bulletin_links, :cascade_callbacks => true + # embeds_many :bulletin_files, :cascade_callbacks => true - # has_many :bulletin_files, :autosave => true, :dependent => :destroy + has_many :bulletin_links, :autosave => true, :dependent => :destroy + has_many :bulletin_files, :autosave => true, :dependent => :destroy accepts_nested_attributes_for :bulletin_files, :allow_destroy => true accepts_nested_attributes_for :bulletin_links, :allow_destroy => true @@ -38,6 +39,9 @@ class Bulletin before_save :set_key + after_save :save_bulletin_links + after_save :save_bulletin_files + def self.search( search = nil, category_id = nil ) @@ -94,6 +98,22 @@ class Bulletin self.is_hidden end + def save_bulletin_links + self.bulletin_links.each do |t| + if t.should_destroy + t.destroy + end + end + end + + def save_bulletin_files + self.bulletin_files.each do |t| + if t.should_destroy + t.destroy + end + end + end + def title @title ||= I18nVariable.first(:conditions => {:key => 'title', :language_value_id => self.id, :language_value_type => self.class}) rescue nil diff --git a/vendor/built_in_modules/announcement/app/models/bulletin_file.rb b/vendor/built_in_modules/announcement/app/models/bulletin_file.rb index 28062d40a..058945158 100644 --- a/vendor/built_in_modules/announcement/app/models/bulletin_file.rb +++ b/vendor/built_in_modules/announcement/app/models/bulletin_file.rb @@ -5,13 +5,27 @@ class BulletinFile mount_uploader :file, AssetUploader - field :filetitle - field :description + # field :filetitle + # field :description + has_one :filetitle, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy + has_one :description, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy # field :to_save, :type => Boolean field :should_destroy, :type => Boolean - # belongs_to :bulletin - embedded_in :bulletin + belongs_to :bulletin + # embedded_in :bulletin + + + protected + + def set_key + if filetitle.new_record? + filetitle.key = 'filetitle' + end + if description.new_record? + description.key = 'description' + end + end end diff --git a/vendor/built_in_modules/announcement/app/models/bulletin_link.rb b/vendor/built_in_modules/announcement/app/models/bulletin_link.rb index a999d45d7..303631820 100644 --- a/vendor/built_in_modules/announcement/app/models/bulletin_link.rb +++ b/vendor/built_in_modules/announcement/app/models/bulletin_link.rb @@ -4,10 +4,12 @@ class BulletinLink include Mongoid::Timestamps field :url - field :name + # field :name + + has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy field :should_destroy, :type => Boolean - embedded_in :bulletin - + # embedded_in :bulletin + belongs_to :bulletin end diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_bulletin_category.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_bulletin_category.html.erb index 579987700..546356fe9 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_bulletin_category.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_bulletin_category.html.erb @@ -1,13 +1,17 @@ - - <%= bulletin_category.key %> - <% @site_valid_locales.each do |locale| %> - <%= bulletin_category.i18n_variable[locale] rescue nil %> - <% end %> - <%= bulletin_category.display %> - - <%= link_to t('bulletin_category.edit'), edit_panel_announcement_back_end_bulletin_category_path(bulletin_category), :remote => true %> | - <%= link_to t('bulletin_category.quick_edit'), panel_announcement_back_end_bulletin_category_quick_edit_path(bulletin_category), :remote => true %> | - <%= link_to t('bulletin_category.delete'), panel_announcement_back_end_bulletin_category_path(bulletin_category), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %> - - \ No newline at end of file + + + <%= bulletin_category.key %> +
+ +
+ + <% @site_valid_locales.each do |locale| %> + <%= bulletin_category.i18n_variable[locale] rescue nil %> + <% end %> + <%= bulletin_category.display %> + \ No newline at end of file diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_form.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_form.html.erb index d7bfac7be..1ce7f629f 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_form.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_form.html.erb @@ -1,36 +1,36 @@ <% # encoding: utf-8 %> <%= form_for(@bulletin_category, :remote => true, :url => @url) do |f| %> -<%#= form_for(@bulletin_category, :remote => true, :url => panel_announcement_back_end_bulletin_category_path(@bulletin_category)) do |f| %> -
- <%= f.label :key %>
- <%= f.text_field :key %> -
- -
- <%= f.label :name %>
- <%= f.fields_for :i18n_variable, (@bulletin_category.new_record? ? @bulletin_category.build_i18n_variable : @bulletin_category.i18n_variable) do |f| %> - <% @site_valid_locales.each do |locale| %> - <%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %> - <%= f.text_field locale, :style => "width:130px" %> - <% end %> - <% end %> -
- -
- <%= f.label :display %>
- <%#= f.select :display, BulletinCategory::PAYMENT_TYPES, :prompt => 'Select a display method' %> +

<%= (@bulletin_category.new_record? ? 'Add' : 'Edit') %>

- <%= f.radio_button :display, "List" %>List - <%#= f.label :display, 'list', :value => '1', :checked => @a %> - <%= f.radio_button :display, "Picture" %>Picture - <%#= f.label :display, 'picture', :value => '2', :checked => @b %> -
顯示方式是設定在前台頁面時,資訊所呈現的樣式 -
+
+ <%= f.label :key %> + <%= f.text_field :key %> +
+ +
+ <%= f.fields_for :i18n_variable, (@bulletin_category.new_record? ? @bulletin_category.build_i18n_variable : @bulletin_category.i18n_variable) do |f| %> + <% @site_valid_locales.each do |locale| %> +
+ <%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %> +
+ <%= f.text_field locale, :class => 'input-xxlarge' %> +
+
+ <% end %> + <% end %> +
+ +
+ <%= f.label :display %> + <%= f.radio_button :display, "List" %>List + <%= f.radio_button :display, "Picture" %>Picture +
顯示方式是設定在前台頁面時,資訊所呈現的樣式 +
-
- <%= f.submit %> +
+ <%= f.submit 'Submit/送出', :class=>'btn btn-primary' %>
<% end %> diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_quick_edit.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_quick_edit.html.erb new file mode 100644 index 000000000..14a729519 --- /dev/null +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_quick_edit.html.erb @@ -0,0 +1,13 @@ + + + + <%= t(:quick_edit) %> + <%= form_for bulletin_category, :url => panel_announcement_back_end_bulletin_category_path(bulletin_category), :html => {:class => 'form-horizontal'} do |f| %> + <%= render :partial => "quick_edit_qe", :locals => { :f => f, :bulletin_category => bulletin_category } %> +
+ <%= f.submit t(:submit), :class => 'btn btn-primary' %> + <%= f.submit t(:cancel), :class => 'btn', :type => 'reset' %> +
+ <% end %> + + diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_quick_edit_qe.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_quick_edit_qe.html.erb new file mode 100644 index 000000000..cb32d861a --- /dev/null +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_quick_edit_qe.html.erb @@ -0,0 +1,28 @@ +<% # encoding: utf-8 %> + +
+ +
+ <%= f.label :key %> + <%= f.text_field :key %> +
+
+ <%= f.fields_for :i18n_variable, bulletin_category.i18n_variable do |f| %> + <% @site_valid_locales.each do |locale| %> +
+ <%= label_tag "title-#{locale}", "Title-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %> +
+ <%= f.text_field locale, :class => 'input-xxlarge' %> +
+
+ <% end %> + <% end %> +
+ +
+ <%= f.label :display %> + <%= f.radio_button :display, "List" %>List + <%= f.radio_button :display, "Picture" %>Picture +
顯示方式是設定在前台頁面時,資訊所呈現的樣式 +
+
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/index.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/index.html.erb index 87a2993c9..0a6e7f83b 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/index.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/index.html.erb @@ -1,43 +1,23 @@ -<% content_for :secondary do %> -
-
-
-
-
- -<% end -%> <%= flash_messages %> -

<%= t('bulletin_category.list_announcement_class') %>

-
-
-
-
-
- - - - <% @site_valid_locales.each do |locale| %> - - <% end %> - - - +
<%= t('bulletin_category.key') %><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %><%= t('bulletin_category.display') %><%= t('bulletin.action') %>
+ + + + <% @site_valid_locales.each do |locale| %> + + <% end %> + + + + -<%# @bulletin_categorys.each do |post| %> <%= render :partial => 'bulletin_category', :collection => @bulletin_categorys %> -<%# end %> + +
<%= t('bulletin_category.key') %><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %><%= t('bulletin_category.display') %>
-
-
-
-
- -

Add New

<%= render :partial => "form" %>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_file.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_file.html.erb index 86785ee03..6da49ceb8 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_file.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_file.html.erb @@ -6,10 +6,22 @@ <%= f.file_field :file %> <%= f.label :file_title %> - <%= f.text_field :filetitle %> + <%#= f.text_field :filetitle %> + <%= f.fields_for :filetitle, (bulletin_file.new_record? ? bulletin_file.build_filetitle : bulletin_file.filetitle ) do |f| %> + <% @site_valid_locales.each do |locale| %> + <%= I18nVariable.from_locale(locale) %> + <%= f.text_field locale %> + <% end %> + <% end %> <%= f.label :file_description %> - <%= f.text_field :description %> + <%#= f.text_field :description %> + <%= f.fields_for :description, (bulletin_file.new_record? ? bulletin_file.build_description : bulletin_file.description ) do |f| %> + <% @site_valid_locales.each do |locale| %> + <%= I18nVariable.from_locale(locale) %> + <%= f.text_field locale %> + <% end %> + <% end %> <% if bulletin_file.new_record? %> diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link.html - ƻs.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link.html - ƻs.erb new file mode 100644 index 000000000..33d1ba1e0 --- /dev/null +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link.html - ƻs.erb @@ -0,0 +1,27 @@ + +
" class='list_item'> +
+ + <%= f.label :link_url %> + <%= f.text_field :url %> + + <%= f.label :link_name %> + <%#= f.text_field :name %> + <%= f.fields_for :i18n_variable, (bulletin_link.new_record? ? bulletin_link.build_i18n_variable : bulletin_link.i18n_variable) do |f| %> + <% @site_valid_locales.each do |locale| %> + <%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %> + <%= f.text_field locale, :style => "width:130px" %> + <% end %> + <% end %> + + + <% if bulletin_link.new_record? %> + <%= t(:delete) %> + <% else %> + <%= f.hidden_field :id %> + <%= t(:delete) %> + <%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %> + <% end %> + +
+
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link.html.erb index 44c7ab757..e0077384a 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link.html.erb @@ -1,12 +1,18 @@ -
" class='list_item'> +
" class='list_item'>
<%= f.label :link_url %> <%= f.text_field :url %> <%= f.label :link_name %> - <%= f.text_field :name %> + <%#= f.text_field :name %> + <%= f.fields_for :i18n_variable, (bulletin_link.new_record? ? bulletin_link.build_i18n_variable : bulletin_link.i18n_variable) do |f| %> + <% @site_valid_locales.each do |locale| %> + <%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %> + <%= f.text_field locale, :style => "width:130px" %> + <% end %> + <% end %> <% if bulletin_link.new_record? %> diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link2.html - ƻs.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link2.html - ƻs.erb new file mode 100644 index 000000000..c44b5c92b --- /dev/null +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link2.html - ƻs.erb @@ -0,0 +1,16 @@ + + "> + <%= link_to bulletin_link2.i18n_variable.zh_tw, bulletin_link2.url, :target => '_blank' %> + <%= link_to bulletin_link2.i18n_variable.en, bulletin_link2.url, :target => '_blank' %> + + + <%= f.hidden_field :id %> + + <%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %> + + + + + + + \ No newline at end of file diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link2.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link2.html.erb new file mode 100644 index 000000000..a3bc52430 --- /dev/null +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link2.html.erb @@ -0,0 +1,17 @@ + + "> + <%= link_to bulletin_link2.i18n_variable.zh_tw, bulletin_link2.url, :target => '_blank' %> + <%= link_to bulletin_link2.i18n_variable.en, bulletin_link2.url, :target => '_blank' %> + + + + <%= f.hidden_field :id %> + + <%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %> + + + + + + + \ No newline at end of file diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link_qe.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link_qe.html.erb new file mode 100644 index 000000000..7208f73cb --- /dev/null +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link_qe.html.erb @@ -0,0 +1,41 @@ +<% # encoding: utf-8 %> + + <%= form_for(@bulletin.bulletin_links, :remote => true, :url => @link_url) do |f| %> + + + + <% end %> + + + \ No newline at end of file diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb index 751a5f127..2e41f3020 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb @@ -1,118 +1,246 @@ <% # encoding: utf-8 %> <%= f.error_messages %> - <%= f.select :bulletin_category_id, @bulletin_categorys.collect{|t| [ t.i18n_variable[I18n.locale], t.id ]}, {}, :class => "input-medium" %> + + + +
+ +
+
+ +
+

Picture

+
+
+ +
+ + +
+ +
+ <% if @bulletin.image.file %> + <%= f.check_box :remove_image %> + <%= t('announcement.刪除已上傳檔案') %> + <% end %> +
+
+
+
-
- <%= f.label :image, t('announcement.image') %>
- <%= f.file_field :image %> - <% if @bulletin.image.file %> - <%= check_box_tag 'bulletin[image_del]' %> - <%= t('announcement.刪除已上傳檔案') %> - <% end %> -
+
+
+ +
+

Date

+
+
+ +
+ <%= f.date_select :postdate, {:use_month_numbers => true, :prompt => { :month => 'Month', :day => 'Day', :year => 'Year'}, :order => [:day, :month, :year] }, {:class => 'input-small'} %> +
+
+
+ +
+ <%= f.date_select :deadline, {:use_month_numbers => true, :prompt => { :month => 'Month', :day => 'Day', :year => 'Year'}, :order => [:day, :month, :year] }, {:class => 'input-small'} %> +
+
+
+
+ +
+
+ +
+

Status

+
+
+ <%= f.check_box :is_top %><%= t('top') %> + <%= f.check_box :is_hot %><%= t('hot') %> + <%= f.check_box :is_hidden %><%= t('hide') %> +
+
+
-
- <%= f.label :title %> - <%= f.fields_for :title, (@bulletin.new_record? ? @bulletin.build_title : @bulletin.title ) do |f| %> - <% @site_valid_locales.each do |locale| %> - - <%= I18nVariable.from_locale(locale) %> - <%= f.text_field locale %> - - <% end %> - <% end %> +
+
+ +
+

Tags

+
+ <% @tags.each do |tag| %> + <%= check_box_tag 'bulletin[tag_ids][]', tag.id, @bulletin.tag_ids.include?(tag.id)%> + <%= tag[I18n.locale] %> + <% end %> +
+
+
-
- <%= f.label :subtitle %> - <%= f.fields_for :subtitle, (@bulletin.new_record? ? @bulletin.build_subtitle : @bulletin.subtitle ) do |f| %> - <% @site_valid_locales.each do |locale| %> - - <%= I18nVariable.from_locale(locale) %> - <%= f.text_area locale, :rows => 10, :cols => 40 %> - - <% end %> - <% end %> -
+ + + -
- <%= f.label :text %> - <%= f.fields_for :text, (@bulletin.new_record? ? @bulletin.build_text : @bulletin.text ) do |f| %> - <% @site_valid_locales.each do |locale| %> - - <%= I18nVariable.from_locale(locale) %> - <%= f.text_area locale, :rows => 10, :cols => 40 %> - - <% end %> - <% end %> -
- -
- <%= f.label :postdate %>
- <%= f.date_select :postdate, :order => [:year, :month, :day], :use_month_numbers => true %> - <%#= date_select("bulletin", "postdate", :use_month_numbers => true) %> -
- -
- <%= f.label :deadline %>
- <%= f.date_select :deadline, :use_month_numbers => true, :prompt => { :day => 'Select day', :month => 'Select month', :year => 'Select year'} %> - <%#= f.date_select :deadline, :order => [:year, :month, :day],:default => 1.years.from_now, :use_month_numbers => true %> -
- -
- <%#= f.label :url %>
- <%#= f.text_field :url, :size => 60 %> -
- - - -
--> - - - - - - diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_quick_edit_links.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_quick_edit_links.html.erb index adfe015c5..1d9004c8e 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_quick_edit_links.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_quick_edit_links.html.erb @@ -17,11 +17,13 @@ + <% bulletin.bulletin_links.each_with_index do |blink, i| %> - … - … + <%= link_to blink.i18n_variable.zh_tw, blink.url, :target => '_blank' %> + <%= link_to blink.i18n_variable.en, blink.url, :target => '_blank' %> + <% end %>
@@ -32,27 +34,25 @@
+ diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/index.html - ƻs.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/index.html - ƻs.erb new file mode 100644 index 000000000..d37d2134c --- /dev/null +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/index.html - ƻs.erb @@ -0,0 +1,9 @@ +<%= render 'filter' %> + + <%= render 'bulletins' %> +
+ +
+ <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_panel_announcement_back_end_bulletin_path, :class => 'btn btn-primary' %> +
+ diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/link_quick_edit.js.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/link_quick_edit.js.erb new file mode 100644 index 000000000..cbe5e3c77 --- /dev/null +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/link_quick_edit.js.erb @@ -0,0 +1,2 @@ +//$.each($(".quick_edit"),function(obj){ $(this).remove(); }); +$("#<%= "bulletin_#{bulletin_link2.id}" %>").append("<%= j render "bulletin_link_qe" %>"); diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/show.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/show.html.erb index f02d91569..ace4ec125 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/show.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/show.html.erb @@ -17,7 +17,7 @@
  • <%= t('announcement.title') %> - <%= @bulletin.title %> + <%= @bulletin.title[I18n.locale] %>
  • <%#= image_tag(@bulletin.image.url, :size => "320x240") if @bulletin.image.file %> @@ -25,23 +25,23 @@
  • <%= t('announcement.subtitle') %> - <%= @bulletin.subtitle %> + <%= @bulletin.subtitle[I18n.locale].html_safe %>
  • <%= t('announcement.text') %> - <%= @bulletin.text %> + <%= @bulletin.text[I18n.locale].html_safe %>
  • <%= t('announcement.link') %> <% @bulletin.bulletin_links.each do | blink | %> - <%= link_to blink.name, blink.url, :target => '_blank' %> + <%= link_to blink.i18n_variable[I18n.locale], blink.url, :target => '_blank' %> <% end %>
  • <%= t('announcement.file') %> <% @bulletin.bulletin_files.each do | bfile | %> - <%= link_to bfile.filetitle, bfile.file.url, {:target => '_blank', :title => bfile.description} if bfile.file.file %> + <%= link_to bfile.filetitle[I18n.locale], bfile.file.url, {:target => '_blank', :title => bfile.description[I18n.locale]} if bfile.file.file %> <% end %>
  • diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/index.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/index.html.erb index e3ba9d488..331661659 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/index.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/index.html.erb @@ -11,7 +11,7 @@
  • <%= image_tag(post.image.url, :size => "290x130") if post.image.file %>

    <%= link_to post.title[I18n.locale], panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>

    -

    <%= post.subtitle[I18n.locale] %>

    +

    <%= post.subtitle[I18n.locale].html_safe %>

  • <% end %> diff --git a/vendor/built_in_modules/announcement/config/routes.rb b/vendor/built_in_modules/announcement/config/routes.rb index c3a60f74e..9a405ecc2 100644 --- a/vendor/built_in_modules/announcement/config/routes.rb +++ b/vendor/built_in_modules/announcement/config/routes.rb @@ -3,7 +3,10 @@ Rails.application.routes.draw do namespace :announcement do namespace :back_end do root :to => "bulletins#index" - resources :bulletins + resources :bulletins do + match "link_quick_add/:bulletin_id" => "bulletins#link_quick_add" ,:as => :link_quick_add + match "link_quick_edit/:bulletin_id" => "bulletins#link_quick_edit" ,:as => :link_quick_edit + end resources :bulletin_categorys, :controller => 'bulletin_categorys' do match "quick_edit/:bulletin_category_id" => "bulletin_categorys#quick_edit" ,:as => :quick_edit end diff --git a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_form.html.erb b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_form.html.erb index e5c7fc45e..4ca568a9e 100644 --- a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_form.html.erb +++ b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_form.html.erb @@ -1,31 +1,32 @@ <% # encoding: utf-8 %> - <%= f.error_messages %> - <%#= debugger %> - -
    - <%= f.label :name %> - <%= @page_context.page.i18n_variable[I18n.locale] %> -
    +<%= f.error_messages %> -
    - <%= f.label :context %> - <%= f.fields_for :context, (@page_context.new_record? ? @page_context.build_context : @page_context.context ) do |f| %> - <% @site_valid_locales.each do |locale| %> - - <%= I18nVariable.from_locale(locale) %> - <%= f.text_area locale, :rows => 10, :cols => 40 %> - - <% end %> - <% end %> -
    - -
    -
    - -
    - <%= f.submit %> -
    +
    + +
    + <%= f.label :name %> + <%= @page_context.page.i18n_variable[I18n.locale] %> +
    + +
    + <%= f.label :context %> + <%= f.fields_for :context, (@page_context.new_record? ? @page_context.build_context : @page_context.context ) do |f| %> + <% @site_valid_locales.each do |locale| %> + + <%= I18nVariable.from_locale(locale) %> + <%= f.text_area locale, :style=>"width:100%" %> + + <% end %> + <% end %> +
    + + +
    + <%= f.submit 'Submit/送出', :class=>'btn btn-primary' %> +
    + +
    <% content_for :page_specific_javascript do %> diff --git a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_page_context.html.erb b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_page_context.html.erb index c1d86fe11..08db9b2d3 100644 --- a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_page_context.html.erb +++ b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_page_context.html.erb @@ -1,10 +1,14 @@ - - <%= page_context.page.i18n_variable[I18n.locale] %> - <%= link_to page_context.version, panel_page_content_back_end_view_path(page_context.page_id) %> - <%= page_context.updated_at.strftime("%Y-%m-%d %H:%I:%S") %> - <%= User.find(page_context.create_user_id).name %> - - <%= link_to t('page_context.edit'), edit_panel_page_content_back_end_page_context_path(page_context) %> - - + + + <%= page_context.page.i18n_variable[I18n.locale] %> +
    + +
    + + <%= link_to page_context.version, panel_page_content_back_end_view_path(page_context.page_id) %> + <%= page_context.updated_at.strftime("%Y-%m-%d %H:%I:%S") %> + <%= User.find(page_context.create_user_id).name %> + \ No newline at end of file diff --git a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_view_page_context.html.erb b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_view_page_context.html.erb index db23a2800..7035a700c 100644 --- a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_view_page_context.html.erb +++ b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/_view_page_context.html.erb @@ -1,10 +1,15 @@ - - <%= view_page_context.page.i18n_variable[I18n.locale] %> - <%= view_page_context.version %> - <%= view_page_context.updated_at.strftime("%Y-%m-%d %H:%I:%S") %> - <%= User.find(view_page_context.create_user_id).name %> - - <%= link_to t('view_page_context.show'), panel_page_content_back_end_page_context_path(view_page_context) %> - - + + + + <%= view_page_context.page.i18n_variable[I18n.locale] %> +
    + +
    + + <%= view_page_context.version %> + <%= view_page_context.updated_at.strftime("%Y-%m-%d %H:%I:%S") %> + <%= User.find(view_page_context.create_user_id).name %> + \ No newline at end of file diff --git a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/edit.html.erb b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/edit.html.erb index 18bb0ce5c..86f2398c0 100644 --- a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/edit.html.erb +++ b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/edit.html.erb @@ -1,7 +1,3 @@ -
    -
    -
    -

    <%= t('page_content.editing_page_content') %>

    @@ -9,8 +5,4 @@ <%= render :partial => 'form', :locals => {:f => f} %> <% end %> -<%= link_back %> -
    -
    -
    -
    \ No newline at end of file +<%#= link_back %> \ No newline at end of file diff --git a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/index.html.erb b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/index.html.erb index a15668810..3227dcd42 100644 --- a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/index.html.erb +++ b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/index.html.erb @@ -1,36 +1,20 @@ -<% content_for :secondary do %> -
    -
    -
    -
    -
    -
      -
    • <%= link_to t('page_context.page_content_list'), panel_page_content_back_end_page_contexts_path %>
    • -
    -<% end -%> <%= flash_messages %> -
    -
    -
    -
    -
    - -

    <%= t('page_context.list_page_content') %>

    - - - - - - - - - +
    <%= t('page_context.name') %><%= t('page_context.version') %><%= t('page_context.update_time') %><%= t('page_context.last_modified') %><%= t('page_context.action') %>
    + + + + + + + + + - <%= render :partial => 'page_context', :collection => @page_contexts %> + <%= render :partial => 'page_context', :collection => @page_contexts %> -
    <%= t('page_context.name') %><%= t('page_context.version') %><%= t('page_context.update_time') %><%= t('page_context.last_modified') %>
    + + -
    diff --git a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/view.html.erb b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/view.html.erb index c5a9871a9..d88df80e0 100644 --- a/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/view.html.erb +++ b/vendor/built_in_modules/page_content/app/views/panel/page_content/back_end/page_contexts/view.html.erb @@ -1,36 +1,19 @@ -<% content_for :secondary do %> -
    -
    -
    -
    -
    -
      -
    • <%= link_to t('page_context.page_content_list'), panel_page_content_back_end_page_contexts_path %>
    • -
    -<% end -%> <%= flash_messages %> -
    -
    -
    -
    -
    - -

    <%= t('page_context.list_page_content') %>

    - - - - - - - - - +
    <%= t('page_context.name') %><%= t('page_context.version') %><%= t('page_context.update_time') %><%= t('page_context.last_modified') %><%= t('page_context.action') %>
    + + + + + + + + + <%= render :partial => 'view_page_context', :collection => @page_contexts %> -
    <%= t('page_context.name') %><%= t('page_context.version') %><%= t('page_context.update_time') %><%= t('page_context.last_modified') %>
    - -
    + + diff --git a/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_link_categorys_controller.rb b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_link_categorys_controller.rb index 3db38adde..0ba3236a2 100644 --- a/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_link_categorys_controller.rb +++ b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_link_categorys_controller.rb @@ -1,6 +1,6 @@ class Panel::WebResource::BackEnd::WebLinkCategorysController < ApplicationController - layout 'admin' + layout 'new_admin' def index @web_link_categorys = WebLinkCategory.all diff --git a/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_links_controller.rb b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_links_controller.rb index f1ec7485d..dfe09ce55 100644 --- a/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_links_controller.rb +++ b/vendor/built_in_modules/web_resource/app/controllers/panel/web_resource/back_end/web_links_controller.rb @@ -1,7 +1,7 @@ class Panel::WebResource::BackEnd::WebLinksController < ApplicationController - layout 'admin' + layout 'new_admin' before_filter :authenticate_user! before_filter :is_admin? diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/_form.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/_form.html.erb index 7eb698eaa..2e0f61ff3 100644 --- a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/_form.html.erb +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/_form.html.erb @@ -1,25 +1,29 @@ <% # encoding: utf-8 %> <%= form_for(@web_link_category, :remote => true, :url => @url) do |f| %> -<%#= form_for(@web_link_category, :remote => true, :url => panel_web_resource_back_end_web_link_category_path(@web_link_category)) do |f| %> -
    - <%= f.label :key %>
    - <%= f.text_field :key %> -
    +

    <%= (@web_link_category.new_record? ? 'Add' : 'Edit') %>

    + +
    + <%= f.label :key %> + <%= f.text_field :key %> +
    + +
    + <%= f.fields_for :i18n_variable, (@web_link_category.new_record? ? @web_link_category.build_i18n_variable : @web_link_category.i18n_variable) do |f| %> + <% @site_valid_locales.each do |locale| %> +
    + <%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %> +
    + <%= f.text_field locale, :class => 'input-xxlarge' %> +
    +
    + <% end %> + <% end %> +
    -
    - <%= f.label :name %>
    - <%= f.fields_for :i18n_variable, (@web_link_category.new_record? ? @web_link_category.build_i18n_variable : @web_link_category.i18n_variable) do |f| %> - <% @site_valid_locales.each do |locale| %> - <%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %> - <%= f.text_field locale, :style => "width:130px" %> - <% end %> - <% end %> -
    - -
    - <%= f.submit %> +
    + <%= f.submit 'Submit/送出', :class=>'btn btn-primary' %>
    <% end %> diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/_web_link_category.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/_web_link_category.html.erb index d6e27e8de..3f6a1a717 100644 --- a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/_web_link_category.html.erb +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/_web_link_category.html.erb @@ -1,12 +1,16 @@ - - <%= web_link_category.key %> - <% @site_valid_locales.each do |locale| %> - <%= web_link_category.i18n_variable[locale] rescue nil %> - <% end %> - - <%= link_to t('web_link_category.edit'), edit_panel_web_resource_back_end_web_link_category_path(web_link_category), :remote => true %> | - <%= link_to t('web_link_category.quick_edit'), panel_web_resource_back_end_web_link_category_quick_edit_path(web_link_category), :remote => true %> | - <%= link_to t('web_link_category.delete'), panel_web_resource_back_end_web_link_category_path(web_link_category), :confirm => t('sure?'), :method => :delete, :remote => true %> - - \ No newline at end of file + + + + <%= web_link_category.key %> +
    + +
    + + <% @site_valid_locales.each do |locale| %> + <%= web_link_category.i18n_variable[locale] rescue nil %> + <% end %> + \ No newline at end of file diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/index.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/index.html.erb index 458424514..762da9e7a 100644 --- a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/index.html.erb +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_link_categorys/index.html.erb @@ -1,43 +1,23 @@ -<% content_for :secondary do %> -
    -
    -
    -
    -
    -
      -
    • <%#= link_to t('web_link_category.new_web_resource_class'), new_panel_web_resource_back_end_web_link_category_path, :class => 'seclink1' %>
    • -
    -<% end -%> + <%= flash_messages %> -

    <%= t('web_link_category.list_web_resource_class') %>

    -
    -
    -
    -
    -
    - - - - <% @site_valid_locales.each do |locale| %> - - <% end %> - - + + + + + <% @site_valid_locales.each do |locale| %> + + <% end %> + + + -<%# @web_link_categorys.each do |post| %> <%= render :partial => 'web_link_category', :collection => @web_link_categorys %> -<%# end %> + + -
    -
    -
    -
    - -

    Add New

    <%= render :partial => "form" %>
    - diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_form.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_form.html.erb index ce17555a8..2abdf4a02 100644 --- a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_form.html.erb +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_form.html.erb @@ -1,62 +1,101 @@ <% # encoding: utf-8 %> <%= f.error_messages %> - <%#= debugger %> - -
    - <%= f.label :category %>
    - <%= f.select :web_link_category_id, @web_link_categorys.collect {|t| [ t.i18n_variable[I18n.locale], t.id ]} %> -
    - -
    - <%= f.label :name %> - <%= f.fields_for :name, (@web_link.new_record? ? @web_link.build_name : @web_link.name ) do |f| %> - <% @site_valid_locales.each do |locale| %> - - <%= I18nVariable.from_locale(locale) %> - <%= f.text_field locale %> - - <% end %> - <% end %> -
    - -
    - <%= f.label :url %>
    - <%= f.text_field :url, :size => 60 %> -
    -
    - <%= f.label :describe %> - <%= f.fields_for :context, (@web_link.new_record? ? @web_link.build_context : @web_link.context ) do |f| %> - <% @site_valid_locales.each do |locale| %> - - <%= I18nVariable.from_locale(locale) %> - <%= f.text_area locale, :rows => 10, :cols => 40 %> - - <% end %> - <% end %> -
    + + +
    + +
    +
    + +
    +

    Status

    +
    +
    + <%= f.check_box :is_top %><%= t('top') %> + <%= f.check_box :is_hot %><%= t('hot') %> + <%= f.check_box :is_hidden %><%= t('hide') %> +
    +
    +
    + +
    +
    + +
    +

    Tags

    +
    + <% @tags.each do |tag| %> + <%= check_box_tag 'web_link[tag_ids][]', tag.id, @web_link.tag_ids.include?(tag.id)%> + <%= tag[I18n.locale] %> + <% end %> +
    +
    -
    - <%= f.label :status %>
    - <%= f.check_box :is_top %><%= t('top') %> - <%= f.check_box :is_hot %><%= t('hot') %> - <%= f.check_box :is_hidden %><%= t('hidden') %> -
    - -
    - <%= f.label :tags %>
    - <% @tags.each do |tag| %> - <%= check_box_tag 'web_link[tag_ids][]', tag.id, @web_link.tag_ids.include?(tag.id)%> - <%= tag[I18n.locale] %> - <% end %> -
    - -
    -
    +
    -
    - <%= f.submit %> + + + +
    +
    + + <%= f.label :category %> + <%= f.select :web_link_category_id, @web_link_categorys.collect {|t| [ t.i18n_variable[I18n.locale], t.id ]} %> + + + +
    + <%= f.label :name %> + <%= f.fields_for :name, (@web_link.new_record? ? @web_link.build_name : @web_link.name ) do |f| %> + <% @site_valid_locales.each do |locale| %> + + <%= I18nVariable.from_locale(locale) %> + <%= f.text_field locale, :class=>'post-title' %> + + <% end %> + <% end %> +
    + +
    + <%= f.label :url %> + <%= f.text_field :url %> +
    + +
    + <%= f.label :describe %> + <%= f.fields_for :context, (@web_link.new_record? ? @web_link.build_context : @web_link.context ) do |f| %> + <% @site_valid_locales.each do |locale| %> + + <%= I18nVariable.from_locale(locale) %> + <%= f.text_area locale, :style=>"width:100%" %> + + <% end %> + <% end %> +
    + +
    + + + + +
    + <%= f.submit 'Submit/送出', :class=>'btn btn-primary' %>
    \ No newline at end of file diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_links.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_links.html.erb index d87b59d80..c58f15e49 100644 --- a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_links.html.erb +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_links.html.erb @@ -1,5 +1,5 @@ - + <% if post.is_top? %> <%= t(:top) %> @@ -10,6 +10,12 @@ <% if post.is_hidden? %> <%= t(:hidden) %> <% end %> +
    + +
    <%= post.web_link_category.i18n_variable[I18n.locale] %> @@ -20,12 +26,5 @@ <%= tag[I18n.locale] %> <% end %> - - <%= link_to t('web_link.edit'), edit_panel_web_resource_back_end_web_link_path(post) %> | - - <%= link_to t(:set_top), eval("panel_web_resource_back_end_web_link_path(post, :authenticity_token => form_authenticity_token, :web_link => {:is_top => true})"), :remote => true, :method => :put, :id => "disable_#{post.id}", :style => "display:#{post.is_top? ? 'none' : ''}", :class => 'switch' %> - <%= link_to t(:cancel_top), eval("panel_web_resource_back_end_web_link_path(post, :authenticity_token => form_authenticity_token, :web_link => {:is_top => false})"), :remote => true, :method => :put, :id => "enable_#{post.id}", :style => "display:#{post.is_top? ? '' : 'none'}", :class => 'switch' %> - - | <%= link_to t('web_link.delete'), panel_web_resource_back_end_web_link_path(post), :confirm => t('sure?'), :method => :delete, :remote => true %> - + diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/index.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/index.html.erb index 82afe4ea1..301c1bbee 100644 --- a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/index.html.erb +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/index.html.erb @@ -1,52 +1,21 @@ -<% content_for :secondary do %> -
    -
    -
    -
    -
    -
      -
    • <%= link_to t('web_link.new_link'), new_panel_web_resource_back_end_web_link_path %>
    • -
    • <%= link_to t('web_link.link_list'), panel_web_resource_back_end_web_links_path %>
    • -
    • <%= link_to t('web_link.new_link_class'), panel_web_resource_back_end_web_link_categorys_path %>
    • -
    -<% end -%> <%= flash_messages %> -
    -
    -
    -
    -
    - - <%= form_for :web_link, :action => 'search', :method => 'get', :url => panel_web_resource_back_end_web_links_path do |f| %> - - <%#= f.select :web_link_category_id, @web_link_categorys.collect {|t| [ t.i18n_variable[I18n.locale], t.id ] },{ :include_blank => t('web_link.select') }%> - - Category <%= select_tag "category_id", options_for_select(@web_link_categorys.collect{|t| [t.i18n_variable[I18n.locale], t.id]}), :prompt => t('web_link.select') %> - - <%= submit_tag "OK", :name => nil %> - - <% end %> - -
    -
    - -

    <%= t('web_link.list_link') %>

    - - - - - - - - - +
    <%= t('web_link.status') %><%= t('web_link.category') %><%= t('web_link.name') %><%= t('web_link.tags') %><%= t('web_link.action') %>
    + + + + + + + + + <% @web_links.each do |post| %> <%= render :partial => 'web_links', :locals => {:post => post} %> - <% end %> -
    <%= t('web_link.status') %><%= t('web_link.category') %><%= t('web_link.name') %><%= t('web_link.tags') %>
    - -
    + <% end %> + + +