-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nostory] refactor scaffold - location, inventory type
- Loading branch information
Showing
55 changed files
with
1,158 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
class InventoryType < ApplicationRecord | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,32 @@ | ||
<%= simple_form_for(@inventory_adjustment, html: { class: 'form-inline' }) do |f| %> | ||
<%= simple_form_for(@inventory_adjustment, | ||
:defaults => { | ||
:label_html => { :class => "col-4" }, | ||
:input_html => { :class => "col-8" }, | ||
:wrapper_html => { :class => "row" }, | ||
:submit_html => { :class => "btn, btn-info"}, | ||
:html => { :class => "form-inline" } | ||
}) do |f| %> | ||
<%= f.error_notification %> | ||
<%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> | ||
|
||
<div class="form-inputs"> | ||
<%= f.association :inventory_tally %> | ||
<%= f.association :purchase %> | ||
<%= f.association :box_item %> | ||
<%= f.input :total_cost %> | ||
<%= f.input :tally_quantity_start, readonly:true %> | ||
<%= f.input :tally_quantity_end, readonly:true %> | ||
<%= f.input :adjustment_quantity %> | ||
<div class="form-inputs container"> | ||
<%= f.association :inventory_tally %> | ||
<%= f.association :purchase %> | ||
<%= f.association :box_item %> | ||
<%= f.input :total_cost %> | ||
<%= f.input :tally_quantity_start %> | ||
<%= f.input :tally_quantity_end %> | ||
<%= f.input :adjustment_quantity %> | ||
</div> | ||
|
||
<div class="form-actions"> | ||
<%= f.button :submit %> | ||
<div class="form-group row mb-0" style="margin: 2rem 0"> | ||
<div class="col-12 offset-4" style="padding-left: 0 !important;"> | ||
<%= f.button :submit, class: "btn-primary" %> | ||
|
||
<button class="btn btn-outline-secondary"> | ||
<%= link_to "Back", :back %> | ||
</button> | ||
</div> | ||
</div> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
<h1>New Inventory Adjustment</h1> | ||
|
||
<%= render 'form', inventory_adjustment: @inventory_adjustment %> | ||
<%= link_to 'Back', inventory_adjustments_path %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,29 @@ | ||
<%= form_with(model: inventory_tally, local: true) do |form| %> | ||
<% if inventory_tally.errors.any? %> | ||
<div id="error_explanation"> | ||
<h2><%= pluralize(inventory_tally.errors.count, "error") %> prohibited this inventory_tally from being saved:</h2> | ||
<ul> | ||
<% inventory_tally.errors.full_messages.each do |message| %> | ||
<li><%= message %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
<%= simple_form_for(@inventory_tally, | ||
:defaults => { | ||
:label_html => { :class => "col-4" }, | ||
:input_html => { :class => "col-8" }, | ||
:wrapper_html => { :class => "row" }, | ||
:submit_html => { :class => "btn, btn-info"}, | ||
:html => { :class => "form-inline" } | ||
}) do |f| %> | ||
<%= f.error_notification %> | ||
<%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> | ||
|
||
<div class="form-inputs container"> | ||
<%= f.input :additional_location_info %> | ||
<%= f.input :cached_quantity %> | ||
<%= f.association :inventory_type %> | ||
<%= f.association :storage_location %> | ||
</div> | ||
|
||
<div class="actions"> | ||
<%= form.submit %> | ||
<div class="form-group row mb-0" style="margin: 2rem 0"> | ||
<div class="col-12 offset-4" style="padding-left: 0 !important;"> | ||
<%= f.button :submit, class: "btn-primary" %> | ||
|
||
<button class="btn btn-outline-secondary"> | ||
<%= link_to "Back", :back %> | ||
</button> | ||
</div> | ||
</div> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
json.extract! inventory_tally, :id, :created_at, :updated_at | ||
json.extract! inventory_tally, :id, :additional_location_info, :cached_quantity, :inventory_type_id, :storage_location_id, :created_at, :updated_at | ||
json.url inventory_tally_url(inventory_tally, format: :json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
<h1>New Inventory Tally</h1> | ||
|
||
<%= render 'form', inventory_tally: @inventory_tally %> | ||
<%= link_to 'Back', inventory_tallies_path %> | ||
<%= render 'form', inventory_tally: @inventory_tally %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,24 @@ | ||
<p id="notice"><%= notice %></p> | ||
|
||
<p> | ||
<strong>Additional location info:</strong> | ||
<%= @inventory_tally.additional_location_info %> | ||
</p> | ||
|
||
<p> | ||
<strong>Cached quantity:</strong> | ||
<%= @inventory_tally.cached_quantity %> | ||
</p> | ||
|
||
<p> | ||
<strong>Inventory type:</strong> | ||
<%= @inventory_tally.inventory_type %> | ||
</p> | ||
|
||
<p> | ||
<strong>Storage location:</strong> | ||
<%= @inventory_tally.storage_location %> | ||
</p> | ||
|
||
<%= link_to 'Edit', edit_inventory_tally_path(@inventory_tally) %> | | ||
<%= link_to 'Back', inventory_tallies_path %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
<%= form_with(model: inventory_type, local: true) do |form| %> | ||
<% if inventory_type.errors.any? %> | ||
<div id="error_explanation"> | ||
<h2><%= pluralize(inventory_type.errors.count, "error") %> prohibited this inventory_type from being saved:</h2> | ||
<ul> | ||
<% inventory_type.errors.full_messages.each do |message| %> | ||
<li><%= message %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
<%= simple_form_for(@inventory_type, | ||
:defaults => { | ||
:label_html => { :class => "col-4" }, | ||
:input_html => { :class => "col-8" }, | ||
:wrapper_html => { :class => "row" }, | ||
:submit_html => { :class => "btn, btn-info"}, | ||
:html => { :class => "form-inline" } | ||
}) do |f| %> | ||
<%= f.error_notification %> | ||
<%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> | ||
|
||
<div class="form-inputs container"> | ||
<%= f.input :name %> | ||
<%= f.input :description %> | ||
</div> | ||
|
||
<div class="actions"> | ||
<%= form.submit %> | ||
<div class="form-group row mb-0" style="margin: 2rem 0"> | ||
<div class="col-12 offset-4" style="padding-left: 0 !important;"> | ||
<%= f.button :submit, class: "btn-primary" %> | ||
|
||
<button class="btn btn-outline-secondary"> | ||
<%= link_to "Back", :back %> | ||
</button> | ||
</div> | ||
</div> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
json.extract! inventory_type, :id, :created_at, :updated_at | ||
json.extract! inventory_type, :id, :name, :description, :created_at, :updated_at | ||
json.url inventory_type_url(inventory_type, format: :json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
<p id="notice"><%= notice %></p> | ||
|
||
<p> | ||
<strong>Name:</strong> | ||
<%= @inventory_type.name %> | ||
</p> | ||
|
||
<p> | ||
<strong>Description:</strong> | ||
<%= @inventory_type.description %> | ||
</p> | ||
|
||
<%= link_to 'Edit', edit_inventory_type_path(@inventory_type) %> | | ||
<%= link_to 'Back', inventory_types_path %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,30 @@ | ||
<%= form_with(model: location, local: true) do |form| %> | ||
<% if location.errors.any? %> | ||
<div id="error_explanation"> | ||
<h2><%= pluralize(location.errors.count, "error") %> prohibited this location from being saved:</h2> | ||
<ul> | ||
<% location.errors.full_messages.each do |message| %> | ||
<li><%= message %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
|
||
<div class="field"> | ||
<%= form.label :name %> | ||
<%= form.text_field :name %> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= form.label :street_address %> | ||
<%= form.text_field :street_address %> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= form.label :city %> | ||
<%= form.text_field :city %> | ||
<%= simple_form_for(@location, | ||
:defaults => { | ||
:label_html => { :class => "col-4" }, | ||
:input_html => { :class => "col-8" }, | ||
:wrapper_html => { :class => "row" }, | ||
:submit_html => { :class => "btn, btn-info"}, | ||
:html => { :class => "form-inline" } | ||
}) do |f| %> | ||
<%= f.error_notification %> | ||
<%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> | ||
|
||
<div class="form-inputs container"> | ||
<%= f.input :name %> | ||
<%= f.input :street_address %> | ||
<%= f.input :city %> | ||
<%= f.input :state %> | ||
<%= f.input :zip %> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= form.label :state %> | ||
<%= form.text_field :state %> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= form.label :zip %> | ||
<%= form.text_field :zip %> | ||
</div> | ||
<div class="form-group row mb-0" style="margin: 2rem 0"> | ||
<div class="col-12 offset-4" style="padding-left: 0 !important;"> | ||
<%= f.button :submit, class: "btn-primary" %> | ||
|
||
<div class="field"> | ||
<%= form.label :type %> | ||
<%= form.text_field :type %> | ||
</div> | ||
|
||
<div class="actions"> | ||
<%= form.submit %> | ||
<button class="btn btn-outline-secondary"> | ||
<%= link_to "Back", :back %> | ||
</button> | ||
</div> | ||
</div> | ||
<% end %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
<h1>New Location</h1> | ||
|
||
<%= render 'form', location: @location %> | ||
<%= link_to 'Back', locations_path %> |
Oops, something went wrong.