office_clerk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +73 -0
- data/.rubocop.yml +6 -0
- data/.travis.yml +9 -0
- data/Gemfile +63 -0
- data/Gemfile.lock +367 -0
- data/Guardfile +28 -0
- data/README.md +44 -0
- data/Rakefile +6 -0
- data/app/assets/images/admin/baskets-2.jpg +0 -0
- data/app/assets/images/admin/baskets.jpg +0 -0
- data/app/assets/images/admin/categories-2.jpg +0 -0
- data/app/assets/images/admin/categories.jpg +0 -0
- data/app/assets/images/admin/clerks-2.jpg +0 -0
- data/app/assets/images/admin/clerks.jpg +0 -0
- data/app/assets/images/admin/orders-2.jpg +0 -0
- data/app/assets/images/admin/orders.jpg +0 -0
- data/app/assets/images/admin/products-2.jpg +0 -0
- data/app/assets/images/admin/products.jpg +0 -0
- data/app/assets/images/admin/purchases-2.jpg +0 -0
- data/app/assets/images/admin/purchases.jpg +0 -0
- data/app/assets/images/admin/suppliers-2.jpg +0 -0
- data/app/assets/images/admin/suppliers.jpg +0 -0
- data/app/assets/images/alpha.png +0 -0
- data/app/assets/images/down-icon.png +0 -0
- data/app/assets/images/header.gif +0 -0
- data/app/assets/images/hihih.jpg +0 -0
- data/app/assets/images/hue.png +0 -0
- data/app/assets/images/koe.jpg +0 -0
- data/app/assets/images/missing.png +0 -0
- data/app/assets/images/saturation.png +0 -0
- data/app/assets/images/shop/basket.jpg +0 -0
- data/app/assets/images/shop/farfalla-logo.jpg +0 -0
- data/app/assets/images/shop/header.gif +0 -0
- data/app/assets/images/shop/header.jpg +0 -0
- data/app/assets/images/shop/header.png +0 -0
- data/app/assets/images/shop/kansi.jpg +0 -0
- data/app/assets/images/shop/kansi.png +0 -0
- data/app/assets/images/shop/logo.png +0 -0
- data/app/assets/images/shop/menu-gourmet.jpg +0 -0
- data/app/assets/images/shop/menu-hius.jpg +0 -0
- data/app/assets/images/shop/menu-huonetuoksu.jpg +0 -0
- data/app/assets/images/shop/menu-info.jpg +0 -0
- data/app/assets/images/shop/menu-kasvo.jpg +0 -0
- data/app/assets/images/shop/menu-laukut.jpg +0 -0
- data/app/assets/images/shop/menu-luomu.jpg +0 -0
- data/app/assets/images/shop/menu-men.jpg +0 -0
- data/app/assets/images/shop/menu-oljy.jpg +0 -0
- data/app/assets/images/shop/menu-tuoksu1.jpg +0 -0
- data/app/assets/images/shop/menu-vaatteet.jpg +0 -0
- data/app/assets/images/shop/menu-valaisin.jpg +0 -0
- data/app/assets/images/shop/menu-vartalo.jpg +0 -0
- data/app/assets/images/shop/spacer.gif +0 -0
- data/app/assets/images/shop/tausta.jpg +0 -0
- data/app/assets/images/shop/tervetuloa.gif +0 -0
- data/app/assets/images/shop/valk.png +0 -0
- data/app/assets/images/shop/valk3.png +0 -0
- data/app/assets/images/shop/violetti-lev.jpg +0 -0
- data/app/assets/images/shop/violetti.jpg +0 -0
- data/app/assets/images/ui-anim_basic_16x16.gif +0 -0
- data/app/assets/images/up-icon.png +0 -0
- data/app/assets/javascripts/admin.js +29 -0
- data/app/assets/javascripts/shop.js +30 -0
- data/app/assets/stylesheets/admin.css.scss +129 -0
- data/app/assets/stylesheets/shop-receipt.css.scss +80 -0
- data/app/assets/stylesheets/shop.css.scss +403 -0
- data/app/controllers/admin_controller.rb +23 -0
- data/app/controllers/application_controller.rb +41 -0
- data/app/controllers/baskets_controller.rb +176 -0
- data/app/controllers/categories_controller.rb +69 -0
- data/app/controllers/clerks_controller.rb +64 -0
- data/app/controllers/orders_controller.rb +57 -0
- data/app/controllers/products_controller.rb +126 -0
- data/app/controllers/purchases_controller.rb +72 -0
- data/app/controllers/sessions_controller.rb +46 -0
- data/app/controllers/shop_controller.rb +90 -0
- data/app/controllers/suppliers_controller.rb +63 -0
- data/app/helpers/admin_helper.rb +28 -0
- data/app/helpers/application_helper.rb +25 -0
- data/app/helpers/baskets_helper.rb +4 -0
- data/app/helpers/categories_helper.rb +4 -0
- data/app/helpers/orders_helper.rb +4 -0
- data/app/helpers/products_helper.rb +4 -0
- data/app/helpers/purchases_helper.rb +4 -0
- data/app/helpers/shop_helper.rb +17 -0
- data/app/helpers/suppliers_helper.rb +4 -0
- data/app/mailers/.keep +0 -0
- data/app/models/basket.rb +114 -0
- data/app/models/category.rb +27 -0
- data/app/models/clerk.rb +46 -0
- data/app/models/item.rb +26 -0
- data/app/models/order.rb +72 -0
- data/app/models/product.rb +100 -0
- data/app/models/purchase.rb +26 -0
- data/app/models/supplier.rb +15 -0
- data/app/views/addresses/_form_fields.html.haml +4 -0
- data/app/views/addresses/show.html.haml +23 -0
- data/app/views/baskets/_small.html.haml +25 -0
- data/app/views/baskets/edit.html.haml +74 -0
- data/app/views/baskets/index.html.haml +55 -0
- data/app/views/baskets/show.html.haml +18 -0
- data/app/views/categories/_treeview.html.haml +8 -0
- data/app/views/categories/_triple.html.haml +12 -0
- data/app/views/categories/edit.html.haml +36 -0
- data/app/views/categories/index.html.haml +49 -0
- data/app/views/categories/show.html.haml +30 -0
- data/app/views/clerks/edit.html.haml +20 -0
- data/app/views/clerks/index.html.haml +37 -0
- data/app/views/clerks/show.html.haml +19 -0
- data/app/views/layouts/_admin_menu.html.haml +14 -0
- data/app/views/layouts/_google.haml +8 -0
- data/app/views/layouts/_messages.html.haml +5 -0
- data/app/views/layouts/admin.html.haml +42 -0
- data/app/views/layouts/shop.html.haml +96 -0
- data/app/views/orders/edit.html.haml +25 -0
- data/app/views/orders/index.html.haml +93 -0
- data/app/views/orders/show.html.haml +37 -0
- data/app/views/products/_line.html.haml +25 -0
- data/app/views/products/_name.html.haml +4 -0
- data/app/views/products/_online.html.haml +2 -0
- data/app/views/products/_triple.html.haml +12 -0
- data/app/views/products/edit.html.haml +42 -0
- data/app/views/products/index.html.haml +86 -0
- data/app/views/products/show.html.haml +94 -0
- data/app/views/purchases/edit.html.haml +9 -0
- data/app/views/purchases/index.html.haml +52 -0
- data/app/views/purchases/show.html.haml +32 -0
- data/app/views/sessions/new.html.haml +10 -0
- data/app/views/sessions/new_clerk.html.haml +22 -0
- data/app/views/shop/_groups.html.haml +8 -0
- data/app/views/shop/_menu.html.haml +5 -0
- data/app/views/shop/_sub.html.haml +0 -0
- data/app/views/shop/checkout.haml +142 -0
- data/app/views/shop/group.html.haml +9 -0
- data/app/views/shop/main_group.html.haml +9 -0
- data/app/views/shop/order.haml +104 -0
- data/app/views/shop/product.html.haml +67 -0
- data/app/views/shop/product_list.html.haml +50 -0
- data/app/views/shop/saved_search.html +6 -0
- data/app/views/shop/sub_group.html.haml +19 -0
- data/app/views/shop/tuotteista.html.haml +40 -0
- data/app/views/shop/welcome.html.haml +103 -0
- data/app/views/suppliers/edit.html.haml +10 -0
- data/app/views/suppliers/index.html.haml +40 -0
- data/app/views/suppliers/show.html.haml +27 -0
- data/bin/bundle +3 -0
- data/bin/rails +8 -0
- data/bin/rake +8 -0
- data/bin/rspec +7 -0
- data/bin/spring +18 -0
- data/config.ru +7 -0
- data/config/application.example.yml +13 -0
- data/config/application.rb +59 -0
- data/config/application.yml +13 -0
- data/config/boot.rb +7 -0
- data/config/database.yml +25 -0
- data/config/environment.rb +6 -0
- data/config/environments/development.rb +31 -0
- data/config/environments/production.rb +80 -0
- data/config/environments/test.rb +36 -0
- data/config/i18n-tasks.yml +11 -0
- data/config/initializers/attack.rb +32 -0
- data/config/initializers/backtrace_silencers.rb +7 -0
- data/config/initializers/filter_parameter_logging.rb +4 -0
- data/config/initializers/inflections.rb +16 -0
- data/config/initializers/migrate.rb +6 -0
- data/config/initializers/mime_types.rb +6 -0
- data/config/initializers/secret_token.rb +12 -0
- data/config/initializers/session_store.rb +3 -0
- data/config/initializers/simple_form.rb +149 -0
- data/config/initializers/simple_form_bootstrap.rb +48 -0
- data/config/initializers/wrap_parameters.rb +14 -0
- data/config/locales/config.yml +23 -0
- data/config/locales/en.yml +183 -0
- data/config/locales/fi.yml +211 -0
- data/config/routes.rb +108 -0
- data/db/migrate/20131224171442_clerks.rb +15 -0
- data/db/migrate/20131226110406_suppliers.rb +9 -0
- data/db/migrate/20131226143612_categories.rb +18 -0
- data/db/migrate/20131226143747_items.rb +14 -0
- data/db/migrate/20131226144134_orders.rb +21 -0
- data/db/migrate/20131226144316_baskets.rb +12 -0
- data/db/migrate/20131226151151_purchases.rb +11 -0
- data/db/migrate/20131226151332_products.rb +27 -0
- data/db/schema.rb +138 -0
- data/db/seeds.rb +4 -0
- data/lib/assets/.keep +0 -0
- data/lib/office_clerk.rb +20 -0
- data/lib/office_clerk/shipping_method.rb +35 -0
- data/lib/tasks/.keep +0 -0
- data/lib/tasks/import.rake +33 -0
- data/lib/templates/haml/scaffold/_form.html.haml +8 -0
- data/office_clerk.gemspec +46 -0
- data/public/404.html +58 -0
- data/public/422.html +58 -0
- data/public/500.html +57 -0
- data/public/favicon.ico +0 -0
- data/public/humans.txt +20 -0
- data/public/robots.txt +5 -0
- data/spec/controllers/baskets_controller_spec.rb +112 -0
- data/spec/controllers/categories_controller_spec.rb +133 -0
- data/spec/controllers/clerks_controller_spec.rb +70 -0
- data/spec/controllers/orders_controller_spec.rb +105 -0
- data/spec/controllers/products_controller_spec.rb +138 -0
- data/spec/controllers/purchases_controller_spec.rb +123 -0
- data/spec/controllers/sessions_controller_spec.rb +18 -0
- data/spec/controllers/suppliers_controller_spec.rb +137 -0
- data/spec/factories/addresses.rb +11 -0
- data/spec/factories/baskets.rb +15 -0
- data/spec/factories/categories.rb +8 -0
- data/spec/factories/clerks.rb +15 -0
- data/spec/factories/items.rb +19 -0
- data/spec/factories/orders.rb +9 -0
- data/spec/factories/products.rb +10 -0
- data/spec/factories/purchases.rb +10 -0
- data/spec/factories/suppliers.rb +7 -0
- data/spec/features/baskets/buttons_spec.rb +35 -0
- data/spec/features/baskets/edit_spec.rb +50 -0
- data/spec/features/baskets/index_spec.rb +12 -0
- data/spec/features/baskets/search_spec.rb +33 -0
- data/spec/features/baskets/show_spec.rb +21 -0
- data/spec/features/categories_spec.rb +21 -0
- data/spec/features/clerks_spec.rb +21 -0
- data/spec/features/orders_spec.rb +14 -0
- data/spec/features/products/index_spec.rb +30 -0
- data/spec/features/products/new_spec.rb +20 -0
- data/spec/features/purchases_spec.rb +14 -0
- data/spec/features/shops_spec.rb +18 -0
- data/spec/features/suppliers_spec.rb +18 -0
- data/spec/models/baskets/inventory_spec.rb +34 -0
- data/spec/models/baskets/items_spec.rb +37 -0
- data/spec/models/baskets/products_spec.rb +31 -0
- data/spec/models/category_spec.rb +18 -0
- data/spec/models/clerk/email_spec.rb +69 -0
- data/spec/models/clerk/password_spec.rb +83 -0
- data/spec/models/item_spec.rb +33 -0
- data/spec/models/locale_spec.rb +17 -0
- data/spec/models/order_spec.rb +19 -0
- data/spec/models/product_spec.rb +29 -0
- data/spec/models/purchase_spec.rb +8 -0
- data/spec/models/supplier_spec.rb +8 -0
- data/spec/routing/baskets_routing_spec.rb +35 -0
- data/spec/routing/categories_routing_spec.rb +35 -0
- data/spec/routing/orders_routing_spec.rb +35 -0
- data/spec/routing/products_routing_spec.rb +35 -0
- data/spec/routing/purchases_routing_spec.rb +35 -0
- data/spec/routing/suppliers_routing_spec.rb +35 -0
- data/spec/spec_helper.rb +74 -0
- data/spec/support/request_helper.rb +31 -0
- data/test/fixtures/baskets.yml +41993 -0
- data/test/fixtures/categories.yml +638 -0
- data/test/fixtures/clerks.yml +694 -0
- data/test/fixtures/items.yml +83651 -0
- data/test/fixtures/orders.yml +58918 -0
- data/test/fixtures/products.yml +110904 -0
- data/test/fixtures/purchases.yml +1755 -0
- data/test/fixtures/suppliers.yml +341 -0
- data/todo +8 -0
- metadata +607 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.row
|
|
2
|
+
%ol.breadcrumb
|
|
3
|
+
%li
|
|
4
|
+
%a{ :href => "/"}= t(:home)
|
|
5
|
+
- parents(@group).each do | group|
|
|
6
|
+
%li
|
|
7
|
+
= link_to group.name , shop_group_path(group.link)
|
|
8
|
+
|
|
9
|
+
.row
|
|
10
|
+
.col-md-3
|
|
11
|
+
- parents(@group).each do | group|
|
|
12
|
+
.group-wrapper.side
|
|
13
|
+
= link_to shop_group_path(group.link) do
|
|
14
|
+
= image_tag group.main_picture.url(:list)
|
|
15
|
+
%h5= group.name
|
|
16
|
+
|
|
17
|
+
.intro2
|
|
18
|
+
%p.description= markdown @group.description
|
|
19
|
+
|
|
20
|
+
.col-md-9
|
|
21
|
+
.row
|
|
22
|
+
- @groups.in_groups_of(3).each do |array|
|
|
23
|
+
.row
|
|
24
|
+
-array.each do |group|
|
|
25
|
+
.col-lg-4
|
|
26
|
+
-next unless group
|
|
27
|
+
.group-wrapper.sub
|
|
28
|
+
=link_to shop_group_path(group.link) do
|
|
29
|
+
= image_tag group.main_picture.url(:product)
|
|
30
|
+
%h3= group.name
|
|
31
|
+
.row.list
|
|
32
|
+
-@products.in_groups_of(4).each do |three|
|
|
33
|
+
.row.product-listing
|
|
34
|
+
-three.each do |product|
|
|
35
|
+
.col-md-3
|
|
36
|
+
-next unless product
|
|
37
|
+
.product-container
|
|
38
|
+
.square-image
|
|
39
|
+
=link_to shop_product_path(:link => product.link ) do
|
|
40
|
+
=image_tag product.main_picture.url
|
|
41
|
+
.product-fact
|
|
42
|
+
=link_to shop_product_path( :link => product.link ) , :class => :info do
|
|
43
|
+
%h4.product-name
|
|
44
|
+
= product.name
|
|
45
|
+
%p Tulisiko tähän pari riviä tuotteen esittelyä pienellä
|
|
46
|
+
.price.selling
|
|
47
|
+
= product.price
|
|
48
|
+
€
|
|
49
|
+
|
|
50
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
%ul.right
|
|
2
|
+
%li.search
|
|
3
|
+
%form{"accept-charset" => "UTF-8", action: "/products", method: "get"}
|
|
4
|
+
%div{style: "margin:0;padding:0;display:inline"}
|
|
5
|
+
%input{name: "utf8", type: "hidden", value: "✓"}/
|
|
6
|
+
%input#keywords{name: "keywords", placeholder: "Etsi", type: "search", size: "7"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.row
|
|
2
|
+
-if @group
|
|
3
|
+
.col-md-3
|
|
4
|
+
.intro2
|
|
5
|
+
= image_tag @group.main_picture.url
|
|
6
|
+
%p.description= markdown @group.description
|
|
7
|
+
|
|
8
|
+
.col-md-9
|
|
9
|
+
- @groups.in_groups_of(3).each do |array|
|
|
10
|
+
.row
|
|
11
|
+
-array.each do |group|
|
|
12
|
+
.col-lg-4
|
|
13
|
+
-next unless group
|
|
14
|
+
.subgroup-wrapper
|
|
15
|
+
=link_to shop_group_path(group.link) do
|
|
16
|
+
= image_tag group.main_picture.url(:product)
|
|
17
|
+
%h3= group.name
|
|
18
|
+
|
|
19
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#content.sixteen{"data-hook" => ""}
|
|
2
|
+
%div{align: "center", font: "", size: "1em"}
|
|
3
|
+
%a{href: "/pages/farfalla"}> FARFALLA LUOMUKOSMETIIKKA
|
|
4
|
+
|
|
5
|
+
= succeed "\u{a0}\u{a0}\u{a0}\u{a0}\u{a0}\u{a0}\u{a0}\u{a0}\u{a0}\u{a0}\u{a0}\u{a0}" do
|
|
6
|
+
%a{href: "/pages/huonetuoksut"} HUONETUOKSUT
|
|
7
|
+
%a{href: "/pages/gourmet"} GOURMET
|
|
8
|
+
%table{align: "center", border: "0", cellpadding: "3", cellspacing: "4"}
|
|
9
|
+
%tbody
|
|
10
|
+
%tr{background: "#ffffff"}
|
|
11
|
+
%td
|
|
12
|
+
%a{href: "/pages/farfalla"}
|
|
13
|
+
%img{src: "http://auringostaitaan.fi/assets/store/kauppa/farfalla-p-e2aa7c994acda55e70f1d5c462644240.jpg"}/
|
|
14
|
+
%td
|
|
15
|
+
%a{href: "/pages/huonetuoksut"}
|
|
16
|
+
%img{src: "http://auringostaitaan.fi/assets/store/kauppa/home_rose-p-d993d6cdd7b74fbb89dab2e984946853.jpg"}/
|
|
17
|
+
%td
|
|
18
|
+
%a{href: "/pages/gourmet"}
|
|
19
|
+
%img{src: "http://auringostaitaan.fi/assets/store/kauppa/feuer-p-3f2cbc32863dab529000578171ff9248.jpg"}/
|
|
20
|
+
%tr{background: "#ffffff"}
|
|
21
|
+
%td{valign: "top"}
|
|
22
|
+
%b Farfalla – laadukasta luomukosmetiikkaa.
|
|
23
|
+
Farfalla on luonut sarjan todella korkealaatuisia, sertifioituja luomutuotteita. 80 prosentissa tuotteista on yli 95% luomua, joka on nykystandardeissa todella paljon.
|
|
24
|
+
%p{style: "text-align:right"}
|
|
25
|
+
%a{href: "/pages/farfalla"}> lue lisää
|
|
26
|
+
|
|
27
|
+
%td{valign: "top"}
|
|
28
|
+
%b ipuro huonetuoksut – hyvinvointia arkeen sekä pientä ja edullista ylellisyyttä.
|
|
29
|
+
Puhtaita ja laadukkaita huonetuoksuja, joiden raaka–aineet on kerätty Grassen kukkaisalueelta.
|
|
30
|
+
%br/
|
|
31
|
+
%p{style: "text-align:right"}
|
|
32
|
+
%a{href: "/pages/huonetuoksut"}> lue lisää
|
|
33
|
+
|
|
34
|
+
%td{valign: "top"}
|
|
35
|
+
%b Gourmet-tuotteemme ovat herkullisia, huolella valittuja ja laadukkaita tuotteita.
|
|
36
|
+
Kaikki tuotteet on ennen valikoimaamme pääsyä tutkittu ja maistettu, ja vain todella korkealaatuiset ja maukkaat pääsevät myyntiin.
|
|
37
|
+
%br/
|
|
38
|
+
%p{style: "text-align:right"}
|
|
39
|
+
%a{href: "/pages/gourmet"}> lue lisää
|
|
40
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
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
|
|
23
|
+
.col-md-6
|
|
24
|
+
%img{:src => "/assets/shop/spacer.gif"}/
|
|
25
|
+
|
|
26
|
+
.col-md-6
|
|
27
|
+
%ul.nav.navbar-nav.navbar-right
|
|
28
|
+
%li.dropdown
|
|
29
|
+
%a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"}
|
|
30
|
+
Auringosta Itään, Kuusta Länteen
|
|
31
|
+
%b.caret
|
|
32
|
+
%ul.dropdown-menu
|
|
33
|
+
%li Liikkeemme
|
|
34
|
+
%li Toimitusehdot
|
|
35
|
+
|
|
36
|
+
%li#link-to-cart
|
|
37
|
+
%a{href: shop_checkout_path}
|
|
38
|
+
= t(:basket)
|
|
39
|
+
- if current_basket.items.count == 0
|
|
40
|
+
= t(:empty)
|
|
41
|
+
-else
|
|
42
|
+
= current_basket.items.count
|
|
43
|
+
= t(:items)
|
|
44
|
+
%li.dropdown
|
|
45
|
+
%a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"}
|
|
46
|
+
= current_clerk ? current_clerk.email : "Login"
|
|
47
|
+
%b.caret
|
|
48
|
+
%ul.dropdown-menu
|
|
49
|
+
- if current_clerk
|
|
50
|
+
%li= link_to t(:sign_out), sign_out_path
|
|
51
|
+
- else
|
|
52
|
+
%li= link_to t(:sign_up), sign_up_path
|
|
53
|
+
%li= link_to t(:sign_in), sign_in_path
|
|
54
|
+
|
|
55
|
+
.row
|
|
56
|
+
.banner
|
|
57
|
+
\
|
|
58
|
+
|
|
59
|
+
.welcome
|
|
60
|
+
.row
|
|
61
|
+
.col-md-5.text-right
|
|
62
|
+
%img{:src => "/assets/shop/tervetuloa.gif"}/
|
|
63
|
+
.col-md-2
|
|
64
|
+
.col-md-5
|
|
65
|
+
%button.btn.btn-primary.btn-mega{:type => "button"} Siirry verkkokauppaan
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
- @groups.in_groups_of(3).each do |array|
|
|
69
|
+
.row
|
|
70
|
+
-array.each do |group|
|
|
71
|
+
.col-md-4
|
|
72
|
+
-next unless group
|
|
73
|
+
.group-wrapper
|
|
74
|
+
=link_to shop_group_path(group.link) do
|
|
75
|
+
= image_tag group.main_picture.url(:product) , :class => "img-responsive"
|
|
76
|
+
%h3= group.name
|
|
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
|
+
:javascript
|
|
97
|
+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
98
|
+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
|
99
|
+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
100
|
+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
|
101
|
+
|
|
102
|
+
ga('create', 'UA-12603339-1', 'auringostaitaan.fi');
|
|
103
|
+
ga('send', 'pageview');
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
%h2
|
|
2
|
+
= t params["action"]
|
|
3
|
+
= t(:supplier)
|
|
4
|
+
= simple_form_for(@supplier) do |f|
|
|
5
|
+
.row
|
|
6
|
+
= f.input :supplier_name
|
|
7
|
+
= render "addresses/form_fields" ,:f => f
|
|
8
|
+
.form-actions
|
|
9
|
+
= f.submit :class => "btn btn-success"
|
|
10
|
+
= link_to t(:back), suppliers_path, :class => "btn btn-warning"
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.row
|
|
2
|
+
.col-md-9.suppliers
|
|
3
|
+
.row
|
|
4
|
+
.col-md-10
|
|
5
|
+
%h2= t(:suppliers)
|
|
6
|
+
= paginate @suppliers
|
|
7
|
+
.col-md-2
|
|
8
|
+
= link_to t(:new) + ' ' + t(:supplier) , new_supplier_path , :class => "btn btn-primary"
|
|
9
|
+
.col-md-3
|
|
10
|
+
= image_tag "admin/suppliers.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, :supplier_name
|
|
18
|
+
%th=t :count
|
|
19
|
+
%th=t :address
|
|
20
|
+
%th{:colspan => "2"}
|
|
21
|
+
%label.checkbox
|
|
22
|
+
= @supplier_scope.length.to_s + " " + t(:suppliers)
|
|
23
|
+
%tbody
|
|
24
|
+
- @suppliers.each do |supplier|
|
|
25
|
+
%tr{:class => "line-#{cycle("1","2")}"}
|
|
26
|
+
%td=supplier.supplier_name
|
|
27
|
+
%td=supplier.products.count
|
|
28
|
+
%td=supplier.whole_address
|
|
29
|
+
%td= link_to t(:show) , supplier_path(supplier), :title => t(:show)
|
|
30
|
+
%td= link_to t(:edit) , edit_supplier_path(supplier), :title => t(:edit)
|
|
31
|
+
= paginate @suppliers
|
|
32
|
+
.col-md-3
|
|
33
|
+
= search_form_for @q, :url => search_suppliers_path, :html => { :class => "well well-small" }, :method => :post do |f|
|
|
34
|
+
.form-group
|
|
35
|
+
= f.text_field :supplier_name_cont , :placeholder => t(:name)
|
|
36
|
+
.form-group
|
|
37
|
+
= f.text_field :address_cont , :placeholder => t(:address)
|
|
38
|
+
= f.submit t(:filter), :class => "btn btn-success"
|
|
39
|
+
= link_to t(:cancel), suppliers_path, :class => "btn btn-warning"
|
|
40
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
%h2
|
|
2
|
+
= t(:supplier) + " : " + @supplier.supplier_name
|
|
3
|
+
|
|
4
|
+
.col-md-6
|
|
5
|
+
%h3= t(:contact)
|
|
6
|
+
%p
|
|
7
|
+
%b
|
|
8
|
+
= t(:name) + " : " + @supplier.name.to_s
|
|
9
|
+
%p
|
|
10
|
+
%b
|
|
11
|
+
= t(:street) + " : " + @supplier.street.to_s
|
|
12
|
+
%p
|
|
13
|
+
%b
|
|
14
|
+
= t(:city) + " : " + @supplier.city.to_s
|
|
15
|
+
.col-md-6
|
|
16
|
+
%p
|
|
17
|
+
%b
|
|
18
|
+
= t(:phone) + " : " + @supplier.phone.to_s
|
|
19
|
+
%p
|
|
20
|
+
%b
|
|
21
|
+
= t(:country) + " : " + @supplier.country.to_s
|
|
22
|
+
|
|
23
|
+
= link_to t(:edit), edit_supplier_path(@supplier), :class => "btn btn-success"
|
|
24
|
+
= link_to t(:back), suppliers_path, :class => "btn btn-warning"
|
|
25
|
+
|
|
26
|
+
=render "products/triple" , :products => @supplier.products.no_items
|
|
27
|
+
|
data/bin/bundle
ADDED
data/bin/rails
ADDED
data/bin/rake
ADDED
data/bin/rspec
ADDED
data/bin/spring
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
# This file loads spring without using Bundler, in order to be fast
|
|
4
|
+
# It gets overwritten when you run the `spring binstub` command
|
|
5
|
+
|
|
6
|
+
unless defined?(Spring)
|
|
7
|
+
require "rubygems"
|
|
8
|
+
require "bundler"
|
|
9
|
+
|
|
10
|
+
if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
|
|
11
|
+
ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
|
|
12
|
+
ENV["GEM_HOME"] = ""
|
|
13
|
+
Gem.paths = ENV
|
|
14
|
+
|
|
15
|
+
gem "spring", match[1]
|
|
16
|
+
require "spring/binstub"
|
|
17
|
+
end
|
|
18
|
+
end
|
data/config.ru
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Add account credentials and API keys here.
|
|
2
|
+
# See http://railsapps.github.io/rails-environment-variables.html
|
|
3
|
+
# This file should be listed in .gitignore to keep your settings secret!
|
|
4
|
+
# Each entry sets a local environment variable and overrides ENV variables in the Unix shell.
|
|
5
|
+
# For example, setting:
|
|
6
|
+
# GMAIL_USERNAME: Your_Gmail_Clerkname
|
|
7
|
+
# makes 'Your_Gmail_Clerkname' available as ENV["GMAIL_USERNAME"]
|
|
8
|
+
|
|
9
|
+
# Add application configuration variables here, as shown below.
|
|
10
|
+
#
|
|
11
|
+
ADMIN_NAME: First Clerk
|
|
12
|
+
ADMIN_EMAIL: user@example.com
|
|
13
|
+
ADMIN_PASSWORD: changeme
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
|
2
|
+
|
|
3
|
+
# Pick the frameworks you want:
|
|
4
|
+
require "active_record/railtie"
|
|
5
|
+
require "action_controller/railtie"
|
|
6
|
+
require "action_mailer/railtie"
|
|
7
|
+
require "sprockets/railtie"
|
|
8
|
+
# require "rails/test_unit/railtie"
|
|
9
|
+
|
|
10
|
+
# Require the gems listed in Gemfile, including any gems
|
|
11
|
+
# you've limited to :test, :development, or :production.
|
|
12
|
+
Bundler.require(:default, Rails.env)
|
|
13
|
+
|
|
14
|
+
module OfficeClerk
|
|
15
|
+
class Application < Rails::Application
|
|
16
|
+
config.autoload_paths += %W(#{config.root}/lib)
|
|
17
|
+
|
|
18
|
+
# don't generate RSpec tests for views and helpers
|
|
19
|
+
config.generators do |g|
|
|
20
|
+
|
|
21
|
+
g.test_framework :rspec, fixture: true
|
|
22
|
+
g.fixture_replacement :factory_girl, dir: 'spec/factories'
|
|
23
|
+
|
|
24
|
+
g.helper_specs false
|
|
25
|
+
end
|
|
26
|
+
config.exceptions_app = self.routes
|
|
27
|
+
|
|
28
|
+
I18n.enforce_available_locales = false
|
|
29
|
+
I18n.default_locale = :fi
|
|
30
|
+
config.after_initialize do
|
|
31
|
+
end
|
|
32
|
+
config.middleware.use Rack::Attack
|
|
33
|
+
config.paperclip_defaults = { :styles => {:thumb => '48x48>', :list => '150x150>', :product => '600x600>' },
|
|
34
|
+
:default_style => :list,
|
|
35
|
+
:url => "/images/:id/:style/:basename.:extension",
|
|
36
|
+
:default_url => "/images/missing/:style.png" }
|
|
37
|
+
|
|
38
|
+
# FOG example see more in paperclip docs {:storage => :fog, :fog_credentials => {:provider => "Local", :local_root => "#{Rails.root}/public"}, :fog_directory => "", :fog_host => "localhost"}
|
|
39
|
+
|
|
40
|
+
# Settings in config/environments/* take precedence over those specified here.
|
|
41
|
+
# Application configuration should go into files in config/initializers
|
|
42
|
+
# -- all .rb files in that directory are automatically loaded.
|
|
43
|
+
|
|
44
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
|
45
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
|
46
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
|
47
|
+
|
|
48
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
|
49
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
|
50
|
+
# config.i18n.default_locale = :de
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Configuration is stored in locale/config.yml under the main key (ie "locale") config
|
|
54
|
+
# You can add to it, or redifine it, just like you do to locale data, by adding a locale file to your app
|
|
55
|
+
# with config locale and the keys you need
|
|
56
|
+
def self.config key
|
|
57
|
+
I18n.t(key , :locale => :config)
|
|
58
|
+
end
|
|
59
|
+
end
|