change view and action for announcement ,Lin checked. Also add validation for object_auth make sure for each object,the object will be unique for each action.
This commit is contained in:
1 parent
8932615f05
commit
cceb785a8d
16 files changed
+58
-55
No files matched your search
+6
-1
@@ -145,7 +145,12 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController
|
||||
protected
|
||||
|
||||
def get_categorys(id = nil)
|
||||
@bulletin_categorys = (id ? BulletinCategory.find(id).to_a : BulletinCategory.excludes('disabled' => true))
|
||||
@bulletin_categorys = []
|
||||
if(is_manager? || is_admin?)
|
||||
@bulletin_categorys = (id ? BulletinCategory.find(id).to_a : BulletinCategory.excludes('disabled' => true))
|
||||
elsif is_sub_manager?
|
||||
@bulletin_categorys = BulletinCategory.authed_for_user(current_user,'submit_new')
|
||||
end
|
||||
end
|
||||
|
||||
def get_sorted_bulletins
|
||||
|
||||
+10
-2
@@ -1,10 +1,18 @@
|
||||
class Panel::Announcement::BackEnd::FactChecksController < OrbitBackendController
|
||||
before_filter :authenticate_user!
|
||||
include AdminHelper
|
||||
layout 'admin'
|
||||
|
||||
def index
|
||||
@bulletin_categorys_preview = BulletinCategory.authed_for_user(current_user,'preview')
|
||||
@bulletin_categorys_check = BulletinCategory.authed_for_user(current_user,'fact_check')
|
||||
@bulletin_categorys_submit_new = []
|
||||
@bulletin_categorys_check =[]
|
||||
if is_admin? || is_manager?
|
||||
#@bulletin_categorys_submit_new = BulletinCategory.all
|
||||
@bulletin_categorys_check = BulletinCategory.all
|
||||
# elsif is_sub_manager?
|
||||
# @bulletin_categorys_submit_new = BulletinCategory.authed_for_user(current_user,'submit_new')
|
||||
# @bulletin_categorys_check = BulletinCategory.authed_for_user(current_user,'fact_check')
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
|
||||
@@ -5,7 +5,7 @@ class BulletinCategory
|
||||
include Mongoid::Timestamps
|
||||
include OrbitCoreLib::ObjectAuthable
|
||||
|
||||
ObjectAuthTitlesOptions = %W{preview fact_check}
|
||||
ObjectAuthTitlesOptions = %W{submit_new fact_check}
|
||||
AfterObjectAuthUrl = '/panel/announcement/back_end/bulletin_categorys'
|
||||
# include Mongoid::MultiParameterAttributes
|
||||
|
||||
|
||||
+8
-13
@@ -1,22 +1,17 @@
|
||||
<% content_for :secondary do %>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<ul class="list">
|
||||
<li><%#= link_to t('bulletin_category.new_announcement_class'), new_panel_announcement_back_end_bulletin_category_path, :class => 'seclink1' %></li>
|
||||
</ul>
|
||||
<%= render :partial => '/panel/announcement/back_end/announcement_secondary' %>
|
||||
<% end -%>
|
||||
|
||||
<%= flash_messages %>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<h1><%= t('bulletin_category.list_announcement_class') %></h1>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<table id="bulletin_categorys">
|
||||
<tr>
|
||||
<th><%= t('bulletin_category.key') %></th>
|
||||
|
||||
+8
-8
@@ -1,15 +1,15 @@
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<% content_for :secondary do %>
|
||||
<ul class="list">
|
||||
<li><%= link_to t('bulletin_category.index'), panel_announcement_back_end_bulletin_categorys_path, :class => 'seclink2' %></li>
|
||||
</ul>
|
||||
<%= render :partial => '/panel/announcement/back_end/announcement_secondary' %>
|
||||
<% end -%>
|
||||
|
||||
<%= flash_messages %>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<h1><%= t('bulletin_category.new_announcement_class') %></h1>
|
||||
<%= form_for @bulletin_category, :url => panel_announcement_back_end_bulletin_categorys_path do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
|
||||
Vendored
+1
-1
@@ -4,4 +4,4 @@
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<% end %>
|
||||
|
||||
<%= link_back %>
|
||||
<%= link_back %>
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
]<%= render 'filter' %>
|
||||
<%= render 'filter' %>
|
||||
<table id="bulettin_sort_list" class="table main-list">
|
||||
<%= render 'bulletins' %>
|
||||
</table>
|
||||
|
||||
Vendored
+1
-2
@@ -1,6 +1,5 @@
|
||||
|
||||
<%= form_for @bulletin, :url => panel_announcement_back_end_bulletins_path do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<% end %>
|
||||
|
||||
<%= link_back %>
|
||||
<%= link_back %>
|
||||
Vendored
+7
-3
@@ -1,10 +1,14 @@
|
||||
<% # encoding: utf-8 %>
|
||||
<% content_for :secondary do %>
|
||||
<%= render :partial => '/panel/announcement/back_end/announcement_secondary' %>
|
||||
<% end -%>
|
||||
|
||||
<%= flash_messages %>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<p id="notice"><%= flash_messages %></p>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
+2
-17
@@ -1,16 +1,5 @@
|
||||
<% content_for :secondary do %>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<ul class="list">
|
||||
<li><%= link_to t('bulletin.new_announcement'), new_panel_announcement_back_end_bulletin_path %></li>
|
||||
<li><%= link_to t('bulletin.announcement_list'), panel_announcement_back_end_bulletins_path %></li>
|
||||
<li><%= link_to t('bulletin.new_announcement_class'), panel_announcement_back_end_bulletin_categorys_path %></li>
|
||||
<li><%= link_to t('bulletin.my_announcement_fact_check'), panel_announcement_back_end_fact_checks_path %></li>
|
||||
|
||||
</ul>
|
||||
<%= render :partial => '/panel/announcement/back_end/announcement_secondary' %>
|
||||
<% end -%>
|
||||
|
||||
<%= flash_messages %>
|
||||
@@ -42,11 +31,7 @@
|
||||
<br />
|
||||
|
||||
<h1><%= t('bulletin.list_announcement') %></h1>
|
||||
<div id="preview_block">
|
||||
<h1>Preview</h1>
|
||||
<%= render :partial => "list_table", :collection => @bulletin_categorys_preview,:as => :bulletin_category%>
|
||||
</div>
|
||||
===================================================================================================================
|
||||
|
||||
<div id="check_block">
|
||||
<h1>Check Please</h1>
|
||||
<%= render :partial => "list_table", :collection => @bulletin_categorys_check,:as => :bulletin_category%>
|
||||
|
||||
@@ -4,6 +4,7 @@ Rails.application.routes.draw do
|
||||
namespace :back_end do
|
||||
match 'public' => "announcements#public",:as => :public
|
||||
resources :fact_checks
|
||||
match 'list_mine' => "announcements#list_mine"
|
||||
root :to => "bulletins#index"
|
||||
resources :bulletins
|
||||
resources :bulletin_categorys, :controller => 'bulletin_categorys' do
|
||||
|
||||
Reference in new issue
Block a user