moves table ids to fixes specs

This commit is contained in:
decabeza
2017-10-20 13:59:58 +02:00
parent ef91fc7941
commit 90067814e4
3 changed files with 139 additions and 133 deletions

View File

@@ -13,44 +13,46 @@
<div id="search-result"></div> <div id="search-result"></div>
<% if @managers.any? %> <div id="managers">
<h3 class="margin"><%= page_entries_info @managers %></h3> <% if @managers.any? %>
<h3 class="margin"><%= page_entries_info @managers %></h3>
<table id="managers"> <table>
<thead> <thead>
<th scope="col"><%= t("admin.managers.index.name") %></th> <th scope="col"><%= t("admin.managers.index.name") %></th>
<th scope="col"><%= t("admin.managers.index.email") %></th> <th scope="col"><%= t("admin.managers.index.email") %></th>
<th scope="col" class="small-3"><%= t("admin.shared.actions") %></th> <th scope="col" class="small-3"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @managers.each do |manager| %> <% @managers.each do |manager| %>
<tr> <tr>
<td> <td>
<%= manager.name %> <%= manager.name %>
</td> </td>
<td> <td>
<%= manager.email %> <%= manager.email %>
</td> </td>
<td> <td>
<% if manager.persisted? %> <% if manager.persisted? %>
<%= link_to t('admin.managers.manager.delete'), <%= link_to t('admin.managers.manager.delete'),
admin_manager_path(manager), admin_manager_path(manager),
method: :delete, method: :delete,
class: "button hollow alert expanded" class: "button hollow alert expanded"
%> %>
<% else %> <% else %>
<%= link_to t('admin.managers.manager.add'),{ controller: "admin/managers", action: :create, user_id: manager.user_id }, <%= link_to t('admin.managers.manager.add'),{ controller: "admin/managers", action: :create, user_id: manager.user_id },
method: :post, class: "button success expanded" %> method: :post, class: "button success expanded" %>
<% end %> <% end %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<%= paginate @managers %> <%= paginate @managers %>
<% else %> <% else %>
<div class="callout primary"> <div class="callout primary">
<%= t("admin.managers.index.no_managers") %> <%= t("admin.managers.index.no_managers") %>
</div> </div>
<% end %> <% end %>
</div>

View File

@@ -15,48 +15,50 @@
<div id="search-result"></div> <div id="search-result"></div>
<% if @moderators.any? %> <div id="moderators">
<% if @moderators.any? %>
<h3><%= page_entries_info @moderators %></h3> <h3><%= page_entries_info @moderators %></h3>
<table id="moderators"> <table>
<thead> <thead>
<th scope="col"><%= t("admin.moderators.index.name") %></th> <th scope="col"><%= t("admin.moderators.index.name") %></th>
<th scope="col" class="small-6"><%= t("admin.moderators.index.email") %></th> <th scope="col" class="small-6"><%= t("admin.moderators.index.email") %></th>
<th scope="col" class="small-3"><%= t("admin.shared.actions") %></th> <th scope="col" class="small-3"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @moderators.each do |moderator| %> <% @moderators.each do |moderator| %>
<tr> <tr>
<td> <td>
<%= moderator.name %> <%= moderator.name %>
</td> </td>
<td> <td>
<%= moderator.email %> <%= moderator.email %>
</td> </td>
<td> <td>
<% if moderator.persisted? %> <% if moderator.persisted? %>
<%= link_to t('admin.moderators.moderator.delete'), <%= link_to t('admin.moderators.moderator.delete'),
admin_moderator_path(moderator), admin_moderator_path(moderator),
method: :delete, method: :delete,
class: "button hollow alert expanded" class: "button hollow alert expanded"
%> %>
<% else %> <% else %>
<%= link_to t('admin.moderators.moderator.add'), <%= link_to t('admin.moderators.moderator.add'),
{ controller: "admin/moderators", action: :create, { controller: "admin/moderators", action: :create,
user_id: moderator.user_id }, user_id: moderator.user_id },
method: :post, method: :post,
class: "button success expanded" %> class: "button success expanded" %>
<% end %> <% end %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<%= paginate @moderators %> <%= paginate @moderators %>
<% else %> <% else %>
<div class="callout primary"> <div class="callout primary">
<%= t("admin.moderators.index.no_moderators") %> <%= t("admin.moderators.index.no_moderators") %>
</div> </div>
<% end %> <% end %>
</div>

