spree_suppliers 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +22 -0
- data/LICENSE +26 -0
- data/README.md +80 -0
- data/Rakefile +31 -0
- data/Versionfile +9 -0
- data/app/assets/javascripts/admin/spree_suppliers.js +1 -0
- data/app/assets/javascripts/invoice_items.js.coffee +3 -0
- data/app/assets/javascripts/store/spree_suppliers.js +1 -0
- data/app/assets/javascripts/supplier_invoices.js.coffee +3 -0
- data/app/assets/javascripts/suppliers.js.coffee +3 -0
- data/app/assets/stylesheets/admin/spree_suppliers.css +3 -0
- data/app/assets/stylesheets/invoice_items.css.scss +3 -0
- data/app/assets/stylesheets/store/spree_suppliers.css +3 -0
- data/app/assets/stylesheets/supplier_invoices.css.scss +3 -0
- data/app/assets/stylesheets/suppliers.css.scss +4 -0
- data/app/controllers/admin/supplier_taxons_controller.rb +61 -0
- data/app/controllers/admin/suppliers_controller.rb +127 -0
- data/app/controllers/admin/vendor_overview_controller.rb +18 -0
- data/app/controllers/invoice_items_controller.rb +2 -0
- data/app/controllers/supplier_invoices_controller.rb +2 -0
- data/app/controllers/suppliers_controller.rb +15 -0
- data/app/models/invoice_item.rb +4 -0
- data/app/models/supplier.rb +8 -0
- data/app/models/supplier_invoice.rb +4 -0
- data/app/overrides/admin.rb +5 -0
- data/app/views/admin/orders/show.html.erb +34 -0
- data/app/views/admin/orders/user.html.erb +19 -0
- data/app/views/admin/products/_form.html.erb +114 -0
- data/app/views/admin/products/_suppliers_form.html.erb +4 -0
- data/app/views/admin/shared/_order_tabs_decide.html.erb +5 -0
- data/app/views/admin/shared/_vendor_order_tabs.html.erb +39 -0
- data/app/views/admin/supplier_taxons/_form.html.erb +23 -0
- data/app/views/admin/supplier_taxons/_taxon_table.html.erb +23 -0
- data/app/views/admin/supplier_taxons/available.js.erb +33 -0
- data/app/views/admin/supplier_taxons/edit.html.erb +11 -0
- data/app/views/admin/supplier_taxons/remove.html.erb +1 -0
- data/app/views/admin/supplier_taxons/select.js.erb +2 -0
- data/app/views/admin/supplier_taxons/selected.html.erb +18 -0
- data/app/views/admin/suppliers/_edit_form.html.erb +75 -0
- data/app/views/admin/suppliers/_edit_hours_form.html.erb +18 -0
- data/app/views/admin/suppliers/_form.html.erb +60 -0
- data/app/views/admin/suppliers/_hours_form.html.erb +11 -0
- data/app/views/admin/suppliers/_image_form.html.erb +11 -0
- data/app/views/admin/suppliers/_supplier.html.erb +24 -0
- data/app/views/admin/suppliers/_supplier_tabs.html.erb +12 -0
- data/app/views/admin/suppliers/_suppliers_table.html.erb +25 -0
- data/app/views/admin/suppliers/_upload_image.html.erb +14 -0
- data/app/views/admin/suppliers/available.js.erb +34 -0
- data/app/views/admin/suppliers/edit.html.erb +13 -0
- data/app/views/admin/suppliers/index.html.erb +97 -0
- data/app/views/admin/suppliers/line_items.html.erb +20 -0
- data/app/views/admin/suppliers/new.html.erb +13 -0
- data/app/views/admin/suppliers/remove.html.erb +1 -0
- data/app/views/admin/suppliers/select.html.erb +1 -0
- data/app/views/admin/suppliers/selected.html.erb +40 -0
- data/app/views/admin/suppliers/show.html.erb +2 -0
- data/app/views/admin/vendor_overview/index.html.erb +1 -0
- data/app/views/shared/_supplier_invoices.html.erb +47 -0
- data/app/views/suppliers/_supplier.html.erb +7 -0
- data/app/views/suppliers/_supplier_list.erb +13 -0
- data/app/views/suppliers/index.html.erb +13 -0
- data/app/views/suppliers/show.html.erb +11 -0
- data/app/views/suppliers/supplier_list.erb +11 -0
- data/config/routes.rb +37 -0
- data/db/migrate/20120131160039_create_suppliers.rb +8 -0
- data/db/migrate/20120131160855_add_fields_to_suppliers.rb +16 -0
- data/db/migrate/20120131161247_create_supplier_invoices.rb +12 -0
- data/db/migrate/20120131161610_create_invoice_items.rb +12 -0
- data/db/migrate/20120201160616_create_suppliers_taxons.rb +16 -0
- data/db/migrate/20120201170705_add_supplier_id_to_products.rb +5 -0
- data/db/seeds.rb +143 -0
- data/db/seeds/images/apple.gif +0 -0
- data/db/seeds/images/apple.jpg +0 -0
- data/db/seeds/images/banana.jpg +0 -0
- data/db/seeds/images/blueberry.jpg +0 -0
- data/db/seeds/images/cherries.jpg +0 -0
- data/db/seeds/images/chicken.jpg +0 -0
- data/db/seeds/images/cow.jpg +0 -0
- data/db/seeds/images/flower.jpg +0 -0
- data/db/seeds/images/goat.jpg +0 -0
- data/db/seeds/images/grapes.jpg +0 -0
- data/db/seeds/images/greenapple.jpg +0 -0
- data/db/seeds/images/greenbeans.jpg +0 -0
- data/db/seeds/images/indie_candy.jpg +0 -0
- data/db/seeds/images/orange.jpg +0 -0
- data/db/seeds/images/squash.jpg +0 -0
- data/db/seeds/images/stock_user.jpg +0 -0
- data/db/seeds/images/strawberry.jpg +0 -0
- data/db/seeds/images/watermelon.jpg +0 -0
- data/lib/generators/spree_suppliers/install/install_generator.rb +31 -0
- data/lib/spree_suppliers.rb +192 -0
- data/lib/spree_suppliers/engine.rb +24 -0
- data/lib/spree_suppliers_hooks.rb +19 -0
- data/script/rails +7 -0
- data/spec/spec_helper.rb +31 -0
- data/spree_suppliers.gemspec +24 -0
- data/test/fixtures/.gitkeep +0 -0
- data/test/fixtures/invoice_items.yml +13 -0
- data/test/fixtures/supplier_invoices.yml +13 -0
- data/test/fixtures/suppliers.yml +11 -0
- data/test/functional/.gitkeep +0 -0
- data/test/functional/invoice_items_controller_test.rb +7 -0
- data/test/functional/supplier_invoices_controller_test.rb +7 -0
- data/test/functional/suppliers_controller_test.rb +7 -0
- data/test/integration/.gitkeep +0 -0
- data/test/performance/browsing_test.rb +12 -0
- data/test/test_helper.rb +13 -0
- data/test/unit/helpers/invoice_items_helper_test.rb +4 -0
- data/test/unit/helpers/supplier_invoices_helper_test.rb +4 -0
- data/test/unit/helpers/suppliers_helper_test.rb +4 -0
- data/test/unit/invoice_item_test.rb +7 -0
- data/test/unit/supplier_invoice_test.rb +7 -0
- data/test/unit/supplier_test.rb +7 -0
- metadata +156 -37
@@ -0,0 +1,34 @@
|
|
1
|
+
<div class='toolbar order-links'>
|
2
|
+
<%= hook :admin_order_show_buttons do %>
|
3
|
+
<% if !current_user.has_role?("vendor") %>
|
4
|
+
<%= button_link_to t("cancel"), fire_admin_order_url(@order.number, {:e => "cancel"}), :icon => 'delete', :confirm => t('are_you_sure') if @order.can_cancel? %>
|
5
|
+
<%= button_link_to t("edit"), edit_admin_order_url(@order.number), :icon => 'edit' %>
|
6
|
+
<% end %>
|
7
|
+
<% end %>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<% render :partial => 'admin/shared/order_tabs_decide', :locals => {:current => "Order Details"} %>
|
11
|
+
<%= hook :admin_order_show_addresses do %>
|
12
|
+
<% if @order.bill_address %>
|
13
|
+
<div class='adr'>
|
14
|
+
<h4><%= t("bill_address") %></h4>
|
15
|
+
<%= render :partial => 'admin/shared/address', :locals => {:address => @order.bill_address} %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
18
|
+
<% if @order.ship_address %>
|
19
|
+
<div class='adr'>
|
20
|
+
<h4><%= t("ship_address") %></h4>
|
21
|
+
<%= render :partial => 'admin/shared/address', :locals => {:address => @order.ship_address} %>
|
22
|
+
</div>
|
23
|
+
<% end %>
|
24
|
+
<hr />
|
25
|
+
<% end %>
|
26
|
+
<% if !current_user.has_role?("vendor") %>
|
27
|
+
<%= hook :admin_order_show_details do %>
|
28
|
+
<%= render :partial => 'admin/shared/order_details', :locals => {:order => @order} %>
|
29
|
+
<% end %>
|
30
|
+
|
31
|
+
<% end %>
|
32
|
+
<h3><%= t("Supplier_Invoices") %></h3>
|
33
|
+
<%= render :partial => 'shared/supplier_invoices', :locals => {:order => @order} %>
|
34
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%= render :partial => 'admin/shared/order_tabs_decide', :locals => {:current => "Customer Details"} %>
|
2
|
+
<%= csrf_meta_tag %>
|
3
|
+
|
4
|
+
<% if @order.cart? %>
|
5
|
+
<div id="add-line-item" data-hook>
|
6
|
+
<fieldset>
|
7
|
+
<legend><%= t(:customer_search) %></legend>
|
8
|
+
<%= label_tag :customer_search, t(:enter_at_least_five_letters) %>
|
9
|
+
<%= text_field_tag :customer_search, nil, :class => 'fullwidth title' %>
|
10
|
+
</fieldset>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<%= render 'shared/error_messages', :target => @order %>
|
15
|
+
|
16
|
+
<%= form_for @order, :url => admin_order_url(@order), :html => { :method => :put} do |f| %>
|
17
|
+
<%= f.hidden_field :number %>
|
18
|
+
<%= render :partial => 'user_form', :locals => {:f => f} %>
|
19
|
+
<% end %>
|
@@ -0,0 +1,114 @@
|
|
1
|
+
<div class="clearfix">
|
2
|
+
<div class="left" data-hook="admin_product_form_left">
|
3
|
+
<%= f.field_container :name do %>
|
4
|
+
<%= f.label :name, t(:name) %> <span class="required">*</span><br />
|
5
|
+
<%= f.text_field :name, :class => 'fullwidth title' %>
|
6
|
+
<%= f.error_message_on :name %>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<%= f.field_container :permalink do %>
|
10
|
+
<%= f.label :permalink, t(:permalink) %> <span class="required">*</span><br />
|
11
|
+
<%= f.text_field :permalink, :class => 'fullwidth title' %>
|
12
|
+
<%= f.error_message_on :permalink %>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<%= f.field_container :description do %>
|
16
|
+
<%= f.label :description, t(:description)%><br />
|
17
|
+
<%= f.text_area :description, {:cols => 60, :rows => 4, :class => 'fullwidth'} %>
|
18
|
+
<%= f.error_message_on :description %>
|
19
|
+
<% end %>
|
20
|
+
</div>
|
21
|
+
<div class="right" data-hook="admin_product_form_right">
|
22
|
+
<%= f.field_container :price do %>
|
23
|
+
<%= f.label :price, t(:master_price) %> <span class="required">*</span><br />
|
24
|
+
<%= f.text_field :price, :value => number_with_precision(@product.price, :precision => 2) %>
|
25
|
+
<%= f.error_message_on :price %>
|
26
|
+
<% end %>
|
27
|
+
|
28
|
+
<%if Spree::Config[:show_price_inc_vat] %>
|
29
|
+
<%= label_tag :price_includes_vat , I18n.t(:price_with_vat_included, :price => I18n.t(:price)) %><br />
|
30
|
+
<%= text_field_tag :price_including_vat, product_price(@product, :show_vat_text => false), :size => 30 %>
|
31
|
+
<%= javascript_tag do -%>
|
32
|
+
var effective_tax_rate = <%= @product.effective_tax_rate %>;
|
33
|
+
<% end -%>
|
34
|
+
<% end %>
|
35
|
+
|
36
|
+
<%= f.field_container :cost_price do %>
|
37
|
+
<%= f.label :cost_price, t(:cost_price) %><br />
|
38
|
+
<%= f.text_field :cost_price, :value => number_with_precision(@product.cost_price, :precision => 2) %>
|
39
|
+
<%= f.error_message_on :cost_price %>
|
40
|
+
<% end %>
|
41
|
+
|
42
|
+
<p>
|
43
|
+
<%= f.label :available_on, t(:available_on) %><br />
|
44
|
+
<%= f.error_message_on :available_on %>
|
45
|
+
<%= f.text_field :available_on, :class => 'datepicker' %>
|
46
|
+
</p>
|
47
|
+
|
48
|
+
<p>
|
49
|
+
<%= render :partial => 'admin/products/suppliers_form', :locals => {:f => f} %>
|
50
|
+
</p>
|
51
|
+
|
52
|
+
|
53
|
+
<p>
|
54
|
+
<%= f.label :sku, t(:sku) %><br />
|
55
|
+
<%= f.text_field :sku, :size => 16 %>
|
56
|
+
</p>
|
57
|
+
<% unless @product.has_variants? %>
|
58
|
+
<% if Spree::Config[:track_inventory_levels] %>
|
59
|
+
<p>
|
60
|
+
<%= f.label :on_hand, t(:on_hand) %><br />
|
61
|
+
<%= f.text_field :on_hand, :size => 4 %>
|
62
|
+
</p>
|
63
|
+
<% end %>
|
64
|
+
<ul id="shipping-specs">
|
65
|
+
<li>
|
66
|
+
<%= f.label :weight, t(:weight) %>
|
67
|
+
<%= f.text_field :weight, :size => 4 %>
|
68
|
+
</li>
|
69
|
+
<li>
|
70
|
+
<%= f.label :height, t(:height) %>
|
71
|
+
<%= f.text_field :height, :size => 4 %>
|
72
|
+
</li>
|
73
|
+
<li>
|
74
|
+
<%= f.label :width, t(:width) %>
|
75
|
+
<%= f.text_field :width, :size => 4 %>
|
76
|
+
</li>
|
77
|
+
<li>
|
78
|
+
<%= f.label :depth, t(:depth) %>
|
79
|
+
<%= f.text_field :depth, :size => 4 %>
|
80
|
+
</li>
|
81
|
+
</ul>
|
82
|
+
<% end %>
|
83
|
+
<p>
|
84
|
+
<%= f.label :shipping_category_id, t(:shipping_categories) %><br />
|
85
|
+
<%= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, {:include_blank => true}, {'style' => 'width:200px'}) %>
|
86
|
+
<%= f.error_message_on :shipping_category %>
|
87
|
+
</p>
|
88
|
+
|
89
|
+
<p>
|
90
|
+
<%= f.label :tax_category_id, t(:tax_category) %><br />
|
91
|
+
<%= f.collection_select(:tax_category_id, @tax_categories, :id, :name, {:include_blank => true}, {'style' => 'width:200px'}) %>
|
92
|
+
<%= f.error_message_on :tax_category %>
|
93
|
+
</p>
|
94
|
+
</div>
|
95
|
+
</div>
|
96
|
+
|
97
|
+
<h2><%= t(:metadata) %></h2>
|
98
|
+
<div data-hook="admin_product_form_meta">
|
99
|
+
<p>
|
100
|
+
<%= f.label :meta_keywords, t(:meta_keywords) %><br />
|
101
|
+
<%= f.text_field :meta_keywords, :class => 'fullwidth' %>
|
102
|
+
</p>
|
103
|
+
<p>
|
104
|
+
<%= f.label :meta_description, t(:meta_description) %><br />
|
105
|
+
<%= f.text_field :meta_description, :class => 'fullwidth' %>
|
106
|
+
</p>
|
107
|
+
</div>
|
108
|
+
|
109
|
+
|
110
|
+
<div data-hook="admin_product_form_additional_fields">
|
111
|
+
<% Variant.additional_fields.select{|af| af[:only].nil? || af[:only].include?(:product) }.each do |field| %>
|
112
|
+
<%= render :partial => 'admin/shared/additional_field', :locals => {:field => field, :f => f} %>
|
113
|
+
<% end %>
|
114
|
+
</div>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<h1><%= t(:order) + " #{@order.number}" %></h1>
|
2
|
+
|
3
|
+
<% content_for :sidebar do %>
|
4
|
+
<div id="order_tab_summary">
|
5
|
+
<h3 id="order_number"><%= "#{t(:order)} ##{@order.number} " %></h3>
|
6
|
+
<h5 id="order_status"><%= "#{t(:status)}: #{t("order_state.#{@order.state}")}" %></h5>
|
7
|
+
<h5 id="order_total"><%= "#{t(:total)}: #{number_to_currency(@order.total)}" %></h5>
|
8
|
+
<% if @order.completed? %>
|
9
|
+
<h5 id="shipment_status"><%= "#{t(:shipment)}: #{t("shipment_states.#{@order.shipment_state}")}" %></h5>
|
10
|
+
<h5 id="payment_status"><%= "#{t(:payment)}: #{t("payment_states.#{@order.payment_state}")}" %></h5>
|
11
|
+
<% end %>
|
12
|
+
<br class="clear" />
|
13
|
+
</div>
|
14
|
+
<br class="clear" />
|
15
|
+
|
16
|
+
<ul class="sidebar">
|
17
|
+
<%= hook :admin_order_tabs, {:current => current} do %>
|
18
|
+
<% unless @order.completed? %>
|
19
|
+
<li<%== ' class="active"' if current == "Order Details" %>>
|
20
|
+
<%= link_to t("order_details"), edit_admin_order_url(@order) %>
|
21
|
+
</li>
|
22
|
+
<li<%== ' class="active"' if current == "Customer Details" %>>
|
23
|
+
<%= link_to t("customer_details"), user_admin_order_url(@order) %>
|
24
|
+
</li>
|
25
|
+
<% else %>
|
26
|
+
<li<%== ' class="active"' if current == "Order Details" %>>
|
27
|
+
<%= link_to t("order_details"), admin_order_url(@order) %>
|
28
|
+
</li>
|
29
|
+
<li<%== ' class="active"' if current == "Customer Details" %>>
|
30
|
+
<%= link_to t("customer_details"), user_admin_order_url(@order) %>
|
31
|
+
</li>
|
32
|
+
<% end %>
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
<% end %>
|
37
|
+
</ul>
|
38
|
+
|
39
|
+
<% end %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<%= hook :admin_inside_taxon_form, {:f => f} do %>
|
2
|
+
<%= f.field_container :name do %>
|
3
|
+
<%= f.label :name, t("name") %> <span class="required">*</span><br />
|
4
|
+
<%= error_message_on :taxon, :name, :class => 'fullwidth title' %>
|
5
|
+
<%= text_field :taxon, :name %>
|
6
|
+
<% end %>
|
7
|
+
|
8
|
+
<%= f.field_container :permalink_part do %>
|
9
|
+
<%= f.label :permalink_part, t("permalink") %><span class="required">*</span><br />
|
10
|
+
<%= @taxon.permalink.split("/")[0...-1].join("/") + "/" %><%= text_field_tag :permalink_part, @permalink_part %>
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<%= f.field_container :icon do %>
|
14
|
+
<%= f.label :icon, t('icon') %><br />
|
15
|
+
<%= f.file_field :icon %>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<%= f.field_container :description do %>
|
19
|
+
<%= f.label :description, t(:description) %><br />
|
20
|
+
<%= f.text_area :description %>
|
21
|
+
<% end %>
|
22
|
+
|
23
|
+
<% end %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<table class="index">
|
2
|
+
<thead>
|
3
|
+
<tr>
|
4
|
+
<th><%= t("name") %></th>
|
5
|
+
<th><%= t("path") %></th>
|
6
|
+
<th></th>
|
7
|
+
</tr>
|
8
|
+
</thead>
|
9
|
+
<tbody>
|
10
|
+
<% taxons.each do |taxon| %>
|
11
|
+
<tr id="<%= dom_id(taxon)%>">
|
12
|
+
<td><%= taxon.name %></td>
|
13
|
+
<td><%= taxon_path taxon %></td>
|
14
|
+
<td lass="actions">
|
15
|
+
<%= link_to_delete taxon, :url => remove_admin_supplier_taxon_url(@supplier, taxon), :name => icon("delete") + ' ' + t("remove") %>
|
16
|
+
</td>
|
17
|
+
</tr>
|
18
|
+
<% end %>
|
19
|
+
<% if taxons.empty? %>
|
20
|
+
<tr><td colspan="3"><%= t('none') %>.</td></tr>
|
21
|
+
<% end %>
|
22
|
+
</tbody>
|
23
|
+
</table>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<script type="text/javascript">
|
2
|
+
function displayRow(){
|
3
|
+
var row = document.getElementById("captionRow");
|
4
|
+
if (row.style.display == '') row.style.display = 'none';
|
5
|
+
else row.style.display = '';
|
6
|
+
}
|
7
|
+
</script>
|
8
|
+
<h4><%= t('available_taxons') %></h4>
|
9
|
+
<table class="index">
|
10
|
+
<thead>
|
11
|
+
<tr>
|
12
|
+
<th><%= t("name") %></th>
|
13
|
+
<th><%= t("path") %></th>
|
14
|
+
<th><%= t("action") %></th>
|
15
|
+
</tr>
|
16
|
+
</thead>
|
17
|
+
<tbody>
|
18
|
+
<% @taxons.each do |taxon| %>
|
19
|
+
<tr id="<%= dom_id(taxon, :sel) %>">
|
20
|
+
<td><%= taxon.name %></td>
|
21
|
+
<td><%= taxon_path taxon %></td>
|
22
|
+
<td class="actions">
|
23
|
+
<%= link_to icon('add') + ' ' + t("select"),
|
24
|
+
select_admin_supplier_taxon_path(@supplier, taxon),
|
25
|
+
:remote => true, :class => 'iconlink' %>
|
26
|
+
</td>
|
27
|
+
</tr>
|
28
|
+
<% end %>
|
29
|
+
<% if @taxons.empty? %>
|
30
|
+
<tr><td colspan="3"><%= t('no_match_found') %>.</td></tr>
|
31
|
+
<% end %>
|
32
|
+
</tbody>
|
33
|
+
</table>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%= render :partial => 'admin/shared/configuration_menu' %>
|
2
|
+
|
3
|
+
<h1><%= t("taxon_edit")%></h1>
|
4
|
+
|
5
|
+
<%= form_for(:taxon, :url => admin_taxonomy_taxon_url(@taxonomy, @taxon), :html => { :method => :put, :multipart => true}) do |f| %>
|
6
|
+
<%= render :partial => 'form', :locals => {:f => f} %>
|
7
|
+
|
8
|
+
<p class="form-buttons">
|
9
|
+
<%= button t("update") %> <%= t("or") %> <%= link_to t("cancel"), edit_admin_taxonomy_url(@taxonomy) %>
|
10
|
+
</p>
|
11
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render :partial => "taxon_table", :locals => {:taxons => @taxons} %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<h1>Editing Vendor</h1>
|
2
|
+
|
3
|
+
<%= render :partial => 'admin/suppliers/supplier_tabs', :locals => {:current => "Taxons"} %>
|
4
|
+
|
5
|
+
<%= form_tag({:controller => "supplier_taxons", :action => "update_taxons"}, :method => :post) do %>
|
6
|
+
<h3>Category</h3>
|
7
|
+
<ul>
|
8
|
+
<% @options.each do |o| %>
|
9
|
+
<%- if @supplier.taxons.select{|p| p.name == o.name}.present? %>
|
10
|
+
<li><%= check_box_tag o.name, o.id, true %><%= label_tag o.name %></li>
|
11
|
+
<% else %>
|
12
|
+
<li><%= check_box_tag o.name, o.id %><%= label_tag o.name %></li>
|
13
|
+
<% end %>
|
14
|
+
<% end %>
|
15
|
+
</ul>
|
16
|
+
<%= submit_tag "Update" %>
|
17
|
+
<% end %>
|
18
|
+
|
@@ -0,0 +1,75 @@
|
|
1
|
+
<table class="admin-report" width="545">
|
2
|
+
<tr>
|
3
|
+
<td valign="top">Company name:</td>
|
4
|
+
<td><%= f.text_field :title, :value => @supplier.title %></td>
|
5
|
+
</tr>
|
6
|
+
<tr>
|
7
|
+
<td valign="top">Company Description:</td>
|
8
|
+
<td><%= f.text_field :notes, :value => @supplier.notes %></td>
|
9
|
+
</tr>
|
10
|
+
</table>
|
11
|
+
|
12
|
+
<h3>Company Information</h3>
|
13
|
+
<table class="admin-report" width="545">
|
14
|
+
<tr>
|
15
|
+
<td valign="top">Phone:</td>
|
16
|
+
<td><%= f.text_field :phone, :value => @supplier.phone %></td>
|
17
|
+
</tr>
|
18
|
+
<tr>
|
19
|
+
<td valign="top">Address:</td>
|
20
|
+
<td><%= f.text_field :address1, :value => @supplier.address1 %></td>
|
21
|
+
</tr>
|
22
|
+
<tr>
|
23
|
+
<td valign="top">Town:</td>
|
24
|
+
<td><%= f.text_field :town, :value => @supplier.town %></td>
|
25
|
+
</tr>
|
26
|
+
<tr>
|
27
|
+
<td valign="top">State:</td>
|
28
|
+
<td><%= f.collection_select :state_id, State.find(:all, :order => 'name ASC'), :id, :name, :include_blank => true %></td>
|
29
|
+
</tr>
|
30
|
+
<tr>
|
31
|
+
<td valign="top">Market:</td>
|
32
|
+
<td><%= f.collection_select :city_id, City.find(:all, :order => 'name ASC'), :id, :name, :include_blank => true %></td>
|
33
|
+
</tr>
|
34
|
+
<tr>
|
35
|
+
<td valign="top">Zip-code:</td>
|
36
|
+
<td><%= f.text_field :zip_code, :value => @supplier.zip_code %></td>
|
37
|
+
</tr>
|
38
|
+
<tr>
|
39
|
+
<td valign="top">Fax:</td>
|
40
|
+
<td><%= f.text_field :fax, :value => @supplier.fax %></td>
|
41
|
+
</tr>
|
42
|
+
<tr>
|
43
|
+
<td valign="top">Email:</td>
|
44
|
+
<td><%= f.text_field :email, :value => @supplier.email %></td>
|
45
|
+
</tr>
|
46
|
+
<tr>
|
47
|
+
<td valign="top">Facebook:</td>
|
48
|
+
<td><%= f.text_field :facebook, :value => @supplier.facebook %></td>
|
49
|
+
</tr>
|
50
|
+
<tr>
|
51
|
+
<td valign="top">Twitter:</td>
|
52
|
+
<td><%= f.text_field :twitter, :value => @supplier.twitter %></td>
|
53
|
+
</tr>
|
54
|
+
<tr>
|
55
|
+
<td valign="top">Website:</td>
|
56
|
+
<td><%= f.text_field :website, :value => @supplier.website %></td>
|
57
|
+
</tr>
|
58
|
+
<tr>
|
59
|
+
<td valign="top">Products Sold:</td>
|
60
|
+
<td><%= f.text_area :products_sold %></td>
|
61
|
+
</tr>
|
62
|
+
</table>
|
63
|
+
|
64
|
+
<h3>Owner Information</h3>
|
65
|
+
<table class="admin-report" width="545">
|
66
|
+
<tr>
|
67
|
+
<td valign="top">Owner Name:</td>
|
68
|
+
<td><%= f.text_field :name, :value => @supplier.name %></td>
|
69
|
+
</tr>
|
70
|
+
<tr>
|
71
|
+
<td valign="top">Owner Description:</td>
|
72
|
+
<td><%= f.text_field :description2, :value => @supplier.description2 %></td>
|
73
|
+
</tr>
|
74
|
+
</table>
|
75
|
+
|