From ee053cd8ac5401256f1b51444ae3c55aa5bee7d3 Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Wed, 21 Nov 2012 11:46:06 +0800 Subject: [PATCH 1/2] fix and hide for visitors,except for album --- .../admin/users_new_interface_controller.rb | 10 +++++++--- .../admin/users_new_interface/_filter.html.erb | 6 ++++-- .../_index_paginator.html.erb | 2 ++ .../_user_for_listing.html.erb | 2 +- .../admin/users_new_interface/show.html.erb | 2 +- app/views/layouts/_guest_orbit_menu.erb | 5 +++++ app/views/layouts/_member_orbit_menu.erb | 15 +++++++++++++++ app/views/layouts/_orbit_bar.html.erb | 18 ++---------------- app/views/layouts/_side_bar_content.html.erb | 10 +++++----- config/mongoid.yml | 2 +- .../back_end/archive_files_controller.rb | 6 +++--- .../archive_files/_archive_files.html.erb | 2 ++ .../panel/calendar/back_end/cals_controller.rb | 6 +++++- .../calendar/back_end/cals/index.html.erb | 2 ++ .../gprs/back_end/locations_controller.rb | 2 +- .../gprs/back_end/locations/index.html.erb | 16 +++++++++++----- 16 files changed, 67 insertions(+), 39 deletions(-) create mode 100644 app/views/layouts/_guest_orbit_menu.erb create mode 100644 app/views/layouts/_member_orbit_menu.erb diff --git a/app/controllers/admin/users_new_interface_controller.rb b/app/controllers/admin/users_new_interface_controller.rb index 8c5ec93a..69c22ed6 100644 --- a/app/controllers/admin/users_new_interface_controller.rb +++ b/app/controllers/admin/users_new_interface_controller.rb @@ -1,9 +1,13 @@ -class Admin::UsersNewInterfaceController < ApplicationController +class Admin::UsersNewInterfaceController < OrbitBackendController layout "new_admin" - before_filter :authenticate_user! - before_filter :set_attribute, :only => [:index, :show, :new, :edit] + # before_filter :authenticate_user! + # before_filter :set_attribute, :only => [:index, :show, :new, :edit] + before_filter :force_order_for_visitor,:only=>[:index,:show] + before_filter :force_order_for_user,:except => [:index,:show] + before_filter :for_app_sub_manager,:except => [:index,:show] + def index get_tags get_sub_roles diff --git a/app/views/admin/users_new_interface/_filter.html.erb b/app/views/admin/users_new_interface/_filter.html.erb index 3262ea5d..4033ff5e 100644 --- a/app/views/admin/users_new_interface/_filter.html.erb +++ b/app/views/admin/users_new_interface/_filter.html.erb @@ -61,8 +61,10 @@ - - + <% if is_admin? %> + + + <%end%> <%= t("admin.new_admin.attributes.roles")%> <%= t("admin.new_admin.attributes.name")%> diff --git a/app/views/admin/users_new_interface/_index_paginator.html.erb b/app/views/admin/users_new_interface/_index_paginator.html.erb index 04fff093..3d8864d0 100644 --- a/app/views/admin/users_new_interface/_index_paginator.html.erb +++ b/app/views/admin/users_new_interface/_index_paginator.html.erb @@ -1,7 +1,9 @@
+ <% if is_admin? %> <%= link_to(new_admin_users_new_interface_path,:class=> "btn btn-primary pull-right") do%> <%= t("admin.new_admin.action.add")%> <% end -%> + <%end -%>
<%= paginate @users, :params => {:inner => false}%>
diff --git a/app/views/admin/users_new_interface/_user_for_listing.html.erb b/app/views/admin/users_new_interface/_user_for_listing.html.erb index 9df1eb10..e7fe44ee 100644 --- a/app/views/admin/users_new_interface/_user_for_listing.html.erb +++ b/app/views/admin/users_new_interface/_user_for_listing.html.erb @@ -1,5 +1,5 @@ - + <% if is_admin? %><% end%>
- <% if @authenticated %> + <%# if @authenticated %>
@@ -41,7 +41,7 @@
- <% end %> + <%# end %> <% content_for :page_specific_javascript do %> <%= javascript_include_tag "jquery.tinyscrollbar" %> <% end %>