View File

@@ -11,58 +11,60 @@
<% end %> <% end %>
</div> </div>
<% if @organizations.any? %> <div id="search-results">
<h3 class="margin"><%= page_entries_info @organizations %></h3> <% if @organizations.any? %>
<h3 class="margin"><%= page_entries_info @organizations %></h3>
<table id="search-results"> <table>
<thead> <thead>
<th scpope="col"><%= t("admin.organizations.index.name") %></th> <th scpope="col"><%= t("admin.organizations.index.name") %></th>
<th scpope="col"><%= t("admin.organizations.index.email") %></th> <th scpope="col"><%= t("admin.organizations.index.email") %></th>
<th scpope="col"><%= t("admin.organizations.index.phone_number") %></th> <th scpope="col"><%= t("admin.organizations.index.phone_number") %></th>
<th scpope="col"><%= t("admin.organizations.index.responsible_name") %></th> <th scpope="col"><%= t("admin.organizations.index.responsible_name") %></th>
<th scpope="col"><%= t("admin.organizations.index.status") %></th> <th scpope="col"><%= t("admin.organizations.index.status") %></th>
<th scpope="col" class="small-3"><%= t("admin.shared.actions") %></th> <th scpope="col" class="small-3"><%= t("admin.shared.actions") %></th>
</thead> </thead>
<tbody> <tbody>
<% @organizations.each do |organization| %> <% @organizations.each do |organization| %>
<tr> <tr>
<td><%= organization.name %></td> <td><%= organization.name %></td>
<td><%= organization.email %></td> <td><%= organization.email %></td>
<td><%= organization.phone_number %></td> <td><%= organization.phone_number %></td>
<td><%= organization.responsible_name %></td> <td><%= organization.responsible_name %></td>
<td> <td>
<% if organization.verified? %> <% if organization.verified? %>
<span class="icon-check"></span> <span class="icon-check"></span>
<%= t("admin.organizations.index.verified") %> <%= t("admin.organizations.index.verified") %>
<% elsif organization.rejected? %> <% elsif organization.rejected? %>
<span class="icon-x"></span> <span class="icon-x"></span>
<%= t("admin.organizations.index.rejected") %> <%= t("admin.organizations.index.rejected") %>
<% else %> <% else %>
<span class="icon-eye"></span> <span class="icon-eye"></span>
<%= t("admin.organizations.index.pending") %> <%= t("admin.organizations.index.pending") %>
<% end %> <% end %>
</td> </td>
<td> <td>
<% if can? :verify, organization %> <% if can? :verify, organization %>
<%= link_to t("admin.organizations.index.verify"), <%= link_to t("admin.organizations.index.verify"),
verify_admin_organization_path(organization, request.query_parameters), verify_admin_organization_path(organization, request.query_parameters),
method: :put, class: "button success small-5" %> method: :put, class: "button success small-5" %>
<% end %> <% end %>
<% if can? :reject, organization %> <% if can? :reject, organization %>
<%= link_to t("admin.organizations.index.reject"), <%= link_to t("admin.organizations.index.reject"),
reject_admin_organization_path(organization, request.query_parameters), reject_admin_organization_path(organization, request.query_parameters),
method: :put, class: "button hollow alert small-5" %> method: :put, class: "button hollow alert small-5" %>
<% end %> <% end %>
</td> </td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<%= paginate @organizations %> <%= paginate @organizations %>
<% else %> <% else %>
<div class="callout alert"> <div class="callout alert">
<%= t("admin.organizations.search.no_results") %> <%= t("admin.organizations.search.no_results") %>
</div> </div>
<% end %> <% end %>
</div>