Merge branch 'ui_ux_changes' of bitbucket.org:code2lab/sxrestaurant into ui_ux_changes
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
@import "BSBMaterial/style";
|
||||
@import "BSBMaterial/themes/all-themes";
|
||||
@import "reset";
|
||||
@import "fileinput.min";
|
||||
|
||||
|
||||
/* Reset */
|
||||
|
||||
@@ -96,7 +96,7 @@ class Crm::CustomersController < BaseCrmController
|
||||
|
||||
# POST /crm/customers
|
||||
# POST /crm/customers.json
|
||||
def create
|
||||
def create
|
||||
# Remove "" default first
|
||||
params[:customer][:tax_profiles].delete_at(0)
|
||||
@crm_customers = Customer.new(customer_params)
|
||||
|
||||
@@ -19,6 +19,10 @@ class CommissionerImageUploader < CarrierWave::Uploader::Base
|
||||
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||
end
|
||||
|
||||
def filename
|
||||
"#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present?
|
||||
end
|
||||
|
||||
# def cache_dir
|
||||
# '/tmp/images'
|
||||
# end
|
||||
|
||||
@@ -19,6 +19,10 @@ class CustomerImageUploader < CarrierWave::Uploader::Base
|
||||
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||
end
|
||||
|
||||
def filename
|
||||
"#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present?
|
||||
end
|
||||
|
||||
# def cache_dir
|
||||
# '/tmp/images'
|
||||
# end
|
||||
|
||||
@@ -19,6 +19,10 @@ class EmployeeImageUploader < CarrierWave::Uploader::Base
|
||||
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||
end
|
||||
|
||||
def filename
|
||||
"#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present?
|
||||
end
|
||||
|
||||
# def cache_dir
|
||||
# '/tmp/images'
|
||||
# end
|
||||
|
||||
@@ -19,6 +19,10 @@ class MenuItemImageUploader < CarrierWave::Uploader::Base
|
||||
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||
end
|
||||
|
||||
def filename
|
||||
"#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present?
|
||||
end
|
||||
|
||||
# def cache_dir
|
||||
# '/tmp/images'
|
||||
# end
|
||||
|
||||
@@ -19,6 +19,10 @@ class ProductImageUploader < CarrierWave::Uploader::Base
|
||||
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||
end
|
||||
|
||||
def filename
|
||||
"#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present?
|
||||
end
|
||||
|
||||
# def cache_dir
|
||||
# '/tmp/images'
|
||||
# end
|
||||
|
||||
@@ -19,6 +19,10 @@ class ShopImageUploader < CarrierWave::Uploader::Base
|
||||
# "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||
end
|
||||
|
||||
def filename
|
||||
"#{Shop.find(1).shop_code}_#{original_filename}" if original_filename.present?
|
||||
end
|
||||
|
||||
# def cache_dir
|
||||
# '/tmp/images'
|
||||
# end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
json.extract! @crm_customer, :id, :name, :company, :contact_no, :email, :date_of_birth,
|
||||
:membership_id, :membership_type, :membership_authentication_code,
|
||||
:salutation, :gender,:nrc_no,:address,:card_no, :paypar_account_no, :customer_type, :tax_profiles
|
||||
:salutation, :gender,:nrc_no,:address,:card_no, :paypar_account_no, :customer_type, :image_path, :tax_profiles
|
||||
json.url crm_customer_url(@crm_customer, format: :json)
|
||||
@@ -185,7 +185,7 @@ $(document).on('click',".customer_tr",function(){
|
||||
url: url,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
success: function(data) {
|
||||
// Selected for Taxes
|
||||
var taxes = JSON.stringify(data.tax_profiles);
|
||||
var parse_taxes = JSON.parse(taxes);
|
||||
@@ -193,7 +193,7 @@ $(document).on('click',".customer_tr",function(){
|
||||
$("#customer_tax_profiles option[value='" + value + "']").attr("selected","selected").css({'color':'#fff','background':'#215d9c'});
|
||||
});
|
||||
|
||||
$('#customer_id').val(data.id);
|
||||
$('#customer_id').val(data.id);
|
||||
$('#customer_name').val(data.name);
|
||||
$('#customer_company').val(data.company);
|
||||
$('#customer_contact_no').val(data.contact_no);
|
||||
@@ -205,6 +205,9 @@ $(document).on('click',".customer_tr",function(){
|
||||
$('#paypar_account_no').val(data.paypar_account_no);
|
||||
$('#customer_address').val(data.address);
|
||||
$('#customer_date_of_birth').val(data.date_of_birth);
|
||||
if(data.image_path.url!=undefined && data.image_path.url!=null){
|
||||
$('.menu-item-img .img-thumbnail').attr('src',data.image_path.url);
|
||||
}
|
||||
$('#customer_membership_type').val(data.membership_type);
|
||||
$('.selectpicker > option[value="'+data.membership_type+'"]').attr('selected','selected');
|
||||
if (data.gender == 'Male') {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
json.extract! @crm_customer, :id, :name, :company, :contact_no, :email, :date_of_birth,
|
||||
:membership_id, :membership_type, :membership_authentication_code,
|
||||
:salutation, :gender,:nrc_no,:address,:card_no, :paypar_account_no, :customer_type, :tax_profiles
|
||||
:salutation, :gender,:nrc_no,:address,:card_no, :paypar_account_no, :customer_type, :image_path, :tax_profiles
|
||||
json.url crm_customer_url(@crm_customer, format: :json)
|
||||
|
||||
@@ -207,6 +207,21 @@
|
||||
<%= f.text_field :date_of_birth,:value=>"01-01-1990",:class=>"form-control datepicker"%>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><%= t("views.right_panel.detail.customer_photo") %></label>
|
||||
<div class="panel padding-10">
|
||||
<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 %>
|
||||
<%= 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-group">
|
||||
<label><%= t("views.right_panel.detail.select_customer_type") %></label>
|
||||
<select class="form-control col-md-12" id="customer_type" name="customer[customer_type]" style="height: 40px" >
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
redis: &redis
|
||||
adapter: redis
|
||||
url: redis://localhost:6379/1
|
||||
|
||||
production: *redis
|
||||
development: *redis
|
||||
test: *redis
|
||||
Reference in New Issue
Block a user