add survey
This commit is contained in:
@@ -319,6 +319,7 @@
|
||||
Back
|
||||
</button>
|
||||
<button type="button" id="add_order" class="btn btn-block bg-blue waves-effect">Add Order</button>
|
||||
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect">Survey</button>
|
||||
<% if @dining.status != "available" %>
|
||||
<% if @status_order == 'order' %>
|
||||
<button type="button" id="customer" class="btn btn-block bg-blue waves-effect" disabled>Customer</button>
|
||||
@@ -395,6 +396,19 @@
|
||||
window.location.href = '/origami/order/' + order_id;
|
||||
});
|
||||
|
||||
// bind survey to order or sale
|
||||
$("#survey").on('click', function () {
|
||||
var sale = $('#sale_id').val();
|
||||
if (sale) {
|
||||
var sale_id = sale
|
||||
} else {
|
||||
var sale_id = $('#save_order_id').attr('data-order');
|
||||
}
|
||||
var table_id = $('.tables').attr("data-id");
|
||||
|
||||
window.location.href = '/origami/' + sale_id + "/survey"
|
||||
});
|
||||
|
||||
// bind customer to order or sale
|
||||
$("#customer").on('click', function () {
|
||||
var sale = $('#sale_id').val();
|
||||
|
||||
@@ -306,6 +306,7 @@
|
||||
<!-- Waiter Buttons -->
|
||||
<button type="button" class="btn btn-default btn-block" id='back'><i class="fa fa-arrow-left"></i> Back</button>
|
||||
<button type="button" id="add_order" class="btn btn-block btn- bg-blue waves-effect">Add Order</button>
|
||||
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect">Survey</button>
|
||||
<% if @room.bookings.length >= 1 %>
|
||||
<% if @status_order == 'order' && @status_sale != 'sale' %>
|
||||
<!-- <button type="button" class="btn bg-blue btn-block" >Add Order</button> -->
|
||||
@@ -409,6 +410,19 @@ $(document).ready(function(){
|
||||
window.location.href = '/origami/order/' + order_id;
|
||||
});
|
||||
|
||||
// bind survey to order or sale
|
||||
$("#survey").on('click', function () {
|
||||
var sale = $('#sale_id').val();
|
||||
if (sale) {
|
||||
var sale_id = sale
|
||||
} else {
|
||||
var sale_id = $('#save_order_id').attr('data-order');
|
||||
}
|
||||
var table_id = $('.tables').attr("data-id");
|
||||
|
||||
window.location.href = '/origami/' + sale_id + "/survey"
|
||||
});
|
||||
|
||||
// bind customer to order or sale
|
||||
$("#customer").on('click', function(){
|
||||
var sale = $('#sale_id').val();
|
||||
|
||||
42
app/views/origami/surveys/_form.html.erb
Executable file
42
app/views/origami/surveys/_form.html.erb
Executable file
@@ -0,0 +1,42 @@
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
|
||||
<%= simple_form_for([:settings,@settings_account]) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
<div class="form-inputs p-l-10">
|
||||
<%= f.input :title ,:input_html=>{:class=>"col-md-10"},:required=>true%>
|
||||
<%= f.input :account_type, :collection => Lookup.collection_of("account_type"),:input_html=>{:class=>"col-md-10"},:required=>true %>
|
||||
<%= f.input :discount %>
|
||||
<%= f.input :point %>
|
||||
<%= f.input :bonus %>
|
||||
<%= f.input :rebate %>
|
||||
</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-4 col-lg-4">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.detail.title") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.title_txt") %> <br>
|
||||
2) <%= t("views.right_panel.detail.account_type") %> - <%= t("views.right_panel.detail.write_txt") %> <%= t("views.right_panel.detail.account_type_txt") %> <br>
|
||||
3) <%= t("views.right_panel.detail.discount") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.discount_txt") %> <br>
|
||||
4) <%= t("views.right_panel.detail.point") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.point_txt") %> <br>
|
||||
5) <%= t("views.right_panel.detail.bonus") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.bonus_txt") %> <br>
|
||||
6) <%= t("views.right_panel.detail.rebate") %> - <%= t("views.right_panel.detail.checkbox") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.rebate_txt") %> <br>
|
||||
</p>
|
||||
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.button_lists") %></i> </h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.button.submit") %> - <%= t("views.right_panel.detail.submit_btn_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
|
||||
</p>
|
||||
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.link_lists") %></i> </h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.button.home") %> - <%= t("views.right_panel.detail.home_txt") %> <br>
|
||||
2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
2
app/views/origami/surveys/_survey.json.jbuilder
Executable file
2
app/views/origami/surveys/_survey.json.jbuilder
Executable file
@@ -0,0 +1,2 @@
|
||||
json.extract! settings_account, :id, :title, :account_type, :created_at, :updated_at
|
||||
json.url settings_account_url(settings_account, format: :json)
|
||||
12
app/views/origami/surveys/edit.html.erb
Executable file
12
app/views/origami/surveys/edit.html.erb
Executable file
@@ -0,0 +1,12 @@
|
||||
<div class="page-header">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
||||
<li class="breadcrumb-item"><a href="<%= settings_accounts_path %>"><%= t("views.right_panel.detail.account") %></a></li>
|
||||
<li class="breadcrumb-item active"><%= t("views.btn.edit") %></li>
|
||||
<span class="float-right">
|
||||
<%= link_to t('.back', :default => t("views.btn.back")), settings_accounts_path %>
|
||||
</span>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<%= render 'form', settings_account: @settings_account %>
|
||||
77
app/views/origami/surveys/index.html.erb
Executable file
77
app/views/origami/surveys/index.html.erb
Executable file
@@ -0,0 +1,77 @@
|
||||
<div class="page-header">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
||||
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.account") %></li>
|
||||
<span class="float-right">
|
||||
<%= link_to t('.back', :default => t("views.btn.back")), dashboard_path %>
|
||||
</span>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<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("views.btn.new"),new_settings_account_path,:class => 'btn btn-primary btn-lg float-right waves-effect"' %>
|
||||
</div>
|
||||
<div class="card">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.title") %></th>
|
||||
<th><%= t("views.right_panel.detail.account_type") %></th>
|
||||
<th><%= t("views.right_panel.detail.discount") %></th>
|
||||
<th><%= t("views.right_panel.detail.point") %></th>
|
||||
<th><%= t("views.right_panel.detail.bonus") %></th>
|
||||
<th><%= t("views.right_panel.detail.rebate") %></th>
|
||||
<th><%= t("views.right_panel.detail.actions") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @settings_accounts.each do |account| %>
|
||||
<tr>
|
||||
<td><%= account.title %></td>
|
||||
<td><%= %><%= account.account_type == 1 ? "Expense" : "Income"%></td>
|
||||
<td><%= account.discount %></td>
|
||||
<td><%= account.point %></td>
|
||||
<td><%= account.bonus %></td>
|
||||
<td><%= account.rebate %></td>
|
||||
<td>
|
||||
<%= link_to t("views.btn.show"), settings_account_path(account),:class => 'btn btn-info btn-sm waves-effect' %>
|
||||
<%= link_to t("views.btn.edit"), edit_settings_account_path(account),:class => 'btn btn-primary btn-sm 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">
|
||||
<h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.detail.title") %> - <%= t("views.right_panel.detail.title_txt") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.account_txt") %> <br>
|
||||
2) <%= t("views.right_panel.detail.account_type") %> - <%= t("views.right_panel.detail.account_type_txt") %> <br>
|
||||
3) <%= t("views.right_panel.detail.discount") %> - <%= t("views.right_panel.detail.status_txt2") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.discount_txt") %> <br>
|
||||
4) <%= t("views.right_panel.detail.point") %> - <%= t("views.right_panel.detail.status_txt2") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.point_txt") %> <br>
|
||||
5) <%= t("views.right_panel.detail.bonus") %> - <%= t("views.right_panel.detail.status_txt2") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.bonus_txt") %> <br>
|
||||
6) <%= t("views.right_panel.detail.rebate") %> - <%= t("views.right_panel.detail.status_txt2") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.rebate_txt") %> <br>
|
||||
7) <%= t("views.right_panel.detail.actions") %> - <%= t("views.right_panel.detail.actions_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
|
||||
</p>
|
||||
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.button_lists") %></i> </h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.button.new") %> - <%= t("views.right_panel.detail.new_btn_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
|
||||
2) <%= t("views.right_panel.button.show") %> - <%= t("views.right_panel.detail.show_btn_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
|
||||
2) <%= t("views.right_panel.button.edit") %> - <%= t("views.right_panel.detail.edit_btn_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
|
||||
</p>
|
||||
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.link_lists") %></i> </h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.button.home") %> - <%= t("views.right_panel.detail.home_txt") %> <br>
|
||||
2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.dashboard_txt") %> <br>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
1
app/views/origami/surveys/index.json.jbuilder
Executable file
1
app/views/origami/surveys/index.json.jbuilder
Executable file
@@ -0,0 +1 @@
|
||||
json.array! @settings_accounts, partial: 'settings_accounts/settings_account', as: :settings_account
|
||||
12
app/views/origami/surveys/new.html.erb
Executable file
12
app/views/origami/surveys/new.html.erb
Executable file
@@ -0,0 +1,12 @@
|
||||
<div class="page-header">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
||||
<li class="breadcrumb-item"><a href="<%= settings_accounts_path %>"><%= t("views.right_panel.detail.account") %></a></li>
|
||||
<li class="breadcrumb-item active"><%= t("views.btn.new") %></li>
|
||||
<span class="float-right">
|
||||
<%= link_to t('.back', :default => t("views.btn.back")), settings_accounts_path %>
|
||||
</span>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<%= render 'form', settings_account: @settings_account %>
|
||||
84
app/views/origami/surveys/show.html.erb
Executable file
84
app/views/origami/surveys/show.html.erb
Executable file
@@ -0,0 +1,84 @@
|
||||
<!-- -->
|
||||
<div class="page-header">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
||||
<li class="breadcrumb-item"><a href="<%= settings_accounts_path %>"><%= t("views.right_panel.detail.account") %></a></li>
|
||||
<li class="breadcrumb-item active"><%= t :details %></li>
|
||||
<span class="float-right">
|
||||
<%= link_to t('.back', :default => t("views.btn.back")), settings_accounts_path %>
|
||||
</span>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Account</h4>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.title") %></th>
|
||||
<th><%= t("views.right_panel.detail.account_type") %></th>
|
||||
<!-- <th>Can get Discount</th> -->
|
||||
<th><%= t("views.right_panel.detail.can_get_points") %></th>
|
||||
<!-- <th>Can get Bonus</th> -->
|
||||
<th><%= t("views.right_panel.detail.can_rebate") %></th>
|
||||
<th><%= t("views.right_panel.detail.actions") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><%= @settings_account.title %></td>
|
||||
<td><%= @settings_account.account_type %></td>
|
||||
<!-- <td><%= @settings_account.discount %></td> -->
|
||||
<td><%= @settings_account.point %></td>
|
||||
<!-- <td><%= @settings_account.bonus %></td> -->
|
||||
<td><%= @settings_account.rebate %></td>
|
||||
|
||||
<td><%= link_to t("views.btn.edit"), edit_settings_account_path(@settings_account),:class => 'btn btn-primary btn-sm waves-effect' %>
|
||||
<button class="delete btn btn-danger btn-sm waves-effect" data-ref="<%= settings_account_path(@settings_account)%>" data-method="delete">
|
||||
<%= t("views.btn.delete") %>
|
||||
</button>
|
||||
|
||||
<span class="hidden" id="delete_text">
|
||||
<h6>Are you sure you want to delete this row ?</h6>
|
||||
<h6>This action can't be undo. </h6>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
|
||||
<div class="card">
|
||||
<div class="body">
|
||||
<h5><i class="material-icons md-18">view_headline <%= t("views.right_panel.header.page_detail") %></i></h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.detail.title") %> - <%= t("views.right_panel.detail.title_txt") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.account_txt") %> <br>
|
||||
2) <%= t("views.right_panel.detail.account_type") %> - <%= t("views.right_panel.detail.account_type_txt") %> <br>
|
||||
3) <%= t("views.right_panel.detail.can_get_points") %> - <%= t("views.right_panel.detail.status_txt2") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.point_txt") %> <br>
|
||||
4) <%= t("views.right_panel.detail.can_rebate") %> - <%= t("views.right_panel.detail.status_txt2") %> <%= t("views.right_panel.detail.for") %> <%= t("views.right_panel.detail.rebate_txt") %> <br>
|
||||
5) <%= t("views.right_panel.detail.actions") %> - <%= t("views.right_panel.detail.actions_txt2") %> <%= t("views.right_panel.detail.account_txt") %> <br>
|
||||
</p>
|
||||
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.button_lists") %></i> </h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.button.edit") %> - <%= t("views.right_panel.detail.edit_btn_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
|
||||
2) <%= t("views.right_panel.button.delete") %> - <%= t("views.right_panel.detail.delete_btn_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
|
||||
</p>
|
||||
<h5><i class="material-icons md-18">list <%= t("views.right_panel.header.link_lists") %></i> </h5>
|
||||
<p>
|
||||
1) <%= t("views.right_panel.button.home") %> - <%= t("views.right_panel.detail.home_txt") %> <br>
|
||||
2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
1
app/views/origami/surveys/show.json.jbuilder
Executable file
1
app/views/origami/surveys/show.json.jbuilder
Executable file
@@ -0,0 +1 @@
|
||||
json.partial! "settings_accounts/settings_account", settings_account: @settings_account
|
||||
Reference in New Issue
Block a user