hummingbird-me/kitsu-web

View on GitHub
app/templates/components/users/user-actions.hbs

Summary

Maintainability
Test Coverage
<div class="stream-item-options">
  {{! Dropdown }}
  <span class="more-wrapper">
    <a href="#" class="more-drop" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
      {{svg-jar "more"}}
    </a>
    <div class="dropdown-menu dropdown-menu-right">
      {{! Hide/Show Posts }}
      {{#if follow}}
        <a class="dropdown-item" href="#" {{action "editHidden" (not follow.hidden)}}>
          {{#if follow.hidden}}
            <div>{{t "users.show-posts.text" user=user.name}}</div>
            <div class="option-info">{{t "users.show-posts.info"}}</div>
          {{else}}
            <div>{{t "users.hide-posts.text" user=user.name}}</div>
            <div class="option-info">{{t "users.hide-posts.info"}}</div>
          {{/if}}
        </a>
      {{/if}}

      {{! Block }}
      {{#if (and session.hasUser (not (is-self user)))}}
        <a class="dropdown-item" href="#" {{action (toggle "blockUserModal" this)}}>{{t "components.users.block" user=user.name}}</a>
        {{#if blockUserModal}}
          {{to-elsewhere named="modal" send=(component "modals/block-user"
            user=user
            onClose=(toggle-action "blockUserModal" this)
          )}}
        {{/if}}
      {{/if}}
    </div>
  </span>
</div>