office_clerk 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (259) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +73 -0
  3. data/.rubocop.yml +6 -0
  4. data/.travis.yml +9 -0
  5. data/Gemfile +63 -0
  6. data/Gemfile.lock +367 -0
  7. data/Guardfile +28 -0
  8. data/README.md +44 -0
  9. data/Rakefile +6 -0
  10. data/app/assets/images/admin/baskets-2.jpg +0 -0
  11. data/app/assets/images/admin/baskets.jpg +0 -0
  12. data/app/assets/images/admin/categories-2.jpg +0 -0
  13. data/app/assets/images/admin/categories.jpg +0 -0
  14. data/app/assets/images/admin/clerks-2.jpg +0 -0
  15. data/app/assets/images/admin/clerks.jpg +0 -0
  16. data/app/assets/images/admin/orders-2.jpg +0 -0
  17. data/app/assets/images/admin/orders.jpg +0 -0
  18. data/app/assets/images/admin/products-2.jpg +0 -0
  19. data/app/assets/images/admin/products.jpg +0 -0
  20. data/app/assets/images/admin/purchases-2.jpg +0 -0
  21. data/app/assets/images/admin/purchases.jpg +0 -0
  22. data/app/assets/images/admin/suppliers-2.jpg +0 -0
  23. data/app/assets/images/admin/suppliers.jpg +0 -0
  24. data/app/assets/images/alpha.png +0 -0
  25. data/app/assets/images/down-icon.png +0 -0
  26. data/app/assets/images/header.gif +0 -0
  27. data/app/assets/images/hihih.jpg +0 -0
  28. data/app/assets/images/hue.png +0 -0
  29. data/app/assets/images/koe.jpg +0 -0
  30. data/app/assets/images/missing.png +0 -0
  31. data/app/assets/images/saturation.png +0 -0
  32. data/app/assets/images/shop/basket.jpg +0 -0
  33. data/app/assets/images/shop/farfalla-logo.jpg +0 -0
  34. data/app/assets/images/shop/header.gif +0 -0
  35. data/app/assets/images/shop/header.jpg +0 -0
  36. data/app/assets/images/shop/header.png +0 -0
  37. data/app/assets/images/shop/kansi.jpg +0 -0
  38. data/app/assets/images/shop/kansi.png +0 -0
  39. data/app/assets/images/shop/logo.png +0 -0
  40. data/app/assets/images/shop/menu-gourmet.jpg +0 -0
  41. data/app/assets/images/shop/menu-hius.jpg +0 -0
  42. data/app/assets/images/shop/menu-huonetuoksu.jpg +0 -0
  43. data/app/assets/images/shop/menu-info.jpg +0 -0
  44. data/app/assets/images/shop/menu-kasvo.jpg +0 -0
  45. data/app/assets/images/shop/menu-laukut.jpg +0 -0
  46. data/app/assets/images/shop/menu-luomu.jpg +0 -0
  47. data/app/assets/images/shop/menu-men.jpg +0 -0
  48. data/app/assets/images/shop/menu-oljy.jpg +0 -0
  49. data/app/assets/images/shop/menu-tuoksu1.jpg +0 -0
  50. data/app/assets/images/shop/menu-vaatteet.jpg +0 -0
  51. data/app/assets/images/shop/menu-valaisin.jpg +0 -0
  52. data/app/assets/images/shop/menu-vartalo.jpg +0 -0
  53. data/app/assets/images/shop/spacer.gif +0 -0
  54. data/app/assets/images/shop/tausta.jpg +0 -0
  55. data/app/assets/images/shop/tervetuloa.gif +0 -0
  56. data/app/assets/images/shop/valk.png +0 -0
  57. data/app/assets/images/shop/valk3.png +0 -0
  58. data/app/assets/images/shop/violetti-lev.jpg +0 -0
  59. data/app/assets/images/shop/violetti.jpg +0 -0
  60. data/app/assets/images/ui-anim_basic_16x16.gif +0 -0
  61. data/app/assets/images/up-icon.png +0 -0
  62. data/app/assets/javascripts/admin.js +29 -0
  63. data/app/assets/javascripts/shop.js +30 -0
  64. data/app/assets/stylesheets/admin.css.scss +129 -0
  65. data/app/assets/stylesheets/shop-receipt.css.scss +80 -0
  66. data/app/assets/stylesheets/shop.css.scss +403 -0
  67. data/app/controllers/admin_controller.rb +23 -0
  68. data/app/controllers/application_controller.rb +41 -0
  69. data/app/controllers/baskets_controller.rb +176 -0
  70. data/app/controllers/categories_controller.rb +69 -0
  71. data/app/controllers/clerks_controller.rb +64 -0
  72. data/app/controllers/orders_controller.rb +57 -0
  73. data/app/controllers/products_controller.rb +126 -0
  74. data/app/controllers/purchases_controller.rb +72 -0
  75. data/app/controllers/sessions_controller.rb +46 -0
  76. data/app/controllers/shop_controller.rb +90 -0
  77. data/app/controllers/suppliers_controller.rb +63 -0
  78. data/app/helpers/admin_helper.rb +28 -0
  79. data/app/helpers/application_helper.rb +25 -0
  80. data/app/helpers/baskets_helper.rb +4 -0
  81. data/app/helpers/categories_helper.rb +4 -0
  82. data/app/helpers/orders_helper.rb +4 -0
  83. data/app/helpers/products_helper.rb +4 -0
  84. data/app/helpers/purchases_helper.rb +4 -0
  85. data/app/helpers/shop_helper.rb +17 -0
  86. data/app/helpers/suppliers_helper.rb +4 -0
  87. data/app/mailers/.keep +0 -0
  88. data/app/models/basket.rb +114 -0
  89. data/app/models/category.rb +27 -0
  90. data/app/models/clerk.rb +46 -0
  91. data/app/models/item.rb +26 -0
  92. data/app/models/order.rb +72 -0
  93. data/app/models/product.rb +100 -0
  94. data/app/models/purchase.rb +26 -0
  95. data/app/models/supplier.rb +15 -0
  96. data/app/views/addresses/_form_fields.html.haml +4 -0
  97. data/app/views/addresses/show.html.haml +23 -0
  98. data/app/views/baskets/_small.html.haml +25 -0
  99. data/app/views/baskets/edit.html.haml +74 -0
  100. data/app/views/baskets/index.html.haml +55 -0
  101. data/app/views/baskets/show.html.haml +18 -0
  102. data/app/views/categories/_treeview.html.haml +8 -0
  103. data/app/views/categories/_triple.html.haml +12 -0
  104. data/app/views/categories/edit.html.haml +36 -0
  105. data/app/views/categories/index.html.haml +49 -0
  106. data/app/views/categories/show.html.haml +30 -0
  107. data/app/views/clerks/edit.html.haml +20 -0
  108. data/app/views/clerks/index.html.haml +37 -0
  109. data/app/views/clerks/show.html.haml +19 -0
  110. data/app/views/layouts/_admin_menu.html.haml +14 -0
  111. data/app/views/layouts/_google.haml +8 -0
  112. data/app/views/layouts/_messages.html.haml +5 -0
  113. data/app/views/layouts/admin.html.haml +42 -0
  114. data/app/views/layouts/shop.html.haml +96 -0
  115. data/app/views/orders/edit.html.haml +25 -0
  116. data/app/views/orders/index.html.haml +93 -0
  117. data/app/views/orders/show.html.haml +37 -0
  118. data/app/views/products/_line.html.haml +25 -0
  119. data/app/views/products/_name.html.haml +4 -0
  120. data/app/views/products/_online.html.haml +2 -0
  121. data/app/views/products/_triple.html.haml +12 -0
  122. data/app/views/products/edit.html.haml +42 -0
  123. data/app/views/products/index.html.haml +86 -0
  124. data/app/views/products/show.html.haml +94 -0
  125. data/app/views/purchases/edit.html.haml +9 -0
  126. data/app/views/purchases/index.html.haml +52 -0
  127. data/app/views/purchases/show.html.haml +32 -0
  128. data/app/views/sessions/new.html.haml +10 -0
  129. data/app/views/sessions/new_clerk.html.haml +22 -0
  130. data/app/views/shop/_groups.html.haml +8 -0
  131. data/app/views/shop/_menu.html.haml +5 -0
  132. data/app/views/shop/_sub.html.haml +0 -0
  133. data/app/views/shop/checkout.haml +142 -0
  134. data/app/views/shop/group.html.haml +9 -0
  135. data/app/views/shop/main_group.html.haml +9 -0
  136. data/app/views/shop/order.haml +104 -0
  137. data/app/views/shop/product.html.haml +67 -0
  138. data/app/views/shop/product_list.html.haml +50 -0
  139. data/app/views/shop/saved_search.html +6 -0
  140. data/app/views/shop/sub_group.html.haml +19 -0
  141. data/app/views/shop/tuotteista.html.haml +40 -0
  142. data/app/views/shop/welcome.html.haml +103 -0
  143. data/app/views/suppliers/edit.html.haml +10 -0
  144. data/app/views/suppliers/index.html.haml +40 -0
  145. data/app/views/suppliers/show.html.haml +27 -0
  146. data/bin/bundle +3 -0
  147. data/bin/rails +8 -0
  148. data/bin/rake +8 -0
  149. data/bin/rspec +7 -0
  150. data/bin/spring +18 -0
  151. data/config.ru +7 -0
  152. data/config/application.example.yml +13 -0
  153. data/config/application.rb +59 -0
  154. data/config/application.yml +13 -0
  155. data/config/boot.rb +7 -0
  156. data/config/database.yml +25 -0
  157. data/config/environment.rb +6 -0
  158. data/config/environments/development.rb +31 -0
  159. data/config/environments/production.rb +80 -0
  160. data/config/environments/test.rb +36 -0
  161. data/config/i18n-tasks.yml +11 -0
  162. data/config/initializers/attack.rb +32 -0
  163. data/config/initializers/backtrace_silencers.rb +7 -0
  164. data/config/initializers/filter_parameter_logging.rb +4 -0
  165. data/config/initializers/inflections.rb +16 -0
  166. data/config/initializers/migrate.rb +6 -0
  167. data/config/initializers/mime_types.rb +6 -0
  168. data/config/initializers/secret_token.rb +12 -0
  169. data/config/initializers/session_store.rb +3 -0
  170. data/config/initializers/simple_form.rb +149 -0
  171. data/config/initializers/simple_form_bootstrap.rb +48 -0
  172. data/config/initializers/wrap_parameters.rb +14 -0
  173. data/config/locales/config.yml +23 -0
  174. data/config/locales/en.yml +183 -0
  175. data/config/locales/fi.yml +211 -0
  176. data/config/routes.rb +108 -0
  177. data/db/migrate/20131224171442_clerks.rb +15 -0
  178. data/db/migrate/20131226110406_suppliers.rb +9 -0
  179. data/db/migrate/20131226143612_categories.rb +18 -0
  180. data/db/migrate/20131226143747_items.rb +14 -0
  181. data/db/migrate/20131226144134_orders.rb +21 -0
  182. data/db/migrate/20131226144316_baskets.rb +12 -0
  183. data/db/migrate/20131226151151_purchases.rb +11 -0
  184. data/db/migrate/20131226151332_products.rb +27 -0
  185. data/db/schema.rb +138 -0
  186. data/db/seeds.rb +4 -0
  187. data/lib/assets/.keep +0 -0
  188. data/lib/office_clerk.rb +20 -0
  189. data/lib/office_clerk/shipping_method.rb +35 -0
  190. data/lib/tasks/.keep +0 -0
  191. data/lib/tasks/import.rake +33 -0
  192. data/lib/templates/haml/scaffold/_form.html.haml +8 -0
  193. data/office_clerk.gemspec +46 -0
  194. data/public/404.html +58 -0
  195. data/public/422.html +58 -0
  196. data/public/500.html +57 -0
  197. data/public/favicon.ico +0 -0
  198. data/public/humans.txt +20 -0
  199. data/public/robots.txt +5 -0
  200. data/spec/controllers/baskets_controller_spec.rb +112 -0
  201. data/spec/controllers/categories_controller_spec.rb +133 -0
  202. data/spec/controllers/clerks_controller_spec.rb +70 -0
  203. data/spec/controllers/orders_controller_spec.rb +105 -0
  204. data/spec/controllers/products_controller_spec.rb +138 -0
  205. data/spec/controllers/purchases_controller_spec.rb +123 -0
  206. data/spec/controllers/sessions_controller_spec.rb +18 -0
  207. data/spec/controllers/suppliers_controller_spec.rb +137 -0
  208. data/spec/factories/addresses.rb +11 -0
  209. data/spec/factories/baskets.rb +15 -0
  210. data/spec/factories/categories.rb +8 -0
  211. data/spec/factories/clerks.rb +15 -0
  212. data/spec/factories/items.rb +19 -0
  213. data/spec/factories/orders.rb +9 -0
  214. data/spec/factories/products.rb +10 -0
  215. data/spec/factories/purchases.rb +10 -0
  216. data/spec/factories/suppliers.rb +7 -0
  217. data/spec/features/baskets/buttons_spec.rb +35 -0
  218. data/spec/features/baskets/edit_spec.rb +50 -0
  219. data/spec/features/baskets/index_spec.rb +12 -0
  220. data/spec/features/baskets/search_spec.rb +33 -0
  221. data/spec/features/baskets/show_spec.rb +21 -0
  222. data/spec/features/categories_spec.rb +21 -0
  223. data/spec/features/clerks_spec.rb +21 -0
  224. data/spec/features/orders_spec.rb +14 -0
  225. data/spec/features/products/index_spec.rb +30 -0
  226. data/spec/features/products/new_spec.rb +20 -0
  227. data/spec/features/purchases_spec.rb +14 -0
  228. data/spec/features/shops_spec.rb +18 -0
  229. data/spec/features/suppliers_spec.rb +18 -0
  230. data/spec/models/baskets/inventory_spec.rb +34 -0
  231. data/spec/models/baskets/items_spec.rb +37 -0
  232. data/spec/models/baskets/products_spec.rb +31 -0
  233. data/spec/models/category_spec.rb +18 -0
  234. data/spec/models/clerk/email_spec.rb +69 -0
  235. data/spec/models/clerk/password_spec.rb +83 -0
  236. data/spec/models/item_spec.rb +33 -0
  237. data/spec/models/locale_spec.rb +17 -0
  238. data/spec/models/order_spec.rb +19 -0
  239. data/spec/models/product_spec.rb +29 -0
  240. data/spec/models/purchase_spec.rb +8 -0
  241. data/spec/models/supplier_spec.rb +8 -0
  242. data/spec/routing/baskets_routing_spec.rb +35 -0
  243. data/spec/routing/categories_routing_spec.rb +35 -0
  244. data/spec/routing/orders_routing_spec.rb +35 -0
  245. data/spec/routing/products_routing_spec.rb +35 -0
  246. data/spec/routing/purchases_routing_spec.rb +35 -0
  247. data/spec/routing/suppliers_routing_spec.rb +35 -0
  248. data/spec/spec_helper.rb +74 -0
  249. data/spec/support/request_helper.rb +31 -0
  250. data/test/fixtures/baskets.yml +41993 -0
  251. data/test/fixtures/categories.yml +638 -0
  252. data/test/fixtures/clerks.yml +694 -0
  253. data/test/fixtures/items.yml +83651 -0
  254. data/test/fixtures/orders.yml +58918 -0
  255. data/test/fixtures/products.yml +110904 -0
  256. data/test/fixtures/purchases.yml +1755 -0
  257. data/test/fixtures/suppliers.yml +341 -0
  258. data/todo +8 -0
  259. metadata +607 -0
