Separate announcement and news

This commit is contained in:
Christophe Vilayphiou committed 2012-04-30 06:31:46 +08:00
1 parent 63ee8eaca9
commit b8f52fa1ec
152 files changed
+4008 -18

No files matched your search

@@ -27,8 +27,10 @@ class Admin::PagePartsController < ApplicationController
@r_tag = @part.public_r_tag.blank? ? LIST[:public_r_tags][0] : @part.public_r_tag
@tag_objects = @r_tag.classify.constantize.all rescue nil
case @module_app.key
when 'bulletin'
when 'announcement'
@categories = BulletinCategory.all
when 'news'
@categories = NewsBulletinCategory.all
when 'web_resource'
@categories = WebLinkCategory.all
end
@@ -67,6 +69,8 @@ class Admin::PagePartsController < ApplicationController
case @module_app.key
when 'announcement'
@categories = BulletinCategory.all
when 'news'
@categories = NewsBulletinCategory.all
when 'web_resource'
@categories = WebLinkCategory.all
end
+12 -1
View File
@@ -31,7 +31,18 @@ class Admin::PagesController < ApplicationController
@designs = Design.all.entries
@design = @item.design ? @item.design : @designs.first
@app_frontend_urls = @item.module_app.app_pages if @item.module_app
@categories = BulletinCategory.all if @item.module_app && @item.module_app.key.eql?('announcement')
if @item.module_app
case @item.module_app.key
when 'announcement'
@categories = BulletinCategory.all
when 'news'
@categories = NewsBulletinCategory.all
when 'web_resource'
@categories = WebLinkCategory.all
end
else
@categories = nil
end
end
def create
+6 -6
View File
@@ -33,9 +33,9 @@ class PagesController < ApplicationController
def index_from_link
if params[:page]
redirect_to "/#{@item.full_name}?page=#{params[:page]}"
redirect_to "/#{@item.full_name}?page=#{params[:page]}&category_id=#{params[:category_id]}&tag_id=#{params[:tag_id]}"
else
redirect_to "/#{@item.full_name}"
redirect_to "/#{@item.full_name}?category_id=#{params[:category_id]}&tag_id=#{params[:tag_id]}"
end
end
@@ -51,11 +51,11 @@ class PagesController < ApplicationController
def get_item
module_app = ModuleApp.first(:conditions => {:key => params[:app_name]})
if params[:category_id]
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id]})
else
# if params[:category_id]
# @item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action], :category => params[:category_id]})
# else
@item = Item.first(:conditions => {:module_app_id => module_app.id, :app_frontend_url => params[:app_action]})
end
# end
end
end
+2 -2
View File
@@ -25,8 +25,8 @@ module OrbitBackendHelper
content_tag :thead do
content_tag :tr, :class => "sort-header" do
concat (content_tag :th, :class => "span1 strong" do
check_box_tag :check_all
link_to content_tag(:i, nil, :class => "icon-trash"), '#', :class => "list-remove"
concat check_box_tag :check_all
concat link_to content_tag(:i, nil, :class => "icon-trash"), '#', :class => "list-remove"
end) if delete_all
titles.each do |title|
concat render_title(title[0], title[1], title[2], title[3])
@@ -1 +1 @@
<%= select 'page_part', 'category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, :selected => (@part ? @part[:category] : nil) if @categories && @categories.size > 0 %>
<%= 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 %>
+1 -1
View File
@@ -27,7 +27,7 @@
<%= t('admin.module_app') %>
<%= render :partial => "app_selector", :locals => { :f => f } %>
<span id="app_page_url"><%= select('page','app_frontend_url', @app_frontend_urls, :selected => @item.app_frontend_url ) rescue ''%> </span>
<span id="app_page_category"><%= select('page','category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, :selected => @item[:category] ) rescue ''%> </span>
<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 ''%> </span>
</p>
<p>
<%= f.label :is_published, "#{t('admin.is_published')} ?" %>
+12
View File
@@ -16,6 +16,18 @@
<% end -%>
<%= content_tag :li, :class => active_for_controllers('news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-announcement') + t('admin.news'), panel_news_back_end_news_bulletins_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals')) do -%>
<%= content_tag :li, link_to(t('news.all_articles'), panel_news_back_end_news_bulletins_path), :class => active_for_action('news_bulletins', 'index') %>
<%= content_tag :li, link_to(t('news.add_new'), new_panel_news_back_end_news_bulletin_path), :class => active_for_action('news_bulletins', 'new') %>
<%= content_tag :li, link_to(t('news.categories'), panel_news_back_end_news_bulletin_categorys_path), :class => active_for_action('news_bulletin_categorys', 'index') %>
<%= content_tag :li, link_to(t('news.tags'), panel_news_back_end_tags_path), :class => active_for_action('/panel/news/back_end/tags', 'index') %>
<%= content_tag :li, link_to(t('news.news_bulletin.approval_setting'), panel_news_back_end_news_approval_setting_path), :class => active_for_action('news_approvals', 'setting') if (is_manager? rescue nil) %>
<% end -%>
<% end -%>
<%#= content_tag :li, :class => active_for_controllers('users') do -%>
<%#= link_to content_tag(:i, nil, :class => 'icons-member') + t('admin.member'), admin_users_path %>
<%# end -%>