diff --git a/app/views/layouts/_side_bar.html.erb b/app/views/layouts/_side_bar.html.erb
index 96e0e2a84..431e83991 100644
--- a/app/views/layouts/_side_bar.html.erb
+++ b/app/views/layouts/_side_bar.html.erb
@@ -1,6 +1,10 @@
<%#= content_tag :li, :class => active_for_controllers('purchases') do -%>
<%#= link_to content_tag(:i, nil, :class => 'icons-purchase') + t('admin.purchase'), admin_purchases_path %>
<%# end -%>
+<% content_for :page_specific_javascript do %>
+ <%= javascript_include_tag "/static/kernel.js" %>
+<% end %>
+<%= flash_messages %>
<%= content_tag :li, :class => active_for_controllers('bulletins', '/panel/announcement/back_end/tags', 'bulletin_categorys','module_apps', 'approvals') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-announcement') + t('admin.announcement'), panel_announcement_back_end_bulletins_path %>
diff --git a/public/static/kernel.js b/public/static/kernel.js
index c5b9a8a6a..ba5b81c38 100644
--- a/public/static/kernel.js
+++ b/public/static/kernel.js
@@ -1,4 +1,5 @@
$(document).ready(function() {
+ $.each($(".notice"),function(k,v){ alert("EMPTY Cate");});
$.each($(".dymanic_load"),function(){
if($(this).attr("path")==''){$(this).html("App setting Failed");}
diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/approvals_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/approvals_controller.rb
index 2d10dd75f..4338fdd13 100644
--- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/approvals_controller.rb
+++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/approvals_controller.rb
@@ -1,5 +1,6 @@
class Panel::Announcement::BackEnd::ApprovalsController < OrbitBackendController
before_filter :authenticate_user!
+ before_filter :is_admin?
include AdminHelper
# layout 'admin'
diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_categorys_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_categorys_controller.rb
index 0e3894b9d..b9151125c 100644
--- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_categorys_controller.rb
+++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_categorys_controller.rb
@@ -1,5 +1,7 @@
class Panel::Announcement::BackEnd::BulletinCategorysController < OrbitBackendController
-
+ before_filter :for_app_manager,:except => [:index]
+
+
def index
@bulletin_categorys = BulletinCategory.all
@bulletin_category = BulletinCategory.new(:display => 'List')
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 f77e70b71..b5ebd0c07 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
@@ -1,8 +1,9 @@
class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
before_filter :authenticate_user!
- before_filter :is_admin?
-
+# before_filter :for_admin_only,:only => [:]
+# before_filter :for_app_manager,:only => [:index,:show,]
+ before_filter :for_app_sub_manager,:except => [:index,:show,:get_sorted_and_filtered_bulletins]
def index
# @bulletins = Bulletin.all
# @bulletins = Bulletin.desc("postdate desc")
@@ -39,6 +40,10 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
@bulletin_file = BulletinFile.new
@file_url = panel_announcement_back_end_bulletins_path
+ @bulletins.delete_if{ |bulletin|
+ bulletin.is_pending == true && (!bulletin.bulletin_category.authed_users('fact_check').include?(current_user) || bulletin.create_user_id!=current_user.id)
+ }
+
respond_to do |format|
format.html # index.html.erb
format.js { }
@@ -76,14 +81,17 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
# @bulletin.bulletin_files.build
# @bulletin.bulletin_files.new
-
- get_categorys
- get_tags
- respond_to do |format|
- format.html # new.html.erb
- format.xml { render :xml => @bulletin }
- end
+ if get_categorys.empty?
+ flash[:notice] = "You dont have any permission for post on cate"
+ redirect_to :action => :index
+ else
+ get_tags
+ respond_to do |format|
+ format.html # new.html.erb
+ format.xml { render :xml => @bulletin }
+ end
+ end
end
# GET /bulletins/1/edit
@@ -311,7 +319,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
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')
+ @bulletin_categorys = BulletinCategory.authed_for_user(current_user,'submit')
end
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 a75440e56..8ad4578ea 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
@@ -4,10 +4,13 @@
<%= bulletin_category.key %>
- - <%= link_to t('bulletin_category.edit'), edit_panel_announcement_back_end_bulletin_category_path(bulletin_category), :remote => true %>
- - <%= show_submit_permission_link(bulletin_category) %>
- - <%= link_to t('bulletin_category.delete'), panel_announcement_back_end_bulletin_category_path(bulletin_category), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %>
-
+ <%if is_manager? || is_admin? %>
+ - <%= show_submit_permission_link(bulletin_category) %>
+ <% end %>
+ <% if is_admin?%>
+ - <%= link_to t('bulletin_category.edit'), edit_panel_announcement_back_end_bulletin_category_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 %>
+ <% end %>
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 28d2fde0c..392e50a35 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
@@ -17,7 +17,7 @@
-
<%= render :partial => "form" %>
+
<%= render :partial => "form" if is_manager?%>
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 b8dd663d9..3722fd81e 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
@@ -1,5 +1,8 @@
- <%= check_box_tag 'to_delete[]', bulletin.id, false, :class => "checkbox_in_list" %> |
+
+ <% if (bulletin.create_user_id == current_user.id) || is_manager? %>
+ <%= check_box_tag 'to_delete[]', bulletin.id, false, :class => "checkbox_in_list" %>
+ <% end -%>
|
<% if bulletin.is_top? %>
<%= t(:top) %>
@@ -23,8 +26,11 @@
| <%= bulletin.bulletin_category.i18n_variable[I18n.locale] %> |
<%= link_to bulletin.title[I18n.locale], panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category.id) rescue ''%>
+
+ <% if (bulletin.create_user_id == current_user.id) || is_manager? %>
+
<% if current_user.admin? || (!bulletin.is_rejected? && !bulletin.is_checked?) %>
- <%= link_to t('bulletin.edit'), edit_panel_announcement_back_end_bulletin_path(bulletin) %>
-
@@ -39,11 +45,13 @@
<%#= debugger %>
<%#= a=1 %>
- <% if show_approval_link(bulletin) %>
- - <%= link_to t('announcement.bulletin.approval'), edit_panel_announcement_back_end_bulletin_path(bulletin) %>
<%#= #TODO add ancher so user can quick access into that part %>
- <% end %>
+
<% end %>
- <%= link_to t('bulletin.delete'), panel_announcement_back_end_bulletin_path(bulletin), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %>
+ <% end -%>
+ <% if show_approval_link(bulletin) %>
+ - <%= link_to t('announcement.bulletin.approval'), edit_panel_announcement_back_end_bulletin_path(bulletin) %>
<%#= #TODO add ancher so user can quick access into that part %>
+ <% end %>
|
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_sort_headers.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_sort_headers.html.erb
index b48cca39c..f53ef5a6c 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_sort_headers.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_sort_headers.html.erb
@@ -2,8 +2,10 @@