registered-sites/app/views/admin/registered_sites/_index.html.erb

55 lines
2.1 KiB
Plaintext
Raw Normal View History

2014-10-27 11:01:37 +00:00
<table class="table main-list">
<thead>
<tr class="sort-header">
<% @table_fields.each do |f| %>
<%= thead(f) %>
<% end %>
</tr>
</thead>
<tbody>
<% @registeredsites.each do |site| %>
<tr>
<td>
<a href="http://<%= site.site_domain %>/" target="_blank"><%= site.title.nil? ? site.site_domain : site.title %></a>
<div class="quick-edit">
<ul class="nav nav-pills">
<% if can_edit_or_delete?(site) %>
<li><a href="/admin/registered_sites/<%= site.id.to_s %>/edit"><%= t(:edit) %></a></li>
<% end %>
</ul>
</div>
</td>
2014-10-27 11:01:37 +00:00
<td><%= site.admin_email %></td>
<td>
<% if !site.site_confirmed %>
<span class="badge badge-important"><%= t("registered_sites.site_inactive") %></span><br />
2014-10-27 11:01:37 +00:00
<%= t("registered_sites.email_not_confirmed") %>
<% elsif !site.access_granted %>
<span class="badge badge-important"><%= t("registered_sites.site_inactive") %></span><br />
2014-10-27 11:01:37 +00:00
<%= t("registered_sites.site_permission_revoked") %>
<% else %>
<span class="badge badge-success"><%= t("registered_sites.site_active") %></span><br />
2014-10-27 11:01:37 +00:00
<% end %>
</td>
2014-12-02 13:15:21 +00:00
<td><%= site.category.nil? ? "Category not assigned." : "<span class='label label-info'>#{site.category.title}</span>".html_safe %></td>
<td>
<% site.tags.each do |tag| %>
<span class="label">
<%= tag.name %>
</span>
<% end %>
</td>
2014-10-27 11:01:37 +00:00
<td>
<% if !site.site_confirmed %>
<a class="btn btn-success" disabled="disabled"> Grant </a>
<% elsif !site.access_granted %>
<a href="/admin/registered_site/change_access/<%= site.site_token %>?status=grant<%= "&page=#{params[:page]}" if params[:page]%>" class="btn btn-success" data-remote="true">Grant</a>
<% else %>
<a href="/admin/registered_site/change_access/<%= site.site_token %>?status=revoke<%= "&page=#{params[:page]}" if params[:page]%>" class="btn btn-danger" data-remote="true">Revoke</a>
<% end %>
</td>
</tr>
<% end %>
</tbody>
2014-12-30 13:00:12 +00:00
</table>