Sha256: b2969c68fa28023c84961746f81415f66fd8ff56fb5ad9d964f1bff186153d62

Contents?: true

Size: 1.98 KB

Versions: 3

Compression:

Stored size: 1.98 KB

Contents

<div class="row">
  <div class="small-12 columns">
    <h1>Permissions<% if @object.title %> <span class="sub_title">for <%= sub_title_for @object %>: <%= @object.try(:title) || 'N/A' %></span><% end %></h1>
    <%= link_to('New', new_polymorphic_path([@object, :permission]), class: 'button') if can? :create, Guts::Permission %>
    <%= link_to 'Back', url_for([:edit, @object]), class: 'secondary hollow button' %>
  </div>
</div>

<% if notice %>
  <div class="row">
    <div class="small-12 columns">
      <div class="callout success notice">
        <p><%= notice %></p>
      </div>
    </div>
  </div>
<% end %>

<div class="row">
  <div class="small-12 columns">
    <% if @object.permissions.size > 0 %>
      <table>
        <thead>
          <th>Feature</th>
          <th>Permission</th>
          <th>Date Assigned</th>
          <th>&nbsp;</th>
        </thead>
        <tbody>
          <% @object.permissions.each do |permission| %>
            <tr>
              <td>
                <% if permission.authorization.subject_class == 'all' %>
                  All Features
                <% else %>
                  <%= permission.authorization.subject_class.gsub(/Guts::/, '').pluralize %>
                <% end %>

                <% if permission.authorization.subject_id %>
                  <small>for ID: <%= permission.authorization.subject_id %></small>
                <% end %>
              </td>
              <td>
                <%= permission.authorization.description.titleize %>
              </td>
              <td>
                <%= permission.created_at.strftime("%b #{permission.created_at.day.ordinalize}, %Y") %>
              </td>
              <td class="action_links">
                <%= link_to_destroy('Revoke', polymorphic_path([@object, permission])) if can? :delete, Guts::Permission %>
              </td>
            </tr>
          <% end %>
        </tbody>
      </table>
    <% else %>
      <p>No permissions have been assigned.</p>
    <% end %>
  </div>
</div>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
guts-2.1.0 app/views/guts/permissions/index.html.erb
guts-2.0.2 app/views/guts/permissions/index.html.erb
guts-2.0.1 app/views/guts/permissions/index.html.erb