Skip to content

Commit

Permalink
Fixed project and site links. Fixes #88
Browse files Browse the repository at this point in the history
  • Loading branch information
atruskie committed Feb 6, 2014
1 parent 013293a commit 73a3496
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
8 changes: 0 additions & 8 deletions src/app/listen/_listen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@
padding: 5px;
}

.project-names > span:not(:last-child) {
word-spacing: -0.3em;

& * {
word-spacing: normal;
}
}

#chunkInfo {

// reset h1 style for page
Expand Down
4 changes: 3 additions & 1 deletion src/app/listen/listen.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ angular.module('bawApp.listen', ['decipher.tags', 'ui.bootstrap.typeahead'])
// get site
Site.get({siteId: result.audioRecording.siteId}, {}, function getSiteSuccess(value) {

value.link = paths.api.routes.siteAbsolute.format({"siteId": value.id});
value.links = value.projectIds.map(function(id) {
return paths.api.routes.site.nestedAbsolute.format({"siteId": value.id, "projectId": id});
});

$scope.model.site = value;
result.site = value;
Expand Down
11 changes: 7 additions & 4 deletions src/app/listen/listen.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ <h1 id="chunkInfo" class="row">

<span ng-repeat="p in model.projects" ng-switch="p.permissions == 'access denied'">
<!--{{ $first && "" || ", "}}-->
<a ng-switch-when="false" ng-href="{{p.link}}">{{p.name}}</a>
<a ng-switch-when="false" ng-href="{{p.link}}" target="_self">{{p.name}}</a>
<!--<a ng-switch-when="true" class="noPermissions hint--warning hint--bottom hint--rounded"-->
<!--data-hint="You have no read access to this project, no information retrieved" ng-href="{{p.link}}">{{p.id}}</a>-->

&nbsp;&#47;&nbsp;
<a ng-switch-when="false" ng-href="{{ model.site.links[$index]}}" target="_self">{{model.site.name}}</a>

</span>
</span>
&nbsp;&#47;&nbsp;
<a ng-href="{{ model.site.link}}">{{model.site.name}}</a>
&nbsp;&#47;&nbsp;

<!--&nbsp;&#47;&nbsp;-->
<span class="hint absolute-time hint--top">{{absoluteDateChunkStart() | moment:"format":"dddd, MMMM Do YYYY, HH:mm:ss ZZ"}}</span>
</span>

Expand Down
5 changes: 4 additions & 1 deletion src/baw.configuration.tpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ angular.module('bawApp.configuration', ['url'])
root: "<%= current.apiRoot %>",
routes: {
project: "/projects/{projectId}",
site: "/sites/{siteId}",
site: {
flattened: "/sites/{siteId}",
nested: "/projects/{projectId}/sites/{siteId}"
},
audioRecording: {
listShort: "/audio_recordings/{recordingId}",
show: "/audio_recordings/{recordingId}",
Expand Down
2 changes: 1 addition & 1 deletion src/components/services/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}]);

bawss.factory('Site', [ '$resource', 'conf.paths', function ($resource, paths) {
return resourcePut($resource, uriConvert(paths.api.routes.siteAbsolute), {projectId: "@projectId", siteId: "@siteId"});
return resourcePut($resource, uriConvert(paths.api.routes.site.flattenedAbsolute), { siteId: "@siteId"});
}]);

// NOTE: deleted photo resource, API for photos no longer exposed
Expand Down

0 comments on commit 73a3496

Please sign in to comment.