mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-02-12 01:17:04 +01:00
Adds an additional check for the existence of a populated user reference, when determining if the current user has immediate access to the requested article. Without this fix, the server will throw an error if the requested article doesn't have a populated user field. Modified the article & articles list view's to check if the article has a populated user. If not, then it will display "Deleted User" in place of the missing user reference. Added a server-side test that ensures we can get a single article if the article.user field is referencing a deleted user. Fixes #1082
22 lines
905 B
HTML
22 lines
905 B
HTML
<section ng-controller="ArticlesController" ng-init="find()">
|
|
<div class="page-header">
|
|
<h1>Articles</h1>
|
|
</div>
|
|
<div class="list-group">
|
|
<a ng-repeat="article in articles" ui-sref="articles.view({articleId: article._id})" class="list-group-item">
|
|
<small class="list-group-item-text">
|
|
Posted on
|
|
<span ng-bind="article.created | date:'mediumDate'"></span>
|
|
by
|
|
<span ng-if="article.user" ng-bind="article.user.displayName"></span>
|
|
<span ng-if="!article.user">Deleted User</span>
|
|
</small>
|
|
<h4 class="list-group-item-heading" ng-bind="article.title"></h4>
|
|
<p class="list-group-item-text" ng-bind="article.content"></p>
|
|
</a>
|
|
</div>
|
|
<div class="alert alert-warning text-center" ng-if="articles.$resolved && !articles.length">
|
|
No articles yet, why don't you <a ui-sref="articles.create">create one</a>?
|
|
</div>
|
|
</section>
|