Update top navigation menus [SCI-8262]

This commit is contained in:
Anton 2023-04-06 13:02:34 +02:00
parent 0c76d7a9b1
commit 624ea16d1f
4 changed files with 66 additions and 35 deletions

View file

@ -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 {

View file

@ -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

View file

@ -40,6 +40,8 @@
}
.dropdown-menu {
@include font-button;
.form-dropdown-break hr {
margin: 0;
}

View file

@ -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