hummingbird-me/kitsu-web

View on GitHub
app/templates/components/admin/report-item.hbs

Summary

Maintainability
Test Coverage
<td>
  <a href={{href-to "users.index" report.user}}>{{report.user.name}}</a>
</td>
<td>
  <a href={{href-to (concat report.naughty.modelType "s") report.naughty.id}}>{{capitalize report.naughty.modelType}}</a>
</td>
<td>{{report.reason}}</td>
<td>{{or report.explanation (t "components.admin.reports.no-explanation")}}</td>
<td>{{or report.moderator.name (t "components.admin.reports.not-set")}}</td>
<td>{{report.status}}</td>
<td class="text-xs-center">
  {{#bootstrap/bs-dropdown as |dropdown|}}
    {{#dropdown.button class="btn-primary" type="btn-sm"}}
      {{t "components.admin.reports.actions.button"}}
    {{/dropdown.button}}
    {{#dropdown.menu}}
      {{#if (or (eq report.status "resolved") (eq report.status "declined"))}}
        {{#dropdown.menu-item onClick=(action "changeStatus" "reported")}}
          {{t "components.admin.reports.actions.open"}}
        {{/dropdown.menu-item}}
      {{/if}}
      {{#if (not (eq report.status "resolved"))}}
        {{#dropdown.menu-item onClick=(action "changeStatus" "resolved")}}
          {{t "components.admin.reports.actions.resolved"}}
        {{/dropdown.menu-item}}
      {{/if}}
      {{#if (not (eq report.status "declined"))}}
        {{#dropdown.menu-item onClick=(action "changeStatus" "declined")}}
          {{t "components.admin.reports.actions.closed"}}
        {{/dropdown.menu-item}}
      {{/if}}
    {{/dropdown.menu}}
  {{/bootstrap/bs-dropdown}}
</td>