Work package breadcrumb navigation

https://community.openproject.com/wp/25622

- adds breadcrumbs of ancestors to wp full screen view
- only visible if current work package has ancestors.
pull/5947/head
Wieland Lindenthal 7 years ago
parent 359c95d09b
commit fb05927a83
  1. 43
      app/assets/stylesheets/layout/_breadcrumb.sass
  2. 5
      frontend/app/components/routing/wp-details/wp.list.details.html
  3. 3
      frontend/app/components/routing/wp-show/wp.show.html
  4. 11
      frontend/app/components/work-packages/wp-breadcrumb/wp-breadcrumb.directive.html
  5. 39
      frontend/app/components/work-packages/wp-breadcrumb/wp-breadcrumb.directive.ts

@ -29,7 +29,8 @@
%breadcrumb--default-font
@include default-font($breadcrumb-font-color, $breadcrumb-font-size, bold)
#breadcrumb
#breadcrumb,
.wp-breadcrumb
display: none
@include default-transition
height: $breadcrumb-height
@ -71,20 +72,34 @@ ul.breadcrumb
height: $breadcrumb-height
line-height: $breadcrumb-height
#breadcrumb ul.breadcrumb li.first-breadcrumb-element
margin-left: 0
height: $breadcrumb-height
line-height: $breadcrumb-height
a
text-decoration: none
display: block
width: 25px
font-size: 12px
#breadcrumb,
.wp-breadcrumb
ul.breadcrumb li.first-breadcrumb-element
margin-left: 0
height: $breadcrumb-height
line-height: $breadcrumb-height
a
text-decoration: none
display: block
width: 25px
font-size: 12px
#breadcrumb ul.breadcrumb li
float: left
margin: 0 0 0 10px
padding: 0
#breadcrumb,
.wp-breadcrumb
ul.breadcrumb li
float: left
margin: 0 0 0 10px
padding: 0
.wp-breadcrumb
ul.breadcrumb
li:first-child
margin-left: 0
// This is ugly. However, this way we do not need to touch complicated
// toolbar-container positioning.
body.action-show .wp-breadcrumb
margin-bottom: -19px
// Hide projects in normal mode
body:not(.accessibility-mode) .breadcrumb .breadcrumb-project-element

@ -42,9 +42,10 @@
</ul>
</div>
<div class="work-packages--details-content">
<span class="hidden-for-sighted" tabindex="-1" focus="$ctrl.shouldFocus" ng-bind="$ctrl.focusAnchorLabel">
</span>
<span class="hidden-for-sighted" tabindex="-1" focus="$ctrl.shouldFocus" ng-bind="$ctrl.focusAnchorLabel">
</span>
<wp-breadcrumb work-package="$ctrl.workPackage"></wp-breadcrumb>
<wp-edit-field-group work-package="$ctrl.workPackage">
<wp-subject></wp-subject>

@ -1,6 +1,9 @@
<div wp-edit-field-group work-package="$ctrl.workPackage"
class="work-packages--show-view"
ng-if="$ctrl.workPackage">
<wp-breadcrumb work-package="$ctrl.workPackage"></wp-breadcrumb>
<div class="toolbar-container">
<div id="toolbar">
<div class="wp-show--header-container">

@ -0,0 +1,11 @@
<div class="wp-breadcrumb -show">
<ul class="breadcrumb"
ng-if="workPackage.ancestors.length > 0">
<li ng-repeat="ancestor in workPackage.ancestors" class="icon-context icon-small icon-arrow-right5">
<a title="{{ancestor.name}}"
class="breadcrumb-project-title nocut"
ui-sref="work-packages.show.activity({workPackageId: ancestor.id})"
ng-bind="ancestor.name"></a>
</li>
</ul>
</div>

@ -0,0 +1,39 @@
// -- copyright
// OpenProject is a project management system.
// Copyright (C) 2012-2015 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-2013 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 doc/COPYRIGHT.rdoc for more details.
// ++
import {openprojectModule} from "../../../angular-modules";
function wpBreadcrumb() {
return {
restrict: 'EA',
scope: {workPackage: '=workPackage'},
templateUrl: '/components/work-packages/wp-breadcrumb/wp-breadcrumb.directive.html'
};
}
openprojectModule.directive('wpBreadcrumb', wpBreadcrumb);
Loading…
Cancel
Save