From 31876c0c1a4b497f7f78a3f677d70d5e9f339f12 Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Mon, 23 Nov 2015 12:59:13 +0100 Subject: [PATCH 1/9] deleted duplicate places --- front-ui/app/stores/cartStore.js | 52 -------------------------------- 1 file changed, 52 deletions(-) diff --git a/front-ui/app/stores/cartStore.js b/front-ui/app/stores/cartStore.js index 1841627..7fc61a4 100644 --- a/front-ui/app/stores/cartStore.js +++ b/front-ui/app/stores/cartStore.js @@ -530,12 +530,6 @@ var supportedPlaces = [{ "code": "76233", "placeLabel": "Domaljevac" } - - , { - "code": "88305", - "placeLabel": "Domanovici" - } - , { "code": "76274", "placeLabel": "Donja Mahala" @@ -716,11 +710,6 @@ var supportedPlaces = [{ "placeLabel": "Glavicice" } - , { - "code": "72230", - "placeLabel": "Globarica" - } - , { "code": "71275", "placeLabel": "Gojevici" @@ -1356,11 +1345,6 @@ var supportedPlaces = [{ "placeLabel": "Mala Socanica" } - , { - "code": "75320", - "placeLabel": "Malesici" - } - , { "code": "76208", "placeLabel": "Maoca" @@ -1451,26 +1435,6 @@ var supportedPlaces = [{ "placeLabel": "Mostar" } - , { - "code": "88000", - "placeLabel": "Mostar, Jug" - } - - , { - "code": "88000", - "placeLabel": "Mostar, Jugozapad" - } - - , { - "code": "88000", - "placeLabel": "Mostar, Sjever" - } - - , { - "code": "88000", - "placeLabel": "Mostar, Zapad" - } - , { "code": "75212", "placeLabel": "Mramor" @@ -1720,12 +1684,6 @@ var supportedPlaces = [{ "code": "75303", "placeLabel": "Poljice" } - - , { - "code": "75320", - "placeLabel": "Popovi" - } - , { "code": "88240", "placeLabel": "Posusje" @@ -1741,11 +1699,6 @@ var supportedPlaces = [{ "placeLabel": "Potocani" } - , { - "code": "88208", - "placeLabel": "Potoci" - } - , { "code": "73290", "placeLabel": "Praca" @@ -2536,11 +2489,6 @@ var supportedPlaces = [{ "placeLabel": "Zaborak" } - , { - "code": "72220", - "placeLabel": "Zabrdje" - } - , { "code": "76333", "placeLabel": "Zabrdje" From b93660b2645d6011f989f5467042bbcf2cb93d15 Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Tue, 24 Nov 2015 10:29:46 +0100 Subject: [PATCH 2/9] added decoration support --- back-office/app/models/item.rb | 4 +++- .../db/migrate/20151124061357_add_decoration_to_item.rb | 5 +++++ front-api/db/schema.rb | 3 ++- front-api/models/multi_media_description.rb | 3 ++- 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 front-api/db/migrate/20151124061357_add_decoration_to_item.rb diff --git a/back-office/app/models/item.rb b/back-office/app/models/item.rb index 0bb9ad1..c991c44 100644 --- a/back-office/app/models/item.rb +++ b/back-office/app/models/item.rb @@ -3,7 +3,8 @@ class Item < ActiveRecord::Base CSV_COL = { :code => 0, :input_price => 1, - :list_price => 2 + :list_price => 2, + :decoration => 3 } belongs_to :unit @@ -117,6 +118,7 @@ class Item < ActiveRecord::Base else item.current_input_price = row[CSV_COL[:input_price]] item.list_price = row[CSV_COL[:list_price]] + item.decoration = row[CSV_COL[:decoration]] item.save! end end diff --git a/front-api/db/migrate/20151124061357_add_decoration_to_item.rb b/front-api/db/migrate/20151124061357_add_decoration_to_item.rb new file mode 100644 index 0000000..290d34e --- /dev/null +++ b/front-api/db/migrate/20151124061357_add_decoration_to_item.rb @@ -0,0 +1,5 @@ +class AddDecorationToItem < ActiveRecord::Migration + def change + add_column :items, :decoration, :string + end +end diff --git a/front-api/db/schema.rb b/front-api/db/schema.rb index 564e0b1..8c9037a 100644 --- a/front-api/db/schema.rb +++ b/front-api/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150726161256) do +ActiveRecord::Schema.define(version: 20151124061357) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -135,6 +135,7 @@ ActiveRecord::Schema.define(version: 20150726161256) do t.decimal "weight", precision: 5, scale: 3 t.integer "delivery_time_estimation_id" t.integer "brand_id" + t.string "decoration" end create_table "link_banners", force: :cascade do |t| diff --git a/front-api/models/multi_media_description.rb b/front-api/models/multi_media_description.rb index 2aa7aa3..4be8f03 100644 --- a/front-api/models/multi_media_description.rb +++ b/front-api/models/multi_media_description.rb @@ -8,7 +8,8 @@ class MultiMediaDescription < ActiveRecord::Base end def resized_url - url.gsub('/upload/v','/upload/c_lpad,h_281,w_375/v') + decoration_slug = item.decoration.present? ? "/#{item.decoration}" : "" + url.gsub('/upload/v',"/upload/c_lpad,h_281,w_375#{decoration_slug}/v") end end From 247d1c72c7444d23801461630c53d08531d27604 Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Thu, 26 Nov 2015 10:49:25 +0100 Subject: [PATCH 3/9] fixed limit for number of items in group --- front-ui/app/stores/itemStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front-ui/app/stores/itemStore.js b/front-ui/app/stores/itemStore.js index a4bb6cf..1ab2944 100644 --- a/front-ui/app/stores/itemStore.js +++ b/front-ui/app/stores/itemStore.js @@ -102,7 +102,7 @@ var fetchBestSellingItemsForGroup = function(groupId) { var items = _bestSellingForGroup; items.setClassificationType(4); items.setClassificationId(groupId); - items.setLimit(30); + items.setLimit(200); items.setOffset(0); items.fetch({ From 8d5067a5678dd5de38b77bc6e5ac26151f93a40c Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Thu, 26 Nov 2015 10:57:25 +0100 Subject: [PATCH 4/9] fixed limit for number of items in group --- front-api/controllers/item.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front-api/controllers/item.rb b/front-api/controllers/item.rb index e58f608..2ae6e89 100644 --- a/front-api/controllers/item.rb +++ b/front-api/controllers/item.rb @@ -12,7 +12,7 @@ def prepare_items_for_mass_display(items) end def offset_and_limit_invalid?(offset, limit) - offset < 0 or limit <= 0 or limit > 100 + offset < 0 or limit <= 0 or limit > 300 end From e993904d780474b3c4c4e044b0bd613a95f6d3c1 Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Sat, 28 Nov 2015 08:28:17 +0100 Subject: [PATCH 5/9] added newsletter signup form --- .../components/about/newsletterSweepstake.js | 39 +++++++++++++ front-ui/app/router.js | 2 + front-ui/build/newsletter.html | 56 +++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 front-ui/app/components/about/newsletterSweepstake.js create mode 100644 front-ui/build/newsletter.html diff --git a/front-ui/app/components/about/newsletterSweepstake.js b/front-ui/app/components/about/newsletterSweepstake.js new file mode 100644 index 0000000..8983df7 --- /dev/null +++ b/front-ui/app/components/about/newsletterSweepstake.js @@ -0,0 +1,39 @@ +var React = require('react'), + CartStore = require('../../stores/cartStore'), + AddToCart = require('../cart/addToCart'), + CartActions = require('../../actions/cartActions'), + LinkBanner = require('../linkBanner/linkBanner'), + NavigationActions = require('../../actions/navigationActions'), + Globals = require('../../globals') + Router = require("react-router"), + Link = Router.Link; + + +var NewsletterSweepstake = React.createClass({ + + render: function() { + + return ( + +
+

Prijavite se na naše novosti i saznajte sve o najnovijim sniženjima i ponudama na Ribici!

+ +

I ovaj put - najsretnije očekuju vrijedne Disney Frozen nagrade!

+ +

Pobjednike objavljujemo u našim email novostima u Ponedjeljak, 7.12.2015.

+ + +

+