InJutiesUpdate
This commit is contained in:
@@ -3,13 +3,13 @@
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.label :dinning_id %>
|
||||
<br/>
|
||||
<label>Dining Name:</label>
|
||||
<%= @table.name %>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<%= f.label :commissioner_ids %>
|
||||
<%= f.collection_select :commissioner_ids, Commissioner.all, :id, :name, {prompt: 'Select Commissioner'}, {class: 'form-control'} %><br/>
|
||||
<label>Commissioner Name:</label>
|
||||
<%= f.collection_select :commissioner_ids, Commissioner.all, :id, :name, {prompt: 'Select Commissioner'}, {class: 'form-control'} %><br/><br/>
|
||||
<label>In time</label>
|
||||
<%= f.text_field :in_time, :value=>DateTime.now.strftime("%Y-%m-%d / %I:%M %p"),:class=>"form-control datepicker"%><br/>
|
||||
<label>Out time</label>
|
||||
@@ -18,7 +18,7 @@
|
||||
<div class="form-actions">
|
||||
<div class='row'>
|
||||
<div class="col-md-2">
|
||||
<%= link_to 'Back', origami_path(@table.id), class: 'btn btn-success' %>
|
||||
<%= link_to 'Back', origami_index_in_juty_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>
|
||||
@@ -50,7 +50,7 @@ $(function() {
|
||||
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/table/' + dining_id;
|
||||
window.location.href = '/origami/assign_in_juty/'+ dining_id;
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.label :dinning_id %>
|
||||
<br/>
|
||||
<label>Dining Name:</label>
|
||||
<%= @table.name %>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<%= f.label :commissioner_ids %>
|
||||
<%= f.collection_select :commissioner_ids, Commissioner.all, :id, :name, {prompt: 'Select Commissioner'}, {class: 'form-control'} ,:value => @in_juty.commissioner.name %><br/>
|
||||
<label>Commissioner Name:</label>
|
||||
<%= f.collection_select :commissioner_ids, Commissioner.all, :id, :name, {class: 'form-control'} ,:value => @in_juty.commissioner.name %><br/><br/>
|
||||
<label>In time</label>
|
||||
<%= f.text_field :in_time, :value=>DateTime.now.strftime("%Y-%m-%d / %I:%M %p"),:class=>"form-control datepicker" ,:value => @in_juty.in_time %><br/>
|
||||
<label>Out time</label>
|
||||
@@ -18,7 +18,7 @@
|
||||
<div class="form-actions">
|
||||
<div class='row'>
|
||||
<div class="col-md-2">
|
||||
<%= link_to 'Back', origami_index_in_juty_path, class: 'btn btn-success' %>
|
||||
<%= link_to 'Back', origami_index_in_juty_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'>Update In Juty</button>
|
||||
@@ -49,9 +49,9 @@ $(function() {
|
||||
$.ajax({
|
||||
type: "PUT",
|
||||
url: ajax_url,
|
||||
data: 'dining_id=' + dining_id + "&commissioner_ids=" + commissioner_ids +'&in_time=' + in_time + "&out_time=" + out_time,
|
||||
data: 'dining_id=' + dining_id + "&commissioner_ids=" + commissioner_ids +'&in_time=' + in_time + "&out_time=" + out_time + "&table_id=" + dining_id,
|
||||
success: function (result) {
|
||||
window.location.href = '/origami/assign_in_juty';
|
||||
window.location.href = '/origami/assign_in_juty/'+ dining_id;
|
||||
}
|
||||
});
|
||||
})
|
||||
@@ -1,3 +1,6 @@
|
||||
<div class="span12">
|
||||
<div class="page-header">
|
||||
<h3>Create In Juty</h3>
|
||||
</div>
|
||||
<%= render 'assign_in_juty', in_juty: @in_juty %>
|
||||
</div>
|
||||
@@ -1,10 +1,6 @@
|
||||
<div class="span12">
|
||||
<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>Edit</li>
|
||||
</ul>
|
||||
<h3>Update In Juty</h3>
|
||||
</div>
|
||||
<%= render 'form', in_juty: @in_juty %>
|
||||
<%= render 'edit_in_juty', in_juty: @in_juty %>
|
||||
</div>
|
||||
@@ -28,10 +28,21 @@
|
||||
<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 'Edit', origami_edit_in_juty_path(in_juty) %></td>
|
||||
<td><%= link_to 'Destroy', origami_destroy_in_juty_path(in_juty), method: :delete, data: {confirm: 'Are you sure?'} %></td>
|
||||
<td><%= link_to 'Back', origami_path(in_juty.dining_facility.id) %></td>
|
||||
<td><%= link_to 'Edit', origami_edit_in_juty_path(in_juty.dining_facility.id,in_juty) %></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>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$('#destroy').on('click', function () {
|
||||
var dining_id = '<%= @table %>'
|
||||
alert(dining_id);
|
||||
|
||||
})
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user