part work multi categories
This commit is contained in:
parent
0a59ddaf8d
commit
ec98d5340d
|
|
@ -0,0 +1,42 @@
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="info-box" style="border: 1px solid rgba(0,0,0,0.2);">
|
||||||
|
<span class="info-box-icon bg-aqua">
|
||||||
|
<i class="fa fa-money"></i>
|
||||||
|
</span>
|
||||||
|
<div class="info-box-content">
|
||||||
|
<span class="info-box-text">Cena</span>
|
||||||
|
<span class="info-box-number">
|
||||||
|
<a href="#" class="xedit" data-type="text" data-pk="<%= @product.id %>" data-name="price" data-url="/ps_admin/product/xedit" data-title="Cena"><%= '%.2f' % @product.price %></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="info-box" style="border: 1px solid rgba(0,0,0,0.2);">
|
||||||
|
<span class="info-box-icon bg-yellow">
|
||||||
|
<i class="fa fa-building"></i>
|
||||||
|
</span>
|
||||||
|
<div class="info-box-content">
|
||||||
|
<span class="info-box-text">Ilość</span>
|
||||||
|
<span class="info-box-number">
|
||||||
|
<a href="#" class="xedit" data-type="text" data-pk="<%= @product.id %>" data-name="qty" data-url="/ps_admin/product/xedit" data-title="Ilość"><%= @product.quantity %></a>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3" id="product_show_active">
|
||||||
|
<%= render '/ps_admin/product/partials/set_active' %>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3" id="product_show_quantity">
|
||||||
|
<%= render '/ps_admin/product/partials/set_chk_quantity' %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6" id="product_show_images">
|
||||||
|
<%= render '/ps_admin/image/partials/images' %>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6" id="product_show_images_form">
|
||||||
|
<%= render '/ps_admin/image/partials/form' %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<thead>
|
||||||
|
<tr><th>Kategoria</th><th><%= link_to raw('<i class="fa fa-plus"></i> Dodaj'), '#', class: "btn btn-success btn-xs" %></th></tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<% @product.categories.each do |cat| %>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<% if cat.id == @product.default_category_id %>
|
||||||
|
<strong>
|
||||||
|
<% end %>
|
||||||
|
<% cat.ancestors.reverse!.each do |c| %>
|
||||||
|
<%= c.name %> >
|
||||||
|
<% end %>
|
||||||
|
<%= cat.name %>
|
||||||
|
<% if cat.id == @product.default_category_id %>
|
||||||
|
</strong>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<%= link_to raw('<i class="fa fa-trash"></i> Usuń'), {controller: '/ps_admin/product', action: 'destroy', id: @product.id, category_id: cat.id},
|
||||||
|
class: "btn btn-danger btn-xs", method: :delete, data: { confirm: cat.id == @product.default_category_id ? "Czy na pewno usunąć produkt?\nUWAGA: Ta operacja usunie produkt ze wszystkich kategorii" : "Czy napewno usunąć produkt z tej kategorii?" }, remote: true %>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -5,47 +5,19 @@
|
||||||
<h3 class="box-title"><%= @product.name %></h3>
|
<h3 class="box-title"><%= @product.name %></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div class="row">
|
<div class="nav-tabs-custom">
|
||||||
<div class="col-md-3">
|
<ul class="nav nav-tabs">
|
||||||
<div class="info-box" style="border: 1px solid rgba(0,0,0,0.2);">
|
<li class="active"><a href="#dane_podst_tab" data-toggle="tab">Dane podstawowe</a></li>
|
||||||
<span class="info-box-icon bg-aqua">
|
<li><a href="#kategorie_tab" data-toggle="tab">Kategorie</a></li>
|
||||||
<i class="fa fa-money"></i>
|
</ul>
|
||||||
</span>
|
<div class="tab-content">
|
||||||
<div class="info-box-content">
|
<div class="tab-pane active" id="dane_podst_tab">
|
||||||
<span class="info-box-text">Cena</span>
|
<%= render '/ps_admin/product/partials/basic_information' %>
|
||||||
<span class="info-box-number">
|
|
||||||
<a href="#" class="xedit" data-type="text" data-pk="<%= @product.id %>" data-name="price" data-url="/ps_admin/product/xedit" data-title="Cena"><%= '%.2f' % @product.price %></a>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="tab-pane" id="kategorie_tab">
|
||||||
<div class="col-md-3">
|
<%= render '/ps_admin/product/partials/categories' %>
|
||||||
<div class="info-box" style="border: 1px solid rgba(0,0,0,0.2);">
|
|
||||||
<span class="info-box-icon bg-yellow">
|
|
||||||
<i class="fa fa-building"></i>
|
|
||||||
</span>
|
|
||||||
<div class="info-box-content">
|
|
||||||
<span class="info-box-text">Ilość</span>
|
|
||||||
<span class="info-box-number">
|
|
||||||
<a href="#" class="xedit" data-type="text" data-pk="<%= @product.id %>" data-name="qty" data-url="/ps_admin/product/xedit" data-title="Ilość"><%= @product.quantity %></a>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3" id="product_show_active">
|
|
||||||
<%= render '/ps_admin/product/partials/set_active' %>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3" id="product_show_quantity">
|
|
||||||
<%= render '/ps_admin/product/partials/set_chk_quantity' %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-6" id="product_show_images">
|
|
||||||
<%= render '/ps_admin/image/partials/images' %>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6" id="product_show_images_form">
|
|
||||||
<%= render '/ps_admin/image/partials/form' %>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-footer">
|
<div class="box-footer">
|
||||||
|
|
@ -58,7 +30,7 @@
|
||||||
<%= javascript_include_tag 'bootstrap-editable' %>
|
<%= javascript_include_tag 'bootstrap-editable' %>
|
||||||
<script>
|
<script>
|
||||||
$.fn.editable.defaults.mode = 'popup';
|
$.fn.editable.defaults.mode = 'popup';
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$('.xedit').editable({
|
$('.xedit').editable({
|
||||||
success: function (response, newValue) {
|
success: function (response, newValue) {
|
||||||
if (!response.success)
|
if (!response.success)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue