-
-
Notifications
You must be signed in to change notification settings - Fork 503
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #498 from rubyforgood/326-admins-controller
- Loading branch information
Showing
32 changed files
with
628 additions
and
54 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
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
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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<tr> | ||
<td><% if barcode_item_row.global %><i class="fa fa-globe"></i><% end %></td> | ||
<td><%= barcode_item_row.barcodeable.name %></td> | ||
<td><%= barcode_item_row.quantity %></td> | ||
<td><%= barcode_item_row.value %></td> | ||
<td class="text-right"> | ||
<%= link_to "View", admin_barcode_item_path(barcode_item_row), class: "btn btn-primary btn-xs" %> | ||
<%= link_to edit_admin_barcode_item_path(barcode_item_row), class: "btn btn-info btn-xs" do %> | ||
<i class="fa fa-edit"></i> Edit | ||
<% end %> | ||
<%= link_to admin_barcode_item_path(barcode_item_row), method: :delete, class: "btn btn-danger btn-xs", data: { confirm: confirm_delete_msg(barcode_item_row.item.name) } do %> | ||
<i class="fa fa-trash"></i> Delete | ||
<% end %> | ||
</tr> |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<%= simple_form_for form, html: { role: "form" } do |f| %> | ||
<div class="box-body "> | ||
|
||
<div class="row"> | ||
<div class="col-xs-8 col-md-6 col-lg-3"> | ||
<%= f.input :quantity, label: "Quantity", wrapper: :vertical_input_group do %> | ||
<span class="input-group-addon"><i class="fa fa-sort-numeric-desc"></i></span> | ||
<%= f.input_field :quantity, class: "form-control" %> | ||
<% end %> | ||
</div><!-- ./col-xs-8 --> | ||
</div><!-- /.row --> | ||
|
||
<div class="row"> | ||
<div class="col-xs-8 col-md-6 col-lg-3"> | ||
<%= f.association :barcodeable, collection: @canonical_items, label: "Item" %> | ||
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="col-xs-8 col-md-6 col-lg-3"> | ||
<%= f.input :value, label: "Barcode", wrapper: :vertical_input_group do %> | ||
<span class="input-group-addon"><i class="fa fa-barcode"></i></span> | ||
<%= f.input_field :value, class: "form-control" %> | ||
<% end %> | ||
</div><!-- ./col-xs-8 --> | ||
</div><!-- /.row --> | ||
|
||
|
||
<%= f.button :submit, class:"btn btn-primary btn-lg"%> | ||
</div><!-- /.box-body --> | ||
<% end #form %> |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<section class="content-header"> | ||
<% content_for :title, "Admin - Inventory - Barcode Items - New" %> | ||
<h1> | ||
Editing Barcode Item | ||
</h1> | ||
<ol class="breadcrumb"> | ||
<li><%= link_to(admin_dashboard_path) do %> | ||
<i class="fa fa-lock"></i> Admin | ||
<% end %> | ||
</li> | ||
<li><%= link_to "All Barcodes", (admin_barcode_items_path) %></li> | ||
<li class="active"> Editing Barcode</li> | ||
</ol> | ||
</section> | ||
|
||
<!-- Main content --> | ||
<section class="content"> | ||
|
||
<!-- Default box --> | ||
<div class="box"> | ||
<div class="box-header with-border"> | ||
<h3 class="box-title">Barcode for <%= @barcode_item.quantity %> of <%= @barcode_item.item.name %></h3> | ||
</div> | ||
<div class="box-body"> | ||
<%= render partial: "form", object: @barcode_item %> | ||
</div> | ||
</div> | ||
<!-- /.box --> | ||
|
||
</section> |
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<section class="content-header"> | ||
<% content_for :title, "Admin - Barcode Items" %> | ||
<h1> | ||
Barcode Items - Global | ||
</h1> | ||
<ol class="breadcrumb"> | ||
<li><%= link_to(admin_dashboard_path) do %> | ||
<i class="fa fa-lock"></i> Admin | ||
<% end %> | ||
</li> | ||
<li><a href="#">Barcode Items</a></li> | ||
</ol> | ||
</section> | ||
|
||
<!-- Main content --> | ||
<section class="content"> | ||
<div class="box"> | ||
<div class="box-header with-border bg-gray"> | ||
<section id="filters"> | ||
<%= form_tag(admin_barcode_items_path, method: :get) do |f| %> | ||
<div class="row"> | ||
<div class="form-group col-lg-4 col-md-4 col-sm-6 col-xs-12"> | ||
<%= label_tag "Filter By Canonical Item Category" %> | ||
<%= collection_select(:filters, :barcodeable_id, @canonical_items.order('name'), :id, :name, { include_blank: true }, class: "form-control") %> | ||
</div> | ||
</div><!-- /.row --> | ||
<div class="row"> | ||
<div class="col-xs-12"> | ||
<%= button_tag type: "submit", class: "btn btn-primary btn-md" do %> | ||
<i class="fa fa-filter"></i> Filter | ||
<% end %> | ||
<%= link_to admin_barcode_items_path, class: "btn btn-outline-primary btn-md" do %> | ||
<i class="fa fa-ban"></i> Clear Filters | ||
<% end %> | ||
<div class="btn-group pull-right"> | ||
<%= link_to new_admin_barcode_item_path(organization_id: current_organization), class: "btn btn-success" do %> | ||
<i class="fa fa-plus"></i> Add New Barcode | ||
<% end %> | ||
</div> | ||
</div> | ||
</div><!-- /.row --> | ||
<% end #form %> | ||
</section><!-- /#filters --> | ||
</div><!-- /.box-header --> | ||
<div class="box-body"> | ||
<div class="row"> | ||
<div class="col-xs-12"> | ||
<div class="box-body table-responsive no-padding"> | ||
<table id="tbl_barcode_items" class="table table-hover"> | ||
<thead> | ||
<tr> | ||
<th>Global</th> | ||
<th>Item Type</th> | ||
<th>Quantity in the Box</th> | ||
<th>Barcode</th> | ||
<th> </th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<%= render partial: "barcode_item_row", collection: @barcode_items %> | ||
</tbody> | ||
</table> | ||
</div><!-- /.box-body --> | ||
</div><!-- /.col-xs-12 --> | ||
</div><!-- /.row --> | ||
</div><!-- /.box-body --> | ||
</div><!-- /.box --> | ||
</section> |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<section class="content-header"> | ||
<% content_for :title, "Admin - Inventory - Barcode Items - New" %> | ||
<h1> | ||
New Barcode Item | ||
</h1> | ||
<ol class="breadcrumb"> | ||
<li><%= link_to(admin_dashboard_path) do %> | ||
<i class="fa fa-lock"></i> Admin | ||
<% end %> | ||
</li> | ||
<li><%= link_to "Barcode Items", (admin_barcode_items_path) %></li> | ||
<li class="active"> New Barcode</li> | ||
</ol> | ||
</section> | ||
|
||
<!-- Main content --> | ||
<section class="content"> | ||
|
||
<!-- Default box --> | ||
<div class="box"> | ||
<%= render partial: "form", object: [:admin, @barcode_item] %> | ||
</div><!-- /.box --> | ||
|
||
</section> |
Oops, something went wrong.