From 33fc96ac7c38230ce68e905be69a41f39b80f7f7 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Sat, 11 Aug 2012 18:19:30 +0800 Subject: [PATCH] Changes for NCCU after email --- app/views/admin/assets/file_upload.html.erb | 2 +- lib/parsers/parser_common.rb | 11 ++++++----- .../announcement/app/models/bulletin.rb | 2 +- .../back_end/bulletins/_bulletin.html.erb | 2 +- .../announcement/widget/bulletins/_index.html.erb | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/views/admin/assets/file_upload.html.erb b/app/views/admin/assets/file_upload.html.erb index 8ea1416f..f1313eeb 100644 --- a/app/views/admin/assets/file_upload.html.erb +++ b/app/views/admin/assets/file_upload.html.erb @@ -45,7 +45,7 @@
- <%= f.label :data, t('admin.data'), :class => "control-label" %> + <%#= f.label :data, t('admin.data'), :class => "control-label" %>
<%= f.file_field :data, :class => 'upload' %>
diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb index 6a9390ea..56fe0c92 100644 --- a/lib/parsers/parser_common.rb +++ b/lib/parsers/parser_common.rb @@ -9,13 +9,14 @@ module ParserCommon res << "'>" i = nil i = 1 if menu.values["li_incremental_#{current}"] - if menu.values['home'] && current == 1 - res << menu_li(page, current_page, current, menu, i, edit) - end - page.visible_children.each do |child| + children = current == 1 ? page.visible_children.reverse : page.visible_children + children.each do |child| res << menu_li(child, current_page, current, menu, i, edit) i += 1 if i end + if menu.values['home'] && current == 1 + res << menu_li(page, current_page, current, menu, i, edit) + end res << "" end res @@ -197,7 +198,7 @@ module ParserCommon when 'module_widget' url = "/panel/#{part.module_app.key}/widget/#{part.widget_path}?inner=true" options = "&category_id=#{!part[:category].blank? ? part[:category].blank? : category}&tag_id=#{!part[:tag].blank? ? part[:tag] : tag}&page=#{params[:page]}&search_query=#{params[:search_query]}&part_title=#{Rack::Utils.escape(part_title).gsub("+", "%20") rescue nil}" - ret << "
" + ret << "
" when 'public_r_tag' ret << "" public_r_tags << part.public_r_tag diff --git a/vendor/built_in_modules/announcement/app/models/bulletin.rb b/vendor/built_in_modules/announcement/app/models/bulletin.rb index a3963bab..850e0618 100644 --- a/vendor/built_in_modules/announcement/app/models/bulletin.rb +++ b/vendor/built_in_modules/announcement/app/models/bulletin.rb @@ -222,7 +222,7 @@ class Bulletin end def fetch_dept - self.cache_dept = (User.current.cache_dept rescue nil) || (User.find(self.create_user_id).cache_dept rescue nil) + self.cache_dept = (User.current.cache_dept rescue nil) || (User.find(self.create_user_id).cache_dept rescue nil) if self.new_record? end end diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb index 754096cb..b8886ad7 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin.html.erb @@ -41,7 +41,7 @@ <%= t(:quick_edit) %>