diff --git a/app/controllers/admin/app_auths_controller.rb b/app/controllers/admin/app_auths_controller.rb
index cb3340fd..56d0ae23 100644
--- a/app/controllers/admin/app_auths_controller.rb
+++ b/app/controllers/admin/app_auths_controller.rb
@@ -66,6 +66,8 @@ class Admin::AppAuthsController < ApplicationController
@module_app = ModuleApp.find(params[:id])
end
-
+ def show
+ @module_app = ModuleApp.find(params[:id])
+ end
end
\ No newline at end of file
diff --git a/app/controllers/admin/module_apps_controller.rb b/app/controllers/admin/module_apps_controller.rb
index e80d4023..440f8100 100644
--- a/app/controllers/admin/module_apps_controller.rb
+++ b/app/controllers/admin/module_apps_controller.rb
@@ -21,6 +21,10 @@ class Admin::ModuleAppsController < ApplicationController
@module_app = ModuleApp.find(params[:id])
end
+ def show
+ @module_app = ModuleApp.find(params[:id])
+
+ end
def update
@module_app = ModuleApp.find(params[:id])
diff --git a/app/controllers/admin/object_auths_controller.rb b/app/controllers/admin/object_auths_controller.rb
index ce404e53..3bff4374 100644
--- a/app/controllers/admin/object_auths_controller.rb
+++ b/app/controllers/admin/object_auths_controller.rb
@@ -14,6 +14,7 @@ class Admin::ObjectAuthsController < ApplicationController
def new
obj = eval(params[:type]).find params[:obj_id]
@object_auth=obj.object_auths.build
+ @object_auth_title_option = eval(params[:type]+"::ObjectAuthTitlesOptions")
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @post }
diff --git a/app/models/prototype_auth.rb b/app/models/prototype_auth.rb
index 734268c4..893f402b 100644
--- a/app/models/prototype_auth.rb
+++ b/app/models/prototype_auth.rb
@@ -68,7 +68,7 @@ class PrototypeAuth
end
end
- def auth_users
+ def auth_users_before_block_list
if self.all?
User.all.entries
else
@@ -83,8 +83,8 @@ class PrototypeAuth
end
end
- def auth_users_after_block_list
- auth_users - self.blocked_users
+ def auth_users
+ auth_users_before_block_list - self.blocked_users
end
# protected
diff --git a/app/views/admin/attributes/_app_selector.html.erb b/app/views/admin/attributes/_app_selector.html.erb
new file mode 100644
index 00000000..c20a3885
--- /dev/null
+++ b/app/views/admin/attributes/_app_selector.html.erb
@@ -0,0 +1 @@
+<%= f.select :module_app_id, @apps.collect { |t| [t.title.capitalize, t.id] }, {:include_blank => true} ,{:rel => admin_module_apps_path } %>
diff --git a/app/views/admin/module_apps/show.html.erb b/app/views/admin/module_apps/show.html.erb
new file mode 100644
index 00000000..27cfbc1a
--- /dev/null
+++ b/app/views/admin/module_apps/show.html.erb
@@ -0,0 +1,37 @@
+
+<%=@module_app.key %>
+<%=@module_app.title %>
+<%=@module_app.version %>
+<%=@module_app.organization %>
+<%=@module_app.author %>
+<%=@module_app.intro %>
+<%=@module_app.update_info %>
+<%=@module_app.create_date %>
+<%=@module_app.enable_frontend%>
+<%=@module_app.app_pages%>
+<%=@module_app.widgets%>
+
+Mangers:
+
+ <% @module_app.managers.each do |manager|%>
+ - <%= manager.user.name %>
+ <%end%>
+
+
+
+SubManagers:
+
+ <% @module_app.sub_managers.each do |manager|%>
+ <%= manager.user.name %>
+ <%end%>
+
+
+
+All User?:<%= @module_app.app_auth.all %>
+Blocked Users:<%= @module_app.app_auth.blocked_users.collect{|t| t.name} %>
+Privilege Users:<%= @module_app.app_auth.privilege_users.collect{|t| t.name}%>
+User Roles:<%= @module_app.app_auth.roles.collect{|t| t.key} %>
+User Sub Roles:<%= @module_app.app_auth.sub_roles.collect{|t| t.key} %>
+
+Available users after calculation:
+<%= @module_app.app_auth.auth_users.collect{|user| user.name}.join(',') %>
diff --git a/app/views/admin/object_auths/new.html.erb b/app/views/admin/object_auths/new.html.erb
index 25fd6fd5..b5b381fb 100644
--- a/app/views/admin/object_auths/new.html.erb
+++ b/app/views/admin/object_auths/new.html.erb
@@ -12,7 +12,8 @@
<%= t('object_auth.new_object_auth') %>
<%= form_for @object_auth, :url => admin_object_auths_path do |f| %>
<%= f.label :title %>
- <%= f.text_field :title, :class => 'text' %>
+ <%= f.select :title,@object_auth_title_option %>
+
<%= f.hidden_field :obj_id, :value => params[:obj_id] %>
<%= f.hidden_field :type, :value => params[:type] %>
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 48b9ac88..6f4c1b7b 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
@@ -105,7 +105,7 @@ class Panel::Announcement::BackEnd::BulletinsController < ApplicationController
end
respond_to do |format|
- if @bulletin.update_attributes(params[:bulletin])
+ if @bulletin.update_attributes(params[:bulletin]) && @bulletin.save
# format.html { redirect_to(panel_announcement_back_end_bulletin_url(@bulletin), :notice => t('bulletin.update_bulletin_success')) }
format.html { redirect_to(panel_announcement_back_end_bulletins_url, :notice => t('bulletin.update_bulletin_success')) }
format.js { render 'toggle_enable' }
diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/fact_checks_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/fact_checks_controller.rb
new file mode 100644
index 00000000..ef7e1943
--- /dev/null
+++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/fact_checks_controller.rb
@@ -0,0 +1,29 @@
+class Panel::Announcement::BackEnd::FactChecksController < ApplicationController
+ layout 'admin'
+
+ def index
+ @bulletin_categorys_preview = BulletinCategory.authed_for_user(current_user,'preview')
+ @bulletin_categorys_check = BulletinCategory.authed_for_user(current_user,'check')
+ end
+
+ def new
+
+ end
+
+ def create
+
+ end
+
+ def update
+
+ end
+
+ def edit
+
+ end
+
+ def destroy
+
+ end
+
+end
diff --git a/vendor/built_in_modules/announcement/app/models/bulletin.rb b/vendor/built_in_modules/announcement/app/models/bulletin.rb
index 7c258f23..188142ea 100644
--- a/vendor/built_in_modules/announcement/app/models/bulletin.rb
+++ b/vendor/built_in_modules/announcement/app/models/bulletin.rb
@@ -4,7 +4,7 @@ class Bulletin
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::MultiParameterAttributes
-
+
has_one :title, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
has_one :subtitle, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
has_one :text, :class_name => "I18nVariable", :as => :language_value, :autosave => true, :dependent => :destroy
diff --git a/vendor/built_in_modules/announcement/app/models/bulletin_category.rb b/vendor/built_in_modules/announcement/app/models/bulletin_category.rb
index 0161847d..4e3dd186 100644
--- a/vendor/built_in_modules/announcement/app/models/bulletin_category.rb
+++ b/vendor/built_in_modules/announcement/app/models/bulletin_category.rb
@@ -3,6 +3,10 @@
class BulletinCategory
include Mongoid::Document
include Mongoid::Timestamps
+ include OrbitCoreLib::ObjectAuthable
+
+ ObjectAuthTitlesOptions = %W{preview fact_check}
+
# include Mongoid::MultiParameterAttributes
PAYMENT_TYPES = [ "List", "Picture" ]
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 57998770..2e0e7ddf 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
@@ -6,6 +6,12 @@
<% end %>
<%= bulletin_category.display %> |
+ <%= link_to t('blog.new_auth'), init_admin_object_auths_path("BulletinCategory",bulletin_category) %>
+ <% bulletin_category.object_auths.each do |obj_auth| %>
+ <%= link_to obj_auth.title,edit_admin_object_auth_url(obj_auth) %>
+ <% end %>
+ |
+
<%= link_to t('bulletin_category.edit'), edit_panel_announcement_back_end_bulletin_category_path(bulletin_category), :remote => true %> |
<%= link_to t('bulletin_category.quick_edit'), panel_announcement_back_end_bulletin_category_quick_edit_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 %>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletins.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletins.html.erb
index 9fec31f3..bbe383bc 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletins.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletins.html.erb
@@ -36,4 +36,4 @@
|
<%= render :partial => 'bulletin', :collection => @bulletins %>
-
\ No newline at end of file
+
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/index.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/index.html.erb
index d37d2134..fd2b29b5 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/index.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/index.html.erb
@@ -6,4 +6,3 @@
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('admin.add'), new_panel_announcement_back_end_bulletin_path, :class => 'btn btn-primary' %>
-
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/_list_table.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/_list_table.html.erb
new file mode 100644
index 00000000..59bac03a
--- /dev/null
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/_list_table.html.erb
@@ -0,0 +1,15 @@
+<%= bulletin_category.key %>
+
+
+ <%= t('bulletin.status') %> |
+ <%= t('bulletin.category') %> |
+ <%= t('bulletin.title') %> |
+ <%= t('bulletin.postdate') %> |
+ <%= t('bulletin.deadline') %> |
+ <%= t('bulletin.action') %> |
+
+
+<% bulletin_category.bulletins.each do |post| %>
+ <%= render :partial => 'panel/announcement/back_end/bulletins/bulletins', :locals => {:post => post,:fact_check_allow=>true} %>
+<% end %>
+
\ No newline at end of file
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/index.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/index.html.erb
new file mode 100644
index 00000000..65ebeb28
--- /dev/null
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/index.html.erb
@@ -0,0 +1,51 @@
+<% content_for :secondary do %>
+
+
+
+
+
+
+ - <%= link_to t('bulletin.new_announcement'), new_panel_announcement_back_end_bulletin_path %>
+ - <%= link_to t('bulletin.announcement_list'), panel_announcement_back_end_bulletins_path %>
+ - <%= link_to t('bulletin.new_announcement_class'), panel_announcement_back_end_bulletin_categorys_path %>
+ - <%= link_to t('bulletin.my_announcement_fact_check'), panel_announcement_back_end_fact_checks_path %>
+
+
+<% end -%>
+
+<%= flash_messages %>
+
+
+
+
+
+
+
+
+
+
+
+
+<%= t('bulletin.list_announcement') %>
+
+ <%= render :partial => "list_table", :collection => @bulletin_categorys_preview,:as => :bulletin_category%>
+
+ <%= render :partial => "list_table", :collection => @bulletin_categorys_check,:as => :bulletin_category%>
+
+
+
diff --git a/vendor/built_in_modules/announcement/config/routes.rb b/vendor/built_in_modules/announcement/config/routes.rb
index c3a60f74..cc877749 100644
--- a/vendor/built_in_modules/announcement/config/routes.rb
+++ b/vendor/built_in_modules/announcement/config/routes.rb
@@ -2,6 +2,7 @@ Rails.application.routes.draw do
namespace :panel do
namespace :announcement do
namespace :back_end do
+ resources :fact_checks
root :to => "bulletins#index"
resources :bulletins
resources :bulletin_categorys, :controller => 'bulletin_categorys' do
@@ -21,4 +22,4 @@ Rails.application.routes.draw do
end
end
end
-end
\ No newline at end of file
+end