diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-02-02 03:25:00 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-02-02 16:25:44 +0300 |
commit | 0ea5d764f2ad8d94adfca36b20ce92e67af81e36 (patch) | |
tree | 87de81a8c6ef8b87600299708165b372f96c389c | |
parent | 07384aa00d8a8759cdb29ba51ae32a6032ba2571 (diff) |
Hide the link for spam logs if the Askimet is disabled
-rw-r--r-- | app/helpers/application_settings_helper.rb | 4 | ||||
-rw-r--r-- | app/views/layouts/nav/_admin.html.haml | 13 |
2 files changed, 11 insertions, 6 deletions
diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index 7d6b58ee21a..23693629a4c 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -23,6 +23,10 @@ module ApplicationSettingsHelper current_application_settings.user_oauth_applications end + def askimet_enabled? + current_application_settings.akismet_enabled? + end + # Return a group of checkboxes that use Bootstrap's button plugin for a # toggle button effect. def restricted_level_checkboxes(help_block_id) diff --git a/app/views/layouts/nav/_admin.html.haml b/app/views/layouts/nav/_admin.html.haml index 8dc20587421..5f8212ea264 100644 --- a/app/views/layouts/nav/_admin.html.haml +++ b/app/views/layouts/nav/_admin.html.haml @@ -82,12 +82,13 @@ Abuse Reports %span.count= number_with_delimiter(AbuseReport.count(:all)) - = nav_link(controller: :spam_logs) do - = link_to admin_spam_logs_path, title: "Spam Logs" do - = icon('exclamation-triangle fw') - %span - Spam Logs - %span.count= number_with_delimiter(SpamLog.count(:all)) + - if askimet_enabled? + = nav_link(controller: :spam_logs) do + = link_to admin_spam_logs_path, title: "Spam Logs" do + = icon('exclamation-triangle fw') + %span + Spam Logs + %span.count= number_with_delimiter(SpamLog.count(:all)) = nav_link(controller: :application_settings, html_options: { class: 'separate-item'}) do = link_to admin_application_settings_path, title: 'Settings' do |