Skip to content

Commit

Permalink
fix(navigation): Synchronize changes from server views
Browse files Browse the repository at this point in the history
baw-server updated it's navigation to the new design style but also
overtook where we left the client. These changes bring both designs to
parity.

See QutEcoacoustics/baw-server#313

Addresses #260
  • Loading branch information
atruskie committed Feb 10, 2017
1 parent e25f96e commit 6e3750e
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 20 deletions.
17 changes: 9 additions & 8 deletions src/app/navigation/_navigation.scss
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
left-nav-bar, right-nav-bar {
ul.nav-pills > li {
& > a, & > button {
padding: 5px 10px;
padding: 5px (1em/4); // approximately 1 standard space's width
text-align: left;
}
}
}

right-nav-bar {
a>.fa, a>.glyphicon {
a .fa, a>.glyphicon {
color: $text-color;
}
}

left-nav-bar {
.tooltip-wide {
width: 200px;
}

@for $i from 0 through 4 {
.indentation-#{$i} {
$step: ($i * 10%);
width: 100% - $step;
margin-left: $step !important;
font-size: 100% - ($step / 2);
width: calc(100% - #{1em * $i});
margin-left: (1em * $i) !important;
font-size: 100% - ($i * 3%);
}
}
}
11 changes: 6 additions & 5 deletions src/app/navigation/leftNavBar.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ <h6>
</h6>
<ul class="nav nav-pills nav-stacked">
<li ng-repeat="link in $ctrl.links"
ng-class="['indentation-' + link.indentation || 0, { active: link.isActive}]">
ng-class="['indentation-' + (link.indentation || 0), { active: link.isActive}]">
<a title="{{ link.title }}"
data-toggle="tooltip"
data-placement="right"
tabindex="{{$index}}"
tooltip-placement="right"
tooltip-class="tooltip-wide"
ng-href="{{ link.href }}"
target="{{ link.target}}"
data-original-title="{{ link.title }}">
<i class="fa fa-fw default-color" ng-class="'fa-' + link.icon"></i>
uib-tooltip="{{ link.title }}">
<i class="fa fa-fw" ng-class="'fa-' + link.icon"></i>
{{ link.title }}
</a>
<ribbon ng-if="link.ribbon" type="{{ link.ribbon }}"/>
Expand Down
22 changes: 17 additions & 5 deletions src/app/navigation/menuDefinition.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,75 +7,87 @@ angular
{
title: "Home",
href: paths.api.links.homeAbsolute,
tooltip: "Home page",
icon: "home",
target: "_self"
},
{
title: "Log in",
href: paths.api.links.loginActualAbsolute,
tooltip: "Log into the website",
icon: "sign-in",
condition: user => user === null,
predicate: user => user === null,
target: "_self"
},
{
title: "My Profile",
href: paths.api.links.myAccountAbsolute,
tooltip: "View my profile",
icon: "user",
condition: user => user !== null,
predicate: user => user !== null,
target: "_self"
},
{
title: "Register",
href: paths.api.links.registerAbsolute,
tooltip: "Create an account",
icon: "user-plus",
condition: user => user === null,
predicate: user => user === null,
target: "_self"
},
{
title: "My Annotations",
href: user => user.annotationUrl,
icon: "square-o",
condition: user => user !== null,
tooltip: "View my recent annotations",
icon: "baw-annotation",
predicate: user => user !== null,
target: "_self"
},
{
title: "Projects",
href: paths.api.links.projectsAbsolute,
tooltip: "View projects I have access to",
icon: "globe",
target: "_self"
},
{
title: "Audio Analysis",
href: paths.site.ngRoutes.analysisJobs.list,
tooltip: "View audio analysis jobs",
icon: "server",
ribbon: "beta"
},
{
title: "Library",
href: paths.site.ngRoutes.library,
tooltip: "Annotation library",
icon: "book"
},
{
title: "Data Request",
href: paths.api.links.dataRequestAbsolute,
tooltip: "Request customized data from the website",
icon: "table",
target: "_self"
},
{
title: "Send Audio",
href: paths.api.links.dataUploadAbsolute,
tooltip: "Send us audio recordings to upload",
icon: "envelope",
target: "_self"
},
{
title: "Report Problem",
href: paths.api.links.bugReportAbsolute,
tooltip: "Report a problem with the website",
icon: "bug",
target: "_self"
},
{
title: "Website Statistics",
href: paths.api.links.websiteStatusAbsolute,
tooltip: "Annotation and audio recording stats",
icon: "line-chart",
target: "_self"
},
Expand Down
3 changes: 2 additions & 1 deletion src/app/navigation/rightNavBar.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ <h4>

<hr/>

<ul class="nav nav-pills nav-stacked" layout render-for="action-items" capability-model="$ctrl.activeResource">
<ul class="nav nav-pills nav-stacked" layout render-for="action-items"
capability-model="$ctrl.activeResource">
</ul>

<br>
Expand Down
2 changes: 1 addition & 1 deletion src/app/navigation/secondaryNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ angular
// allows for dynamic filtering or generation of links
let transformLinks = function(links) {
return links
.filter((link) => !link.condition || link.condition.call(link, userModel, controller.activeResource))
.filter((link) => !link.predicate || link.predicate.call(link, userModel, controller.activeResource))
.map(link => {
// copy object so we don't overwrite original values by reference permanently
let newLink = Object.assign({}, link);
Expand Down

0 comments on commit 6e3750e

Please sign in to comment.