afimb/chouette2

View on GitHub
app/views/api_keys/_api_key.html.erb

Summary

Maintainability
Test Coverage
<div id="index_item" class="panel panel-default api_key">
  <div class="panel-heading">
    <div class="panel-title clearfix">
      <% if policy(:application).write? %>
        <span class="pull-right">
          <%= link_to edit_referential_api_key_path(@referential, api_key), :class => "btn btn-default btn-sm" do %>
            <span class="fa fa-pencil"></span>
          <% end %>
          <%= link_to referential_api_key_path(@referential, api_key), :method => :delete, :data => {:confirm =>  t('api_keys.actions.destroy_confirm')}, :class => "btn btn-danger btn-sm" do %>
            <span class="fa fa-trash-o"></span>
          <% end %>
        </span>
      <% end %>
      <h5>
        <%= link_to([@referential, api_key], :class => "preview", :title => "#{Chouette::StopArea.model_name.human.capitalize} #{api_key.name}") do %>
        <span class="name">
          <%= truncate(api_key.name, :length => 20) %>
        </span>
        <% end %>
      </h5>
    </div>
  </div>
  <div class="panel-body">
    <p>
      <%= api_key.class.human_attribute_name('token') %> <%= truncate(api_key.token, :length => 20) %>
    </p>
    <p>
      <%= api_key.class.human_attribute_name('updated_at') %> <%= l(api_key.updated_at) %>
    </p>
  </div>
</div>