merge with august_spring
This commit is contained in:
@@ -332,7 +332,7 @@
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block">Discount</button>
|
||||
<button type="button" id="other-charges" class="btn btn-primary btn-block">Charges</button>
|
||||
<button type="button" id="commissions" class="btn btn-primary btn-block">Commissions</button>
|
||||
<button type="button" id="in_juties" class="btn btn-primary btn-block">In Juties</button>
|
||||
<button type="button" id="in_duties" class="btn btn-primary btn-block">In Duties</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='move' disabled="">Move</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-block" disabled> Req.Bill</button>
|
||||
<button type="button" id="first_bill" class="btn btn-primary btn-block">First Bill</button>
|
||||
@@ -579,9 +579,9 @@
|
||||
window.location.href = '/origami/table/' + dining_id + "/sale/" + sale_id + "/load_commissioners";
|
||||
});
|
||||
|
||||
$('#in_juties').on('click', function () {
|
||||
$('#in_duties').on('click', function () {
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
window.location.href = '/origami/assign_in_juty/'+ dining_id;
|
||||
window.location.href = '/origami/assign_in_duty/'+ dining_id;
|
||||
});
|
||||
|
||||
$('#void').on('click', function () {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= simple_form_for([:origami, @in_juty]) do |f| %>
|
||||
<%= simple_form_for([:origami, @in_duty]) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= simple_form_for @in_juty, :url => origami_index_in_juty_path(@table.id), :method => :post do |f| %>
|
||||
<%= simple_form_for @in_duty, :url => origami_index_in_duty_path(@table.id), :method => :post do |f| %>
|
||||
<span class="patch_method"></span>
|
||||
<%= f.error_notification %>
|
||||
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
|
||||
2
app/views/origami/in_duties/_in_duty.json.jbuilder
Normal file
2
app/views/origami/in_duties/_in_duty.json.jbuilder
Normal file
@@ -0,0 +1,2 @@
|
||||
json.extract! in_duty, :id, :created_at, :updated_at
|
||||
json.url in_duty_url(in_duty, format: :json)
|
||||
@@ -1,9 +1,9 @@
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<h3>Create In Juty</h3>
|
||||
<h3>Create In Duty</h3>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<%= simple_form_for([:origami,@in_juty]) do |f| %>
|
||||
<%= simple_form_for([:origami,@in_duty]) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
@@ -22,10 +22,10 @@
|
||||
<div class="form-actions">
|
||||
<div class='row'>
|
||||
<div class="col-md-2">
|
||||
<%= link_to 'Back', origami_index_in_juty_path(@table.id), class: 'btn btn-success' %>
|
||||
<%= link_to 'Back', origami_index_in_duty_path(@table.id), class: 'btn btn-success' %>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<button type="button" class="btn btn-primary btn-block" id='in_juty'>Create In Juty</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='in_duty'>Create In Duty</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -45,18 +45,18 @@ $(function() {
|
||||
$('.datepicker').css('cursor','pointer');
|
||||
});
|
||||
|
||||
$('#in_juty').on('click', function () {
|
||||
var ajax_url = "/origami/assign_in_juty";
|
||||
var commissioner_ids = $('#in_juty_commissioner_ids').val();
|
||||
var in_time = $('#in_juty_in_time').val();
|
||||
var out_time = $('#in_juty_out_time').val();
|
||||
$('#in_duty').on('click', function () {
|
||||
var ajax_url = "/origami/assign_in_duty";
|
||||
var commissioner_ids = $('#in_duty_commissioner_ids').val();
|
||||
var in_time = $('#in_duty_in_time').val();
|
||||
var out_time = $('#in_duty_out_time').val();
|
||||
var dining_id = '<%= @table.id %>'
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajax_url,
|
||||
data: 'dining_id=' + dining_id + "&commissioner_ids=" + commissioner_ids +'&in_time=' + in_time + "&out_time=" + out_time,
|
||||
success: function (result) {
|
||||
window.location.href = '/origami/assign_in_juty/'+ dining_id;
|
||||
window.location.href = '/origami/assign_in_duty/'+ dining_id;
|
||||
}
|
||||
});
|
||||
})
|
||||
@@ -2,9 +2,9 @@
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= origami_root_path %>">Home</a></li>
|
||||
<li><a href="<%= origami_in_juties_path %>">In Juties</a></li>
|
||||
<li><a href="<%= origami_in_duties_path %>">In Duties</a></li>
|
||||
<li>Edit</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', in_juty: @in_juty %>
|
||||
<%= render 'form', in_duty: @in_duty %>
|
||||
</div>
|
||||
6
app/views/origami/in_duties/edit_in_duty.html.erb
Normal file
6
app/views/origami/in_duties/edit_in_duty.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<h3>Update In Duty</h3>
|
||||
</div>
|
||||
<%= render 'edit_in_duty', in_duty: @in_duty %>
|
||||
</div>
|
||||
@@ -14,27 +14,27 @@
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @juties_in.each do |in_juty| %>
|
||||
<tr class="injuty_tr" data-ref="<%= in_juty.id %>">
|
||||
<% @duties_in.each do |in_duty| %>
|
||||
<tr class="induty_tr" data-ref="<%= in_duty.id %>">
|
||||
<td>
|
||||
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check"></td>
|
||||
<td><%= in_juty.dining_facility.name rescue '-' %></td>
|
||||
<td><%= in_juty.commissioner.name rescue '-' %></td>
|
||||
<td><%= in_juty.in_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %></td>
|
||||
<td><%= in_juty.out_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %></td>
|
||||
<td><%= link_to 'Destroy', origami_destroy_in_juty_path(in_juty.dining_facility.id, in_juty), method: :delete, data: {confirm: 'Are you sure?'} %></td>
|
||||
<td><%= in_duty.dining_facility.name rescue '-' %></td>
|
||||
<td><%= in_duty.commissioner.name rescue '-' %></td>
|
||||
<td><%= in_duty.in_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %></td>
|
||||
<td><%= in_duty.out_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %></td>
|
||||
<td><%= link_to 'Destroy', origami_destroy_in_duty_path(in_duty.dining_facility.id, in_duty), method: :delete, data: {confirm: 'Are you sure?'} %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= paginate @juties_in %>
|
||||
<%= paginate @duties_in %>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 partial">
|
||||
<%= render 'form', in_juty: @in_juty, table: @table %>
|
||||
<%= render 'form', in_duty: @in_duty, table: @table %>
|
||||
</div>
|
||||
<span style="float: right">
|
||||
<%= link_to t('.new', :default => t("helpers.links.new")), new_origami_in_juty_path, :class => 'btn btn-primary btn-sm' %>
|
||||
<%= link_to t('.new', :default => t("helpers.links.new")), new_origami_in_duty_path, :class => 'btn btn-primary btn-sm' %>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -43,13 +43,13 @@
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).on('click', ".injuty_tr", function () {
|
||||
$(document).on('click', ".induty_tr", function () {
|
||||
|
||||
$(this).closest('tr').find('.checkbox_check').prop("checked", true);
|
||||
|
||||
var in_juty_id = $(this).attr('data-ref');
|
||||
var in_duty_id = $(this).attr('data-ref');
|
||||
var table_id = "<%= @table.id %>";
|
||||
var url = "/origami/assign_in_juty/table/" + table_id + "/in_juty/" + in_juty_id + "/edit";
|
||||
var url = "/origami/assign_in_duty/table/" + table_id + "/in_duty/" + in_duty_id + "/edit";
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
@@ -59,22 +59,22 @@
|
||||
success: function (data) {
|
||||
debugger;
|
||||
$('.partial').empty().append(data);
|
||||
// $('#in_juty_id').val(data.in_juty.id);
|
||||
// $('#in_juty_commissioner_ids').val(data.commissioner.id);
|
||||
// $('#in_juty_in_time').val(data.in_juty.in_time);
|
||||
// $('#in_juty_out_time').val(data.in_juty.out_time);
|
||||
// $('#in_duty_id').val(data.in_duty.id);
|
||||
// $('#in_duty_commissioner_ids').val(data.commissioner.id);
|
||||
// $('#in_duty_in_time').val(data.in_duty.in_time);
|
||||
// $('#in_duty_out_time').val(data.in_duty.out_time);
|
||||
//
|
||||
// $('#update').removeAttr('disabled').val('');
|
||||
// $('#update').attr('value', 'Update');
|
||||
// $('#create').attr('disabled', 'disabled');
|
||||
//
|
||||
// $("#new_in_juty").attr('class', 'simple_form edit_in_juty');
|
||||
// var id = "edit_in_juty_" + in_juty_id;
|
||||
// $("#new_in_juty").attr('id', id);
|
||||
// $("#new_in_duty").attr('class', 'simple_form edit_in_duty');
|
||||
// var id = "edit_in_duty_" + in_duty_id;
|
||||
// $("#new_in_duty").attr('id', id);
|
||||
//
|
||||
// $(".edit_in_juty").attr('id', id);
|
||||
// $(".edit_in_juty").attr('action', '/origami/edit_in_juty/' + $('#in_juty_id').val());
|
||||
// $(".edit_in_juty").attr('action', '/origami/edit_in_juty/' + $('#in_juty_id').val());
|
||||
// $(".edit_in_duty").attr('id', id);
|
||||
// $(".edit_in_duty").attr('action', '/origami/edit_in_duty/' + $('#in_duty_id').val());
|
||||
// $(".edit_in_duty").attr('action', '/origami/edit_in_duty/' + $('#in_duty_id').val());
|
||||
// $(".patch_method").html('<input type="hidden" name="_method" value="patch">');
|
||||
|
||||
// setInterval(function () {
|
||||
1
app/views/origami/in_duties/index.json.jbuilder
Normal file
1
app/views/origami/in_duties/index.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.array! @in_duties, partial: 'in_duties/in_duty', as: :in_duty
|
||||
@@ -18,24 +18,24 @@
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @juties_in.each do |in_juty| %>
|
||||
<tr class="injuty_tr" data-ref="<%= in_juty.id %>">
|
||||
<% @duties_in.each do |in_duty| %>
|
||||
<tr class="induty_tr" data-ref="<%= in_duty.id %>">
|
||||
<td>
|
||||
<input type="radio" style="width:20px;" name="checkbox" class="checkbox_check"></td>
|
||||
<td><%= in_juty.dining_facility.name rescue '-' %></td>
|
||||
<td><%= in_juty.commissioner.name rescue '-' %></td>
|
||||
<td><%= in_juty.in_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %></td>
|
||||
<td><%= in_juty.out_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %></td>
|
||||
<td><%= link_to 'Remove', origami_destroy_in_juty_path(in_juty.dining_facility.id, in_juty), method: :delete, data: {confirm: 'Are you sure?'} %></td>
|
||||
<td><%= in_duty.dining_facility.name rescue '-' %></td>
|
||||
<td><%= in_duty.commissioner.name rescue '-' %></td>
|
||||
<td><%= in_duty.in_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %></td>
|
||||
<td><%= in_duty.out_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %></td>
|
||||
<td><%= link_to 'Remove', origami_destroy_in_duty_path(in_duty.dining_facility.id, in_duty), method: :delete, data: {confirm: 'Are you sure?'} %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= paginate @juties_in %>
|
||||
<%= paginate @duties_in %>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 partial">
|
||||
<%= render 'form', in_juty: @in_juty, table: @table %>
|
||||
<%= render 'form', in_duty: @in_duty, table: @table %>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1">
|
||||
@@ -45,13 +45,13 @@
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).on('click', ".injuty_tr", function () {
|
||||
$(document).on('click', ".induty_tr", function () {
|
||||
|
||||
$(this).closest('tr').find('.checkbox_check').prop("checked", true);
|
||||
|
||||
var in_juty_id = $(this).attr('data-ref');
|
||||
var in_duty_id = $(this).attr('data-ref');
|
||||
var table_id = "<%= @table.id %>";
|
||||
var url = "/origami/assign_in_juty/table/" + table_id + "/in_juty/" + in_juty_id + "/edit";
|
||||
var url = "/origami/assign_in_duty/table/" + table_id + "/in_duty/" + in_duty_id + "/edit";
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
@@ -61,22 +61,22 @@
|
||||
success: function (data) {
|
||||
debugger;
|
||||
$('.partial').empty().append(data);
|
||||
// $('#in_juty_id').val(data.in_juty.id);
|
||||
// $('#in_juty_commissioner_ids').val(data.commissioner.id);
|
||||
// $('#in_juty_in_time').val(data.in_juty.in_time);
|
||||
// $('#in_juty_out_time').val(data.in_juty.out_time);
|
||||
// $('#in_duty_id').val(data.in_duty.id);
|
||||
// $('#in_duty_commissioner_ids').val(data.commissioner.id);
|
||||
// $('#in_duty_in_time').val(data.in_duty.in_time);
|
||||
// $('#in_duty_out_time').val(data.in_duty.out_time);
|
||||
//
|
||||
// $('#update').removeAttr('disabled').val('');
|
||||
// $('#update').attr('value', 'Update');
|
||||
// $('#create').attr('disabled', 'disabled');
|
||||
//
|
||||
// $("#new_in_juty").attr('class', 'simple_form edit_in_juty');
|
||||
// var id = "edit_in_juty_" + in_juty_id;
|
||||
// $("#new_in_juty").attr('id', id);
|
||||
// $("#new_in_duty").attr('class', 'simple_form edit_in_duty');
|
||||
// var id = "edit_in_duty_" + in_duty_id;
|
||||
// $("#new_in_duty").attr('id', id);
|
||||
//
|
||||
// $(".edit_in_juty").attr('id', id);
|
||||
// $(".edit_in_juty").attr('action', '/origami/edit_in_juty/' + $('#in_juty_id').val());
|
||||
// $(".edit_in_juty").attr('action', '/origami/edit_in_juty/' + $('#in_juty_id').val());
|
||||
// $(".edit_in_duty").attr('id', id);
|
||||
// $(".edit_in_duty").attr('action', '/origami/edit_in_duty/' + $('#in_duty_id').val());
|
||||
// $(".edit_in_duty").attr('action', '/origami/edit_in_duty/' + $('#in_duty_id').val());
|
||||
// $(".patch_method").html('<input type="hidden" name="_method" value="patch">');
|
||||
|
||||
// setInterval(function () {
|
||||
@@ -91,14 +91,14 @@
|
||||
});
|
||||
|
||||
$('#reset').click(function () {
|
||||
var url = "<%= new_origami_in_juty_path %>";
|
||||
var url = "<%= new_origami_in_duty_path %>";
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
data: { table_id: <%= @table.id %> },
|
||||
success: function (data) {
|
||||
$('.partial').empty().append(data);
|
||||
$('.injuty_tr > td > .checkbox_check').prop("checked", false);
|
||||
$('.induty_tr > td > .checkbox_check').prop("checked", false);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -2,9 +2,9 @@
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= origami_root_path %>">Home</a></li>
|
||||
<li><a href="<%= origami_in_juties_path %>">In Juties</a></li>
|
||||
<li><a href="<%= origami_in_juties_path %>">In Duties</a></li>
|
||||
<li>New</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= render 'form', in_juty: @in_juty, table: @table %>
|
||||
<%= render 'form', in_duty: @in_duty, table: @table %>
|
||||
</div>
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="page-header">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= origami_root_path %>">Home</a></li>
|
||||
<li><a href="<%= origami_in_juties_path %>">In Juties</a></li>
|
||||
<li><a href="<%= origami_in_duties_path %>">In Duties</a></li>
|
||||
|
||||
<span style="float: right">
|
||||
</span>
|
||||
@@ -9,34 +9,34 @@
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">In Juty</h4>
|
||||
<h4 class="card-title">In Duty</h4>
|
||||
<table class="table">
|
||||
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td style="width:20%">Dining Facility Name</td>
|
||||
<td><%= @in_juty.dining_facility.name%></td>
|
||||
<td><%= @in_duty.dining_facility.name%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:20%">Commissioner Name</td>
|
||||
<td>
|
||||
<%= @in_juty.commissioner.name rescue '-' %>
|
||||
<%= @in_duty.commissioner.name rescue '-' %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:20%">In Time</td>
|
||||
<td><%= @in_juty.in_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %></td>
|
||||
<td><%= @in_duty.in_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:20%">Out Time</td>
|
||||
<td><%= @in_juty.out_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %></td>
|
||||
<td><%= @in_duty.out_time.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") rescue '-' %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= link_to 'Back', origami_in_juties_path, class: 'btn btn-success' %>
|
||||
<%= link_to 'Edit', edit_origami_in_juty_path(@in_juty), class: 'btn btn-info' %>
|
||||
<%= link_to 'Destroy', origami_in_juty_path(@in_juty), method: :delete, data: {confirm: 'Are you sure?'}, class: 'btn btn-danger' %>
|
||||
<%= link_to 'Back', origami_in_duties_path, class: 'btn btn-success' %>
|
||||
<%= link_to 'Edit', edit_origami_in_duty_path(@in_duty), class: 'btn btn-info' %>
|
||||
<%= link_to 'Destroy', origami_in_duty_path(@in_duty), method: :delete, data: {confirm: 'Are you sure?'}, class: 'btn btn-danger' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
1
app/views/origami/in_duties/show.json.jbuilder
Normal file
1
app/views/origami/in_duties/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.partial! "in_duties/in_duty", in_duty: @in_duty
|
||||
@@ -1,2 +0,0 @@
|
||||
json.extract! in_juty, :id, :created_at, :updated_at
|
||||
json.url in_juty_url(in_juty, format: :json)
|
||||
@@ -1,6 +0,0 @@
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<h3>Update In Juty</h3>
|
||||
</div>
|
||||
<%= render 'edit_in_juty', in_juty: @in_juty %>
|
||||
</div>
|
||||
@@ -1 +0,0 @@
|
||||
json.array! @in_juties, partial: 'in_juties/in_juty', as: :in_juty
|
||||
@@ -1 +0,0 @@
|
||||
json.partial! "in_juties/in_juty", in_juty: @in_juty
|
||||
Reference in New Issue
Block a user