First version for App and Object auth.Taking Announcement as experiment
This commit is contained in:
1 parent
3bcd7ea349
commit
cc550c5745
28 files changed
+146
-34
No files matched your search
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title": "Announcement",
|
||||
"title": "announcement",
|
||||
"version": "0.1",
|
||||
"organization": "Rulingcom",
|
||||
"author": "RD dep",
|
||||
|
||||
+3
-2
@@ -1,9 +1,10 @@
|
||||
class Panel::Announcement::BackEnd::FactChecksController < ApplicationController
|
||||
class Panel::Announcement::BackEnd::FactChecksController < OrbitBackendController
|
||||
before_filter :authenticate_user!
|
||||
layout 'admin'
|
||||
|
||||
def index
|
||||
@bulletin_categorys_preview = BulletinCategory.authed_for_user(current_user,'preview')
|
||||
@bulletin_categorys_check = BulletinCategory.authed_for_user(current_user,'check')
|
||||
@bulletin_categorys_check = BulletinCategory.authed_for_user(current_user,'fact_check')
|
||||
end
|
||||
|
||||
def new
|
||||
|
||||
@@ -6,7 +6,7 @@ class BulletinCategory
|
||||
include OrbitCoreLib::ObjectAuthable
|
||||
|
||||
ObjectAuthTitlesOptions = %W{preview fact_check}
|
||||
|
||||
AfterObjectAuthUrl = '/panel/announcement/back_end/bulletin_categorys'
|
||||
# include Mongoid::MultiParameterAttributes
|
||||
|
||||
PAYMENT_TYPES = [ "List", "Picture" ]
|
||||
|
||||
+9
-7
@@ -5,13 +5,15 @@
|
||||
<td><%= bulletin_category.i18n_variable[locale] rescue nil %></td>
|
||||
<% end %>
|
||||
<td><%= bulletin_category.display %></td>
|
||||
<td>
|
||||
<%= link_to t('blog.new_auth'), init_admin_object_auths_path("BulletinCategory",bulletin_category) %> <br/ >
|
||||
<% bulletin_category.object_auths.each do |obj_auth| %>
|
||||
<%= link_to obj_auth.title,edit_admin_object_auth_url(obj_auth) %><br />
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<% if is_manager? %>
|
||||
<td>
|
||||
<%= link_to t('blog.new_auth'), init_admin_object_auths_path("BulletinCategory",bulletin_category,@module_app) %> <br/ >
|
||||
<% bulletin_category.object_auths.each do |obj_auth| %>
|
||||
<%= link_to obj_auth.title,edit_admin_object_auth_url(obj_auth) %><br />
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<% 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 %>
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
<%= render 'filter' %>
|
||||
]<%= render 'filter' %>
|
||||
<table id="bulettin_sort_list" class="table main-list">
|
||||
<%= render 'bulletins' %>
|
||||
</table>
|
||||
|
||||
+7
-3
@@ -42,10 +42,14 @@
|
||||
<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%>
|
||||
|
||||
</div>
|
||||
<br />
|
||||
|
||||
@@ -2,6 +2,7 @@ Rails.application.routes.draw do
|
||||
namespace :panel do
|
||||
namespace :announcement do
|
||||
namespace :back_end do
|
||||
match 'public' => "announcements#public",:as => :public
|
||||
resources :fact_checks
|
||||
root :to => "bulletins#index"
|
||||
resources :bulletins
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
# desc "Explaining what the task does"
|
||||
# task :announcement do
|
||||
# # Task goes here
|
||||
# end
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
class Panel::NewBlog::FrontEnd::CommentsController < ObitFrontendController
|
||||
class Panel::NewBlog::FrontEnd::CommentsController < OrbitFrontendController
|
||||
def create
|
||||
@post = Post.find(params[:post_id])
|
||||
@comment = @post.comments.create!(params[:comment])
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
class Panel::NewBlog::FrontEnd::PostsController < ObitFrontendController
|
||||
class Panel::NewBlog::FrontEnd::PostsController < OrbitFrontendController
|
||||
# GET /posts
|
||||
# GET /posts.xml
|
||||
def index
|
||||
|
||||
Reference in new issue
Block a user