diff --git a/app/assets/images/ncculogo.ico b/app/assets/images/ncculogo.ico new file mode 100644 index 00000000..3aa5e1c6 Binary files /dev/null and b/app/assets/images/ncculogo.ico differ diff --git a/app/models/site.rb b/app/models/site.rb index a3e0513d..a0116bd3 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -18,6 +18,7 @@ class Site has_one :title, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy has_one :footer, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy + has_one :sub_menu, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy has_many :site_metas, :autosave => true, :dependent => :destroy before_save :set_key @@ -33,7 +34,6 @@ class Site end def up_to_date? - p res = %x(git remote show origin) res = res.split('rails_3_1').pop.gsub('(', '').gsub(')','').strip rescue nil res.eql?('local out of date') ? false : true end @@ -46,6 +46,10 @@ class Site @footer ||= I18nVariable.first(:conditions => {:key => 'footer', :language_value_id => self.id, :language_value_type => self.class}) rescue nil end + def sub_menu + @sub_menu ||= I18nVariable.first(:conditions => {:key => 'sub_menu', :language_value_id => self.id, :language_value_type => self.class}) rescue nil + end + METAS.each do |meta| define_method meta do fetch_meta = self.site_metas.where(key: meta).limit(1) @@ -66,6 +70,7 @@ class Site def set_key title.key = 'title' if title && (title.key.blank? rescue true) footer.key = 'footer' if footer && (footer.key.blank? rescue true) + sub_menu.key = 'sub_menu' if sub_menu && (sub_menu.key.blank? rescue true) end end diff --git a/app/models/tag.rb b/app/models/tag.rb index f77f24c1..f621de6a 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -3,6 +3,8 @@ class Tag include Mongoid::Document include Mongoid::Timestamps + field :key + belongs_to :module_app end diff --git a/app/views/admin/sites/site_info.html.erb b/app/views/admin/sites/site_info.html.erb index f3315293..1b7c90f5 100644 --- a/app/views/admin/sites/site_info.html.erb +++ b/app/views/admin/sites/site_info.html.erb @@ -57,6 +57,14 @@ <% end %> +
+ +
+ <%= f.fields_for :sub_menu, @site.sub_menu do |f| %> + <%= f.text_area locale, :class => "tinymce_textarea input-xxlarge" %> + <% end %> +
+
<% end %> <% end %> diff --git a/app/views/layouts/_side_bar.html.erb b/app/views/layouts/_side_bar.html.erb index f127a73c..c3838827 100644 --- a/app/views/layouts/_side_bar.html.erb +++ b/app/views/layouts/_side_bar.html.erb @@ -27,6 +27,7 @@ <%= content_tag :li, link_to(t('announcement.categories'), panel_news_back_end_news_bulletin_categorys_path), :class => active_for_action('news_bulletin_categorys', 'index') %> <%= content_tag :li, link_to(t('announcement.tags'), panel_news_back_end_tags_path), :class => active_for_action('/panel/news/back_end/tags', 'index') %> <%= content_tag :li, link_to(t('announcement.news_bulletin.approval_setting'), panel_news_back_end_news_approval_setting_path), :class => active_for_action('news_approvals', 'setting') if (is_manager? rescue nil) %> + <%= content_tag :li, link_to(t('admin.module.authorization'),edit_admin_module_app_path(ModuleApp.first(conditions: {key: "news"}))), :class => active_sys_call_for_app('module_apps','edit','news') if (is_admin? rescue nil) %> <% end -%> <% end -%> diff --git a/app/views/layouts/new_admin.html.erb b/app/views/layouts/new_admin.html.erb index 4686545e..51a96190 100644 --- a/app/views/layouts/new_admin.html.erb +++ b/app/views/layouts/new_admin.html.erb @@ -3,6 +3,7 @@ <%= @title || APP_CONFIG['orbit'] %> + "> diff --git a/app/views/layouts/page_layout.html.erb b/app/views/layouts/page_layout.html.erb index dd9aa94a..0a7240ef 100644 --- a/app/views/layouts/page_layout.html.erb +++ b/app/views/layouts/page_layout.html.erb @@ -3,6 +3,7 @@ <%= page_title(@item).html_safe %> + "> <%= page_metas(@item).html_safe %> - -<%#= link_back %> diff --git a/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb b/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb index bf51d308..263d1cf2 100644 --- a/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb +++ b/vendor/built_in_modules/news/app/controllers/panel/news/front_end/news_bulletins_controller.rb @@ -13,7 +13,9 @@ class Panel::News::FrontEnd::NewsBulletinsController < OrbitWidgetController if !params[:category_id].blank? @news_bulletins = NewsBulletin.can_display.where(:news_bulletin_category_id => params[:category_id]).any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10) elsif !params[:tag_id].blank? - @news_bulletins = NewsTag.find(params[:tag_id]).news_bulletins.can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10) + tmp = NewsTag.find(params[:tag_id]) rescue nil + tmp = NewsTag.where(key: params[:tag_id])[0] unless tmp + @news_bulletins = tmp.news_bulletins.can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10) rescue nil else @news_bulletins = NewsBulletin.can_display.any_of( {deadline: nil,:postdate.lte => date_now} , {:deadline.gte => date_now,:postdate.lte => date_now} ).desc( :is_top, :postdate).page( params[:page]).per(10) end diff --git a/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/index.html.erb b/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/index.html.erb index ed957be2..7b3b6399 100644 --- a/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/index.html.erb +++ b/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/index.html.erb @@ -8,25 +8,24 @@

<%= t('news.list_news') %>

<% end %> - - - - - - - -<% @news_bulletins.each do |post| %> - - - - - - -<% end %> - + + + + + + + <% @news_bulletins.each do |post| %> + + + + + + <% end %> +
<%= t('news.news_bulletin.category') %><%= t('news.news_bulletin.title') %><%= t('news.news_bulletin.postdate') %>
<%= post.news_bulletin_category.i18n_variable[I18n.locale] %><%= link_to post.title[I18n.locale], panel_news_front_end_news_bulletin_path(post) %> - <%#= link_to post.title, panel_news_back_end_news_bulletin_path(post) %> - <%= post.postdate %>
<%= t('news.news_bulletin.image') %><%= t('news.news_bulletin.title') %><%= t('news.news_bulletin.postdate') %>
<%= image_tag post.image %> + <%= link_to post.title[I18n.locale], panel_news_front_end_news_bulletin_path(post) %> + <%= post.subtitle[I18n.locale].html_safe %> + <%= post.postdate %>
<%= paginate @news_bulletins, :params => {:inner => 'false'} %> diff --git a/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.html.erb b/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.html.erb index 67bfb396..fae904cb 100644 --- a/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.html.erb +++ b/vendor/built_in_modules/news/app/views/panel/news/front_end/news_bulletins/show.html.erb @@ -14,58 +14,21 @@
<%= @news_bulletin.text[I18n.locale].html_safe %>
+ +<% if @news_bulletin.news_bulletin_links.size > 0 %> + <%= t('announcement.link') %> + <% @news_bulletin.news_bulletin_links.each do | blink | %> + <%= link_to blink.i18n_variable[I18n.locale], blink.url, :target => '_blank' %> + <% end %> +<% end %> + +<% if @news_bulletin.news_bulletin_files.size > 0 %> + <%= t('announcement.file') %> + <% @news_bulletin.news_bulletin_files.each do | bfile | %> + <%= link_to bfile.filetitle[I18n.locale], bfile.file.url, {:target => '_blank', :title => bfile.description} if bfile.file.file %> + <% end %> +<% end %> +
- - -<%#= link_back %>