Skip to content

Commit

Permalink
added template for annnotation comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark committed May 12, 2014
1 parent 85d1dee commit cf44b4c
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 7 deletions.
76 changes: 72 additions & 4 deletions src/app/annotationLibrary/annotationItem.tpl.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="content" data-ng-controller="AnnotationItemCtrl">
<div id="content">
<h3>Annotation {{model.audioEventId}}</h3>

<div class="row">
Expand Down Expand Up @@ -69,14 +69,19 @@ <h3 class="panel-title pull-left">Details</h3>
{{annotation.annotationDurationRounded}} seconds duration
</a>
<a data-ng-repeat="project in annotation.projects"
data-ng-href="{{$parent.createProjectUrl(project.id)}}" class="list-group-item" title="Project name.">
data-ng-href="{{$parent.createProjectUrl(project.id)}}" class="list-group-item"
title="Project name.">
<span class="glyphicon glyphicon-home"></span>&nbsp;
Project: {{project.name}}
</a>
<a data-ng-href="{{annotation.urls.site}}" class="list-group-item" title="Site name.">
<span class="glyphicon glyphicon-map-marker"></span>&nbsp;
<span class="glyphicon glyphicon-music"></span>&nbsp;
Site: {{annotation.siteName}}
</a>
<a data-ng-href="{{annotation.urls.audioRecording}}" class="list-group-item" title="Site name.">
<span class="glyphicon glyphicon-map-marker"></span>&nbsp;
Audio recording: {{annotation.audioRecordingId}}
</a>
<a data-ng-href="{{annotation.urls.user}}" class="list-group-item" title="User.">
<span class="glyphicon glyphicon-user"></span>&nbsp;
{{annotation.ownerName }}
Expand All @@ -97,7 +102,70 @@ <h3 class="panel-title pull-left"><span class="glyphicon glyphicon-comment"></sp
</h3>
</div>
<div class="panel-body">
<em>Coming soon...</em>
<ul class="media-list">
<li class="media">
<a class="pull-left" href="#">
<img class="media-object" src="" alt="">
</a>

<div class="media-body">
<p class="pull-right">
<a href="#">link</a> | <a href="#">report</a>
</p>
<h4 class="media-heading">
UserName
<small title="absolute timestamp">time ago in words</small>
</h4>
<p>
Comment body
</p>
</div>
</li>
<li class="media">
<a class="pull-left" href="#">
<img class="media-object" src="" alt="">
</a>

<div class="media-body">
<p class="pull-right">
<a href="#">link</a> | <a href="#">report</a>
</p>
<h4 class="media-heading">
UserName
<small title="absolute timestamp">time ago in words</small>
</h4>
<p>
Comment body
</p>
</div>
</li>
</ul>
<ul class="media-list">
<li class="media">
<a class="pull-left" href="#">
<img class="media-object" src="" alt="">
</a>

<div class="media-body">
<h4 class="media-heading">
{{profile.userName}}
<small title="now">now</small>
</h4>

<form role="form">
<div class="form-group">
<textarea class="form-control"
placeholder="Add a comment / Continue the discussion"
style="width:90%" id="addAnnotationComment"></textarea>
</div>
<button type="submit" class="btn btn-default">Post</button>
</form>

</div>
</li>
</ul>


</div>
</div>
</div>
Expand Down
17 changes: 14 additions & 3 deletions src/app/annotationLibrary/annotationLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ baw.annotationLibrary.addCalculatedProperties = function addCalculatedProperties
'&end=' + audioEvent.calcOffsetEnd,
listenWithoutPadding: '/listen/' + audioEvent.audioRecordingId +
'?start=' + audioEvent.startTimeSeconds +
'&end=' + audioEvent.endTimeSeconds
'&end=' + audioEvent.endTimeSeconds,
audioRecording: '/library?' + $url.toKeyValue({audioRecordingId: audioEvent.audioRecordingId}, true),
};

return audioEvent;
Expand Down Expand Up @@ -269,8 +270,14 @@ angular.module('bawApp.annotationLibrary', ['bawApp.configuration'])
.controller('AnnotationItemCtrl',
['$scope', '$location', '$resource', '$routeParams', '$url',
'conf.paths', 'conf.constants', 'bawApp.unitConverter',
'AudioEvent', 'Tag', 'Media',
function ($scope, $location, $resource, $routeParams, $url, paths, constants, unitConverter, AudioEvent, Tag, Media) {
'AudioEvent', 'Tag', 'Media', 'UserProfile',
function ($scope, $location, $resource, $routeParams, $url,
paths, constants, unitConverter, AudioEvent, Tag, Media, UserProfile) {

$scope.$on(UserProfile.eventKeys.loaded, profileLoaded);
if (UserProfile.profile && UserProfile.profile.preferences) {
profileLoaded(null, UserProfile);
}

var parameters = {
audioEventId: $routeParams.audioEventId,
Expand Down Expand Up @@ -311,4 +318,8 @@ angular.module('bawApp.annotationLibrary', ['bawApp.configuration'])
return '/projects/' + projectId;
};

function profileLoaded(event, userProfile){
$scope.profile = userProfile.profile;
}

}]);

0 comments on commit cf44b4c

Please sign in to comment.