office_clerk 0.9 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/Gemfile.lock +11 -11
- data/README.md +26 -8
- data/Rakefile +2 -2
- data/app/controllers/admin_controller.rb +2 -6
- data/app/controllers/baskets_controller.rb +2 -2
- data/app/controllers/office_controller.rb +1 -0
- data/app/controllers/orders_controller.rb +1 -1
- data/app/controllers/sessions_controller.rb +5 -5
- data/app/helpers/office_helper.rb +0 -19
- data/app/views/addresses/show.html.haml +2 -2
- data/app/views/baskets/_small.html.haml +1 -1
- data/app/views/baskets/edit.html.haml +18 -17
- data/app/views/baskets/index.html.haml +19 -17
- data/app/views/baskets/show.html.haml +3 -3
- data/app/views/categories/_treeview.html.haml +1 -1
- data/app/views/categories/edit.html.haml +5 -5
- data/app/views/categories/index.html.haml +8 -7
- data/app/views/categories/show.html.haml +5 -4
- data/app/views/clerks/edit.html.haml +4 -4
- data/app/views/clerks/index.html.haml +7 -6
- data/app/views/clerks/show.html.haml +4 -3
- data/app/views/layouts/_admin_menu.html.haml +8 -8
- data/app/views/layouts/office_clerk.haml +3 -3
- data/app/views/manage/all.haml +2 -2
- data/app/views/orders/_payment.html.haml +11 -0
- data/app/views/orders/_shipment.html.haml +10 -0
- data/app/views/orders/index.html.haml +9 -8
- data/app/views/orders/shipment.haml +3 -1
- data/app/views/orders/show.html.haml +29 -47
- data/app/views/products/_head.haml +1 -1
- data/app/views/products/_line.html.haml +1 -1
- data/app/views/products/_triple.html.haml +1 -1
- data/app/views/products/edit.html.haml +6 -4
- data/app/views/products/index.html.haml +24 -22
- data/app/views/products/show.html.haml +15 -13
- data/app/views/purchases/index.html.haml +7 -6
- data/app/views/purchases/show.html.haml +8 -7
- data/app/views/suppliers/edit.html.haml +4 -3
- data/app/views/suppliers/index.html.haml +7 -6
- data/app/views/suppliers/show.html.haml +4 -3
- data/bin/rails +11 -3
- data/config/locales/en.yml +1 -1
- data/config/locales/fi.yml +1 -1
- data/db/migrate/20131226144316_baskets.rb +2 -2
- data/db/schema.rb +2 -2
- data/lib/office_clerk/engine.rb +3 -3
- data/lib/office_clerk/version.rb +1 -1
- data/test_app/app/controllers/application_controller.rb +1 -1
- data/test_app/config/application.rb +3 -0
- data/test_app/config/initializers/assets.rb +3 -1
- metadata +4 -9
- data/config/initializers/backtrace_silencers.rb +0 -7
- data/config/initializers/filter_parameter_logging.rb +0 -4
- data/config/initializers/inflections.rb +0 -16
- data/config/initializers/migrate.rb +0 -18
- data/config/initializers/mime_types.rb +0 -6
- data/config/initializers/session_store.rb +0 -3
- data/config/initializers/wrap_parameters.rb +0 -14
@@ -1,15 +1,14 @@
|
|
1
|
-
%h2
|
1
|
+
%h2.categories_edit_start
|
2
2
|
= t params["action"]
|
3
3
|
= t(:category)
|
4
4
|
%ol.breadcrumb
|
5
5
|
- parents(@category).each do | group|
|
6
6
|
%li
|
7
7
|
- if group.id
|
8
|
-
= link_to group.name ,
|
8
|
+
= link_to group.name , category_path(group)
|
9
9
|
- else
|
10
10
|
= t(:new)
|
11
|
-
|
12
|
-
= bootstrap_form_for(@category, :html => { :multipart => true } , :url => url) do |f|
|
11
|
+
= bootstrap_form_for(@category, :html => { :multipart => true } ) do |f|
|
13
12
|
.row.form-group
|
14
13
|
.col-md-5
|
15
14
|
= f.text_field :name
|
@@ -32,9 +31,10 @@
|
|
32
31
|
= f.submit :class => "btn btn-success"
|
33
32
|
%br
|
34
33
|
%br
|
35
|
-
= link_to t(:back),
|
34
|
+
= link_to t(:back), categories_path, :class => "btn btn-warning"
|
36
35
|
.row
|
37
36
|
.col-md-4
|
38
37
|
= f.file_field :main_picture
|
39
38
|
.col-md-4
|
40
39
|
= f.file_field :extra_picture
|
40
|
+
.categories_edit_end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
.row
|
1
|
+
.row.categories_index_start
|
2
2
|
.col-md-9.categories
|
3
3
|
.row
|
4
4
|
.col-md-10
|
5
5
|
%h2= t(:categories)
|
6
6
|
= paginate @categories
|
7
7
|
.col-md-2
|
8
|
-
= link_to t(:new) + ' ' + t(:category) ,
|
8
|
+
= link_to t(:new) + ' ' + t(:category) , new_category_path , :class => "btn btn-primary"
|
9
9
|
.col-md-3
|
10
10
|
= image_tag "office_clerk/categories.jpg" , :class => "img-responsive"
|
11
11
|
.row
|
@@ -26,14 +26,14 @@
|
|
26
26
|
- @categories.each do |category|
|
27
27
|
%tr{:class => "line-#{cycle("1","2")}"}
|
28
28
|
%td.image= image_tag category.main_picture.url(:thumb)
|
29
|
-
%td=link_to category.name,
|
29
|
+
%td=link_to category.name, category_path(category), :title => t(:show) , :class => category.online && "online"
|
30
30
|
%td=category.products.length.to_s
|
31
31
|
%td=category.online ? t(:online) : t(:not_online)
|
32
|
-
%td=link_to category.category.name,
|
33
|
-
%td= link_to t(:edit),
|
32
|
+
%td=link_to category.category.name, category_path(category.category) , :class => category.category.online && "online" if category.category
|
33
|
+
%td= link_to t(:edit), edit_category_path(category), :title => t(:edit)
|
34
34
|
= paginate @categories
|
35
35
|
.col-md-3
|
36
|
-
= search_form_for @q
|
36
|
+
= search_form_for @q , :html => { :class => "form-horizontal" }, :method => :get do |f|
|
37
37
|
.form-group
|
38
38
|
.input-group
|
39
39
|
= f.text_field :name_cont , :class => "form-control" , :placeholder => t(:name)
|
@@ -53,8 +53,9 @@
|
|
53
53
|
=t(:blanks)
|
54
54
|
= f.radio_button :description_blank , true
|
55
55
|
= f.submit t(:filter), :id => :filter , :class => "btn btn-success"
|
56
|
-
= link_to t(:cancel),
|
56
|
+
= link_to t(:cancel), categories_path, :class => "btn btn-warning"
|
57
57
|
%hr
|
58
58
|
- @roots.each do |group|
|
59
59
|
%ul.cat
|
60
60
|
= render "treeview" , :group => group
|
61
|
+
.categories_index_end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
.row
|
1
|
+
.row.categories_show_start
|
2
2
|
.col-md-6
|
3
3
|
%h2
|
4
4
|
= t(:category)
|
@@ -25,10 +25,11 @@
|
|
25
25
|
%p
|
26
26
|
= image_tag @category.extra_picture.url
|
27
27
|
|
28
|
-
= link_to t(:edit),
|
29
|
-
= link_to t(:back),
|
28
|
+
= link_to t(:edit), edit_category_path(@category), :class => "btn btn-primary"
|
29
|
+
= link_to t(:back), categories_path, :class => "btn btn-primary"
|
30
30
|
%b= t(:shop_link) + " : "
|
31
|
-
= link_to @category.link ,
|
31
|
+
= link_to @category.link , categories_path(@category.link)
|
32
32
|
|
33
33
|
=render "triple" , :groups => @category.categories
|
34
34
|
=render "products/triple" , :products => @category.products.no_items
|
35
|
+
.categories_show_end
|
@@ -1,10 +1,9 @@
|
|
1
|
-
%h2
|
1
|
+
%h2.clerks_edit_start
|
2
2
|
= t params["action"]
|
3
3
|
= t(:clerk)
|
4
4
|
-if @clerk.admin
|
5
5
|
=t(:admin)
|
6
|
-
|
7
|
-
= bootstrap_form_for(@clerk, :url => url) do |f|
|
6
|
+
= bootstrap_form_for(@clerk) do |f|
|
8
7
|
.row
|
9
8
|
= f.check_box :admin
|
10
9
|
= f.email_field :email
|
@@ -15,4 +14,5 @@
|
|
15
14
|
= f.password_field :password_confirmation
|
16
15
|
.form-actions
|
17
16
|
= f.submit :class => "btn btn-success" , :id => "submit"
|
18
|
-
= link_to t(:back),
|
17
|
+
= link_to t(:back), clerks_path, :class => "btn btn-warning"
|
18
|
+
.clerks_edit_end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
.row
|
1
|
+
.row.clerks_index_start
|
2
2
|
.col-md-9.clerks
|
3
3
|
.row
|
4
4
|
.col-md-10
|
5
5
|
%h2= t(:clerks)
|
6
6
|
= paginate @clerks
|
7
7
|
.col-md-2
|
8
|
-
= link_to t(:new) + ' ' + t(:clerk) ,
|
8
|
+
= link_to t(:new) + ' ' + t(:clerk) , new_clerk_path , :class => "btn btn-primary"
|
9
9
|
.col-md-3
|
10
10
|
= image_tag "office_clerk/clerks.jpg" , :class => "img-responsive"
|
11
11
|
.row
|
@@ -24,14 +24,15 @@
|
|
24
24
|
%tr{:class => "line-#{cycle("1","2")}"}
|
25
25
|
%td=clerk.email
|
26
26
|
%td=clerk.whole_address
|
27
|
-
%td= link_to t(:show) ,
|
28
|
-
%td= link_to t(:edit),
|
27
|
+
%td= link_to t(:show) , clerk_path(clerk), :title => t(:show)
|
28
|
+
%td= link_to t(:edit), edit_clerk_path(clerk), :title => t(:edit)
|
29
29
|
= paginate @clerks
|
30
30
|
.col-md-3
|
31
|
-
= search_form_for @q, :
|
31
|
+
= search_form_for @q, :html => { :class => "form-horizontal" }, :method => :get do |f|
|
32
32
|
.form-group
|
33
33
|
= f.text_field :email_cont , :class => "form-control" , :placeholder => t(:email)
|
34
34
|
.form-group
|
35
35
|
= f.text_field :address_cont ,:class => "form-control" , :placeholder => t(:address)
|
36
36
|
= f.submit t(:filter), :id => :filter , :class => "btn btn-success"
|
37
|
-
= link_to t(:cancel),
|
37
|
+
= link_to t(:cancel), clerks_path, :class => "btn btn-warning"
|
38
|
+
.clerks_index_end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
%h2
|
1
|
+
%h2.clerks_show_start
|
2
2
|
= t(:clerk) + " : " + @clerk.email
|
3
3
|
-if @clerk.admin
|
4
4
|
(
|
@@ -15,5 +15,6 @@
|
|
15
15
|
%p
|
16
16
|
%b= t(:phone) + " : " + @clerk.phone.to_s
|
17
17
|
|
18
|
-
= link_to t(:edit),
|
19
|
-
= link_to t(:back),
|
18
|
+
= link_to t(:edit), edit_clerk_path(@clerk), :class => "btn btn-success"
|
19
|
+
= link_to t(:back), clerks_path, :class => "btn btn-warning"
|
20
|
+
.clerks_show_end
|
@@ -1,16 +1,16 @@
|
|
1
1
|
%li{:class => params[:controller] == "products" && "active" }
|
2
|
-
= link_to t(:products),
|
2
|
+
= link_to t(:products), products_path
|
3
3
|
%li{:class => params[:controller] == "baskets" && "active" }
|
4
|
-
= link_to t(:baskets),
|
4
|
+
= link_to t(:baskets), baskets_path
|
5
5
|
%li{:class => params[:controller] == "orders" && "active" }
|
6
|
-
= link_to t(:orders),
|
6
|
+
= link_to t(:orders), orders_path
|
7
7
|
%li{:class => params[:controller] == "purchases" && "active" }
|
8
|
-
= link_to t(:purchases),
|
8
|
+
= link_to t(:purchases), purchases_path
|
9
9
|
%li{:class => params[:controller] == "categories" && "active" }
|
10
|
-
= link_to t(:categories),
|
10
|
+
= link_to t(:categories), categories_path
|
11
11
|
%li{:class => params[:controller] == "suppliers" && "active" }
|
12
|
-
= link_to t(:suppliers),
|
12
|
+
= link_to t(:suppliers), suppliers_path
|
13
13
|
%li{:class => params[:controller] == "clerks" && "active" }
|
14
|
-
= link_to t(:clerks),
|
14
|
+
= link_to t(:clerks), clerks_path
|
15
15
|
%li{:class => params[:controller] == "manage" && "active" }
|
16
|
-
= link_to t(:manage),
|
16
|
+
= link_to t(:manage), manage_all_path
|
@@ -16,13 +16,13 @@
|
|
16
16
|
.container-fluid
|
17
17
|
%nav.navbar.navbar-default.navbar-fixed-top.navbar-inverse.hidden-print{role: "navigation"}
|
18
18
|
.navbar-header
|
19
|
-
%ul.nav.navbar-nav
|
19
|
+
%ul.nav.navbar-nav.menu
|
20
20
|
%li
|
21
21
|
%a{href: "/"}= t(:shop)
|
22
22
|
= render :partial => "layouts/admin_menu"
|
23
23
|
%ul.nav.navbar-nav.navbar-right
|
24
|
-
%li= link_to current_clerk.email ,
|
25
|
-
%li= link_to t(:sign_out),
|
24
|
+
%li= link_to current_clerk.email , edit_clerk_path(current_clerk)
|
25
|
+
%li= link_to t(:sign_out), sign_out_path
|
26
26
|
= render "layouts/messages"
|
27
27
|
|
28
28
|
= yield
|
data/app/views/manage/all.haml
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
.row
|
1
|
+
.row.order_index_start
|
2
2
|
.col-md-9.orders
|
3
3
|
.row
|
4
4
|
.col-md-10
|
5
5
|
%h2= t(:orders)
|
6
6
|
= paginate @orders
|
7
7
|
.col-md-2
|
8
|
-
= link_to t(:new) + ' ' + t(:order) ,
|
8
|
+
= link_to t(:new) + ' ' + t(:order) , new_order_path , :class => "btn btn-primary new_order"
|
9
9
|
.col-md-3
|
10
10
|
= image_tag "office_clerk/orders.jpg" , :class => "img-responsive"
|
11
11
|
|
12
12
|
.row
|
13
13
|
.col-md-9
|
14
14
|
%div
|
15
|
-
%table.table.table-
|
15
|
+
%table.table.table-striped.table-condensed
|
16
16
|
%thead
|
17
17
|
%tr
|
18
18
|
%th= sort_link [:office,@q], :number
|
@@ -26,12 +26,12 @@
|
|
26
26
|
- @orders.each do |order|
|
27
27
|
%tr{:class => "line-#{cycle("1","2")}"}
|
28
28
|
%td.number
|
29
|
-
= link_to order.number.to_s ,
|
29
|
+
= link_to order.number.to_s , order_path(order), :title => t(:show)
|
30
30
|
-unless order.note.blank?
|
31
31
|
%span.glyphicon.glyphicon-flag
|
32
32
|
%td.text-right= date(order.ordered_on)
|
33
33
|
%td.text-right= order.basket.items.length rescue "basket #{order.id}"
|
34
|
-
%td.text-right= link_to euros(order.total_price),
|
34
|
+
%td.text-right= link_to euros(order.total_price), basket_path(order.basket)
|
35
35
|
%td.email= order.email
|
36
36
|
%td.text-right= date(order.paid_on)
|
37
37
|
%td.text-right= date(order.shipped_on)
|
@@ -39,10 +39,10 @@
|
|
39
39
|
.btn-group
|
40
40
|
= paginate @orders
|
41
41
|
.btn-group.pull-right
|
42
|
-
= link_to
|
42
|
+
= link_to orders_path({:format => :csv}.merge( params)), {:class => "btn btn-primary"} do
|
43
43
|
%i.icon-download CSV
|
44
44
|
.col-md-3
|
45
|
-
= search_form_for @q, :
|
45
|
+
= search_form_for @q, :html => { :class => "form-horizontal" , :role => "form"}, :method => :get do |f|
|
46
46
|
.form-group
|
47
47
|
.input-group
|
48
48
|
= f.text_field :number_cont ,:class => "form-control" , :placeholder => t(:order_number)
|
@@ -93,4 +93,5 @@
|
|
93
93
|
.form-group.col-md-4
|
94
94
|
= f.text_field :canceled_on_lteq , :class => "form-control datepicker",:value => sort_date(:canceled_on_lteq)
|
95
95
|
= f.submit t(:filter), :id => :filter , :class => "btn btn-success"
|
96
|
-
= link_to t(:cancel),
|
96
|
+
= link_to t(:cancel), orders_path, :class => "btn btn-warning"
|
97
|
+
.order_index_end
|
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
.sipment_start
|
2
|
+
= bootstrap_form_for @order do |f|
|
2
3
|
.row
|
3
4
|
= f.alert_message t(:fix_errors) , error_summary: false
|
4
5
|
|
@@ -55,3 +56,4 @@
|
|
55
56
|
%th.text-right
|
56
57
|
%span#order_total= @order.total_price.round(2)
|
57
58
|
€
|
59
|
+
.sipment_end
|
@@ -1,8 +1,12 @@
|
|
1
|
-
.row
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
.row.order_show_start
|
2
|
+
.col-md-7
|
3
|
+
%h2
|
4
|
+
= t(:order) + " : " + @order.number.to_s
|
5
|
+
- unless @order.canceled_on.blank?
|
6
|
+
= t(:canceled_on) + " : " + date(@order.canceled_on)
|
7
|
+
.col-md-3
|
8
|
+
%br
|
9
|
+
%b= t(:total_price) + " : " + euros(@order.total_price)
|
6
10
|
|
7
11
|
.row
|
8
12
|
.col-md-7
|
@@ -23,7 +27,7 @@
|
|
23
27
|
= @order.street
|
24
28
|
= @order.city
|
25
29
|
%br
|
26
|
-
= link_to @order.email.to_s ,
|
30
|
+
= link_to @order.email.to_s , search_orders_path( :"q[email_cont]" => @order.email )
|
27
31
|
%br
|
28
32
|
= @order.phone.to_s
|
29
33
|
|
@@ -34,27 +38,9 @@
|
|
34
38
|
%br
|
35
39
|
%br
|
36
40
|
|
37
|
-
= link_to t(:edit) ,
|
38
|
-
|
39
|
-
= link_to t(:new) + ' ' + t(:order) , office.new_order_path( :address => @order.id) , :class => "btn btn-primary copy_order"
|
40
|
-
|
41
|
-
%tr
|
42
|
-
%td
|
43
|
-
%b
|
44
|
-
= t(:paid_on) + ":"
|
45
|
-
\
|
46
|
-
-if @order.paid_on
|
47
|
-
= date(@order.paid_on)
|
48
|
-
-else
|
49
|
-
= link_to t(:paid), office.pay_order_path(@order), :class => "btn btn-info pay_now"
|
41
|
+
= link_to t(:edit) , shipment_order_path(@order) , :class => "btn btn-info shipment_type"
|
50
42
|
|
51
|
-
|
52
|
-
%b
|
53
|
-
= t(:shipped_on) + " : "
|
54
|
-
-unless(@order.shipped_on.blank?)
|
55
|
-
=date(@order.shipped_on)
|
56
|
-
-else
|
57
|
-
= link_to t(:ship), office.ship_order_path(@order), :class => "btn btn-info ship_now"
|
43
|
+
= link_to t(:new) + ' ' + t(:order) , new_order_path( :address => @order.id) , :class => "btn btn-primary copy_order"
|
58
44
|
|
59
45
|
%tr
|
60
46
|
%td
|
@@ -63,22 +49,17 @@
|
|
63
49
|
\
|
64
50
|
|
65
51
|
|
66
|
-
.col-md-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
%
|
76
|
-
|
77
|
-
%p
|
78
|
-
%br
|
79
|
-
%br
|
80
|
-
%br
|
81
|
-
%b= t(:total_price) + " : " + euros(@order.total_price)
|
52
|
+
.col-md-5
|
53
|
+
%table.table.table-condensed.no-bg.no-border
|
54
|
+
%tbody
|
55
|
+
%tr
|
56
|
+
%td{ colspan: 2}
|
57
|
+
%b= t(:note)
|
58
|
+
= in_place @order , :note, :as => :textarea
|
59
|
+
%tr
|
60
|
+
=render "shipment"
|
61
|
+
%tr
|
62
|
+
= render "payment"
|
82
63
|
|
83
64
|
|
84
65
|
-content_for :basket do
|
@@ -114,20 +95,20 @@
|
|
114
95
|
%b= t(:order_actions)
|
115
96
|
%br
|
116
97
|
|
117
|
-
= link_to t(:back),
|
98
|
+
= link_to t(:back), orders_path, :class => "btn btn-warning"
|
118
99
|
\
|
119
|
-
= link_to t(:edit),
|
100
|
+
= link_to t(:edit), edit_basket_path(@order.basket), :class => "btn btn-info edit_basket" unless @order.basket.locked?
|
120
101
|
\
|
121
|
-
= link_to t(:cancel),
|
102
|
+
= link_to t(:cancel), cancel_order_path(@order), :data =>{:confirm => t(:cancel_confirmation )} , :class => "btn btn-danger cancel_order" if @order.basket.locked?
|
122
103
|
\
|
123
|
-
= link_to t(:destroy) ,
|
104
|
+
= link_to t(:destroy) , order_path(@order), :data => {:confirm => t(:are_you_sure )}, :method => :delete, :title => t(:destroy) , :class => "btn btn-danger" if @order.shipped_on.nil? and @order.paid_on.nil?
|
124
105
|
|
125
106
|
.col-md-2
|
126
107
|
.col-md-5
|
127
108
|
%b= t(:order_mail)
|
128
109
|
%br
|
129
110
|
- mail_actions.each do |action|
|
130
|
-
= link_to t("order_button.#{action}") ,
|
111
|
+
= link_to t("order_button.#{action}") , mail_order_path( @order , :act => action) , :class => "btn btn-info"
|
131
112
|
\
|
132
113
|
|
133
114
|
|
@@ -138,3 +119,4 @@
|
|
138
119
|
.order_show_back
|
139
120
|
%br
|
140
121
|
%br
|
122
|
+
.order_show_end
|
@@ -5,7 +5,7 @@
|
|
5
5
|
- @product.products.each do |product|
|
6
6
|
%td
|
7
7
|
= image_tag product.main_picture.url(:thumb)
|
8
|
-
=link_to product.name ,
|
8
|
+
=link_to product.name , product_path(product)
|
9
9
|
%tr.line-2
|
10
10
|
%td=t(:price)
|
11
11
|
- @product.products.each do |product|
|