Merge branch 'design_team' into ldap
This commit is contained in:
commit
eba4671733
29 files changed
+191
-47
No files matched your search
Vendored
+1
-1
@@ -2,7 +2,7 @@ module Panel::Announcement::BackEnd::BulletinsHelper
|
||||
|
||||
def show_approval_link(bulletin)
|
||||
by_bulletin = (!bulletin.is_expired? and !bulletin.is_checked?)
|
||||
by_user = (bulletin.bulletin_category.authed_users('fact_check').include?(current_user) or is_manager?)
|
||||
by_user = (bulletin.bulletin_category.authed_users('fact_check').include?(current_user) or is_manager? or is_admin?)
|
||||
by_bulletin and by_user
|
||||
end
|
||||
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
class Panel::WebResource::BackEnd::WebLinkCategorysController < OrbitBackendController
|
||||
|
||||
before_filter :for_app_manager,:except => [:index]
|
||||
|
||||
def index
|
||||
@web_link_categorys = WebLinkCategory.all
|
||||
@web_link_category = WebLinkCategory.new(:display => 'List')
|
||||
|
||||
+9
-2
@@ -1,7 +1,7 @@
|
||||
class Panel::WebResource::BackEnd::WebLinksController < OrbitBackendController
|
||||
|
||||
before_filter :authenticate_user!
|
||||
before_filter :is_admin?
|
||||
# before_filter :for_app_manager,:except => [:index,:show]
|
||||
before_filter :for_app_sub_manager,:except => [:index]
|
||||
|
||||
def index
|
||||
|
||||
@@ -134,6 +134,13 @@ class Panel::WebResource::BackEnd::WebLinksController < OrbitBackendController
|
||||
|
||||
def get_categorys(id = nil)
|
||||
@web_link_categorys = (id ? WebLinkCategory.find(id).to_a : WebLinkCategory.excludes('disabled' => true))
|
||||
|
||||
@web_link_categorys = []
|
||||
if(is_manager? || is_admin?)
|
||||
@web_link_categorys = (id ? WebLinkCategory.find(id).to_a : WebLinkCategory.excludes('disabled' => true))
|
||||
elsif is_sub_manager?
|
||||
@web_link_categorys = WebLinkCategory.authed_for_user(current_user,'edit')
|
||||
end
|
||||
end
|
||||
|
||||
def get_tags
|
||||
|
||||
@@ -3,12 +3,21 @@
|
||||
class WebLinkCategory
|
||||
include Mongoid::Document
|
||||
include Mongoid::Timestamps
|
||||
include OrbitCoreLib::ObjectAuthable
|
||||
|
||||
# include Mongoid::MultiParameterAttributes
|
||||
|
||||
AfterObjectAuthUrl = '/panel/page_content/back_end/page_contexts'
|
||||
APP_NAME = 'web_resource'
|
||||
ObjectAuthTitlesOptions = %W{edit}
|
||||
|
||||
field :key
|
||||
|
||||
has_one :i18n_variable, :as => :language_value, :autosave => true, :dependent => :destroy
|
||||
|
||||
has_many :web_links
|
||||
|
||||
def pp_object
|
||||
i18n_variable[I18n.locale]
|
||||
end
|
||||
|
||||
end
|
||||
+9
-6
@@ -3,12 +3,15 @@
|
||||
<tr id="<%= dom_id web_link_category %>" class="with_action">
|
||||
<td>
|
||||
<%= web_link_category.key %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<li><%= link_to t('web_link_category.edit'), edit_panel_web_resource_back_end_web_link_category_path(web_link_category), :remote => true %></li>
|
||||
<li><%= link_to t('web_link_category.delete'), panel_web_resource_back_end_web_link_category_path(web_link_category), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %></li>
|
||||
</ul>
|
||||
</div>
|
||||
<%if at_least_module_manager %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<li><%= link_to t('web_link_category.edit'), edit_panel_web_resource_back_end_web_link_category_path(web_link_category), :remote => true %></li>
|
||||
<li><%= link_to t('web_link_category.delete'), panel_web_resource_back_end_web_link_category_path(web_link_category), :confirm => t('announcement.sure?'), :method => :delete, :remote => true %></li>
|
||||
<li><%= show_web_link_permission_link web_link_category %></li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end -%>
|
||||
</td>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td><%= web_link_category.i18n_variable[locale] rescue nil %></td>
|
||||
|
||||
+1
-1
@@ -34,6 +34,6 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div id="form"><%= render :partial => "form" %></div>
|
||||
<div id="form"><%= render :partial => "form" if at_least_module_manager%></div>
|
||||
|
||||
|
||||
+2
@@ -24,8 +24,10 @@
|
||||
<%= link_to web_link.name[I18n.locale], panel_web_resource_back_end_web_link_path(web_link) %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<%if at_least_module_manager || web_link.web_link_category.cur_user_is_sub_manager_of(:edit)%>
|
||||
<li><%= link_to t('web_link.edit'), edit_panel_web_resource_back_end_web_link_path(web_link) %></li>
|
||||
<li><%= link_to t('web_link.delete'), panel_web_resource_back_end_web_link_path(web_link), :confirm => t('sure?'), :method => :delete, :remote => true %></li>
|
||||
<% end -%>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
Reference in new issue
Block a user