From fe89b942e7c05f111582cfaedb2869d68ea17993 Mon Sep 17 00:00:00 2001 From: Luka Murn Date: Wed, 11 Oct 2017 14:15:37 +0200 Subject: [PATCH 1/2] Add Add-ons page to User -> Settings -> Account Closes SCI-1675. --- .../settings/account/addons_controller.rb | 8 +++++++ app/helpers/user_settings_helper.rb | 7 +++++- .../settings/account/_navigation.html.erb | 3 +++ .../settings/account/addons/index.html.erb | 22 +++++++++++++++++++ config/locales/en.yml | 5 +++++ config/routes.rb | 3 +++ 6 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 app/controllers/users/settings/account/addons_controller.rb create mode 100644 app/views/users/settings/account/addons/index.html.erb diff --git a/app/controllers/users/settings/account/addons_controller.rb b/app/controllers/users/settings/account/addons_controller.rb new file mode 100644 index 000000000..9b18d556a --- /dev/null +++ b/app/controllers/users/settings/account/addons_controller.rb @@ -0,0 +1,8 @@ +module Users + module Settings + module Account + class AddonsController < ApplicationController + end + end + end +end diff --git a/app/helpers/user_settings_helper.rb b/app/helpers/user_settings_helper.rb index ce06ccf60..448ef9b63 100644 --- a/app/helpers/user_settings_helper.rb +++ b/app/helpers/user_settings_helper.rb @@ -1,7 +1,8 @@ module UserSettingsHelper def on_settings_account_page? controller_name == 'registrations' && action_name == 'edit' || - controller_name == 'preferences' && action_name == 'index' + controller_name == 'preferences' && action_name == 'index' || + controller_name == 'addons' && action_name == 'index' end def on_settings_account_profile_page? @@ -12,6 +13,10 @@ module UserSettingsHelper controller_name == 'preferences' end + def on_settings_account_addons_page? + controller_name == 'addons' + end + def on_settings_team_page? controller_name.in?(%w(teams audits)) && action_name.in?(%w(index new create show audits_index)) diff --git a/app/views/users/settings/account/_navigation.html.erb b/app/views/users/settings/account/_navigation.html.erb index f890b5a5f..63993494d 100644 --- a/app/views/users/settings/account/_navigation.html.erb +++ b/app/views/users/settings/account/_navigation.html.erb @@ -5,4 +5,7 @@ + \ No newline at end of file diff --git a/app/views/users/settings/account/addons/index.html.erb b/app/views/users/settings/account/addons/index.html.erb new file mode 100644 index 000000000..de7c58a21 --- /dev/null +++ b/app/views/users/settings/account/addons/index.html.erb @@ -0,0 +1,22 @@ +<% provide(:head_title, t('users.settings.account.addons.head_title')) %> + +<%= render partial: 'users/settings/navigation.html.erb' %> +
+
+ +
+
+ <%= render partial: 'users/settings/account/navigation.html.erb' %> +
+
+

<%= t('users.settings.account.addons.title') %>

+
+ + <%= t('users.settings.account.addons.no_addons') %> + +
+
+
+
+
+
diff --git a/config/locales/en.yml b/config/locales/en.yml index 24498ed3c..cb1a4a473 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1292,6 +1292,7 @@ en: navigation: profile: "Profile" preferences: "Preferences" + addons: "Add-ons" preferences: head_title: "Settings | My preferences" edit: @@ -1307,6 +1308,10 @@ en: select_team: "Select team" tutorial_reset_flash: "Tutorial can now be repeated." tutorial_reset_error: "Tutorial could not be repeated." + addons: + head_title: "Settings | Add-ons" + title: "Add-ons" + no_addons: "You have no add-ons." teams: head_title: "Settings | Teams" breadcrumbs: diff --git a/config/routes.rb b/config/routes.rb index 7aed6b3f9..c6b412da4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -28,6 +28,9 @@ Rails.application.routes.draw do get 'users/settings/account/preferences', to: 'users/settings/account/preferences#index', as: 'preferences' + get 'users/settings/account/addons', + to: 'users/settings/account/addons#index', + as: 'addons' put 'users/settings/account/preferences', to: 'users/settings/account/preferences#update', as: 'update_preferences' From 38bce08b5abf341a0af005dcd863d78602e3fc33 Mon Sep 17 00:00:00 2001 From: Luka Murn Date: Fri, 13 Oct 2017 09:27:18 +0200 Subject: [PATCH 2/2] Minor wording change. --- config/locales/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index cb1a4a473..402735557 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1311,7 +1311,7 @@ en: addons: head_title: "Settings | Add-ons" title: "Add-ons" - no_addons: "You have no add-ons." + no_addons: "You have no sciNote Add-ons." teams: head_title: "Settings | Teams" breadcrumbs: