main css conflict

This commit is contained in:
Senad Uka
2015-11-29 10:02:57 +01:00
13 changed files with 153 additions and 66 deletions

View File

@@ -3,7 +3,8 @@ class Item < ActiveRecord::Base
CSV_COL = { CSV_COL = {
:code => 0, :code => 0,
:input_price => 1, :input_price => 1,
:list_price => 2 :list_price => 2,
:decoration => 3
} }
belongs_to :unit belongs_to :unit
@@ -117,6 +118,7 @@ class Item < ActiveRecord::Base
else else
item.current_input_price = row[CSV_COL[:input_price]] item.current_input_price = row[CSV_COL[:input_price]]
item.list_price = row[CSV_COL[:list_price]] item.list_price = row[CSV_COL[:list_price]]
item.decoration = row[CSV_COL[:decoration]]
item.save! item.save!
end end
end end

View File

@@ -12,7 +12,7 @@ def prepare_items_for_mass_display(items)
end end
def offset_and_limit_invalid?(offset, limit) def offset_and_limit_invalid?(offset, limit)
offset < 0 or limit <= 0 or limit > 100 offset < 0 or limit <= 0 or limit > 300
end end

View File

@@ -0,0 +1,5 @@
class AddDecorationToItem < ActiveRecord::Migration
def change
add_column :items, :decoration, :string
end
end

View File

@@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # 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 # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
@@ -135,6 +135,7 @@ ActiveRecord::Schema.define(version: 20150726161256) do
t.decimal "weight", precision: 5, scale: 3 t.decimal "weight", precision: 5, scale: 3
t.integer "delivery_time_estimation_id" t.integer "delivery_time_estimation_id"
t.integer "brand_id" t.integer "brand_id"
t.string "decoration"
end end
create_table "link_banners", force: :cascade do |t| create_table "link_banners", force: :cascade do |t|

View File

@@ -8,7 +8,8 @@ class MultiMediaDescription < ActiveRecord::Base
end end
def resized_url 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
end end

View File

@@ -1,21 +1,23 @@
var AppDispatcher = require('../dispatcher/appDispatcher'); var AppDispatcher = require('../dispatcher/appDispatcher');
var NavigationConstants = require('../constants/navigationConstants'); var NavigationConstants = require('../constants/navigationConstants');
var globals = require('../globals');
// Define action methods // Define action methods
var NavigationActions = { var NavigationActions = {
// select item // select item
goToItemDetails: function(item) { goToItemDetails: function(item) {
AppDispatcher.handleAction({ AppDispatcher.handleAction({
actionType: NavigationConstants.CHANGE_URL, actionType: NavigationConstants.CHANGE_URL,
url: '/artikal/' + item.get('id') +'/' + item.get('name') url: '/artikal/' + item.get('id') +'/' + globals.Slugify(item.get('name'))
}); });
}, },
goToSection: function(section) { goToSection: function(section) {
AppDispatcher.handleAction({ AppDispatcher.handleAction({
actionType: NavigationConstants.CHANGE_URL, actionType: NavigationConstants.CHANGE_URL,
url: '/sekcija/'+ section.get('id') + '/' + section.get('name') url: '/sekcija/'+ section.get('id') + '/' + globals.Slugify(section.get('name'))
}); });
}, },
_getQueryStringPart: function(query, offset, limit) { _getQueryStringPart: function(query, offset, limit) {
@@ -46,7 +48,7 @@ var NavigationActions = {
}, },
goToCategory: function(category,section, query, offset, limit) { goToCategory: function(category,section, query, offset, limit) {
var url ='/sekcija/' + section.get('name') +'/kategorija/'+ category.get('id') + '/' + category.get('name'); var url ='/sekcija/' + section.get('name') +'/kategorija/'+ category.get('id') + '/' + globals.Slugify(category.get('name'));
var q = this._getQueryStringPart(query, offset, limit); var q = this._getQueryStringPart(query, offset, limit);
AppDispatcher.handleAction({ AppDispatcher.handleAction({
actionType: NavigationConstants.CHANGE_URL, actionType: NavigationConstants.CHANGE_URL,
@@ -56,7 +58,7 @@ var NavigationActions = {
goToSubCategory: function(subCategory, offset, limit, query) { goToSubCategory: function(subCategory, offset, limit, query) {
var q = this._getQueryStringPart(query, offset, limit); var q = this._getQueryStringPart(query, offset, limit);
var url = '/podkategorija/' + subCategory.get('id') + '/' + subCategory.get('name'); var url = '/podkategorija/' + subCategory.get('id') + '/' + globals.Slugify(subCategory.get('name'));
AppDispatcher.handleAction({ AppDispatcher.handleAction({
actionType: NavigationConstants.CHANGE_URL, actionType: NavigationConstants.CHANGE_URL,
url: (url + q) url: (url + q)

View File

@@ -0,0 +1,40 @@
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 (
<div className="center">
<h1 className="normal-message">Novosti i sniženja</h1>
<p className="normal-message">Prijavite se na naše novosti i saznajte sve o najnovijim sniženjima i ponudama na Ribici!</p>
<p className="normal-message"><strong>I ovaj put - najsretnije očekuju vrijedne Disney Frozen nagrade!</strong> <br /></p>
<p className="normal-message">Pobjednike objavljujemo u našim email novostima u Ponedjeljak, 7.12.2015. </p>
<p style={{"textAlign": "center"}}>
<iframe style={{"width": "100%", "height": "500px", "border": "0px", "overflow": "hidden"}} src="newsletter.html" />
</p>
</div>
);
}
});
module.exports = NewsletterSweepstake;

View File

@@ -487,3 +487,21 @@ line-height: 18.2px;
width: 708px; width: 708px;
word-wrap: break-word; word-wrap: break-word;
} }
.message {
font-size: 130%;
text-align: left;
margin-left: 20px;
margin-right: 20px;
}
.normal-message {
text-align: left;
margin-left: 20px;
margin-right: 20px;
}

View File

@@ -4,12 +4,24 @@ module.exports = {
ItemGroupIdOfStartPage: "1", ItemGroupIdOfStartPage: "1",
ItemGroupIdOfEmptyCartPage: "1", ItemGroupIdOfEmptyCartPage: "1",
FormatCurrency: function(amount_s) { FormatCurrency: function(amount_s) {
var amount = parseFloat(amount_s); var amount = parseFloat(amount_s);
return ( amount.toFixed(2) + " KM" ) return (amount.toFixed(2) + " KM")
}, },
FormatPercentage: function(amount_s) { FormatPercentage: function(amount_s) {
var amount = parseFloat(amount_s); var amount = parseFloat(amount_s);
return ( amount.toFixed(2) + "%" ) return (amount.toFixed(2) + "%")
}, },
MaxNumberOfItemsToBeAdded: 1000 MaxNumberOfItemsToBeAdded: 1000,
Slugify: function(text) {
return text.toString().toLowerCase()
.replace(/š/g,'s')
.replace(/[čć]/g,'c')
.replace(/[ž]/g,'z')
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
}; };

View File

@@ -18,6 +18,7 @@ var BySubCategory = require('./components/browsing/bySubCategory');
var BySection = require('./components/browsing/bySection'); var BySection = require('./components/browsing/bySection');
var ThankYouPage = require('./components/thankyou/thankYouPage'); var ThankYouPage = require('./components/thankyou/thankYouPage');
var AboutUsPage = require('./components/about/aboutUsPage'); var AboutUsPage = require('./components/about/aboutUsPage');
var NewsletterSweepstake = require('./components/about/newsletterSweepstake');
// var Register = require('./components/account/register'); // var Register = require('./components/account/register');
// var Login = require('./components/account/login'); // var Login = require('./components/account/login');
var SearchResultsPage = require('./components/search/searchResultsPage'); var SearchResultsPage = require('./components/search/searchResultsPage');
@@ -36,6 +37,7 @@ var routes = (
<Route name='byCat' path="sekcija/:sekcijaName/kategorija/:id/*" handler={ByCategory} /> <Route name='byCat' path="sekcija/:sekcijaName/kategorija/:id/*" handler={ByCategory} />
<Route name='hvala' path="/hvala" handler={ThankYouPage} /> <Route name='hvala' path="/hvala" handler={ThankYouPage} />
<Route name='onama' path="/o-nama" handler={AboutUsPage} /> <Route name='onama' path="/o-nama" handler={AboutUsPage} />
<Route name='newsletter' path="/email-novosti" handler={NewsletterSweepstake} />
<Route name='pretraga' path="/pretraga" handler={SearchResultsPage} /> <Route name='pretraga' path="/pretraga" handler={SearchResultsPage} />
<DefaultRoute handler={StartPage}/> <DefaultRoute handler={StartPage}/>
</Route> </Route>

View File

@@ -530,12 +530,6 @@ var supportedPlaces = [{
"code": "76233", "code": "76233",
"placeLabel": "Domaljevac" "placeLabel": "Domaljevac"
} }
, {
"code": "88305",
"placeLabel": "Domanovici"
}
, { , {
"code": "76274", "code": "76274",
"placeLabel": "Donja Mahala" "placeLabel": "Donja Mahala"
@@ -716,11 +710,6 @@ var supportedPlaces = [{
"placeLabel": "Glavicice" "placeLabel": "Glavicice"
} }
, {
"code": "72230",
"placeLabel": "Globarica"
}
, { , {
"code": "71275", "code": "71275",
"placeLabel": "Gojevici" "placeLabel": "Gojevici"
@@ -1356,11 +1345,6 @@ var supportedPlaces = [{
"placeLabel": "Mala Socanica" "placeLabel": "Mala Socanica"
} }
, {
"code": "75320",
"placeLabel": "Malesici"
}
, { , {
"code": "76208", "code": "76208",
"placeLabel": "Maoca" "placeLabel": "Maoca"
@@ -1451,26 +1435,6 @@ var supportedPlaces = [{
"placeLabel": "Mostar" "placeLabel": "Mostar"
} }
, {
"code": "88000",
"placeLabel": "Mostar, Jug"
}
, {
"code": "88000",
"placeLabel": "Mostar, Jugozapad"
}
, {
"code": "88000",
"placeLabel": "Mostar, Sjever"
}
, {
"code": "88000",
"placeLabel": "Mostar, Zapad"
}
, { , {
"code": "75212", "code": "75212",
"placeLabel": "Mramor" "placeLabel": "Mramor"
@@ -1720,12 +1684,6 @@ var supportedPlaces = [{
"code": "75303", "code": "75303",
"placeLabel": "Poljice" "placeLabel": "Poljice"
} }
, {
"code": "75320",
"placeLabel": "Popovi"
}
, { , {
"code": "88240", "code": "88240",
"placeLabel": "Posusje" "placeLabel": "Posusje"
@@ -1741,11 +1699,6 @@ var supportedPlaces = [{
"placeLabel": "Potocani" "placeLabel": "Potocani"
} }
, {
"code": "88208",
"placeLabel": "Potoci"
}
, { , {
"code": "73290", "code": "73290",
"placeLabel": "Praca" "placeLabel": "Praca"
@@ -2536,11 +2489,6 @@ var supportedPlaces = [{
"placeLabel": "Zaborak" "placeLabel": "Zaborak"
} }
, {
"code": "72220",
"placeLabel": "Zabrdje"
}
, { , {
"code": "76333", "code": "76333",
"placeLabel": "Zabrdje" "placeLabel": "Zabrdje"

View File

@@ -102,7 +102,7 @@ var fetchBestSellingItemsForGroup = function(groupId) {
var items = _bestSellingForGroup; var items = _bestSellingForGroup;
items.setClassificationType(4); items.setClassificationType(4);
items.setClassificationId(groupId); items.setClassificationId(groupId);
items.setLimit(30); items.setLimit(200);
items.setOffset(0); items.setOffset(0);
items.fetch({ items.fetch({

View File

@@ -0,0 +1,56 @@
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<script>window.html5 || document.write('<script src="js/vendor/html5shiv.js"><\/script>')</script>
<![endif]-->
</head>
<body>
<!-- Begin MailChimp Signup Form -->
<link href="//cdn-images.mailchimp.com/embedcode/classic-081711.css" rel="stylesheet" type="text/css">
<style type="text/css">
#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
/* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
</style>
<div id="mc_embed_signup">
<form action="//ribica.us11.list-manage.com/subscribe/post?u=e7326b7fcff6f5faa9c098b0a&amp;id=d252ea09a5" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<h2>Ribica novosti i sniženja</h2>
<div class="indicates-required"><span class="asterisk">*</span> obavezno</div>
<div class="mc-field-group">
<label for="mce-EMAIL">Email Adresa <span class="asterisk">*</span>
</label>
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
</div>
<div class="mc-field-group">
<label for="mce-FNAME">Ime </label>
<input type="text" value="" name="FNAME" class="" id="mce-FNAME">
</div>
<div class="mc-field-group">
<label for="mce-LNAME">Prezime </label>
<input type="text" value="" name="LNAME" class="" id="mce-LNAME">
</div>
<div class="mc-field-group">
<label for="mce-GRAD">Grad </label>
<input type="text" value="" name="GRAD" class="" id="mce-GRAD">
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div> <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_e7326b7fcff6f5faa9c098b0a_d252ea09a5" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Prijavi se" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
</div>
</form>
</div>
<script type='text/javascript' src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script><script type='text/javascript'>(function($) {window.fnames = new Array(); window.ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]='LNAME';ftypes[2]='text';fnames[3]='GRAD';ftypes[3]='text'; }(jQuery));var $mcj = jQuery.noConflict(true);</script>
<!--End mc_embed_signup-->
</body>
</html>