update adminbsb for setting pages

This commit is contained in:
Aung Myo
2017-10-12 18:17:05 +06:30
parent 049d3c5958
commit e9ff6481d4
13 changed files with 381 additions and 243 deletions

View File

@@ -1,35 +1,49 @@
<%= simple_form_for([:settings,@settings_product]) do |f| %>
<%= f.error_notification %>
<div class="col-md-8">
<div class="form-group">
<%= f.input :item_code, :input_html => { :id => 'item_code' } %>
<%= f.input :name %>
<%= f.input :alt_name %>
<%= f.input :unit_price %>
<%= f.input :description %>
<%= f.input :information %>
<label><%= f.check_box :taxable %>Taxable</label>
</div>
</div>
<label>Product Image</label>
<div class="col-md-4">
<div class="panel padding-10">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">
<%= simple_form_for([:settings,@settings_product]) do |f| %>
<%= f.error_notification %>
<div class="form-group">
<div class="menu-item-img">
<% if f.object.image_path? %>
<p><%= f.object.name %></p>
<%= image_tag f.object.image_path.url, :class => "img-thumbnail" %>
<% else %>
<p>Sample Image</p>
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
<% end %>
</div>
<%= f.file_field :image_path, :class => "img-thumbnail" %>
<%= f.input :item_code, :input_html => { :id => 'item_code' } %>
<%= f.input :name %>
<%= f.input :alt_name %>
<%= f.input :unit_price %>
<%= f.input :description %>
<%= f.input :information %>
<label><%= f.check_box :taxable %>Taxable</label>
</div>
</div>
<div class="form-actions">
<%= f.button :submit %>
<label>Product Image</label>
<div class="panel padding-10">
<div class="form-group">
<div class="menu-item-img">
<% if f.object.image_path? %>
<p><%= f.object.name %></p>
<%= image_tag f.object.image_path.url, :class => "img-thumbnail" %>
<% else %>
<p>Sample Image</p>
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
<% end %>
</div>
<%= f.file_field :image_path, :class => "img-thumbnail" %>
</div>
</div>
<div class="form-actions">
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
</div>
<% end %>
</div>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
<div class="card">
<div class="body">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
</div>
</div>
</div>
<% end %>
</div>

View File

@@ -1,10 +1,12 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= settings_products_path %>">Products</a></li>
<li>Edit</li>
</ul>
</div>
<%= render 'form', settings_product: @settings_product %>
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item"><a href="<%= settings_products_path %>">Products</a></li>
<li class="breadcrumb-item active">Edit</li>
<span class="float-right">
<%= link_to 'Back', settings_products_path %>
</span>
</ol>
</div>
<br>
<%= render 'form', settings_product: @settings_product %>

View File

@@ -1,15 +1,21 @@
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= %>">Home</a></li>
<li>Product</li>
<span style="float: right">
<%= link_to t('.new', :default => t("helpers.links.new")),new_settings_product_path,:class => 'btn btn-primary btn-sm' %>
</span>
</ul>
</div>
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item active">Product</li>
<span class="float-right">
<%= link_to 'Back', dashboard_path %>
</span>
</ol>
</div>
<br>
<div class="card">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">
<div class="m-b-10 clearfix">
<%= link_to t('.new', :default => t("helpers.links.new")),new_settings_product_path,:class => 'btn btn-primary btn-lg float-right waves-effect"' %>
</div>
<div class="card">
<table class="table table-striped">
<thead>
<tr>
@@ -21,7 +27,7 @@
<th>Description</th>
<th>Information</th>
<th>Taxable</th>
<th colspan="3"></th>
<th >Actions</th>
</tr>
</thead>
@@ -35,11 +41,24 @@
<td><%= settings_product.description %></td>
<td><%= settings_product.information %></td>
<td><%= settings_product.taxable %></td>
<td><%= link_to 'Show', settings_product_path(settings_product) %></td>
<td><%= link_to 'Edit', edit_settings_product_path(settings_product) %></td>
<td><%= link_to 'Destroy', settings_product_path(settings_product), method: :delete, data: { confirm: 'Are you sure?' } %></td>
<td><%= link_to 'Show', settings_product_path(settings_product),:class => 'btn btn-info btn-lg waves-effect' %>
<%= link_to 'Edit', edit_settings_product_path(settings_product),:class => 'btn btn-primary btn-lg waves-effect' %>
<%= link_to 'Destroy', settings_product_path(settings_product), method: :delete, data: { confirm: 'Are you sure?' },:class => 'btn btn-danger btn-lg waves-effect' %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
<div class="card">
<div class="body">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
</div>
</div>
</div>
</div>

