shoppe 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/Rakefile +18 -0
- data/app/assets/images/shoppe/document.svg +1 -0
- data/app/assets/images/shoppe/logo.svg +47 -0
- data/app/assets/images/shoppe/shoppe.svg +25 -0
- data/app/assets/images/shoppe/square.svg +9 -0
- data/app/assets/images/shoppe/statuses/accepted.svg +14 -0
- data/app/assets/images/shoppe/statuses/paid.svg +16 -0
- data/app/assets/images/shoppe/statuses/received.svg +15 -0
- data/app/assets/images/shoppe/statuses/rejected.svg +14 -0
- data/app/assets/images/shoppe/statuses/shipped.svg +14 -0
- data/app/assets/javascripts/shoppe/application.coffee +11 -0
- data/app/assets/stylesheets/shoppe/application.scss +302 -0
- data/app/assets/stylesheets/shoppe/elements.scss +73 -0
- data/app/assets/stylesheets/shoppe/reset.scss +93 -0
- data/app/assets/stylesheets/shoppe/sub.scss +90 -0
- data/app/assets/stylesheets/shoppe/variables.scss +1 -0
- data/app/controllers/shoppe/application_controller.rb +39 -0
- data/app/controllers/shoppe/attachments_controller.rb +12 -0
- data/app/controllers/shoppe/dashboard_controller.rb +7 -0
- data/app/controllers/shoppe/delivery_service_prices_controller.rb +42 -0
- data/app/controllers/shoppe/delivery_services_controller.rb +45 -0
- data/app/controllers/shoppe/orders_controller.rb +36 -0
- data/app/controllers/shoppe/product_categories_controller.rb +45 -0
- data/app/controllers/shoppe/products_controller.rb +45 -0
- data/app/controllers/shoppe/sessions_controller.rb +31 -0
- data/app/controllers/shoppe/users_controller.rb +46 -0
- data/app/helpers/shoppe/application_helper.rb +10 -0
- data/app/helpers/shoppe/shoppe_helper.rb +28 -0
- data/app/mailers/shoppe/order_mailer.rb +25 -0
- data/app/mailers/shoppe/user_mailer.rb +10 -0
- data/app/models/shoppe/delivery_service.rb +22 -0
- data/app/models/shoppe/delivery_service_price.rb +19 -0
- data/app/models/shoppe/order.rb +325 -0
- data/app/models/shoppe/order_item.rb +113 -0
- data/app/models/shoppe/product.rb +56 -0
- data/app/models/shoppe/product_category.rb +22 -0
- data/app/models/shoppe/user.rb +41 -0
- data/app/views/layouts/shoppe/application.html.haml +35 -0
- data/app/views/layouts/shoppe/sub.html.haml +10 -0
- data/app/views/shoppe/delivery_service_prices/_form.html.haml +28 -0
- data/app/views/shoppe/delivery_service_prices/edit.html.haml +5 -0
- data/app/views/shoppe/delivery_service_prices/index.html.haml +22 -0
- data/app/views/shoppe/delivery_service_prices/new.html.haml +5 -0
- data/app/views/shoppe/delivery_services/_form.html.haml +35 -0
- data/app/views/shoppe/delivery_services/edit.html.haml +5 -0
- data/app/views/shoppe/delivery_services/index.html.haml +24 -0
- data/app/views/shoppe/delivery_services/new.html.haml +5 -0
- data/app/views/shoppe/order_mailer/accepted.text.erb +12 -0
- data/app/views/shoppe/order_mailer/received.text.erb +12 -0
- data/app/views/shoppe/order_mailer/rejected.text.erb +10 -0
- data/app/views/shoppe/order_mailer/shipped.text.erb +16 -0
- data/app/views/shoppe/orders/index.html.haml +60 -0
- data/app/views/shoppe/orders/show.html.haml +117 -0
- data/app/views/shoppe/product_categories/_form.html.haml +25 -0
- data/app/views/shoppe/product_categories/edit.html.haml +6 -0
- data/app/views/shoppe/product_categories/index.html.haml +15 -0
- data/app/views/shoppe/product_categories/new.html.haml +5 -0
- data/app/views/shoppe/products/_form.html.haml +71 -0
- data/app/views/shoppe/products/edit.html.haml +5 -0
- data/app/views/shoppe/products/index.html.haml +27 -0
- data/app/views/shoppe/products/new.html.haml +5 -0
- data/app/views/shoppe/sessions/new.html.haml +12 -0
- data/app/views/shoppe/sessions/reset.html.haml +11 -0
- data/app/views/shoppe/user_mailer/new_password.text.erb +9 -0
- data/app/views/shoppe/users/_form.html.haml +26 -0
- data/app/views/shoppe/users/edit.html.haml +5 -0
- data/app/views/shoppe/users/index.html.haml +17 -0
- data/app/views/shoppe/users/new.html.haml +5 -0
- data/config/routes.rb +24 -0
- data/config/shoppe.example.yml +6 -0
- data/db/migrate/20130926094549_create_shoppe_initial_schema.rb +116 -0
- data/db/seeds.rb +85 -0
- data/db/seeds_data/poe400.jpg +0 -0
- data/db/seeds_data/snom-870-blk.jpg +0 -0
- data/db/seeds_data/snom-870-grey.jpg +0 -0
- data/db/seeds_data/snom-mm2.jpg +0 -0
- data/db/seeds_data/spa303.jpg +0 -0
- data/db/seeds_data/t18p.jpg +0 -0
- data/db/seeds_data/t20p.jpg +0 -0
- data/db/seeds_data/t22p.jpg +0 -0
- data/db/seeds_data/t26p.jpg +0 -0
- data/db/seeds_data/t41pn.jpg +0 -0
- data/db/seeds_data/t46gn.jpg +0 -0
- data/db/seeds_data/w52p.jpg +0 -0
- data/db/seeds_data/yhs32.jpg +0 -0
- data/lib/shoppe.rb +41 -0
- data/lib/shoppe/engine.rb +35 -0
- data/lib/shoppe/errors/inappropriate_delivery_service.rb +11 -0
- data/lib/shoppe/errors/insufficient_stock_to_fulfil.rb +19 -0
- data/lib/shoppe/errors/not_enough_stock.rb +19 -0
- data/lib/shoppe/errors/payment_declined.rb +15 -0
- data/lib/shoppe/setup_generator.rb +14 -0
- data/lib/shoppe/version.rb +3 -0
- data/lib/tasks/shoppe.rake +17 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +23 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +29 -0
- data/test/dummy/config/environments/production.rb +80 -0
- data/test/dummy/config/environments/test.rb +36 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +12 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +3 -0
- data/test/dummy/config/shoppe.yml +7 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +119 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +893 -0
- data/test/dummy/log/test.log +6397 -0
- data/test/dummy/public/404.html +58 -0
- data/test/dummy/public/422.html +58 -0
- data/test/dummy/public/500.html +57 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/models/shoppe/basket_test.rb +26 -0
- data/test/models/shoppe/user_test.rb +37 -0
- data/test/shoppe_test.rb +17 -0
- data/test/test_helper.rb +4 -0
- metadata +453 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
Hello <%=@order.first_name%>!
|
2
|
+
|
3
|
+
Re: Order #<%=@order.number%>
|
4
|
+
|
5
|
+
Unfortunately, this attached order was rejected. This is most likely to our over-zealous fraud system so if you wish to continue with this order, please drop us an email or give us a call.
|
6
|
+
|
7
|
+
Many thanks,
|
8
|
+
|
9
|
+
<%=Shoppe.config[:store_name]%>
|
10
|
+
<%=Shoppe.config[:email_address]%>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Hello <%=@order.first_name%>!
|
2
|
+
|
3
|
+
Re: Order #<%=@order.number%>
|
4
|
+
|
5
|
+
We're pleased to let you know your order has been shipped and
|
6
|
+
will be with you shortly!
|
7
|
+
|
8
|
+
<% if @order.courier_tracking_url -%>
|
9
|
+
You can the delivery online at:
|
10
|
+
<%=@order.courier_tracking_url%>
|
11
|
+
<% end -%>
|
12
|
+
|
13
|
+
Many thanks,
|
14
|
+
|
15
|
+
<%=Shoppe.config[:store_name]%>
|
16
|
+
<%=Shoppe.config[:email_address]%>
|
@@ -0,0 +1,60 @@
|
|
1
|
+
- @page_title = 'Orders'
|
2
|
+
|
3
|
+
= content_for :header do
|
4
|
+
%p.buttons= link_to "Search Orders", '#', :class => 'button', :rel => 'searchOrders'
|
5
|
+
%h2
|
6
|
+
Orders
|
7
|
+
%span= page_entries_info @orders
|
8
|
+
|
9
|
+
.orderSearch{:style => action_name == 'search' ? "display:block" : ''}
|
10
|
+
= search_form_for @query, :url => search_orders_path, :html => { :method => :post } do |f|
|
11
|
+
%dl.left
|
12
|
+
%dt= f.label :id_eq, "Order Number"
|
13
|
+
%dd= f.text_field :id_eq
|
14
|
+
%dt= f.label :first_name_or_last_name_or_company_cont, "Customer"
|
15
|
+
%dd= f.text_field :first_name_or_last_name_or_company_cont
|
16
|
+
%dt= f.label :address1_or_address2_or_address3_or_address4_or_postcode_cont, "Address"
|
17
|
+
%dd= f.text_field :address1_or_address2_or_address3_or_address4_or_postcode_cont
|
18
|
+
%dt= f.label :consignment_number_cont, "Consignment Number"
|
19
|
+
%dd= f.text_field :consignment_number_cont
|
20
|
+
%dt= f.label :received_at_eq, "Received between"
|
21
|
+
%dd
|
22
|
+
= f.text_field :received_at_gteq, :class => 'small'
|
23
|
+
→
|
24
|
+
= f.text_field :received_at_lteq, :class => 'small'
|
25
|
+
%dl.right
|
26
|
+
%dt= f.label :products_title_cont, "Contains product"
|
27
|
+
%dd= f.text_field :products_title_cont
|
28
|
+
|
29
|
+
%dt= f.label :email_address_cont, "E-Mail Address"
|
30
|
+
%dd= f.text_field :email_address_cont
|
31
|
+
%dt= f.label :phone_number_cont, "Phone Number"
|
32
|
+
%dd= f.text_field :phone_number_cont
|
33
|
+
%dt= f.label :status_eq, "Status"
|
34
|
+
%dd= f.select :status_eq, [nil] + Shoppe::Order::STATUSES.map { |s| [s.humanize, s]}
|
35
|
+
%dd= f.submit "Search", :class => 'button green button'
|
36
|
+
|
37
|
+
.table
|
38
|
+
%table.data
|
39
|
+
%thead
|
40
|
+
%tr
|
41
|
+
%th Number
|
42
|
+
%th Customer
|
43
|
+
%th Status
|
44
|
+
%th Products
|
45
|
+
%th Total
|
46
|
+
%th Paid?
|
47
|
+
%tbody
|
48
|
+
- for order in @orders
|
49
|
+
%tr
|
50
|
+
%td= link_to order.number, order
|
51
|
+
%td= order.customer_name
|
52
|
+
%td= status_tag order.status
|
53
|
+
%td
|
54
|
+
%ul
|
55
|
+
- for item in order.order_items
|
56
|
+
%li #{item.quantity} x #{item.product.title}
|
57
|
+
%td= number_to_currency order.total
|
58
|
+
%td= boolean_tag order.paid?
|
59
|
+
|
60
|
+
= paginate @orders
|
@@ -0,0 +1,117 @@
|
|
1
|
+
- @page_title = 'Order #' + @order.number
|
2
|
+
|
3
|
+
= content_for :header do
|
4
|
+
%p.buttons= link_to "Back to orders", :orders, :class => 'button'
|
5
|
+
%h2 Order ##{@order.number}
|
6
|
+
|
7
|
+
#order
|
8
|
+
.details
|
9
|
+
.left
|
10
|
+
%dl
|
11
|
+
%dt Name
|
12
|
+
%dd= @order.first_name + ' ' + @order.last_name
|
13
|
+
%dt Company
|
14
|
+
%dd= @order.company.blank? ? '-' : @order.company
|
15
|
+
%dt Address
|
16
|
+
%dd= @order.address1
|
17
|
+
%dd= @order.address2
|
18
|
+
%dd= @order.address3
|
19
|
+
%dd= @order.address4
|
20
|
+
%dt Postcode
|
21
|
+
%dd= @order.postcode
|
22
|
+
%dd= @order.country
|
23
|
+
.right
|
24
|
+
%dl
|
25
|
+
%dt E-Mail Address
|
26
|
+
%dd= @order.email_address
|
27
|
+
%dt Telephone
|
28
|
+
%dd= @order.phone_number
|
29
|
+
%dt Weight
|
30
|
+
%dd #{@order.total_weight}kg
|
31
|
+
%dt Build Time
|
32
|
+
%dd= distance_of_time_in_words(@order.created_at, @order.received_at)
|
33
|
+
|
34
|
+
|
35
|
+
- if !@order.paid?
|
36
|
+
= form_tag [:pay, @order] do
|
37
|
+
%p.ship
|
38
|
+
= text_field_tag 'payment_reference', '', :placeholder => "Enter payment reference..."
|
39
|
+
= submit_tag "Mark as paid", :class => 'button green'
|
40
|
+
|
41
|
+
- if @order.accepted? && !@order.shipped?
|
42
|
+
= form_tag [:ship, @order] do
|
43
|
+
%p.ship
|
44
|
+
= text_field_tag 'consignment_number', '', :placeholder => "Enter consignment number..."
|
45
|
+
= submit_tag "Ship", :class => 'button green'
|
46
|
+
|
47
|
+
- if @order.paid? && !(@order.accepted? || @order.rejected?)
|
48
|
+
%p.acceptreject
|
49
|
+
= link_to 'Accept order', [:accept, @order], :method => :post, :class => 'button green'
|
50
|
+
= link_to "Reject order", [:reject, @order], :method => :post, :class => 'button purple'
|
51
|
+
|
52
|
+
.status-bar
|
53
|
+
%ul
|
54
|
+
- if @order.received?
|
55
|
+
%li.received
|
56
|
+
%h4 Order Received
|
57
|
+
%p on #{@order.received_at.to_s(:short)} from #{@order.ip_address}
|
58
|
+
|
59
|
+
- if @order.paid?
|
60
|
+
%li.payment
|
61
|
+
%h4 Payment Received
|
62
|
+
%p on #{@order.paid_at.to_s(:short)} using #{@order.payment_method}
|
63
|
+
%p Reference <b>#{@order.payment_reference}</b>
|
64
|
+
|
65
|
+
- if @order.accepted?
|
66
|
+
%li.accepted
|
67
|
+
%h4 Order Accepted
|
68
|
+
%p on #{@order.accepted_at.to_s(:short)} by #{@order.accepter.try(:short_name) || 'Unknown'}
|
69
|
+
|
70
|
+
- elsif @order.rejected?
|
71
|
+
%li.rejected
|
72
|
+
%h4 Order rejected
|
73
|
+
%p on #{@order.rejected_at.to_s(:short)} by #{@order.rejecter.try(:short_name) || 'Unknown'}
|
74
|
+
|
75
|
+
- if @order.shipped?
|
76
|
+
%li.shipped
|
77
|
+
%h4 Order Shipped
|
78
|
+
%p on #{@order.shipped_at.to_s(:short)} by #{@order.shipper.try(:short_name) || 'Unknown'}
|
79
|
+
- if @order.courier_tracking_url
|
80
|
+
%p= link_to "Tracking URL", @order.courier_tracking_url
|
81
|
+
- else
|
82
|
+
%p Consignment # <b>#{@order.consignment_number}</b>
|
83
|
+
|
84
|
+
.order_items
|
85
|
+
.table
|
86
|
+
%table.data
|
87
|
+
%thead
|
88
|
+
%tr
|
89
|
+
%th Qty
|
90
|
+
%th Item
|
91
|
+
%th SKU
|
92
|
+
%th Price
|
93
|
+
%th= Shoppe.config[:tax_name]
|
94
|
+
%th Sub-Total
|
95
|
+
%tbody
|
96
|
+
- for item in @order.order_items
|
97
|
+
%tr
|
98
|
+
%td= item.quantity
|
99
|
+
%td= link_to item.product.title, [:edit, item.product]
|
100
|
+
%td= item.product.sku
|
101
|
+
%td= number_to_currency item.sub_total
|
102
|
+
%td= number_to_currency item.tax_amount
|
103
|
+
%td= number_to_currency item.total
|
104
|
+
%tfoot
|
105
|
+
%tr
|
106
|
+
%td.right.bold{:colspan => 5}= link_to @order.delivery_service.name, [:edit, @order.delivery_service]
|
107
|
+
%td= number_to_currency @order.delivery_price
|
108
|
+
%tr
|
109
|
+
%td.right.bold{:colspan => 5} Total (excluding #{Shoppe.config[:tax_name]})
|
110
|
+
%td= number_to_currency @order.total_before_tax
|
111
|
+
%tr
|
112
|
+
%td.right.bold{:colspan => 5}= Shoppe.config[:tax_name]
|
113
|
+
%td= number_to_currency @order.tax
|
114
|
+
%tr
|
115
|
+
%td.right.bold{:colspan => 5} Total
|
116
|
+
%td= number_to_currency @order.total
|
117
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
= form_for @product_category do |f|
|
2
|
+
= f.error_messages
|
3
|
+
= field_set_tag 'Category Details' do
|
4
|
+
%dl
|
5
|
+
%dt= f.label :name
|
6
|
+
%dd= f.text_field :name
|
7
|
+
%dl
|
8
|
+
%dt= f.label :permalink
|
9
|
+
%dd= f.text_field :permalink
|
10
|
+
%dl
|
11
|
+
%dt= f.label :description
|
12
|
+
%dd= f.text_area :description
|
13
|
+
= field_set_tag "Attachments" do
|
14
|
+
|
15
|
+
%dl
|
16
|
+
%dt= f.label :image_file, "Image"
|
17
|
+
%dd
|
18
|
+
= attachment_preview @product_category.image
|
19
|
+
%p= f.file_field :image_file
|
20
|
+
|
21
|
+
%p.submit
|
22
|
+
- unless @product_category.new_record?
|
23
|
+
%span.right= link_to "Delete", @product_category, :class => 'button purple', :method => :delete, :data => {:confirm => "Are you sure you wish to remove this category?"}
|
24
|
+
= f.submit :class => 'button green'
|
25
|
+
= link_to "Cancel", :product_categories, :class => 'button'
|
@@ -0,0 +1,15 @@
|
|
1
|
+
- @page_title = "Product Categories"
|
2
|
+
|
3
|
+
= content_for :header do
|
4
|
+
%p.buttons=link_to "New category", :new_product_category, :class => 'button green'
|
5
|
+
%h2 Product Categories
|
6
|
+
|
7
|
+
.table
|
8
|
+
%table.data
|
9
|
+
%thead
|
10
|
+
%tr
|
11
|
+
%th Name
|
12
|
+
%tbody
|
13
|
+
- for cat in @product_categories
|
14
|
+
%tr
|
15
|
+
%td= link_to cat.name, [:edit, cat]
|
@@ -0,0 +1,71 @@
|
|
1
|
+
= form_for @product, :html => {:multipart => true} do |f|
|
2
|
+
= f.error_messages
|
3
|
+
= field_set_tag "Category" do
|
4
|
+
%dl
|
5
|
+
%dt= f.label :product_category_id
|
6
|
+
%dd= f.collection_select :product_category_id, Shoppe::ProductCategory.ordered, :id, :name, :include_blank => true
|
7
|
+
= field_set_tag "Product Information" do
|
8
|
+
%dl
|
9
|
+
%dt= f.label :title
|
10
|
+
%dd= f.text_field :title
|
11
|
+
%dl
|
12
|
+
%dt= f.label :permalink
|
13
|
+
%dd= f.text_field :permalink
|
14
|
+
%dl
|
15
|
+
%dt= f.label :sku, 'SKU'
|
16
|
+
%dd= f.text_field :sku
|
17
|
+
%dl
|
18
|
+
%dt= f.label :description
|
19
|
+
%dd= f.text_area :description
|
20
|
+
%dl
|
21
|
+
%dt= f.label :short_description
|
22
|
+
%dd= f.text_area :short_description
|
23
|
+
%dl
|
24
|
+
%dt= f.label :in_the_box, "What's in the box?"
|
25
|
+
%dd= f.text_area :in_the_box
|
26
|
+
= field_set_tag "Attachments" do
|
27
|
+
|
28
|
+
%dl
|
29
|
+
%dt= f.label :default_image_file, "Default Image"
|
30
|
+
%dd
|
31
|
+
= attachment_preview @product.default_image
|
32
|
+
%p= f.file_field :default_image_file
|
33
|
+
%dl
|
34
|
+
%dt= f.label :data_sheet_file, "Datasheet"
|
35
|
+
%dd
|
36
|
+
= attachment_preview @product.data_sheet
|
37
|
+
%p= f.file_field :data_sheet_file
|
38
|
+
|
39
|
+
= field_set_tag "Pricing" do
|
40
|
+
%dl
|
41
|
+
%dt= f.label :price
|
42
|
+
%dd= f.text_field :price
|
43
|
+
%dl
|
44
|
+
%dt= f.label :tax_rate
|
45
|
+
%dd= f.text_field :tax_rate
|
46
|
+
|
47
|
+
= field_set_tag "Website Properties" do
|
48
|
+
%dl
|
49
|
+
%dt= f.label :active, "On sale?"
|
50
|
+
%dd
|
51
|
+
= f.check_box :active
|
52
|
+
= f.label :active, "If checked, this product will be displayed within the public store"
|
53
|
+
%dl
|
54
|
+
%dt= f.label :featured, "Featured?"
|
55
|
+
%dd
|
56
|
+
= f.check_box :featured
|
57
|
+
= f.label :featured, "If checked, this product will appear on your homepage"
|
58
|
+
|
59
|
+
= field_set_tag "Stock Control" do
|
60
|
+
%dl
|
61
|
+
%dt= f.label :weight
|
62
|
+
%dd= f.text_field :weight
|
63
|
+
%dl
|
64
|
+
%dt= f.label :stock
|
65
|
+
%dd= f.text_field :stock
|
66
|
+
|
67
|
+
%p.submit
|
68
|
+
- unless @product.new_record?
|
69
|
+
%span.right= link_to "Delete", @product, :class => 'button purple', :method => :delete, :data => {:confirm => "Are you sure you wish to remove this product?"}
|
70
|
+
= f.submit :class => 'button green'
|
71
|
+
= link_to "Cancel", :products, :class => 'button'
|
@@ -0,0 +1,27 @@
|
|
1
|
+
- @page_title = "Products"
|
2
|
+
|
3
|
+
= content_for :header do
|
4
|
+
%p.buttons
|
5
|
+
= link_to "New product", :new_product, :class => 'button green'
|
6
|
+
= link_to "New category", :new_product_category, :class => 'button green'
|
7
|
+
|
8
|
+
%h2 Products
|
9
|
+
|
10
|
+
.table
|
11
|
+
%table.data
|
12
|
+
%thead
|
13
|
+
%tr
|
14
|
+
%th SKU
|
15
|
+
%th Name
|
16
|
+
%th Price
|
17
|
+
%th Stock
|
18
|
+
%tbody
|
19
|
+
- for category, products in @products
|
20
|
+
%tr
|
21
|
+
%th{:colspan => 4}= category.name
|
22
|
+
- for product in products
|
23
|
+
%tr
|
24
|
+
%td= product.sku
|
25
|
+
%td= link_to product.title, [:edit, product]
|
26
|
+
%td= number_to_currency product.price
|
27
|
+
%td= product.stock
|
@@ -0,0 +1,12 @@
|
|
1
|
+
- @page_title = 'Admin Login'
|
2
|
+
= display_flash
|
3
|
+
.loginArea
|
4
|
+
= form_tag :login, :class => 'login' do
|
5
|
+
%p.field
|
6
|
+
= text_field_tag 'email_address', params[:email_address], :class => 'focus', :placeholder => 'E-Mail Address'
|
7
|
+
%p.field
|
8
|
+
= password_field_tag 'password', params[:password], :class => '', :placeholder => 'Password'
|
9
|
+
%p.submit
|
10
|
+
= submit_tag "Login", :class => 'button green'
|
11
|
+
%p.reset
|
12
|
+
= link_to "Reset your password?", login_reset_path
|
@@ -0,0 +1,11 @@
|
|
1
|
+
- @page_title = 'Admin Login'
|
2
|
+
= display_flash
|
3
|
+
.loginArea
|
4
|
+
%h2 Reset your password
|
5
|
+
= form_tag :login_reset, :class => 'login' do
|
6
|
+
%p.field
|
7
|
+
= text_field_tag 'email_address', params[:email_address], :class => 'focus', :placeholder => 'E-Mail Address'
|
8
|
+
%p.submit
|
9
|
+
= submit_tag "Login", :class => 'button green'
|
10
|
+
%p.reset
|
11
|
+
= link_to "Back to login", login_path
|
@@ -0,0 +1,26 @@
|
|
1
|
+
= form_for @user do |f|
|
2
|
+
= f.error_messages
|
3
|
+
= field_set_tag "User Details" do
|
4
|
+
%dl
|
5
|
+
%dt= f.label :first_name
|
6
|
+
%dd= f.text_field :first_name
|
7
|
+
%dl
|
8
|
+
%dt= f.label :last_name
|
9
|
+
%dd= f.text_field :last_name
|
10
|
+
= field_set_tag "Login" do
|
11
|
+
%dl
|
12
|
+
%dt= f.label :email_address
|
13
|
+
%dd= f.text_field :email_address
|
14
|
+
%dl
|
15
|
+
%dt= f.label :password
|
16
|
+
%dd= f.password_field :password
|
17
|
+
%dl
|
18
|
+
%dt= f.label :password_confirmation, "...and again"
|
19
|
+
%dd= f.password_field :password_confirmation
|
20
|
+
|
21
|
+
|
22
|
+
%p.submit
|
23
|
+
- unless @user.new_record?
|
24
|
+
%span.right= link_to "Delete", @user, :class => 'button purple', :method => :delete, :data => {:confirm => "Are you sure you wish to remove this user?"}
|
25
|
+
= f.submit :class => 'button green'
|
26
|
+
= link_to "Cancel", :users, :class => 'button'
|