OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/app/assets/stylesheets/layout/_main_menu.sass

396 lines
9.9 KiB

//-- copyright
// OpenProject is a project management system.
// Copyright (C) 2012-2018 the OpenProject Foundation (OPF)
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License version 3.
//
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
// Copyright (C) 2006-2017 Jean-Philippe Lang
// Copyright (C) 2010-2013 the ChiliProject Team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See docs/COPYRIGHT.rdoc for more details.
//++
$toggler-width: 40px
[27828] Feature: Query menu in sidenav (#6429) * in main menu add gantt as extra work package child item * Satisfy spec and code climate * Add gantt chart icon behin default gantt query name. * WIP Query menu in left sidebar * Shift query dropdown in left sidenav * Reload menu or load query on click from every project location * WIP set correct label for default queries * Query menu listens on all changes of queries (delete, create, rename, toggle starred) and updates immediatly * WIP: Inline edit, field validation * Inline Edit validation and comfirm * Inline edit: validation of duplicate name * Set default columns and sorting for static queries * Codeclimate issues fixed * WIP Inline edit validation not working perfectly in all error states * Inline edit working * Autocompleter hover disabled and hovering over categories fixed * Category hover and toggle fixed; tested in Chrome, Firefox and Opera * Placeholder cut off fixed and text wrap added * English and german wording adjusted * Styles of inline edit and menu adjusted; matching wiki page styles * prevent menus to be displayed to often * application menu only displayed on work package * specify using no_menu layout more often * adapt tests to altered production implementation * Hamburger icon only in project; on global wp page: default queries shown correctly and summary removed * searching for undefined leads to error * Accessible click fixed (listen on escape) * Gantt in top menu deleted (gantt chart is part of default queries on wp page) * load menu on wp summary page * reduce times queries are loaded * lowercase on second word * remove menu from search and home * Styles fixed (category toggle and correct highlighting) * reflect static query in url * fix autocomplete handling in specs * Open all global menus on default and hide hamburger icon on global pages; Rebuild changes that have been ovrwritten after merge" * Correct highlighting of default queries after reload * Replace summary cuke with spec * WIP * Clear up selectors * Avoid actively setting promises and instead use $state.go to load links [ci skip] * Make editable title component a little simpler We can reuse the component I built for the wiki, that wasn't present in the frontend beforehand. * Fix moving through the menu and selecting items [ci skip] * Add save button to query title when query changed * Improve static names lookup by comparing query_props * Adapt and fix specs * Allow inner scrolling of wp query results Also, style the webkit scrollbar to make it pretty where supported * Allow renaming the query through setting menu, but simply focus on field [ci skip]
6 years ago
$menu-item-line-height: 30px
.main-menu
bottom: auto
@include varprop(width, main-menu-width)
@include varprop(min-width, main-menu-width)
float: left
overflow-x: hidden
left: 0
border-right-style: solid
@include varprop(border-right-width, main-menu-border-width)
@include varprop(border-right-color, header-border-bottom-color)
// min-height is full height minus header and footer.
min-height: calc(100vh - 55px)
@include varprop(background-color, main-menu-bg-color)
#menu-sidebar
height: 100%
overflow: auto
[27828] Feature: Query menu in sidenav (#6429) * in main menu add gantt as extra work package child item * Satisfy spec and code climate * Add gantt chart icon behin default gantt query name. * WIP Query menu in left sidebar * Shift query dropdown in left sidenav * Reload menu or load query on click from every project location * WIP set correct label for default queries * Query menu listens on all changes of queries (delete, create, rename, toggle starred) and updates immediatly * WIP: Inline edit, field validation * Inline Edit validation and comfirm * Inline edit: validation of duplicate name * Set default columns and sorting for static queries * Codeclimate issues fixed * WIP Inline edit validation not working perfectly in all error states * Inline edit working * Autocompleter hover disabled and hovering over categories fixed * Category hover and toggle fixed; tested in Chrome, Firefox and Opera * Placeholder cut off fixed and text wrap added * English and german wording adjusted * Styles of inline edit and menu adjusted; matching wiki page styles * prevent menus to be displayed to often * application menu only displayed on work package * specify using no_menu layout more often * adapt tests to altered production implementation * Hamburger icon only in project; on global wp page: default queries shown correctly and summary removed * searching for undefined leads to error * Accessible click fixed (listen on escape) * Gantt in top menu deleted (gantt chart is part of default queries on wp page) * load menu on wp summary page * reduce times queries are loaded * lowercase on second word * remove menu from search and home * Styles fixed (category toggle and correct highlighting) * reflect static query in url * fix autocomplete handling in specs * Open all global menus on default and hide hamburger icon on global pages; Rebuild changes that have been ovrwritten after merge" * Correct highlighting of default queries after reload * Replace summary cuke with spec * WIP * Clear up selectors * Avoid actively setting promises and instead use $state.go to load links [ci skip] * Make editable title component a little simpler We can reuse the component I built for the wiki, that wasn't present in the frontend beforehand. * Fix moving through the menu and selecting items [ci skip] * Add save button to query title when query changed * Improve static names lookup by comparing query_props * Adapt and fix specs * Allow inner scrolling of wp query results Also, style the webkit scrollbar to make it pretty where supported * Allow renaming the query through setting menu, but simply focus on field [ci skip]
6 years ago
%absolute-layout-mode &
position: relative
[27828] Feature: Query menu in sidenav (#6429) * in main menu add gantt as extra work package child item * Satisfy spec and code climate * Add gantt chart icon behin default gantt query name. * WIP Query menu in left sidebar * Shift query dropdown in left sidenav * Reload menu or load query on click from every project location * WIP set correct label for default queries * Query menu listens on all changes of queries (delete, create, rename, toggle starred) and updates immediatly * WIP: Inline edit, field validation * Inline Edit validation and comfirm * Inline edit: validation of duplicate name * Set default columns and sorting for static queries * Codeclimate issues fixed * WIP Inline edit validation not working perfectly in all error states * Inline edit working * Autocompleter hover disabled and hovering over categories fixed * Category hover and toggle fixed; tested in Chrome, Firefox and Opera * Placeholder cut off fixed and text wrap added * English and german wording adjusted * Styles of inline edit and menu adjusted; matching wiki page styles * prevent menus to be displayed to often * application menu only displayed on work package * specify using no_menu layout more often * adapt tests to altered production implementation * Hamburger icon only in project; on global wp page: default queries shown correctly and summary removed * searching for undefined leads to error * Accessible click fixed (listen on escape) * Gantt in top menu deleted (gantt chart is part of default queries on wp page) * load menu on wp summary page * reduce times queries are loaded * lowercase on second word * remove menu from search and home * Styles fixed (category toggle and correct highlighting) * reflect static query in url * fix autocomplete handling in specs * Open all global menus on default and hide hamburger icon on global pages; Rebuild changes that have been ovrwritten after merge" * Correct highlighting of default queries after reload * Replace summary cuke with spec * WIP * Clear up selectors * Avoid actively setting promises and instead use $state.go to load links [ci skip] * Make editable title component a little simpler We can reuse the component I built for the wiki, that wasn't present in the frontend beforehand. * Fix moving through the menu and selecting items [ci skip] * Add save button to query title when query changed * Improve static names lookup by comparing query_props * Adapt and fix specs * Allow inner scrolling of wp query results Also, style the webkit scrollbar to make it pretty where supported * Allow renaming the query through setting menu, but simply focus on field [ci skip]
6 years ago
// Fixed heights to allow inner scrolling
.menu_root,
.menu_root > li.open,
.main-menu--children > li.partial,
wp-query-select,
.wp-query-menu--container,
.wp-query-menu--search-container
height: 100%
.main-menu--children
height: calc(100% - (#{$main-menu-item-height} + 20px))
ul
margin: 0
padding: 0
// -------------------- ALL menu items ---------------------------
li
float: none
list-style-type: none
margin: 0
padding: 0
white-space: nowrap
position: relative
min-height: 23px
&.ng-leave
@include animation(0.5s fade-out)
[class*="-menu-item"]
display: flex
align-items: center
// -------------------- MAIN menu items ---------------------------
li a
// work around due to dom manipulation on document: ready:
// this isn't scoped to .main-item-wrapper to avoid flickering
padding-left: 11px
&.toggler
// explicitly reset to zero to avoid selector precedence problems
padding-left: 0
.main-menu--children li a
// children have no icon so we need to push them right.
padding-left: 32px
a
text-decoration: none
line-height: $main-menu-item-height
display: block
position: relative
height: $main-menu-item-height
@include varprop(color, main-menu-font-color)
font-family: $body-font-family
font-weight: normal
font-size: $main-menu-font-size
font-style: normal
7 years ago
&:hover
text-decoration: none
.toggler
width: $toggler-width
height: $main-menu-item-height
text-align: center
7 years ago
overflow: hidden
.toggle-follow
position: absolute
width: 140px
.icon-time
background: none
padding: 0
$arrow-left-width: 40px
.main-item-wrapper
display: flex
&:hover
@if $main-menu-enable-toggle-highlighting != true
// simultaneously hover all menu item anchor tags
> a
@include varprop(color, main-menu-hover-font-color)
&.toggler
@include varprop(background, main-menu-bg-hover-background)
a
&.selected, &.selected + a
@include varprop(background, main-menu-bg-selected-background)
@include varprop(color, main-menu-selected-font-color)
&:hover
@include varprop(background, main-menu-bg-hover-background)
&:hover, &:focus , &:active
@include varprop(background, main-menu-bg-hover-background)
@include varprop(color, main-menu-hover-font-color)
a:not(.toggler)
@extend .small-12
a:not(:only-child):first-of-type
flex: 0 0 calc(100% - 40px)
max-width: calc(100% - 40px)
// -------------------- CHILD menu items ---------------------------
.main-menu--children
display: none
padding-top: 10px
padding-bottom: 10px
padding: 0
width: 100%
&.unattached
border-top: 1px solid #ddd
li
&.partial
padding-bottom: 10px
// resetting styles in partials.
background: initial
&:hover,
li,
li:hover
background: initial
a
padding: initial
&:hover
@if $main-menu-enable-toggle-highlighting != true
// simultaneously hover all menu item anchor tags
> a
@include varprop(color, main-menu-bg-hover-background)
> a
&.selected, &.selected
@include varprop(background, main-menu-bg-selected-background)
@include varprop(color, main-menu-selected-font-color)
&:hover, &:focus , &:active
@include varprop(color, main-menu-hover-font-color)
@include varprop(background, main-menu-child-bg-hover-color)
.main-menu--children-menu-header
padding: 10px 10px 0 10px
height: calc(#{$main-menu-item-height} + 10px)
.main-menu--arrow-left-to-project
display: inline-block
width: $arrow-left-width
float: left
border-radius: 3px
padding-left: 14px
padding-right: 14px
width: 40px
&:hover, &:focus, &:active
@include varprop(background, main-menu-bg-hover-background)
@include varprop(color, main-menu-hover-font-color)
a.main-menu--parent-node
display: inline-block
padding: 0px 11px 0 11px
font-size: $main-menu-font-size
font-weight: 700
width: calc(100% - #{$arrow-left-width})
height: $main-menu-item-height
line-height: $main-menu-item-height
border-radius: 3px
@include varprop(color, main-menu-font-color)
&:hover, &:focus, &:active
@include varprop(background, main-menu-bg-hover-background)
@include varprop(color, main-menu-hover-font-color)
// logic for showing either parent or child menu
7 years ago
.main-menu
ul.menu_root
&.closed
li
display: none
> li.open
display: list-item
.main-item-wrapper
display: none
.main-menu--children
display: block
li
display: list-item
&.open
> li
display: list-item
.main-menu--children-menu-header
display: none
.hidden-navigation
7 years ago
.main-menu
width: $main-menu-folded-width
min-width: $main-menu-folded-width
ul
&.menu_root
> li
.main-item-wrapper
7 years ago
a:not(:only-child)
@extend .small-12
.ellipsis
text-overflow: clip
-o-text-overflow: clip
-ms-text-overflow: clip
.toggler
display: none
#sidebar,
.main-menu--children
display: none
#sidebar
margin: 30px 0 0 0
padding: 0 17px 0 17px
width: auto
@include varprop(color, main-menu-sidebar-font-color)
font-family: $body-font-family
font-style: normal
h3
display: block
border: none
@include varprop(color, main-menu-sidebar-h3-color)
font-weight: normal
font-size: $main-menu-sidebar-h3-font-size
margin: 30px 0 8px 0
padding: 10px 0 0 0
text-transform: uppercase
> h3:first-child
margin-top: 0
a, a:link
@include varprop(color, main-menu-sidebar-link-color)
display: inline
position: static
text-decoration: underline
a:hover
text-decoration: underline
label
@include varprop(color, main-menu-sidebar-font-color)
@include text-shortener
max-width: 80%
vertical-align: top
ul
border: none
overflow-x: hidden
li
border: none
li a
padding: 0
&.-hidden
display: none
[27828] Feature: Query menu in sidenav (#6429) * in main menu add gantt as extra work package child item * Satisfy spec and code climate * Add gantt chart icon behin default gantt query name. * WIP Query menu in left sidebar * Shift query dropdown in left sidenav * Reload menu or load query on click from every project location * WIP set correct label for default queries * Query menu listens on all changes of queries (delete, create, rename, toggle starred) and updates immediatly * WIP: Inline edit, field validation * Inline Edit validation and comfirm * Inline edit: validation of duplicate name * Set default columns and sorting for static queries * Codeclimate issues fixed * WIP Inline edit validation not working perfectly in all error states * Inline edit working * Autocompleter hover disabled and hovering over categories fixed * Category hover and toggle fixed; tested in Chrome, Firefox and Opera * Placeholder cut off fixed and text wrap added * English and german wording adjusted * Styles of inline edit and menu adjusted; matching wiki page styles * prevent menus to be displayed to often * application menu only displayed on work package * specify using no_menu layout more often * adapt tests to altered production implementation * Hamburger icon only in project; on global wp page: default queries shown correctly and summary removed * searching for undefined leads to error * Accessible click fixed (listen on escape) * Gantt in top menu deleted (gantt chart is part of default queries on wp page) * load menu on wp summary page * reduce times queries are loaded * lowercase on second word * remove menu from search and home * Styles fixed (category toggle and correct highlighting) * reflect static query in url * fix autocomplete handling in specs * Open all global menus on default and hide hamburger icon on global pages; Rebuild changes that have been ovrwritten after merge" * Correct highlighting of default queries after reload * Replace summary cuke with spec * WIP * Clear up selectors * Avoid actively setting promises and instead use $state.go to load links [ci skip] * Make editable title component a little simpler We can reuse the component I built for the wiki, that wasn't present in the frontend beforehand. * Fix moving through the menu and selecting items [ci skip] * Add save button to query title when query changed * Improve static names lookup by comparing query_props * Adapt and fix specs * Allow inner scrolling of wp query results Also, style the webkit scrollbar to make it pretty where supported * Allow renaming the query through setting menu, but simply focus on field [ci skip]
6 years ago
%absolute-layout-mode &
display: none
.menu-wiki-pages-tree
border-top: $main-menu-border-width solid $main-menu-border-color
padding-top: 7px
padding-left: 7px
padding-right: 7px
.main-menu--segment-header
@include varprop(color, content-icon-link-pressed-color)
text-transform: uppercase
padding-left: $hierarchy-span-width
font-size: 0.7rem
7 years ago
.main-menu--resizer
background: none
height: 100vh
width: 18px
position: fixed
top: 0px
border-left-width: 2px
border-left-style: solid
border-left-color: transparent
left: calc(#{$main-menu-width} - 2px)
left: calc(var(--main-menu-width) - 2px)
vertical-align: middle
z-index: 1
cursor: col-resize
%absolute-layout-mode &
z-index: 100
&:hover
7 years ago
@include varprop(border-left-color, main-menu-resizer-color)
.main-menu--navigation-toggler
opacity: 1
i:before
@include varprop(color, main-menu-navigation-toggler-font-hover-color)
&.show
7 years ago
left: $main-menu-folded-width
.main-menu--navigation-toggler
.hidden-navigation &
text-align: right
opacity: 0
cursor: col-resize
&:hover
@include varprop(color, main-menu-navigation-toggler-font-hover-color)
i:before
@include icon-mixin-arrow-right2
7 years ago
i:before
@include icon-mixin-arrow-right2
position: absolute
top: 0
height: 40px
text-align: left
7 years ago
margin-top: 50vh
margin-left: -14px
padding: 0
7 years ago
// Center toggle icon vertically. The element is higher than it looks like.
line-height: 38px
i
display: inline-block
width: 30px
cursor: pointer
line-height: 40px
&:before
color: $light-gray
padding-right: 0
padding-left: 2px
7 years ago
&:hover
@include varprop(color, main-menu-navigation-toggler-font-hover-color)
font-size: 11px
i:before
padding-left: 0
@include icon-mixin-arrow-left2
7 years ago
%absolute-layout-mode &
z-index: 100