diff --git a/app/assets/stylesheets/navigation/top_menu.scss b/app/assets/stylesheets/navigation/top_menu.scss index faf42a780..14c50e613 100644 --- a/app/assets/stylesheets/navigation/top_menu.scss +++ b/app/assets/stylesheets/navigation/top_menu.scss @@ -48,6 +48,11 @@ margin-left: .75em; } + .dropdown-menu li a { + line-height: 1rem; + padding: .625rem 1rem; + } + @media(max-width: 1200px) { .sci--navigation--top-menu-logo { .logo { diff --git a/app/assets/stylesheets/shared_styles/constants/fonts.scss b/app/assets/stylesheets/shared_styles/constants/fonts.scss index d02929a38..75d2d0e72 100644 --- a/app/assets/stylesheets/shared_styles/constants/fonts.scss +++ b/app/assets/stylesheets/shared_styles/constants/fonts.scss @@ -1,3 +1,5 @@ +// scss-lint:disable ImportantRule + $font-family-lato: Lato, "Open Sans", Arial, Helvetica, sans-serif; $font-family-sans-serif: "Open Sans", Arial, Helvetica, sans-serif; $font-family-serif: Georgia, "Times New Roman", Times, serif; @@ -57,6 +59,10 @@ $font-fas-plus: "\f02b"; font-weight: 501; } +html { + font-size: 16px !important; +} + // $font-size-large: ceil(($font-size-base * 1.1)); //16px // $font-size-small: ceil(($font-size-base * .9)); //13px // $font-size-h1: floor(($font-size-base * 2.6)); //36px diff --git a/app/assets/stylesheets/shared_styles/elements/dropdown.scss b/app/assets/stylesheets/shared_styles/elements/dropdown.scss index a1f8bf9b5..54926cb7f 100644 --- a/app/assets/stylesheets/shared_styles/elements/dropdown.scss +++ b/app/assets/stylesheets/shared_styles/elements/dropdown.scss @@ -40,6 +40,8 @@ } .dropdown-menu { + @include font-button; + .form-dropdown-break hr { margin: 0; } diff --git a/app/controllers/navigations_controller.rb b/app/controllers/navigations_controller.rb index acff216be..297ee6db6 100644 --- a/app/controllers/navigations_controller.rb +++ b/app/controllers/navigations_controller.rb @@ -3,38 +3,6 @@ class NavigationsController < ApplicationController include ApplicationHelper - HELP_MENU_LINKS = [ - { name: I18n.t('left_menu_bar.support_links.support'), url: Constants::SUPPORT_URL }, - { name: I18n.t('left_menu_bar.support_links.tutorials'), url: Constants::TUTORIALS_URL }, - { name: I18n.t('left_menu_bar.academy'), url: Constants::ACADEMY_BL_LINK } - ] - - SETTINGS_MENU_LINKS = [ - { - name: I18n.t('users.settings.sidebar.teams'), - url: Rails.application.routes.url_helpers.teams_path - }, { - name: I18n.t('users.settings.sidebar.account_nav.addons'), - url: Rails.application.routes.url_helpers.addons_path - }, { - name: I18n.t('users.settings.sidebar.webhooks'), - url: Rails.application.routes.url_helpers.users_settings_webhooks_path - } - ] - - USER_MENU_LINKS = [ - { - name: I18n.t('users.settings.sidebar.account_nav.profile'), - url: Rails.application.routes.url_helpers.edit_user_registration_path - }, { - name: I18n.t('users.settings.sidebar.account_nav.preferences'), - url: Rails.application.routes.url_helpers.preferences_path - }, { - name: I18n.t('users.settings.sidebar.account_nav.connected_accounts'), - url: Rails.application.routes.url_helpers.connected_accounts_path - } - ] - def top_menu render json: { root_url: root_path, @@ -43,9 +11,9 @@ class NavigationsController < ApplicationController search_url: search_path, teams: teams, settings: [], - help_menu: NavigationsController::HELP_MENU_LINKS, - settings_menu: NavigationsController::SETTINGS_MENU_LINKS, - user_menu: NavigationsController::USER_MENU_LINKS, + help_menu: help_menu_links, + settings_menu: settings_menu_links, + user_menu: user_menu_links, user: user } end @@ -76,4 +44,54 @@ class NavigationsController < ApplicationController sign_out_url: destroy_user_session_path } end + + def help_menu_links + links = [ + { name: I18n.t('left_menu_bar.support_links.support'), url: Constants::SUPPORT_URL }, + { name: I18n.t('left_menu_bar.support_links.tutorials'), url: Constants::TUTORIALS_URL }, + { name: I18n.t('left_menu_bar.academy'), url: Constants::ACADEMY_BL_LINK } + ] + + private_methods.select { |i| i.to_s[/^help_menu_links_[a-z]*_extension$/] }.each do |method| + links = __send__(method, links) + end + + links + end + + def settings_menu_links + links = [ + { + name: I18n.t('users.settings.sidebar.teams'), url: teams_path + }, { + name: I18n.t('users.settings.sidebar.account_nav.addons'), url: addons_path + }, { + name: I18n.t('users.settings.sidebar.webhooks'), url: users_settings_webhooks_path + } + ] + + private_methods.select { |i| i.to_s[/^settings_menu_links_[a-z]*_extension$/] }.each do |method| + links = __send__(method, links) + end + + links + end + + def user_menu_links + links = [ + { + name: I18n.t('users.settings.sidebar.account_nav.profile'), url: edit_user_registration_path + }, { + name: I18n.t('users.settings.sidebar.account_nav.preferences'), url: preferences_path + }, { + name: I18n.t('users.settings.sidebar.account_nav.connected_accounts'), url: connected_accounts_path + } + ] + + private_methods.select { |i| i.to_s[/^user_menu_links_[a-z]*_extension$/] }.each do |method| + links = __send__(method, links) + end + + links + end end