View File

@@ -1,4 +1,4 @@
<div class="span12">
<!-- <div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
@@ -7,8 +7,19 @@
</ul>
</div>
<%= render 'form', settings_product: @settings_product %>
</div> -->
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item"><a href="<%= settings_products_path %>">Products</a></li>
<li class="breadcrumb-item active">New</li>
<span class="float-right">
<%= link_to 'Back', settings_products_path %>
</span>
</ol>
</div>
<br>
<%= render 'form', settings_product: @settings_product %>
<script>
function randomNumber(len) {
var sValidCharacters = "01234ABCDEFGHIJabcdefghijk56789lmnKLMNOPQRSTUVWXYZopqrstuvwxyz";

View File

@@ -1,33 +1,45 @@
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= settings_products_path %>">Products</a></li>
<span style="float: right">
</span>
</ul>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item"><a href="<%= settings_products_path %>">Products</a></li>
<li class="breadcrumb-item active">Details</li>
<span class="float-right">
<%= link_to 'Back', settings_products_path %>
</span>
</ol>
</div>
<div class="card">
<div class="card-block">
<h4 class="card-title">Product</h4>
<table class="table">
<br>
<tbody>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">
<div class="card">
<div class="card-block">
<h4 class="card-title">Product</h4>
<table class="table">
<tr><td style="width:20%">Item code</td><td><%= @settings_product.item_code %></td></tr>
<tr><td style="width:20%">Name</td><td><%= @settings_product.name %></td></tr>
<tr><td style="width:20%">Alt name</td><td><%= @settings_product.alt_name %></td></tr>
<tr><td style="width:20%">Unit price</td><td><%= @settings_product.unit_price %></td></tr>
<tr><td style="width:20%">Image path</td><td><%= image_tag @settings_product.image_path, :size => '200x200'%></td></tr>
<tr><td style="width:20%">Description</td><td><%= @settings_product.description %></td></tr>
<tr><td style="width:20%">Information</td><td><%= @settings_product.information %></td></tr>
<tr><td style="width:20%">Taxable</td><td><%= @settings_product.taxable %></td></tr>
<tr><td style="width:20%"><%= link_to 'Edit', edit_settings_product_path(@settings_product) %></td><td><%= link_to 'Destroy', settings_product_path(@settings_product), method: :delete, data: { confirm: 'Are you sure?' } %></td></tr>
<tbody>
</tbody>
</table>
<tr><td style="width:20%">Item code</td><td><%= @settings_product.item_code %></td></tr>
<tr><td style="width:20%">Name</td><td><%= @settings_product.name %></td></tr>
<tr><td style="width:20%">Alt name</td><td><%= @settings_product.alt_name %></td></tr>
<tr><td style="width:20%">Unit price</td><td><%= @settings_product.unit_price %></td></tr>
<tr><td style="width:20%">Image path</td><td><%= image_tag @settings_product.image_path, :size => '200x200'%></td></tr>
<tr><td style="width:20%">Description</td><td><%= @settings_product.description %></td></tr>
<tr><td style="width:20%">Information</td><td><%= @settings_product.information %></td></tr>
<tr><td style="width:20%">Taxable</td><td><%= @settings_product.taxable %></td></tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
<div class="card">
<div class="body">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
</div>
</div>
</div>
</div>