mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-19 13:52:23 +01:00
Adds a custom field named `isCurrentUserOwner` to the Article document before it's returned to the client. This field is used to determine if the current User should is the "owner", and should see the edit/delete controls on the client-side when viewing a single article. This custom (ad-hoc) field is NOT persisted to the database; it's merely attached to the document. Added server-side route tests for verifying the ad-hoc "isCurrentUserOwner" field is properly set on the a single Article document. Fixes #1146
24 lines
774 B
HTML
24 lines
774 B
HTML
<section>
|
|
<div class="page-header">
|
|
<h1 ng-bind="vm.article.title"></h1>
|
|
</div>
|
|
<div class="pull-right" ng-show="vm.article.isCurrentUserOwner">
|
|
<a class="btn btn-primary" ui-sref="articles.edit({ articleId: vm.article._id })">
|
|
<i class="glyphicon glyphicon-edit"></i>
|
|
</a>
|
|
<a class="btn btn-primary" ng-click="vm.remove()">
|
|
<i class="glyphicon glyphicon-trash"></i>
|
|
</a>
|
|
</div>
|
|
<small>
|
|
<em class="text-muted">
|
|
Posted on
|
|
<span ng-bind="vm.article.created | date:'mediumDate'"></span>
|
|
by
|
|
<span ng-if="vm.article.user" ng-bind="vm.article.user.displayName"></span>
|
|
<span ng-if="!vm.article.user">Deleted User</span>
|
|
</em>
|
|
</small>
|
|
<p class="lead" ng-bind="vm.article.content"></p>
|
|
</section>
|