Adds styles and missing i18n for valuator groups 👨🏻🎨
This commit is contained in:
@@ -31,7 +31,7 @@ class Admin::ValuatorsController < Admin::BaseController
|
||||
def update
|
||||
@valuator = Valuator.find(params[:id])
|
||||
if @valuator.update(valuator_params)
|
||||
notice = "Valuator updated successfully"
|
||||
notice = t("admin.valuators.form.updated")
|
||||
redirect_to [:admin, @valuator], notice: notice
|
||||
else
|
||||
render :edit
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<%= hidden_field_tag filter_name, filter_value %>
|
||||
<% end %>
|
||||
|
||||
<div class="row">
|
||||
<div class="row expanded">
|
||||
<div class="small-12 column">
|
||||
<%= f.text_field :title, maxlength: Budget::Investment.title_max_length %>
|
||||
</div>
|
||||
@@ -26,22 +26,26 @@
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.text_field :external_url %>
|
||||
</div>
|
||||
<div class="small-12 medium-6">
|
||||
<%= f.text_field :external_url %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.select :heading_id, budget_heading_select_options(@budget), include_blank: t("admin.budget_investments.edit.select_heading") %>
|
||||
<div class="small-12 medium-6">
|
||||
<%= f.select :heading_id, budget_heading_select_options(@budget), include_blank: t("admin.budget_investments.edit.select_heading") %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 id="classification"><%= t("admin.budget_investments.edit.classification") %></h2>
|
||||
|
||||
<div class="row">
|
||||
<div class="row expanded margin-top">
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= f.select(:administrator_id,
|
||||
@admins.collect{ |a| [a.name_and_email, a.id ] },
|
||||
{ include_blank: t("admin.budget_investments.edit.undefined") }) %>
|
||||
<h2 id="classification"><%= t("admin.budget_investments.edit.classification") %></h2>
|
||||
|
||||
<div class="small-12 medium-6">
|
||||
<%= f.select(:administrator_id,
|
||||
@admins.collect{ |a| [a.name_and_email, a.id ] },
|
||||
{ include_blank: t("admin.budget_investments.edit.undefined") }) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -59,26 +63,27 @@
|
||||
class: 'js-tag-list' %>
|
||||
</div>
|
||||
|
||||
<p>Groups</p>
|
||||
<div class="small-12 column">
|
||||
<%= f.label :valuator_ids, "Groups assigned" %>
|
||||
<div class="small-12 column margin-top">
|
||||
<%= f.label :valuator_ids, t("admin.budget_investments.edit.user_groups") %>
|
||||
<ul>
|
||||
<%= f.collection_check_boxes :valuator_group_ids, @valuator_groups, :id, :name do |group| %>
|
||||
|
||||
<%= group.label(title: group.object.name) { group.check_box + truncate(group.object.name, length: 60) } %>
|
||||
<li><%= group.label(title: group.object.name) { group.check_box + truncate(group.object.name, length: 60) } %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<p>Valuators</p>
|
||||
<div class="small-12 column">
|
||||
<%= f.label :valuator_ids, t("admin.budget_investments.edit.assigned_valuators") %>
|
||||
|
||||
<%= f.collection_check_boxes :valuator_ids, @valuators, :id, :email do |b| %>
|
||||
<%= b.label(title: valuator_label(b.object)) { b.check_box + truncate(b.object.description_or_email, length: 60) } %>
|
||||
<% end %>
|
||||
<div class="small-12 column">
|
||||
<hr>
|
||||
<%= f.label :valuator_ids, t("admin.budget_investments.edit.assigned_valuators") %>
|
||||
<ul>
|
||||
<%= f.collection_check_boxes :valuator_ids, @valuators, :id, :email do |b| %>
|
||||
<li><%= b.label(title: valuator_label(b.object)) { b.check_box + truncate(b.object.description_or_email, length: 60) } %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row margin-top">
|
||||
<div class="row expanded margin-top">
|
||||
<% if @investment.incompatible? || @investment.winner? %>
|
||||
<div class="small-12 medium-3 column">
|
||||
<h2 id="incompatible"><%= t("admin.budget_investments.edit.compatibility") %></h2>
|
||||
@@ -97,7 +102,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="margin-top">
|
||||
<div class="small-12 column margin-top">
|
||||
<%= f.submit(class: "button", value: t("admin.budget_investments.edit.submit_button")) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</p>
|
||||
|
||||
<p id="assigned_valuator_groups">
|
||||
<strong>Valuator Groups:</strong>
|
||||
<strong><%= t("admin.budget_investments.show.valuator_groups") %>:</strong>
|
||||
<% if @investment.valuator_groups.any? %>
|
||||
<%= @investment.valuator_groups.collect(&:name).join(', ') %>
|
||||
<% else %>
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
<div>
|
||||
Name: <%= group.name %>
|
||||
</div>
|
||||
<tr>
|
||||
<td>
|
||||
<%= link_to group.name, admin_valuator_group_path(group) %>
|
||||
</td>
|
||||
<td>
|
||||
<!-- Pending add members list COUNT -->
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to t("admin.actions.delete"),
|
||||
admin_valuator_group_path(group),
|
||||
method: :delete, class: "button hollow alert" %>
|
||||
|
||||
<div>
|
||||
Members:
|
||||
</div>
|
||||
|
||||
<div>
|
||||
Edit:
|
||||
<%= link_to "Edit", edit_admin_valuator_group_path(group) %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
Destoy:
|
||||
<%= link_to "Destroy", admin_valuator_group_path(group), method: :delete %>
|
||||
</div>
|
||||
<br/>
|
||||
<%= link_to t("admin.actions.edit"),
|
||||
edit_admin_valuator_group_path(group),
|
||||
class: "button hollow" %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
<%= form_for [:admin, @group] do |f| %>
|
||||
<%= f.text_field :name %>
|
||||
<%= f.submit %>
|
||||
<% end %>
|
||||
<%= back_link_to admin_valuator_groups_path %>
|
||||
|
||||
<div class="small-12 medium-6 margin-top">
|
||||
<%= form_for [:admin, @group] do |f| %>
|
||||
<%= f.label :name, t("admin.valuator_groups.form.name") %>
|
||||
<%= f.text_field :name, label: false %>
|
||||
<%= f.submit t("admin.valuator_groups.form.edit"), class: "button success" %>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -1,4 +1,23 @@
|
||||
<%= render partial: 'group', collection: @groups %>
|
||||
<h2 class="inline-block"><%= t("admin.valuator_groups.index.title") %></h2>
|
||||
|
||||
There are <%= @groups.count %> groups of users
|
||||
<%= link_to "Nuevo", new_admin_valuator_group_path %>
|
||||
<%= link_to t("admin.valuator_groups.index.new"), new_admin_valuator_group_path, class: "button float-right" %>
|
||||
|
||||
<% if @groups.any? %>
|
||||
<h3 class="margin">There are <%= @groups.count %> groups of users</h3>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<th scope="col"><%= t("admin.valuator_groups.index.name") %></th>
|
||||
<th scope="col"><%= t("admin.valuator_groups.index.members") %></th>
|
||||
<th scope="col" class="small-3"><%= t("admin.shared.actions") %></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%= render partial: 'group', collection: @groups %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<% else %>
|
||||
<div class="callout primary">
|
||||
<%= t("admin.valuator_groups.index.no_groups") %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
<%= form_for [:admin, @group] do |f| %>
|
||||
<%= f.text_field :name %>
|
||||
<%= f.submit %>
|
||||
<% end %>
|
||||
<%= back_link_to admin_valuator_groups_path %>
|
||||
|
||||
<%= link_to "Go back", admin_valuator_groups_path %>
|
||||
<div class="small-12 medium-6 margin-top">
|
||||
<%= form_for [:admin, @group] do |f| %>
|
||||
<%= f.label :name, t("admin.valuator_groups.form.name") %>
|
||||
<%= f.text_field :name, label: false %>
|
||||
<%= f.submit t("admin.valuator_groups.form.new"), class: "button success" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Hey there I'm group <%= @group.name %>
|
||||
<%= back_link_to admin_valuator_groups_path %>
|
||||
|
||||
<br/>
|
||||
<%= link_to "Ver todos los grupos", admin_valuator_groups_path %>
|
||||
<h2><%= t("admin.valuator_groups.show.title", group: @group.name) %></h2>
|
||||
|
||||
<!-- Pending add members list -->
|
||||
|
||||
@@ -1,9 +1,20 @@
|
||||
<%= form_for [:admin, @valuator] do |f| %>
|
||||
<%= f.text_field :description %>
|
||||
<%= f.select :valuator_group_id,
|
||||
@valuator_groups.map {|group| [group.name, group.id] },
|
||||
{ include_blank: true } %>
|
||||
<%= f.submit %>
|
||||
<% end %>
|
||||
<%= back_link_to admin_valuators_path %>
|
||||
|
||||
<%= link_to "Go back", admin_valuator_path(@valuator) %>
|
||||
<h2><%= t("admin.valuators.form.edit_title") %></h2>
|
||||
|
||||
<div class="callout highlight">
|
||||
<strong><%= @valuator.name %></strong><br>
|
||||
<%= @valuator.email %>
|
||||
</div>
|
||||
|
||||
<div class="margin-top">
|
||||
<%= form_for [:admin, @valuator] do |f| %>
|
||||
<%= f.text_field :description %>
|
||||
<div class="small-12 medium-6">
|
||||
<%= f.select :valuator_group_id,
|
||||
@valuator_groups.map {|group| [group.name, group.id] },
|
||||
{ include_blank: true } %>
|
||||
</div>
|
||||
<%= f.submit t("admin.valuators.form.update"), class: "button success" %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<h2><%= t("admin.valuators.index.title") %></h2>
|
||||
<h2 class="inline-block"><%= t("admin.valuators.index.title") %></h2>
|
||||
|
||||
<%= link_to t("admin.valuators.index.valuator_groups"), admin_valuator_groups_path, class: "button hollow float-right" %>
|
||||
|
||||
<%= render "admin/shared/user_search", url: search_admin_valuators_path %>
|
||||
|
||||
<%= link_to "Grupos de evaluadores", admin_valuator_groups_path %>
|
||||
|
||||
<div id="valuators">
|
||||
<% if @valuators.any? %>
|
||||
<h3 class="margin"><%= page_entries_info @valuators %></h3>
|
||||
@@ -13,13 +13,13 @@
|
||||
<th scope="col"><%= t("admin.valuators.index.name") %></th>
|
||||
<th scope="col"><%= t("admin.valuators.index.email") %></th>
|
||||
<th scope="col"><%= t("admin.valuators.index.description") %></th>
|
||||
<th scope="col">Grupo</th>
|
||||
<th scope="col"><%= t("admin.valuators.index.group") %></th>
|
||||
<th scope="col"><%= t("admin.actions.actions") %></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @valuators.each do |valuator| %>
|
||||
<tr>
|
||||
<td><%= valuator.name %></td>
|
||||
<td><%= link_to valuator.name, admin_valuator_path(valuator) %></td>
|
||||
<td><%= valuator.email %></td>
|
||||
<td>
|
||||
<% if valuator.description.present? %>
|
||||
@@ -29,16 +29,20 @@
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= valuator.valuator_group.try(:name) %>
|
||||
<% if valuator.valuator_group.present? %>
|
||||
<%= valuator.valuator_group.try(:name) %>
|
||||
<% else %>
|
||||
<%= t("admin.valuators.index.no_group") %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to "Edit",
|
||||
<%= link_to t("admin.actions.edit"),
|
||||
edit_admin_valuator_path(valuator),
|
||||
class: "button hollow expanded" %>
|
||||
class: "button hollow" %>
|
||||
<%= link_to t("admin.valuators.valuator.delete"),
|
||||
admin_valuator_path(valuator),
|
||||
method: :delete,
|
||||
class: "button hollow alert expanded" %>
|
||||
class: "button hollow alert" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
@@ -1,7 +1,30 @@
|
||||
<div>Name: <%= @valuator.name %></div>
|
||||
<div>Description <%= @valuator.description %></div>
|
||||
<div>Email: <%= @valuator.email %></div>
|
||||
<div>Group: <%= @valuator.valuator_group.try(:name) %></div>
|
||||
<%= back_link_to admin_valuators_path %>
|
||||
|
||||
<%= link_to "See all evaluators", admin_valuators_path %>
|
||||
<%= link_to "Edit", edit_admin_valuator_path(@valuator) %>
|
||||
<%= link_to t("admin.actions.edit"), edit_admin_valuator_path(@valuator), class: "button hollow float-right" %>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<h2><%= @valuator.name %></h2>
|
||||
|
||||
<div class="callout highlight">
|
||||
<p>
|
||||
<strong><%= t("admin.valuators.show.email") %></strong><br>
|
||||
<%= @valuator.email %>
|
||||
</p>
|
||||
<p>
|
||||
<strong><%= t("admin.valuators.show.description") %></strong><br>
|
||||
<% if @valuator.description.present? %>
|
||||
<%= @valuator.description %>
|
||||
<% else %>
|
||||
<%= t("admin.valuators.show.no_description") %>
|
||||
<% end %>
|
||||
</p>
|
||||
<p>
|
||||
<strong><%= t("admin.valuators.show.group") %></strong><br>
|
||||
<% if @valuator.valuator_group.present? %>
|
||||
<%= @valuator.valuator_group.try(:name) %>
|
||||
<% else %>
|
||||
<%= t("admin.valuators.show.no_group") %>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user