mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-10 00:11:22 +08:00
Merge pull request #5262 from aignatov-bio/ai-sci-8262-update-settings-menu
Update top navigation menus [SCI-8262]
This commit is contained in:
commit
86d33891c3
4 changed files with 66 additions and 35 deletions
|
|
@ -48,6 +48,11 @@
|
||||||
margin-left: .75em;
|
margin-left: .75em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dropdown-menu li a {
|
||||||
|
line-height: 1rem;
|
||||||
|
padding: .625rem 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
@media(max-width: 1200px) {
|
@media(max-width: 1200px) {
|
||||||
.sci--navigation--top-menu-logo {
|
.sci--navigation--top-menu-logo {
|
||||||
.logo {
|
.logo {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
// scss-lint:disable ImportantRule
|
||||||
|
|
||||||
$font-family-lato: Lato, "Open Sans", Arial, Helvetica, sans-serif;
|
$font-family-lato: Lato, "Open Sans", Arial, Helvetica, sans-serif;
|
||||||
$font-family-sans-serif: "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;
|
$font-family-serif: Georgia, "Times New Roman", Times, serif;
|
||||||
|
|
@ -57,6 +59,10 @@ $font-fas-plus: "\f02b";
|
||||||
font-weight: 501;
|
font-weight: 501;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
font-size: 16px !important;
|
||||||
|
}
|
||||||
|
|
||||||
// $font-size-large: ceil(($font-size-base * 1.1)); //16px
|
// $font-size-large: ceil(($font-size-base * 1.1)); //16px
|
||||||
// $font-size-small: ceil(($font-size-base * .9)); //13px
|
// $font-size-small: ceil(($font-size-base * .9)); //13px
|
||||||
// $font-size-h1: floor(($font-size-base * 2.6)); //36px
|
// $font-size-h1: floor(($font-size-base * 2.6)); //36px
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-menu {
|
.dropdown-menu {
|
||||||
|
@include font-button;
|
||||||
|
|
||||||
.form-dropdown-break hr {
|
.form-dropdown-break hr {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,38 +3,6 @@
|
||||||
class NavigationsController < ApplicationController
|
class NavigationsController < ApplicationController
|
||||||
include ApplicationHelper
|
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
|
def top_menu
|
||||||
render json: {
|
render json: {
|
||||||
root_url: root_path,
|
root_url: root_path,
|
||||||
|
|
@ -43,9 +11,9 @@ class NavigationsController < ApplicationController
|
||||||
search_url: search_path,
|
search_url: search_path,
|
||||||
teams: teams,
|
teams: teams,
|
||||||
settings: [],
|
settings: [],
|
||||||
help_menu: NavigationsController::HELP_MENU_LINKS,
|
help_menu: help_menu_links,
|
||||||
settings_menu: NavigationsController::SETTINGS_MENU_LINKS,
|
settings_menu: settings_menu_links,
|
||||||
user_menu: NavigationsController::USER_MENU_LINKS,
|
user_menu: user_menu_links,
|
||||||
user: user
|
user: user
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
@ -76,4 +44,54 @@ class NavigationsController < ApplicationController
|
||||||
sign_out_url: destroy_user_session_path
|
sign_out_url: destroy_user_session_path
|
||||||
}
|
}
|
||||||
end
|
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
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue