Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into addorder
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
<%= simple_form_for([:crm,@crm_customer]) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ $(document).on('click',".customer_tr",function(){
|
||||
var url = "customers/" + customer_id + "/edit";
|
||||
}
|
||||
|
||||
$("#customer_tax_profiles").children().removeAttr("selected").css({'color':'#000','background':'none'});;
|
||||
$("#customer_tax_profiles").children().removeAttr("selected").css({'color':'#000','background':'none'});
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
@@ -135,7 +135,6 @@ $(document).on('click',".customer_tr",function(){
|
||||
// Selected for Taxes
|
||||
var taxes = JSON.stringify(data.tax_profiles);
|
||||
var parse_taxes = JSON.parse(taxes);
|
||||
console.log(parse_taxes);
|
||||
$.each(parse_taxes, function(i, value){
|
||||
$("#customer_tax_profiles option[value='" + value + "']").attr("selected","selected").css({'color':'#fff','background':'#215d9c'});
|
||||
});
|
||||
|
||||
@@ -9,5 +9,6 @@
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit ,:class=>'btn btn-success'%>
|
||||
<%= link_to 'Back', settings_item_sets_path,:class => 'btn btn-danger' %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
<h1>Editing Settings Item Set</h1>
|
||||
|
||||
<%= render 'form', settings_item_set: @settings_item_set %>
|
||||
<%= link_to 'Back', settings_item_sets_path,:class => 'btn btn-danger' %>
|
||||
|
||||
@@ -2,4 +2,3 @@
|
||||
|
||||
<%= render 'form', settings_item_set: @settings_item_set %>
|
||||
|
||||
<%= link_to 'Back', settings_item_sets_path,:class => 'btn btn-danger' %>
|
||||
|
||||
@@ -1,36 +1,52 @@
|
||||
<%= simple_form_for([:settings,@category, @settings_menu_item]) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
<div class="col-md-4">
|
||||
|
||||
<div class="col-md-8 panel">
|
||||
<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>Menu Item Image</p>
|
||||
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
|
||||
<% end %>
|
||||
<div class="col-md-6">
|
||||
<%= f.input :item_code %>
|
||||
<%= f.input :name %>
|
||||
<%= f.input :alt_name %>
|
||||
<%= f.input :type %>
|
||||
<%= f.input :min_qty %>
|
||||
<%= f.input :account_id, :label => "Account type", :collection => Account.collection %>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<%= f.input :is_available, :class => "form-control" %>
|
||||
|
||||
<%= f.input :is_sub_item, :class => "form-control" %>
|
||||
|
||||
<%= f.input :item_attributes, :collection => @item_attributes, :input_html => { :multiple => true }, :class => "form-control item_attributes" %>
|
||||
|
||||
<%= f.input :item_options, :collection => @item_options, :input_html => { :multiple => true }, :class => "form-control item_options" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<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>Menu Item Image</p>
|
||||
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= f.file_field :image_path, :class => "img-thumbnail" %>
|
||||
</div>
|
||||
<%= f.file_field :image_path, :class => "img-thumbnail" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="form-inputs">
|
||||
<%= f.input :item_code %>
|
||||
<%= f.input :name %>
|
||||
<%= f.input :alt_name %>
|
||||
<%= f.input :type %>
|
||||
<%= f.input :account_id, :label => "Account type", :collection => Account.collection %>
|
||||
<%= f.input :menu_item_id, :label => "Parent Menu Item", :collection => MenuItem.collection %>
|
||||
|
||||
<%= f.input :min_qty %>
|
||||
<%= f.input :min_selectable_item %>
|
||||
<%= f.input :max_selectable_item %>
|
||||
<div class="panel padding-10">
|
||||
<div class="form-group">
|
||||
<%= f.input :item_sets, :collection => @item_sets, :input_html => { :multiple => true }, :class => "form-control item_sets" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
<!-- <h1>Editing Settings Menu Item</h1>-->
|
||||
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
@@ -8,5 +6,27 @@
|
||||
<li>Edit</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', settings_set_menu_item: @settings_menu_item %>
|
||||
|
||||
<%= render 'form', settings_set_menu_item: @settings_menu_item, item_sets: @item_sets %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
// auto selected after loaded
|
||||
<%
|
||||
@settings_menu_item.item_sets.each do |set|
|
||||
%>
|
||||
$("#simple_menu_item_item_sets option[value='" + <%= set.id %> + "']").attr("selected","selected").css({'color':'#fff','background':'#215d9c'});
|
||||
<%
|
||||
end
|
||||
%>
|
||||
|
||||
// After loaded
|
||||
$("#simple_menu_item_item_sets").on('click', 'option', function(e){
|
||||
if($(this).attr("selected")){
|
||||
$(this).removeAttr("selected");
|
||||
$(this).css({'color':'#000','background':'#fff'});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -11,5 +11,5 @@
|
||||
<li>New</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', settings_set_menu_item: @settings_menu_item %>
|
||||
<%= render 'form', settings_set_menu_item: @settings_menu_item, item_attributes: @item_attributes, item_options: @item_options, item_sets: @item_sets %>
|
||||
</div>
|
||||
|
||||
@@ -1,35 +1,52 @@
|
||||
<%= simple_form_for([:settings,@category, @settings_menu_item]) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
<div class="col-md-4">
|
||||
|
||||
<div class="col-md-8 panel">
|
||||
<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>Menu Item Image</p>
|
||||
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
|
||||
<% end %>
|
||||
<div class="col-md-6">
|
||||
<%= f.input :item_code %>
|
||||
<%= f.input :name %>
|
||||
<%= f.input :alt_name %>
|
||||
<%= f.input :type %>
|
||||
<%= f.input :min_qty %>
|
||||
<%= f.input :account_id, :label => "Account type", :collection => Account.collection %>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<%= f.input :is_available, :class => "form-control" %>
|
||||
|
||||
<%= f.input :is_sub_item, :class => "form-control" %>
|
||||
|
||||
<%= f.input :item_attributes, :collection => @item_attributes, :input_html => { :multiple => true }, :class => "form-control item_attributes" %>
|
||||
|
||||
<%= f.input :item_options, :collection => @item_options, :input_html => { :multiple => true }, :class => "form-control item_options" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<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>Menu Item Image</p>
|
||||
<%= image_tag "/image/menu_images/default.png", :class => "img-thumbnail" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= f.file_field :image_path, :class => "img-thumbnail" %>
|
||||
</div>
|
||||
<%= f.file_field :image_path, :class => "img-thumbnail" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="form-inputs">
|
||||
<%= f.input :item_code %>
|
||||
<%= f.input :name %>
|
||||
<%= f.input :alt_name %>
|
||||
<%= f.input :type %>
|
||||
<%= f.input :account_id, :label => "Account type", :collection => Account.collection %>
|
||||
<%= f.input :menu_item_id, :label => "Parent Menu Item", :collection => MenuItem.collection %>
|
||||
<%= f.input :min_qty %>
|
||||
<%= f.input :min_selectable_item %>
|
||||
<%= f.input :max_selectable_item %>
|
||||
<div class="panel padding-10">
|
||||
<div class="form-group">
|
||||
<%= f.input :item_sets, :collection => @item_sets, :input_html => { :multiple => true }, :class => "form-control item_sets" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
<div class="form-actions">
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
<!-- <h1>Editing Settings Menu Item</h1>
|
||||
|
||||
<%= render 'form', settings_menu_item: @settings_menu_item %>-->
|
||||
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
@@ -10,5 +6,27 @@
|
||||
<li>Edit</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', settings_simple_menu_item: @settings_menu_item %>
|
||||
|
||||
<%= render 'form', settings_simple_menu_item: @settings_menu_item, item_sets: @item_sets %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
// auto selected after loaded
|
||||
<%
|
||||
@settings_menu_item.item_sets.each do |set|
|
||||
%>
|
||||
$("#simple_menu_item_item_sets option[value='" + <%= set.id %> + "']").attr("selected","selected").css({'color':'#fff','background':'#215d9c'});
|
||||
<%
|
||||
end
|
||||
%>
|
||||
|
||||
// After loaded
|
||||
$("#simple_menu_item_item_sets").on('click', 'option', function(e){
|
||||
if($(this).attr("selected")){
|
||||
$(this).removeAttr("selected");
|
||||
$(this).css({'color':'#000','background':'#fff'});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -10,5 +10,9 @@
|
||||
<li>New</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', settings_simple_menu_item: @settings_menu_item %>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= render 'form', settings_simple_menu_item: @settings_menu_item, item_attributes: @item_attributes, item_options: @item_options, item_sets: @item_sets %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user