improves styles for admin budgets show
This commit is contained in:
@@ -1,76 +1,74 @@
|
|||||||
<div class="small-12 column">
|
<table>
|
||||||
<table>
|
<thead>
|
||||||
<thead>
|
<tr>
|
||||||
<tr>
|
<th colspan="3" class="with-button">
|
||||||
<th colspan="3" class="with-button">
|
<%= group.name %>
|
||||||
<%= group.name %>
|
<%= link_to t("admin.budgets.form.add_heading"), "#", class: "button float-right js-toggle-link", data: { "toggle-selector" => "#group-#{group.id}-new-heading-form" } %>
|
||||||
<%= link_to t("admin.budgets.form.add_heading"), "#", class: "button float-right js-toggle-link", data: { "toggle-selector" => "#group-#{group.id}-new-heading-form" } %>
|
</th>
|
||||||
</th>
|
</tr>
|
||||||
</tr>
|
|
||||||
|
|
||||||
<% if headings.blank? %>
|
<% if headings.blank? %>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
|
||||||
<td colspan="3">
|
|
||||||
<div class="callout primary">
|
|
||||||
<%= t("admin.budgets.form.no_heading") %>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<% else %>
|
|
||||||
<tr>
|
|
||||||
<th><%= t("admin.budgets.form.table_heading") %></th>
|
|
||||||
<th><%= t("admin.budgets.form.table_amount") %></th>
|
|
||||||
<th><%= t("admin.budgets.form.table_geozone") %></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<!-- new heading form -->
|
|
||||||
<tr id="group-<%= group.id %>-new-heading-form" style="display:none">
|
|
||||||
<td colspan="3">
|
|
||||||
<%= form_for [:admin, @budget, group, Budget::Heading.new], remote: true do |f| %>
|
|
||||||
<label><%= t("admin.budgets.form.heading") %></label>
|
|
||||||
<%= f.text_field :name,
|
|
||||||
label: false,
|
|
||||||
maxlength: 50,
|
|
||||||
placeholder: t("admin.budgets.form.heading") %>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="small-12 medium-6 column">
|
|
||||||
<label><%= t("admin.budgets.form.amount") %></label>
|
|
||||||
<%= f.text_field :price,
|
|
||||||
label: false,
|
|
||||||
maxlength: 8,
|
|
||||||
placeholder: t("admin.budgets.form.amount") %>
|
|
||||||
</div>
|
|
||||||
<div class="small-12 medium-6 column">
|
|
||||||
<label><%= t("admin.budgets.form.geozone") %></label>
|
|
||||||
<%= f.select :geozone_id, geozone_select_options, {include_blank: t("geozones.none"), label: false} %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<%= f.submit t("admin.budgets.form.save_heading"), class: "button success" %>
|
|
||||||
<% end %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<!-- /. new heading form -->
|
|
||||||
<!-- headings list -->
|
|
||||||
<% headings.each do |heading| %>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td colspan="3">
|
||||||
<%= heading.name %>
|
<div class="callout primary">
|
||||||
</td>
|
<%= t("admin.budgets.form.no_heading") %>
|
||||||
<td>
|
</div>
|
||||||
<%= heading.price %>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<%= geozone_name_from_id heading.geozone_id %>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<% else %>
|
||||||
|
<tr>
|
||||||
|
<th><%= t("admin.budgets.form.table_heading") %></th>
|
||||||
|
<th><%= t("admin.budgets.form.table_amount") %></th>
|
||||||
|
<th><%= t("admin.budgets.form.table_geozone") %></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<!-- new heading form -->
|
||||||
|
<tr id="group-<%= group.id %>-new-heading-form" style="display:none">
|
||||||
|
<td colspan="3">
|
||||||
|
<%= form_for [:admin, @budget, group, Budget::Heading.new], remote: true do |f| %>
|
||||||
|
<label><%= t("admin.budgets.form.heading") %></label>
|
||||||
|
<%= f.text_field :name,
|
||||||
|
label: false,
|
||||||
|
maxlength: 50,
|
||||||
|
placeholder: t("admin.budgets.form.heading") %>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="small-12 medium-6 column">
|
||||||
|
<label><%= t("admin.budgets.form.amount") %></label>
|
||||||
|
<%= f.text_field :price,
|
||||||
|
label: false,
|
||||||
|
maxlength: 8,
|
||||||
|
placeholder: t("admin.budgets.form.amount") %>
|
||||||
|
</div>
|
||||||
|
<div class="small-12 medium-6 column">
|
||||||
|
<label><%= t("admin.budgets.form.geozone") %></label>
|
||||||
|
<%= f.select :geozone_id, geozone_select_options, {include_blank: t("geozones.none"), label: false} %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<%= f.submit t("admin.budgets.form.save_heading"), class: "button success" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<!-- /. headings list -->
|
</td>
|
||||||
</tbody>
|
</tr>
|
||||||
</table>
|
<!-- /. new heading form -->
|
||||||
</div>
|
<!-- headings list -->
|
||||||
|
<% headings.each do |heading| %>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<%= heading.name %>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<%= heading.price %>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<%= geozone_name_from_id heading.geozone_id %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
<!-- /. headings list -->
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|||||||
@@ -1,34 +1,32 @@
|
|||||||
<div class="small-12 column">
|
<h3 class="inline-block"><%= t('admin.budgets.show.groups') %></h3>
|
||||||
<h3 class="inline-block"><%= t('admin.budgets.show.groups') %></h3>
|
<% if groups.blank? %>
|
||||||
<% if groups.blank? %>
|
<div class="callout primary">
|
||||||
<div class="callout primary">
|
<%= t("admin.budgets.form.no_groups") %>
|
||||||
<%= t("admin.budgets.form.no_groups") %>
|
<strong><%= link_to t("admin.budgets.form.add_group"), "#",
|
||||||
<strong><%= link_to t("admin.budgets.form.add_group"), "#",
|
class: "js-toggle-link",
|
||||||
class: "js-toggle-link",
|
data: { "toggle-selector" => "#new-group-form" } %></strong>
|
||||||
data: { "toggle-selector" => "#new-group-form" } %></strong>
|
</div>
|
||||||
</div>
|
<% else %>
|
||||||
<% else %>
|
<%= link_to t("admin.budgets.form.add_group"), "#", class: "button float-right js-toggle-link", data: { "toggle-selector" => "#new-group-form" } %>
|
||||||
<%= link_to t("admin.budgets.form.add_group"), "#", class: "button float-right js-toggle-link", data: { "toggle-selector" => "#new-group-form" } %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<%= form_for [:admin, @budget, Budget::Group.new], html: {id: "new-group-form", style: "display:none"}, remote: true do |f| %>
|
<%= form_for [:admin, @budget, Budget::Group.new], html: {id: "new-group-form", style: "display:none"}, remote: true do |f| %>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<span class="input-group-label">
|
<span class="input-group-label">
|
||||||
<label><%= f.label :name,t("admin.budgets.form.group") %></label>
|
<label><%= f.label :name,t("admin.budgets.form.group") %></label>
|
||||||
</span>
|
</span>
|
||||||
<%= f.text_field :name,
|
<%= f.text_field :name,
|
||||||
label: false,
|
label: false,
|
||||||
maxlength: 50,
|
maxlength: 50,
|
||||||
placeholder: t("admin.budgets.form.group") %>
|
placeholder: t("admin.budgets.form.group") %>
|
||||||
<div class="input-group-button">
|
<div class="input-group-button">
|
||||||
<%= f.submit t("admin.budgets.form.create_group"), class: "button success" %>
|
<%= f.submit t("admin.budgets.form.create_group"), class: "button success" %>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<% groups.each do |group| %>
|
<% groups.each do |group| %>
|
||||||
<div class="row" id="<%= dom_id(group) %>">
|
<div id="<%= dom_id(group) %>">
|
||||||
<%= render "admin/budgets/group", group: group, headings: group.headings %>
|
<%= render "admin/budgets/group", group: group, headings: group.headings %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
<div class="row">
|
<%= link_to admin_budgets_path do %>
|
||||||
<div class="small-12 medium-9 column">
|
<span class="icon-angle-left"></span>
|
||||||
<h2><%= @budget.name %> <small><%= link_to(t('shared.edit'), edit_admin_budget_path(@budget)) %></small></h2>
|
<%= t('shared.back') %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<%= @budget.description %>
|
<h2><%= @budget.name %></h2>
|
||||||
|
|
||||||
<p>
|
<div id="<%= dom_id @budget %>_groups">
|
||||||
<strong><%= t('admin.budgets.show.phase') %>:</strong> <%= t("budget.phase.#{@budget.phase}") %> |
|
|
||||||
<strong><%= t('admin.budgets.show.currency') %>:</strong> <%= @budget.currency_symbol %>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="<%= dom_id @budget %>_groups" class="row">
|
|
||||||
<%= render "groups", groups: @budget.groups %>
|
<%= render "groups", groups: @budget.groups %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user