discourse/app/assets/javascripts/admin/templates/flags.js.handlebars

161 lines
6.2 KiB
Handlebars
Raw Normal View History

2013-02-05 14:16:51 -05:00
<div class='admin-controls'>
<div class='span15'>
<ul class="nav nav-pills">
2013-09-16 14:08:55 -04:00
<li>{{#link-to 'adminFlags.active'}}{{i18n admin.flags.active}}{{/link-to}}</li>
<li>{{#link-to 'adminFlags.old'}}{{i18n admin.flags.old}}{{/link-to}}</li>
2013-02-05 14:16:51 -05:00
</ul>
</div>
2013-02-05 14:16:51 -05:00
</div>
<div class="admin-container">
{{#if model.loading}}
<div class='admin-loading'>{{i18n loading}}</div>
{{else}}
{{#if model.length}}
<table class='admin-flags'>
<thead>
<tr>
<th class='user'></th>
<th class='excerpt'></th>
<th class='flaggers'>{{i18n admin.flags.flagged_by}}</th>
<th class='flaggers'>{{#if adminOldFlagsView}}{{i18n admin.flags.resolved_by}}{{/if}}</th>
<th class='last-flagged'></th>
<th class='action'></th>
</tr>
</thead>
<tbody>
{{#each flaggedPost in content}}
<tr {{bind-attr class="flaggedPost.extraClasses"}}>
2014-02-05 17:54:16 -05:00
<td class='user'>
{{#if flaggedPost.postAuthorFlagged}}
{{#if flaggedPost.user}}
{{#link-to 'adminUser' flaggedPost.user}}{{avatar flaggedPost.user imageSize="small"}}{{/link-to}}
{{/if}}
{{/if}}
</td>
2013-06-21 03:12:17 -04:00
2014-02-05 17:54:16 -05:00
<td class='excerpt'>
{{#if flaggedPost.topicHidden}}<i title='{{i18n topic_statuses.invisible.help}}' class='fa fa-eye-slash'></i> {{/if}}<h3><a href='{{unbound flaggedPost.url}}'>{{flaggedPost.title}}</a></h3>
<br>
{{#if flaggedPost.postAuthorFlagged}}
{{{flaggedPost.excerpt}}}
{{/if}}
</td>
<td class='flaggers'>
<table>
<tbody>
{{#each flaggedPost.flaggers}}
<tr>
<td>
{{#link-to 'adminUser' this.user}}{{avatar this.user imageSize="small"}} {{/link-to}}
</td>
<td>
{{date this.flaggedAt}}
</td>
<td>
{{this.flagType}}
</td>
</tr>
{{/each}}
</tbody>
</table>
</td>
2013-06-21 03:12:17 -04:00
<td class='flaggers result'>
<table>
<tbody>
{{#each flaggedPost.flaggers}}
<tr>
{{#if deletedBy}}
<td>
{{#link-to 'adminUser' this.deletedBy}}{{avatar this.deletedBy imageSize="small"}} {{/link-to}}
</td>
<td>
{{#if this.tookAction}}
<i class='fa fa-gavel'></i>
{{/if}}
</td>
<td>
{{date this.deletedAt}}
</td>
{{/if}}
</tr>
{{/each}}
</tbody>
</table>
</td>
</tr>
2013-06-21 03:12:17 -04:00
2014-02-05 17:54:16 -05:00
{{#if flaggedPost.topicFlagged}}
<tr>
<td></td>
<td class='message'><div>{{{i18n admin.flags.topic_flagged}}}</div></td>
<td></td>
<td></td>
</tr>
{{/if}}
{{#each flaggedPost.messages}}
<tr>
<td></td>
<td class='message'>
<div>
{{#unless bySystemUser}}
{{#link-to 'adminUser' user}}{{avatar user imageSize="small"}}{{/link-to}}
{{message}}
2013-12-09 16:27:49 -05:00
<a href="{{unbound permalink}}"><button class='btn'><i class="fa fa-reply"></i> {{i18n admin.flags.view_message}}</button></a>
{{else}}
<b>{{i18n admin.flags.system}}</b>:
{{message}}
{{/unless}}
</div>
</td>
<td></td>
<td></td>
</tr>
{{/each}}
2013-06-21 03:12:17 -04:00
<tr>
<td colspan="4" class="action">
{{#if adminActiveFlagsView}}
2014-02-05 17:54:16 -05:00
{{#if flaggedPost.topicFlagged}}
<a href='{{unbound flaggedPost.url}}' class="btn">{{i18n admin.flags.visit_topic}}</a>
{{/if}}
2014-02-05 17:54:16 -05:00
{{#if flaggedPost.postAuthorFlagged}}
{{#if flaggedPost.postHidden}}
<button title='{{i18n admin.flags.disagree_unhide_title}}' class='btn' {{action disagreeFlags flaggedPost}}><i class="fa fa-thumbs-o-down"></i> {{i18n admin.flags.disagree_unhide}}</button>
<button title='{{i18n admin.flags.defer_title}}' class='btn' {{action deferFlags flaggedPost}}><i class="fa fa-external-link"></i> {{i18n admin.flags.defer}}</button>
{{else}}
<button title='{{i18n admin.flags.agree_hide_title}}' class='btn' {{action agreeFlags flaggedPost}}><i class="fa fa-thumbs-o-up"></i> {{i18n admin.flags.agree_hide}}</button>
<button title='{{i18n admin.flags.disagree_title}}' class='btn' {{action disagreeFlags flaggedPost}}><i class="fa fa-thumbs-o-down"></i> {{i18n admin.flags.disagree}}</button>
{{/if}}
2013-06-21 03:29:54 -04:00
2014-02-05 17:54:16 -05:00
{{#if flaggedPost.canDeleteAsSpammer}}
<button title='{{i18n admin.flags.delete_spammer_title}}' class="btn" {{action deleteSpammer flaggedPost}}><i class="fa fa-exclamation-triangle"></i> {{i18n flagging.delete_spammer}}</button>
{{/if}}
<button title='{{i18n admin.flags.delete_post_title}}' class='btn' {{action deletePost flaggedPost}}><i class="fa fa-trash-o"></i> {{i18n admin.flags.delete_post}}</button>
{{else}}
<button title='{{i18n admin.flags.clear_topic_flags_title}}' class='btn' {{action doneTopicFlags flaggedPost}}>{{i18n admin.flags.clear_topic_flags}}</button>
{{/if}}
{{/if}}
</td>
</tr>
{{/each}}
</tbody>
</table>
{{#if view.loading}}
<div class='admin-loading'>{{i18n loading}}</div>
{{/if}}
{{else}}
<p>{{i18n admin.flags.no_results}}</p>
{{/if}}
{{/if}}
</div>