register_modules/app/views/admin/admin_modules/_index.html.erb

49 lines
2.0 KiB
Plaintext

<table class="table main-list">
<thead>
<tr class="sort-header">
<% @table_fields.each_with_index do |f,i| %>
<%= thead(f) %>
<% end %>
</tr>
</thead>
<tbody>
<% if @registered_modules.blank? %>
<tr>
<td colspan="<%= @table_fields.length %>" style="text-align:center;">
No completed modules, ask developers to complete them fast.
</td>
</tr>
<% else %>
<% @registered_modules.each do |rm| %>
<tr>
<td width="20%"><%= rm.name %></td>
<% if rm.category.nil? %>
<td width="20%">No category assigned.</td>
<% else %>
<td width="20%"><%= rm.category.title %></td>
<% end %>
<% user = User.find(rm.create_user_id) %>
<td width="20%"><%= user.name rescue user.user_name %></td>
<% if rm.approved %>
<td>
<a class="btn btn-small btn-info action-btns" data-id="<%= rm.id.to_s %>" href="/admin/admin_modules/install_site_list?id=<%= rm.id.to_s %>" for="installation">Install</a>
<a class="btn btn-small btn-danger action-btns" data-id="<%= rm.id.to_s %>" href="/admin/admin_modules/uninstall_site_list?id=<%= rm.id.to_s %>" for="uninstallation">Uninstall</a>
<a class="btn btn-small btn-warning action-btns" data-id="<%= rm.id.to_s %>" href="/admin/admin_modules/revokelist?id=<%= rm.id.to_s %>" for="revoke_access">Revoke Access</a>
<a class="btn btn-small btn-success action-btns" data-id="<%= rm.id.to_s %>" href="/admin/admin_modules/grantlist?id=<%= rm.id.to_s %>" for="grant_access">Grant Access</a>
<a class="btn btn-small edit-btn" href="/admin/admin_modules/approve?module_id=<%= rm.id.to_s %>">Edit</a>
</td>
<% else %>
<td>
<a class="btn btn-small btn-primary approve-btn" href="/admin/admin_modules/approve?module_id=<%= rm.id.to_s %>">Approve</button>
</td>
<% end %>
</tr>
<% end %>
<% end %>
</tbody>
</table>
<%=
content_tag :div, class: "bottomnav clearfix" do
content_tag :div, paginate(@registered_modules), class: "pagination pagination-centered"
end
%>