From e20df41db518e92cdc163196ec46500e8fe9c494 Mon Sep 17 00:00:00 2001 From: "Matt K. Fu" Date: Mon, 27 May 2013 14:33:45 +0800 Subject: [PATCH] add user log link at site page --- app/controllers/admin/user_actions_controller.rb | 4 +++- app/views/admin/sites/_side_bar.html.erb | 1 + app/views/admin/user_actions/index.html.erb | 4 ++++ config/locales/en.yml | 1 + config/locales/zh_tw.yml | 1 + 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/user_actions_controller.rb b/app/controllers/admin/user_actions_controller.rb index dff3a432d..ee812d311 100644 --- a/app/controllers/admin/user_actions_controller.rb +++ b/app/controllers/admin/user_actions_controller.rb @@ -1,5 +1,7 @@ class Admin::UserActionsController < OrbitBackendController - + layout "new_admin" + before_filter :authenticate_user! + before_filter :is_admin? def index @user_actions = UserAction.all end diff --git a/app/views/admin/sites/_side_bar.html.erb b/app/views/admin/sites/_side_bar.html.erb index 67b7c6619..2a564bd52 100644 --- a/app/views/admin/sites/_side_bar.html.erb +++ b/app/views/admin/sites/_side_bar.html.erb @@ -8,6 +8,7 @@ <%= content_tag :li, link_to(t('mail.setting'), admin_site_mail_setting_path(@site)), :class => active_for_action('sites', 'mail_setting') %> <%#= content_tag :li, link_to(t(:theme), admin_site_ui_theme_path(@site)), :class => active_for_action('sites', 'ui_theme') %> <%= content_tag :li, link_to(t('sitemap'), admin_site_sitemap_path(@site)), :class => active_for_action('sites', 'sitemap') %> + <%= content_tag :li, link_to(t('user_actions'), admin_user_actions_path), :class => active_for_action('user_actions', 'index') %> <% end -%> <% end -%> diff --git a/app/views/admin/user_actions/index.html.erb b/app/views/admin/user_actions/index.html.erb index a957e15d1..fb9133206 100644 --- a/app/views/admin/user_actions/index.html.erb +++ b/app/views/admin/user_actions/index.html.erb @@ -1,3 +1,7 @@ +<% content_for :side_bar do %> + <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :icon => 'icons-cog', :side_bar_content => 'admin/sites/side_bar'} %> +<% end %> + diff --git a/config/locales/en.yml b/config/locales/en.yml index 7dc10aafb..d83137253 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -465,6 +465,7 @@ en: url: URL use_status: Use Statue user: User + user_actions: User log user_action: time: Time name: Account diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index 17ba94020..7c1b180ef 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -466,6 +466,7 @@ zh_tw: url: 網址 use_status: 使用狀態 user: 使用者 + user_actions: 使用者Log user_action: time: 時間 name: 使用帳號
<%= I18n.t 'user_action.time' %>