mirror of
https://github.com/rickbarrette/redmine_qbo_lineitems.git
synced 2026-04-03 15:41:58 -04:00
Updated views for items and accounts
This commit is contained in:
@@ -1,37 +1,48 @@
|
||||
<h2>Items</h2>
|
||||
|
||||
<div class="contextual">
|
||||
<%= link_to "New Item", new_item_path, class: "icon icon-add" %>
|
||||
<%= link_to l(:label_item_new), new_item_path, class: 'icon icon-add' %>
|
||||
</div>
|
||||
|
||||
<table class="list items">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>SKU</th>
|
||||
<th>Description</th>
|
||||
<th>Price</th>
|
||||
<th>Active</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<h2><%= l(:label_items) %></h2>
|
||||
|
||||
<tbody>
|
||||
<% @items.each do |item| %>
|
||||
<tr>
|
||||
<td><%= link_to item.name, item_path(item) %></td>
|
||||
<td><%= item.sku %></td>
|
||||
<td><%= item.description %></td>
|
||||
<td><%= number_to_currency(item.unit_price) %></td>
|
||||
<td><%= item.active ? "Yes" : "No" %></td>
|
||||
<td>
|
||||
<%= link_to "Edit", edit_item_path(item), class: "icon icon-edit" %>
|
||||
<%= link_to "Delete", item_path(item),
|
||||
method: :delete,
|
||||
data: { confirm: "Are you sure?" },
|
||||
class: "icon icon-del" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% if @items.any? %>
|
||||
<div class="autoscroll">
|
||||
<table class="list items">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= l(:field_name) %></th>
|
||||
<th><%= l(:field_sku) %></th>
|
||||
<th><%= l(:field_description) %></th>
|
||||
<th><%= l(:field_unit_price) %></th>
|
||||
<th class="center"><%= l(:field_taxable) %></th>
|
||||
<th class="center"><%= l(:field_active) %></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @items.each do |item| %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td class="name"><%= link_to item.name, item_path(item) %></td>
|
||||
<td class="sku"><%= item.sku %></td>
|
||||
<td class="description"><%= truncate(item.description, length: 60) %></td>
|
||||
<td class="unit_price"><%= number_to_currency(item.unit_price) %></td>
|
||||
<td class="taxable center">
|
||||
<%= item.taxable ? content_tag(:span, '', class: 'icon icon-ok') : "" %>
|
||||
</td>
|
||||
<td class="active center">
|
||||
<%= checked_image item.active %>
|
||||
</td>
|
||||
<td class="buttons">
|
||||
<%= link_to l(:button_edit), edit_item_path(item), class: 'icon icon-edit' %>
|
||||
<%= link_to l(:button_delete), item_path(item),
|
||||
method: :delete,
|
||||
data: { confirm: l(:text_are_you_sure) },
|
||||
class: 'icon icon-del' %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user