Vulcan/client/views/comments/comment_item.html
Charlie DeTar ed09d0ea7c Fully abstract isAdmin
We're using a fork with a different definition of "isAdmin" (using
``meteor-roles`` rather than the boolean user.isAdmin).  ``lib/user.js``
provides abstracted methods for reading admin state, which makes it very
easy to change our definition -- except that the abstractions weren't
used universally.

This commit finishes the job of using the abstractions, and adds a few
new parts to also allow abstracting setting and updating admin-ness:

 - setAdmin: sets admin status directly on a user object.
 - updateAdmin: executes a mongo update to set admin status.
 - adminMongoQuery: the query parameter for admin-ness, for composing
   user queries with other fields.
 - notAdminMongoQuery: the query parameter for not-admin-ness.
2014-10-03 16:21:06 -06:00

50 lines
1.9 KiB
HTML

<template name="comment_item">
<li class="comment module comment-displayed" id="{{_id}}">
<div class="comment-body">
{{#if isDeleted}}
<div class="comment-deleted">This comment has been deleted.</div>
{{else}}
<div class="comment-content">
<div class="comment-actions {{#if upvoted}}upvoted{{else}}not-upvoted{{/if}} {{#if downvoted}}downvoted{{else}}not-downvoted{{/if}}">
<a class="upvote" href="#">
<i class="icon-up"></i>
<span>{{i18n "upvote"}}</span>
</a>
<a class="downvote" href="#">
<i class="icon-down"></i>
<span>{{i18n "downvote"}}</span>
</a>
</div>
<div class="user-avatar">{{>avatar userId=userId class=""}}</div>
<div class="comment-main">
<div class="comment-meta">
<a class="comment-username" href="{{profileUrl}}">{{authorName}}</a>
<span class="comment-time">{{ago}},</span>
<span class="points">{{upvotes}}</span> <span class="unit">points </span>
<a href="/comments/{{_id}}" class="comment-permalink icon-link goto-comment">{{i18n "link"}}</a>
{{#if can_edit}}
| <a class="edit-link" href="/comments/{{_id}}/edit">{{i18n "Edit"}}</a>
{{/if}}
{{#if isAdmin}}
| <span>{{full_date}}</span>
{{/if}}
</div>
<div class="comment-text markdown">{{{htmlBody}}}</div>
{{#if getSetting "nestedComments" true}}
<a href="/comments/{{_id}}" class="comment-reply goto-comment">{{i18n "Reply"}}</a>
{{/if}}
</div>
</div>
{{/if}}
{{#if showChildComments}}
<ul class="comment-children comment-list">
{{#each child_comments}}
{{#with this}}
{{> UI.dynamic template=comment_item}}
{{/with}}
{{/each}}
</ul>
{{/if}}
</div>
</li>
</template>