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

View File

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

View File

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