Extracts common elements out of management views
This commit is contained in:
8
app/views/management/_account_info.html.erb
Normal file
8
app/views/management/_account_info.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<p class="account-info">
|
||||
<%= t("management.document_type_label") %> <strong><%= humanize_document_type(verification.document_type) %></strong>
|
||||
<%= t("management.document_number") %> <strong><%= verification.document_number %></strong>
|
||||
<% if verification.user? %>
|
||||
<%= t("management.username_label") %> <strong><%= verification.user.username %></strong>
|
||||
<%= t("management.email_label") %> <strong><%= verification.user.email %></strong>
|
||||
<% end %>
|
||||
</p>
|
||||
20
app/views/management/_user_permissions.html.erb
Normal file
20
app/views/management/_user_permissions.html.erb
Normal file
@@ -0,0 +1,20 @@
|
||||
<%
|
||||
# Parameters:
|
||||
# message: A string explaining the permissions
|
||||
# permissions: An array of symbols containing the permissions
|
||||
# (can be :debates, :proposal, :support_proposal, :votes)
|
||||
%>
|
||||
<div class="user-permissions">
|
||||
|
||||
<p><%= message %></p>
|
||||
|
||||
<ul>
|
||||
<% [:debates, :proposal, :support_proposal, :votes].each do |permission| %>
|
||||
<li>
|
||||
<i class="<%= permissions.include?(permission) ? 'icon-check' : 'icon-x' %>"></i>
|
||||
<%= t("management.users.user_permission_#{permission}") %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@@ -1,27 +1,15 @@
|
||||
<p class="account-info">
|
||||
<%= t("management.document_type_label") %> <strong><%= humanize_document_type(@document_verification.document_type) %></strong>
|
||||
<%= t("management.document_number") %> <strong><%= @document_verification.document_number %></strong>
|
||||
</p>
|
||||
<%= render 'management/account_info.html', verification: @document_verification %>
|
||||
|
||||
<div class="alert-box alert radius">
|
||||
<%= t("management.users.census_error") %>
|
||||
</div>
|
||||
|
||||
<div class="user-permissions">
|
||||
<%= render 'management/user_permissions',
|
||||
message: t("management.users.census_error_info"),
|
||||
permissions: [:debates, :proposal] %>
|
||||
|
||||
<p><%= t("management.users.census_error_info") %></p>
|
||||
|
||||
<ul>
|
||||
<li><i class="icon-check"></i> <%= t("management.users.user_permission_debates") %></li>
|
||||
<li><i class="icon-check"></i> <%= t("management.users.user_permission_proposal") %></li>
|
||||
<li><i class="icon-x"></i> <%= t("management.users.user_permission_support_proposal") %></li>
|
||||
<li><i class="icon-x"></i> <%= t("management.users.user_permission_votes") %></li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
<%= t("management.users.has_not_account_html",
|
||||
url: link_to(t("management.users.portal_url"), t("management.users.portal_url"),
|
||||
target: "_blank")).html_safe %>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<p>
|
||||
<%= t("management.users.has_not_account_html",
|
||||
url: link_to(t("management.users.portal_url"), t("management.users.portal_url"),
|
||||
target: "_blank")).html_safe %>
|
||||
</p>
|
||||
|
||||
@@ -1,29 +1,15 @@
|
||||
<p class="account-info">
|
||||
<%= t("management.document_type_label") %> <strong><%= humanize_document_type(@document_verification.document_type) %></strong>
|
||||
<%= t("management.document_number") %> <strong><%= @document_verification.document_number %></strong>
|
||||
<%= t("management.username_label") %> <strong><%= @document_verification.user.username %></strong>
|
||||
<%= t("management.email_label") %> <strong><%= @document_verification.user.email %></strong>
|
||||
</p>
|
||||
<%= render 'management/account_info.html', verification: @document_verification %>
|
||||
|
||||
<div class="alert-box success radius">
|
||||
<%= t("management.users.census_success_account") %>
|
||||
</div>
|
||||
|
||||
<div class="user-permissions">
|
||||
<%= render 'management/user_permissions',
|
||||
message: t("management.users.census_success_info"),
|
||||
permissions: [:debates, :proposal, :support_proposal] %>
|
||||
|
||||
<p><%= t("management.users.census_success_info") %></p>
|
||||
|
||||
<ul>
|
||||
<li><i class="icon-check"></i> <%= t("management.users.user_permission_debates") %></li>
|
||||
<li><i class="icon-check"></i> <%= t("management.users.user_permission_proposal") %></li>
|
||||
<li><i class="icon-check"></i> <%= t("management.users.user_permission_support_proposal") %></li>
|
||||
<li><i class="icon-x"></i> <%= t("management.users.user_permission_votes") %></li>
|
||||
</ul>
|
||||
|
||||
<%= form_for @document_verification, url: management_on_site_verifications_path do |f| %>
|
||||
<%= f.hidden_field :document_type %>
|
||||
<%= f.hidden_field :document_number %>
|
||||
<%= f.submit t("management.users.verify"), class: "button success radius" %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<%= form_for @document_verification, url: management_on_site_verifications_path do |f| %>
|
||||
<%= f.hidden_field :document_type %>
|
||||
<%= f.hidden_field :document_number %>
|
||||
<%= f.submit t("management.users.verify"), class: "button success radius" %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,25 +1,11 @@
|
||||
<p class="account-info">
|
||||
<%= t("management.document_type_label") %> <strong><%= humanize_document_type(@document_verification.document_type) %></strong>
|
||||
<%= t("management.document_number") %> <strong><%= @document_verification.document_number %></strong>
|
||||
<%= t("management.username_label") %> <strong><%= @document_verification.user.username %></strong>
|
||||
<%= t("management.email_label") %> <strong><%= @document_verification.user.email %></strong>
|
||||
</p>
|
||||
<%= render 'management/account_info.html', verification: @document_verification %>
|
||||
|
||||
<div class="alert-box success radius">
|
||||
<%= t("management.users.already_verified") %>
|
||||
</div>
|
||||
|
||||
<div class="user-permissions">
|
||||
|
||||
<p><%= t("management.users.census_success_info") %></p>
|
||||
|
||||
<ul>
|
||||
<li><i class="icon-check"></i> <%= t("management.users.user_permission_debates") %></li>
|
||||
<li><i class="icon-check"></i> <%= t("management.users.user_permission_proposal") %></li>
|
||||
<li><i class="icon-check"></i> <%= t("management.users.user_permission_support_proposal") %></li>
|
||||
<li><i class="icon-check"></i> <%= t("management.users.user_permission_votes") %></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<%= render 'management/user_permissions',
|
||||
message: t("management.users.census_success_info"),
|
||||
permissions: [:debates, :proposal, :support_proposal] %>
|
||||
|
||||
<a href="javascript:window.print();" class="button warning radius"><%= t("management.print_info") %></a>
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
<p class="account-info">
|
||||
<%= t("management.document_type_label") %> <strong><%= humanize_document_type(@email_verification.document_type) %></strong>
|
||||
<%= t("management.document_number") %> <strong><%= @email_verification.document_number %></strong>
|
||||
</p>
|
||||
<%= render 'management/account_info.html', verification: @email_verification %>
|
||||
|
||||
<div class="alert-box success radius">
|
||||
<%= t("management.users.census_success") %>
|
||||
|
||||
@@ -1,26 +1,14 @@
|
||||
<p class="account-info">
|
||||
<%= t("management.document_type_label") %> <strong><%= humanize_document_type(@email_verification.document_type) %></strong>
|
||||
<%= t("management.document_number") %> <strong><%= @email_verification.document_number %></strong>
|
||||
<%= t("management.username_label") %> <strong><%= @email_verification.user.username %></strong>
|
||||
<%= t("management.email_label") %> <strong><%= @email_verification.user.email %></strong>
|
||||
</p>
|
||||
<%= render 'management/account_info.html', verification: @email_verification %>
|
||||
|
||||
<div class="alert-box success radius">
|
||||
<%= t("management.users.email_sent") %>
|
||||
</div>
|
||||
|
||||
<div class="user-permissions">
|
||||
<%= render 'management/user_permissions',
|
||||
message: t("management.users.census_success_info"),
|
||||
permissions: [:debates, :proposal, :support_proposal, :votes] %>
|
||||
|
||||
<p><%= t("management.users.census_success_info") %></p>
|
||||
|
||||
<ul>
|
||||
<li><i class="icon-check"></i> <%= t("management.users.user_permission_debates") %></li>
|
||||
<li><i class="icon-check"></i> <%= t("management.users.user_permission_proposal") %></li>
|
||||
<li><i class="icon-check"></i> <%= t("management.users.user_permission_support_proposal") %></li>
|
||||
<li><i class="icon-check"></i> <%= t("management.users.user_permission_votes") %></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<a href="javascript:window.print();" class="button warning radius"><%= t("management.print_info") %></a>
|
||||
<p>
|
||||
<a href="javascript:window.print();" class="button warning radius"><%= t("management.print_info") %></a>
|
||||
</p>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user