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

65 lines
2.9 KiB
Plaintext

<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 %>
<li><a href="/admin/registered_sites/<%= site.id.to_s %>/progress"><%= t("registered_sites.progress") %></a></li>
</ul>
</div>
</td>
<td><%= site.admin_email %></td>
<td>
<% if !site.site_confirmed %>
<span class="badge badge-important"><%= t("registered_sites.site_inactive") %></span><br />
<%= t("registered_sites.email_not_confirmed") %>
<% elsif !site.access_granted %>
<span class="badge badge-important"><%= t("registered_sites.site_inactive") %></span><br />
<%= t("registered_sites.site_permission_revoked") %>
<% else %>
<span class="badge badge-success"><%= t("registered_sites.site_active") %></span><br />
<% end %>
</td>
<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>
<td>
<% if !site.site_confirmed %>
<a class="btn btn-success" href="<%='/site/send_email?store_token='+site.uid%>"> <%=t('resend_email')%></a>
<% elsif !site.access_granted %>
<a href="/admin/registered_site/change_access/<%= site.site_token %>?status=grant<%= "&page=#{params[:page]}" if params[:page]%><%= "&keywords=#{params[:keywords]}" if params[:keywords] %>" 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]%><%= "&keywords=#{params[:keywords]}" if params[:keywords] %>" class="btn btn-warning" data-remote="true">Revoke</a>
<% end %>
<% if current_user.is_admin? %>
<a href="/admin/registered_sites/<%= site.id.to_s %>?s=s<%= "&page=#{params[:page]}" if params[:page]%><%= "&keywords=#{params[:keywords]}" if params[:keywords] %>" class="btn btn-danger" data-remote="true" data-method="delete" data-confirm="Are you sure?"><i class="icons-trash"></i></a>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%=
content_tag :div, class: "bottomnav clearfix" do
content_tag :div, paginate(@registeredsites), class: "pagination pagination-centered"
end
%>