@@ -0,0 +1,55 @@
1
+ .row
2
+ .col-md-9.baskets
3
+ .row
4
+ .col-md-10
5
+ %h2= t(:baskets)
6
+ = paginate @baskets
7
+ .col-md-2
8
+ = link_to t(:new) + ' ' + t(:basket) , new_basket_path , :class => "btn btn-primary"
9
+ .col-md-3
10
+ = image_tag "admin/baskets.jpg" , :class => "img-responsive"
11
+ .row
12
+ .col-md-9
13
+ %div
14
+ %table.table.table-striped.table-bordered.table-condensed
15
+ %thead
16
+ %tr
17
+ %th= sort_link @q, :created_at
18
+ %th= sort_link @q, :total_price
19
+ %th= t(:items)
20
+ %th
21
+ %label.checkbox
22
+ = @basket_scope.length.to_s + " " + t("baskets")
23
+ %tbody
24
+ - @baskets.each do |basket|
25
+ %tr{:class => "line-#{cycle("1","2")}"}
26
+ %td
27
+ = date(basket.created_at.to_date)
28
+ %td
29
+ = euros basket.total_price
30
+ %td
31
+ - basket.items.each do |item| #should break at 5 and do the rest as tooltip
32
+ = item.quantity
33
+ x
34
+ = item.name
35
+ %br
36
+ %td= basket_edit_link(basket)
37
+ = paginate @baskets
38
+ .col-md-3
39
+ = search_form_for @q, :url => search_baskets_path, :html => { :class => "well well-large" }, :method => :post do |f|
40
+ .form-group.row
41
+ .col-md-3
42
+ = t(:type)
43
+ .col-md-9
44
+ = f.select :kori_type_eq, [["",""] , [t(:order) , "Order"] , [t(:purchase),"Purchase"]] , {}, :class => "form-control"
45
+ .form-group
46
+ = f.text_field :items_product_name_cont , :class => "form-control" , :placeholder => t(:name_contains)
47
+ .form-group.row
48
+ .col-md-3
49
+ = f.label(:total_price)
50
+ .col-md-4
51
+ = f.text_field :total_price_gt , :class => "form-control"
52
+ .col-md-4
53
+ = f.text_field :total_price_lt , :class => "form-control"
54
+ = f.submit t(:filter), :class => "btn btn-success"
55
+ = link_to t(:cancel), baskets_path, :class => "btn btn-warning"
@@ -0,0 +1,18 @@
1
+ %h2
2
+ = t(:basket) + " : "
3
+ = t(:order) + " " + @basket.kori.number.to_s if @basket.isa(:order)
4
+ .col-md-4
5
+ %p
6
+ %b
7
+ = t(:total_price) + " : " + euros(@basket.total_price)
8
+ .col-md-4
9
+ %p
10
+ %b
11
+ = t(:total_tax) + " : " + euros(@basket.total_tax)
12
+
13
+ = render "small" , :basket => @basket
14
+
15
+ .col-md-12{"data-no-turbolink" => true}
16
+ = link_to t(:back), orders_path, :class => "btn btn-warning"
17
+ = link_to t(:destroy) , basket_path(@basket), :data => { :confirm => t(:are_you_sure) }, :method => :delete, :title => t(:destroy) , :class => "btn btn-danger" unless @basket.kori_type
18
+ = link_to t(:print_order), invoice_order_path(@basket.kori) , :target => "_blank" , :class => "btn btn-primary print_order" if @basket.isa(:order)
@@ -0,0 +1,8 @@
1
+ %li
2
+ = link_to "#{group.name} (#{group.products.length})" , category_path(group), :title => t(:edit) , :class => group.online && "online"
3
+ - ar = group.categories
4
+ -if ar.length > 0
5
+ %ul.subcat
6
+ - ar.each do |g|
7
+ = render "treeview" , :group => g
8
+
@@ -0,0 +1,12 @@
1
+ %h3= groups.count.to_s + " " + t(:categories)
2
+ .row
3
+ %table.table.table-striped.table-bordered.table-condensed
4
+ %tbody
5
+ - groups.in_groups_of(3).each do |array|
6
+ %tr{:class => "line-#{cycle("1","2")}"}
7
+ -array.each do |group|
8
+ -next unless group
9
+ %td= image_tag group.main_picture.url(:thumb)
10
+ %td
11
+ = link_to category_path(group), :title => t(:show) do
12
+ = group.name
@@ -0,0 +1,36 @@
1
+ %h2
2
+ = t params["action"]
3
+ = t(:category)
4
+ %ol.breadcrumb
5
+ - parents(@category).each do | group|
6
+ %li
7
+ - if group.id
8
+ = link_to group.name , category_path(group)
9
+ - else
10
+ = t(:new)
11
+
12
+ = simple_form_for(@category, :html => { :multipart => true , :class => "form-horizontal" }) do |f|
13
+ .row.form-group
14
+ .col-md-6
15
+ = f.input :category , input_html: { class: 'form-control' } do
16
+ = f.select :category_id, Category.all.order(:name).map { |c| [c.name, c.id ] }, :include_blank => true , :prompt => t(:select)
17
+ = f.input :online
18
+ = f.input :name
19
+ = f.input :link
20
+ = f.input :position
21
+ .col-md-6
22
+ = f.input :description , :as => :text , :input_html => {:rows => 12}
23
+ .row
24
+ .col-md-6
25
+ = image_tag @category.main_picture.url
26
+ .row
27
+ .col-md-6
28
+ = f.file_field :main_picture
29
+ .col-md-6
30
+ = f.file_field :extra_picture
31
+ .row
32
+ .col-md-3
33
+ = f.submit :class => "btn btn-success"
34
+ .col-md-3
35
+ = link_to t(:back), categories_path, :class => "btn btn-warning"
36
+
@@ -0,0 +1,49 @@
1
+ .row
2
+ .col-md-9.categories
3
+ .row
4
+ .col-md-10
5
+ %h2= t(:categories)
6
+ = paginate @categories
7
+ .col-md-2
8
+ = link_to t(:new) + ' ' + t(:category) , new_category_path , :class => "btn btn-primary"
9
+ .col-md-3
10
+ = image_tag "admin/categories.jpg" , :class => "img-responsive"
11
+ .row
12
+ .col-md-9
13
+ %div
14
+ %table.table.table-striped.table-bordered.table-condensed
15
+ %thead
16
+ %tr
17
+ %th=t( "picture")
18
+ %th= sort_link @q, :name
19
+ %th= t(:count)
20
+ %th= t(:online)
21
+ %th=t( "activerecord.attributes.category.category")
22
+ %th{:colspan => "3"}
23
+ %label.checkbox
24
+ = @category_scope.length.to_s + " " +t(:categories)
25
+ %tbody
26
+ - @categories.each do |category|
27
+ %tr{:class => "line-#{cycle("1","2")}"}
28
+ %td= image_tag category.main_picture.url(:thumb)
29
+ %td=link_to category.name, category_path(category), :title => t(:show) , :class => category.online && "online"
30
+ %td=category.products.length.to_s
31
+ %td=category.online ? t(:online) : t(:not_online)
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
+ = paginate @categories
35
+ .col-md-3
36
+ = search_form_for @q, :url => search_categories_path, :html => { :class => "well well-small" }, :method => :post do |f|
37
+ .form-group
38
+ = f.text_field :name_cont , :placeholder => t(:name)
39
+ .form-group
40
+ = f.text_field :description_cont , :placeholder => t(:description)
41
+ .search_heading
42
+ = t(:online)
43
+ = f.check_box :online_eq
44
+ = f.submit t(:filter), :class => "btn btn-success"
45
+ = link_to t(:cancel), categories_path, :class => "btn btn-warning"
46
+ %hr
47
+ - @roots.each do |group|
48
+ %ul.cat
49
+ = render "treeview" , :group => group
@@ -0,0 +1,30 @@
1
+ .col-md-6
2
+ %h2
3
+ = t(:category)
4
+ = @category.name
5
+ = render "products/online" , :object => @category
6
+
7
+ %ol.breadcrumb
8
+ - parents(@category).each do | group|
9
+ %li
10
+ = link_to group.name , category_path(group)
11
+ %p
12
+ %b
13
+ = t(:description) + " : "
14
+ = markdown @category.description
15
+ .col-md-6
16
+ %p
17
+ %b
18
+ = t(:link) + " : "
19
+ = @category.link
20
+ %p
21
+ %b
22
+ = t(:picture) + " : "
23
+ = image_tag @category.main_picture.url
24
+
25
+ = link_to t(:edit), edit_category_path(@category), :class => "btn btn-primary"
26
+ = link_to t(:back), categories_path, :class => "btn btn-primary"
27
+
28
+ =render "products/triple" , :products => @category.products.no_items
29
+ =render "triple" , :groups => @category.categories
30
+
@@ -0,0 +1,20 @@
1
+ %h2
2
+ = t params["action"]
3
+ = t(:clerk)
4
+ -if @clerk.admin
5
+ =t(:admin)
6
+ = simple_form_for(@clerk, :html => { :class => "form-horizontal" }) do |f|
7
+ .row
8
+ = f.input :admin
9
+ = f.input :email
10
+ = f.input :name
11
+ = f.input :street
12
+ = f.input :city
13
+ = f.input :phone
14
+ -unless @clerk.new_record?
15
+ =f.label t(:may_be_blank)
16
+ = f.input :password
17
+ = f.input :password_confirmation
18
+ .form-actions
19
+ = f.submit :class => "btn btn-success"
20
+ = link_to t(:back), clerks_path, :class => "btn btn-warning"
@@ -0,0 +1,37 @@
1
+ .row
2
+ .col-md-9.clerks
3
+ .row
4
+ .col-md-10
5
+ %h2= t(:clerks)
6
+ = paginate @clerks
7
+ .col-md-2
8
+ = link_to t(:new) + ' ' + t(:clerk) , new_clerk_path , :class => "btn btn-primary"
9
+ .col-md-3
10
+ = image_tag "admin/clerks.jpg" , :class => "img-responsive"
11
+ .row
12
+ .col-md-9
13
+ %div
14
+ %table.table.table-striped.table-bordered.table-condensed
15
+ %thead
16
+ %tr
17
+ %th=sort_link @q, :email
18
+ %th=t(:address)
19
+ %th{:colspan => "2"}
20
+ %label.checkbox
21
+ = @clerk_scope.length.to_s + " " + t(:clerk)
22
+ %tbody
23
+ - @clerks.each do |clerk|
24
+ %tr{:class => "line-#{cycle("1","2")}"}
25
+ %td=clerk.email
26
+ %td=clerk.whole_address
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
+ = paginate @clerks
30
+ .col-md-3
31
+ = search_form_for @q, :url => search_clerks_path, :html => { :class => "well well-small" }, :method => :post do |f|
32
+ .form-group
33
+ = f.text_field :email_cont , :placeholder => t(:email)
34
+ .form-group
35
+ = f.text_field :address_cont , :placeholder => t(:address)
36
+ = f.submit t(:filter), :class => "btn btn-success"
37
+ = link_to t(:cancel), clerks_path, :class => "btn btn-warning"
@@ -0,0 +1,19 @@
1
+ %h2
2
+ = t(:clerk) + " : " + @clerk.email
3
+ -if @clerk.admin
4
+ (
5
+ =t(:admin)
6
+ )
7
+ %p
8
+ %b= t(:address)
9
+ %p
10
+ %b= t(:name) + " : " + @clerk.name.to_s
11
+ %p
12
+ %b= t(:street) + " : " + @clerk.street.to_s
13
+ %p
14
+ %b= t(:city) + " : " + @clerk.city.to_s
15
+ %p
16
+ %b= t(:phone) + " : " + @clerk.phone.to_s
17
+
18
+ = link_to t(:edit), edit_clerk_path(@clerk), :class => "btn btn-success"
19
+ = link_to t(:back), clerks_path, :class => "btn btn-warning"
@@ -0,0 +1,14 @@
1
+ %li{:class => params[:controller] == "products" && "active" }
2
+ = link_to t(:products), products_path
3
+ %li{:class => params[:controller] == "baskets" && "active" }
4
+ = link_to t(:baskets), baskets_path
5
+ %li{:class => params[:controller] == "orders" && "active" }
6
+ = link_to t(:orders), orders_path
7
+ %li{:class => params[:controller] == "purchases" && "active" }
8
+ = link_to t(:purchases), purchases_path
9
+ %li{:class => params[:controller] == "categories" && "active" }
10
+ = link_to t(:categories), categories_path
11
+ %li{:class => params[:controller] == "suppliers" && "active" }
12
+ = link_to t(:suppliers), suppliers_path
13
+ %li{:class => params[:controller] == "clerks" && "active" }
14
+ = link_to t(:clerks), clerks_path
@@ -0,0 +1,8 @@
1
+ :javascript
2
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
3
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
4
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
5
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
6
+
7
+ ga('create', 'UA-12603339-1', 'auringostaitaan.fi');
8
+ ga('send', 'pageview');
@@ -0,0 +1,5 @@
1
+ - flash.each do |name, msg|
2
+ - if msg.is_a?(String)
3
+ %div{:class => "alert alert-#{name == :notice ? "success" : "danger"}"}
4
+ %button.close{"aria-hidden" => "true", "data-dismiss" => "alert", :type => "btn btn-primary"} ×
5
+ = content_tag :div, msg, :id => "flash_#{name}"
@@ -0,0 +1,42 @@
1
+ !!!
2
+ %html{:lang => (I18n.locale || I18n.default_locale)}
3
+ %head
4
+ %meta{:charset => "utf-8"}/
5
+ %title Office Clerk
6
+ %meta{:content => "Office Clerk", :name => "description"}
7
+ = stylesheet_link_tag "admin"
8
+ = javascript_include_tag "admin"
9
+ = csrf_meta_tags
10
+ = yield :head
11
+ %body{:style => ""}
12
+ .container-fluid
13
+ %nav.navbar.navbar-default.navbar-fixed-top.navbar-inverse{role: "navigation"}
14
+ .navbar-header
15
+ %ul.nav.navbar-nav
16
+ %li
17
+ %a{href: "/"}= t(:shop)
18
+ = render :partial => "layouts/admin_menu"
19
+ %ul.nav.navbar-nav.navbar-right
20
+ %li= link_to current_clerk.email , edit_clerk_path(current_clerk)
21
+ %li= link_to t(:sign_out), sign_out_path
22
+
23
+ .row.content
24
+ - if not flash[:notice].blank? then
25
+ .col-md-12.alert
26
+ .alert-notice.row
27
+ .col-md-3
28
+ .alert-heading= t(:info) + " :"
29
+ .col-md-9
30
+ .alert-message!= flash[:notice]
31
+ - if not flash[:error].blank? then
32
+ .col-md-12.alert
33
+ .alert-error.row
34
+ .col-md-3
35
+ .alert-heading= t(:info) + " :"
36
+ .col-md-9
37
+ .alert-message!= flash[:notice]
38
+ .large-12.column
39
+ .row.space
40
+ =image_tag "shop/spacer.gif"
41
+
42
+ = yield
@@ -0,0 +1,96 @@
1
+ !!!
2
+ /[if lt IE 7 ] <html class="ie ie6" lang="en">
3
+ /[if IE 7 ] <html class="ie ie7" lang="en">
4
+ /[if IE 8 ] <html class="ie ie8" lang="en">
5
+ /[if IE 9 ] <html class="ie ie9" lang="en">
6
+ %html{lang: "fi"}
7
+ %head
8
+ %meta{charset: "utf-8"}/
9
+ %title Auringosta Itään, Kuusta Länteen
10
+ %meta{content: "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}
11
+ %meta{content: "width=device-width, initial-scale=1.0, maximum-scale=1", name: "viewport"}
12
+ %meta{content: "Sisustus, Lifestyle, luomukosmetiikka , luonnonkosmetiikka , farfalla", name: "keywords"}
13
+ = stylesheet_link_tag "shop"
14
+ = javascript_include_tag "shop"
15
+ = csrf_meta_tags
16
+ %body
17
+ .container-fluid
18
+ %header
19
+ .row
20
+ %nav.navbar.navbar-inverse.navbar-fixed-top{:role => "navigation"}
21
+ .navbar-inner
22
+ .row.taustalogo
23
+ .col-md-6
24
+ %a{href: "/"}
25
+ %img{:src => "/assets/shop/spacer.gif", :height => "80", :width => "650"}/
26
+
27
+ .col-md-6
28
+ %ul.nav.navbar-nav.navbar-right
29
+ %li.dropdown
30
+ %a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"}
31
+ Auringosta Itään, Kuusta Länteen
32
+ %b.caret
33
+ %ul.dropdown-menu
34
+ %li Liikkeemme
35
+ %li Toimitusehdot
36
+
37
+ %li#link-to-cart{"data-no-turbolink" => true}
38
+ %a{href: shop_checkout_path}
39
+ = t(:basket)
40
+ - if current_basket.items.count == 0
41
+ = t(:empty)
42
+ -else
43
+ = current_basket.items.count
44
+ = t(:items)
45
+ %li.dropdown
46
+ %a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"}
47
+ = current_clerk ? current_clerk.email : "Login"
48
+ %b.caret
49
+ %ul.dropdown-menu
50
+ - if current_clerk
51
+ %li= link_to t(:sign_out), sign_out_path
52
+ - else
53
+ %li= link_to t(:sign_up), sign_up_path
54
+ %li= link_to t(:sign_in), sign_in_path
55
+
56
+ .main
57
+ .row
58
+ - if not flash[:notice].blank? then
59
+ .col-md-12
60
+ .alert-notice.row
61
+ .col-md-9
62
+ .col-md-3.alert-shop
63
+ .alert-message!= flash[:notice]
64
+ - if not flash[:error].blank? then
65
+ .col-md-12.alert-shop
66
+ .alert-error.row.alert-shop
67
+ .col-md-1
68
+ .alert-heading= t(:info) + " :"
69
+ .col-md-11
70
+ .alert-message!= flash[:notice]
71
+
72
+
73
+ .row
74
+ .col-md-12
75
+ = yield
76
+
77
+
78
+ .row
79
+ .col-md-6
80
+ .footer
81
+ Suunnittelu ja toteutus Ruby Design    
82
+ %br/
83
+ Powered by
84
+ %a{href: "http://rubyclerks.com/"} RubyClerks
85
+ .col-md-6
86
+ .footer.right
87
+ %b> AURINGOSTA ITÄÄN, KUUSTA LÄNTEEN
88
+ %br/
89
+ Fredrikinkatu 19 (Viiskulma), Helsinki
90
+ %br/
91
+ puh +358- (0)9- 621 7001 | Y-tunnus 2380478-1
92
+ %br/
93
+ %br/
94
+
95
+
96
+ = render "layouts/google" if Rails.env.production?