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 Jun 4, 2014
1 parent 2842248 commit 2f1bf3f
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 4 deletions.
68 changes: 66 additions & 2 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 @@ -78,6 +78,7 @@ <h3 class="panel-title pull-left">Details</h3>
Site: {{annotation.siteName}}
</a>
<a data-ng-href="{{annotation.urls.user}}" target="_self" class="list-group-item" title="User.">

<span class="glyphicon glyphicon-user"></span>&nbsp;
{{annotation.ownerName }}
</a>
Expand All @@ -97,7 +98,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
14 changes: 12 additions & 2 deletions src/app/annotationLibrary/annotationLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,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 @@ -340,4 +346,8 @@ angular.module('bawApp.annotationLibrary', ['bawApp.configuration'])
return $url.formatUri(paths.api.links.projectAbsolute, {projectId: projectId});
};

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

}]);

0 comments on commit 2f1bf3f

Please sign in to comment.