Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d97516e24e | ||
|
|
9820f6a363 | ||
|
|
6b4bc6aa20 | ||
|
|
98e64830e1 | ||
|
|
5c899ca6ed | ||
|
|
138c5de68e | ||
|
|
edb1325c07 | ||
|
|
6b97c2342c | ||
|
|
70ee58e989 | ||
|
|
7e62881d16 | ||
|
|
d111406f03 | ||
|
|
1368a71f26 | ||
|
|
e0fda3e9ee | ||
|
|
30e48cd1b6 | ||
|
|
0e2e5b8fb9 | ||
|
|
418eb028ae | ||
|
|
1c0c4fa78a | ||
|
|
53ef339f5f |
34
back-office/app/views/items/import.html.erb
Normal file
34
back-office/app/views/items/import.html.erb
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<%= form_tag('./import') do %>
|
||||||
|
<p><label for="supplier_id">Supplier: </label>
|
||||||
|
<%= select_tag "supplier_id", options_from_collection_for_select(@suppliers, "id", "name", @selected_supplier.try(:id)) %></p>
|
||||||
|
|
||||||
|
<p><label for="codes">
|
||||||
|
Codes to check:
|
||||||
|
</label><br />
|
||||||
|
<%= text_area_tag "codes", @codes_to_check, rows: 20, columns: 50 %></p>
|
||||||
|
|
||||||
|
<p><%= submit_tag "Check" %></p>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h2> In database: <%= @items.length %>, in file: <%= @codes_to_check_array.length %> </h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h2>Not in database (<%= @missing_from_database.length %>): </h2>
|
||||||
|
<br />
|
||||||
|
<% @missing_from_database.each do |code| %>
|
||||||
|
<%= code %><br />
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h2>Not in file (<%= @missing_from_codes.length %>): </h2>
|
||||||
|
<br />
|
||||||
|
<% @missing_from_codes.each do |code| %>
|
||||||
|
<%= code %><br />
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
create_the_cart = -> () {
|
create_the_cart = lambda do
|
||||||
# -1 is a placeholder for user id when we implement users
|
# -1 is a placeholder for user id when we implement users
|
||||||
# auid will still be used in case user is not logged in
|
# auid will still be used in case user is not logged in
|
||||||
Cart.find_or_create(anonymous_id, logged_in_user_id).to_json
|
Cart.find_or_create(anonymous_id, logged_in_user_id).to_json
|
||||||
}
|
end
|
||||||
post '/cart', &create_the_cart
|
post '/cart', &create_the_cart
|
||||||
put '/cart', &create_the_cart
|
put '/cart', &create_the_cart
|
||||||
|
|
||||||
@@ -16,22 +16,19 @@ get '/cart/item' do
|
|||||||
Cart.just_find(anonymous_id, logged_in_user_id).item_in_carts.to_json
|
Cart.just_find(anonymous_id, logged_in_user_id).item_in_carts.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
update_cart_item = ->() {
|
update_cart_item = lambda do
|
||||||
cart_id = Cart.just_find(anonymous_id, logged_in_user_id).id
|
cart_id = Cart.just_find(anonymous_id, logged_in_user_id).id
|
||||||
item_id = @json_params["item_id"].to_i
|
item_id = @json_params['item_id'].to_i
|
||||||
count = @json_params["count"].to_i
|
count = @json_params['count'].to_i
|
||||||
ItemInCart.update_state(cart_id, item_id, count).to_json
|
ItemInCart.update_state(cart_id, item_id, count).to_json
|
||||||
}
|
end
|
||||||
put '/cart/item', &update_cart_item
|
put '/cart/item', &update_cart_item
|
||||||
post '/cart/item', &update_cart_item
|
post '/cart/item', &update_cart_item
|
||||||
|
|
||||||
|
|
||||||
# gets list of items in cart without count
|
# gets list of items in cart without count
|
||||||
get '/cart/item/display' do
|
get '/cart/item/display' do
|
||||||
cart = Cart.just_find(anonymous_id, logged_in_user_id)
|
cart = Cart.just_find(anonymous_id, logged_in_user_id)
|
||||||
item_ids = cart.item_in_carts.map do |x|
|
item_ids = cart.item_in_carts.map(&:item_id)
|
||||||
x.item_id
|
|
||||||
end
|
|
||||||
items = []
|
items = []
|
||||||
items = Item.find(item_ids) if cart.item_in_carts.length > 0
|
items = Item.find(item_ids) if cart.item_in_carts.length > 0
|
||||||
prepare_items_for_mass_display(items)
|
prepare_items_for_mass_display(items)
|
||||||
@@ -39,9 +36,23 @@ end
|
|||||||
|
|
||||||
get '/cart/delivery_destination' do
|
get '/cart/delivery_destination' do
|
||||||
cart = Cart.just_find(anonymous_id, logged_in_user_id)
|
cart = Cart.just_find(anonymous_id, logged_in_user_id)
|
||||||
cart.delivery_destination.to_json(:except => [:created_at, :email_verification_code, :phone_verification_code])
|
cart.delivery_destination.to_json(except: [:created_at, :email_verification_code, :phone_verification_code])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
update_delivery_destination = lambda do
|
||||||
|
cart = Cart.just_find(anonymous_id, logged_in_user_id)
|
||||||
|
allowed_keys = %w(name address place postal_code phone email note payment_method gift
|
||||||
|
recipient_name recipient_address recipient_place recipient_postal_code recipient_phone recipient_email)
|
||||||
|
|
||||||
|
params = @json_params.reject { |key, _| !allowed_keys.include?(key) }
|
||||||
|
cart.delivery_destination.update_attributes(params)
|
||||||
|
cart.delivery_destination.save!
|
||||||
|
cart.delivery_destination.to_json(except: [:created_at, :email_verification_code, :phone_verification_code])
|
||||||
|
end
|
||||||
|
put '/cart/delivery_destination', &update_delivery_destination
|
||||||
|
post '/cart/delivery_destination', &update_delivery_destination
|
||||||
|
|
||||||
|
|
||||||
def report_to_trello(cart)
|
def report_to_trello(cart)
|
||||||
Thread.new do
|
Thread.new do
|
||||||
@cart = cart
|
@cart = cart
|
||||||
@@ -50,8 +61,8 @@ def report_to_trello(cart)
|
|||||||
card = Trello::Card.new
|
card = Trello::Card.new
|
||||||
card.list_id = list.id
|
card.list_id = list.id
|
||||||
card.name = cart.title
|
card.name = cart.title
|
||||||
card.pos = "bottom"
|
card.pos = 'bottom'
|
||||||
card.desc = erb(:cart_trello, :layout => false)
|
card.desc = erb(:cart_trello, layout: false)
|
||||||
card.save
|
card.save
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -75,22 +86,21 @@ post '/cart/delivery_destination', &update_delivery_destination
|
|||||||
def send_order_email(cart)
|
def send_order_email(cart)
|
||||||
Thread.new do
|
Thread.new do
|
||||||
client = SendGrid::Client.new(
|
client = SendGrid::Client.new(
|
||||||
api_user: RibicaConfig.SENDGRID_API_USER,
|
api_user: RibicaConfig::SENDGRID_API_USER,
|
||||||
api_key: RibicaConfig.SENDGRID_API_KEY
|
api_key: RibicaConfig::SENDGRID_API_KEY
|
||||||
)
|
)
|
||||||
|
|
||||||
email = SendGrid::Mail.new do |m|
|
email = SendGrid::Mail.new do |m|
|
||||||
m.to = RibicaConfig.BACKOFFICE_ORDER_EMAIL_TO
|
m.to = RibicaConfig::BACKOFFICE_ORDER_EMAIL_TO
|
||||||
m.from = RibicaConfig.BACKOFFICE_ORDER_EMAIL_FROM
|
m.from = RibicaConfig::BACKOFFICE_ORDER_EMAIL_FROM
|
||||||
m.from_name = "Prodavnica Ribica"
|
m.from_name = 'Prodavnica Ribica'
|
||||||
m.subject = "Nova Narudžba: #{cart.id}"
|
m.subject = "Nova Narudžba: #{cart.id}"
|
||||||
m.html = "Mušterija naručila nešto. <br /> Pogledati #{RibicaConfig.ROOT_ADDRESS}/backoffice/carts/#{cart.id}"
|
m.html = "Mušterija naručila nešto. <br /> Pogledati #{RibicaConfig::ROOT_ADDRESS}/backoffice/carts/#{cart.id}"
|
||||||
end
|
end
|
||||||
client.send(email)
|
client.send(email)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
post '/cart/confirmation' do
|
post '/cart/confirmation' do
|
||||||
anonymous = anonymous_id
|
anonymous = anonymous_id
|
||||||
cart = Cart.just_find(anonymous, logged_in_user_id)
|
cart = Cart.just_find(anonymous, logged_in_user_id)
|
||||||
@@ -98,51 +108,51 @@ post '/cart/confirmation' do
|
|||||||
cart.ordered = true
|
cart.ordered = true
|
||||||
cart.save!
|
cart.save!
|
||||||
end
|
end
|
||||||
|
report_to_trello(cart)
|
||||||
|
send_order_email(cart)
|
||||||
# since there is no more ordered cart this needs to be done
|
# since there is no more ordered cart this needs to be done
|
||||||
# in order for next call of Cart#just_find to be ready
|
# in order for next call of Cart#just_find to be ready
|
||||||
Cart.find_or_create(anonymous, logged_in_user_id)
|
Cart.find_or_create(anonymous, logged_in_user_id)
|
||||||
#report_to_trello(cart)
|
'OK'.to_json
|
||||||
send_order_email(cart)
|
|
||||||
"OK".to_json
|
|
||||||
end
|
end
|
||||||
|
|
||||||
post '/payment/confirmation' do
|
post '/payment/confirmation' do
|
||||||
data = JSON.parse params[:custom]
|
data = JSON.parse params[:custom]
|
||||||
|
|
||||||
puts "Data #{data.inspect}"
|
puts "Data #{data.inspect}"
|
||||||
|
|
||||||
anonymous = data["anonymous_id_string"]
|
anonymous = data['anonymous_id_string']
|
||||||
user = data["user_id"]
|
user = data['user_id']
|
||||||
user ||= -1
|
user ||= -1
|
||||||
user = user.to_i
|
user = user.to_i
|
||||||
|
|
||||||
cart = Cart.just_find(anonymous, user)
|
cart = Cart.just_find(anonymous, user)
|
||||||
if cart.item_in_carts.length > 0
|
if cart.item_in_carts.length > 0
|
||||||
cart.ordered = true
|
cart.ordered = true
|
||||||
cart.save!
|
cart.save!
|
||||||
end
|
end
|
||||||
|
|
||||||
Cart.find_or_create(anonymous, user)
|
Cart.find_or_create(anonymous, user)
|
||||||
#report_to_trello(cart)
|
report_to_trello(cart)
|
||||||
send_order_email(cart)
|
send_order_email(cart)
|
||||||
"OK".to_json
|
'OK'.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
get '/pikpay/confirmation' do
|
get '/pikpay/confirmation' do
|
||||||
anonymous = params["anonymous_id_string"]
|
anonymous = params['anonymous_id_string']
|
||||||
user = params["user_id"]
|
user = params['user_id']
|
||||||
user ||= -1
|
user ||= -1
|
||||||
user = user.to_i
|
user = user.to_i
|
||||||
|
|
||||||
cart = Cart.just_find(anonymous, user)
|
cart = Cart.just_find(anonymous, user)
|
||||||
if cart.item_in_carts.length > 0
|
if cart.item_in_carts.length > 0
|
||||||
cart.ordered = true
|
cart.ordered = true
|
||||||
cart.save!
|
cart.save!
|
||||||
end
|
end
|
||||||
|
|
||||||
Cart.find_or_create(anonymous, user)
|
Cart.find_or_create(anonymous, user)
|
||||||
#report_to_trello(cart)
|
report_to_trello(cart)
|
||||||
send_order_email(cart)
|
send_order_email(cart)
|
||||||
|
|
||||||
redirect "#{RibicaConfig::ROOT_ADDRESS}/hvala"
|
redirect "#{RibicaConfig::ROOT_ADDRESS}/hvala"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
<%
|
<%
|
||||||
dd = @cart.delivery_destination
|
dd = @cart.delivery_destination
|
||||||
c = @cart
|
c = @cart
|
||||||
@@ -9,51 +8,43 @@
|
|||||||
**Adresa:**
|
**Adresa:**
|
||||||
<%= dd.address %>
|
<%= dd.address %>
|
||||||
|
|
||||||
|
|
||||||
<%= dd.place.to_s.strip %> <%= Place.name_from_code(dd.place.to_s) %>
|
<%= dd.place.to_s.strip %> <%= Place.name_from_code(dd.place.to_s) %>
|
||||||
|
|
||||||
Bosna i Hercegovina
|
Bosna i Hercegovina
|
||||||
|
|
||||||
**Email: **<%= dd.email %>
|
**Email:** <%= dd.email %>
|
||||||
|
|
||||||
**Telefon: ** +387 <%= dd.phone %>
|
**Telefon:** +387 <%= dd.phone %>
|
||||||
|
|
||||||
**Plaćanje: ** <%= dd.get_payment_string %>
|
**Plaćanje:** <%= dd.get_payment_string %>
|
||||||
|
|
||||||
|
**Napomena:**
|
||||||
|
|
||||||
**Napomena: **
|
|
||||||
<%= dd.note %>
|
<%= dd.note %>
|
||||||
|
|
||||||
<% if dd.gift %>
|
<% if dd.gift %>
|
||||||
**Poklon **
|
**Poklon** **Name:** <%= dd.recipient_name %>
|
||||||
|
**Postal code:** <%= dd.recipient_postal_code %>
|
||||||
**Name: **<%= dd.recipient_name %>
|
**Place:** <%= dd.recipient_place %>
|
||||||
**Postal code: **<%= dd.recipient_postal_code %>
|
**Address:** <%= dd.recipient_address %>
|
||||||
**Place: **<%= dd.recipient_place %>
|
**Phone:** <%= dd.recipient_phone %>
|
||||||
**Address: **<%= dd.recipient_address %>
|
**Email:** <%= dd.recipient_email %>
|
||||||
**Phone: **<%= dd.recipient_phone %>
|
|
||||||
**Email: **<%= dd.recipient_email %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if dd.instant_delivery %>
|
<% if dd.instant_delivery %>
|
||||||
|
|
||||||
**Naručeno:** <%= @cart.updated_at.in_time_zone("Europe/Sarajevo").strftime("%A %d.%m.%Y. %H:%M") %>
|
**Naručeno:**
|
||||||
|
<%= @cart.updated_at.in_time_zone("Europe/Sarajevo").strftime("%A %d.%m.%Y. %H:%M") %>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
<% if dd.instant_delivery %>
|
|
||||||
** OVO JE NARUDŽBA ZA INSTANT DOSTAVU **
|
|
||||||
<% end %>
|
|
||||||
<% @cart.item_in_carts.each do |iic| %>
|
<% @cart.item_in_carts.each do |iic| %>
|
||||||
**<%= iic.item.code %> <%= iic.item.name %>**
|
**<%= iic.item.code %> <%= iic.item.name %>**
|
||||||
|
|
||||||
**<%= iic.count %>** x <%= Helper.money(iic.price) %> = <%= Helper.money(iic.count * iic.price) %>
|
**<%= iic.count %>** x <%= Helper.money(iic.price) %> = <%= Helper.money(iic.count * iic.price) %>
|
||||||
|
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
Dostava
|
Dostava
|
||||||
1 x <%= Helper.money(c.delivery_cost) %> = <%= Helper.money(c.delivery_cost) %>
|
1 x <%= Helper.money(c.delivery_cost) %> = <%= Helper.money(c.delivery_cost) %>
|
||||||
|
|
||||||
**UKUPNO:** <%= Helper.money(c.total) %>
|
**UKUPNO:** <%= Helper.money(c.total) %>
|
||||||
|
|
||||||
[Pogledati OVAJ LINK](https://www.ribica.ba/backoffice/carts/<%= @cart.id %>)
|
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ var NewsletterSweepstake = React.createClass({
|
|||||||
<h1 className="normal-message">Novosti i sniženja</h1>
|
<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">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"><strong>I ovaj put - najsretnije očekuju vrijedne Lego i Disney Frozen nagrade nagrade!</strong> <br /></p>
|
||||||
|
|
||||||
<p className="normal-message">Pobjednike objavljujemo u našim email novostima u Ponedjeljak, 7.12.2015. </p>
|
<p className="normal-message">Pobjednike objavljujemo u našim email novostima u Nedjelju, 7.2.2016. </p>
|
||||||
|
|
||||||
|
|
||||||
<p style={{"textAlign": "center"}}>
|
<p style={{"textAlign": "center"}}>
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ var CheckoutPage = React.createClass({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="form-group ">
|
<div className="form-group ">
|
||||||
<label className="col-md-4 control-label" htmlFor="note">Napomena</label>
|
<label className="col-md-4 control-label" htmlFor="note">Napomena (poruka, ili broj nagradnog kupona)</label>
|
||||||
<div className="col-md-4">
|
<div className="col-md-4">
|
||||||
<textarea className="form-control" id="note" name="note" value={this.state.deliveryDestination.get('note')} onChange={this._onFieldChange} ></textarea>
|
<textarea className="form-control" id="note" name="note" value={this.state.deliveryDestination.get('note')} onChange={this._onFieldChange} ></textarea>
|
||||||
</div>
|
</div>
|
||||||
@@ -118,7 +118,7 @@ var CheckoutPage = React.createClass({
|
|||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<div className="checkbox">
|
<div className="checkbox">
|
||||||
<label><input type="checkbox" name="gift" checked={this.state.deliveryDestination.get('gift')} onChange={this._onFieldChange} />Poklon</label>
|
<label><input type="checkbox" name="gift" checked={this.state.deliveryDestination.get('gift')} onChange={this._onFieldChange} />Poklon (plaćanje samo preko Paypal-a)</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ var SingleItem = React.createClass({
|
|||||||
var hidePrice = this.props.hidePrice || false;
|
var hidePrice = this.props.hidePrice || false;
|
||||||
var self = this;
|
var self = this;
|
||||||
var itemClick = this.itemClick;
|
var itemClick = this.itemClick;
|
||||||
|
var stopPropagation = this.stopPropagation;
|
||||||
|
var itemUrl = NavigationStore.getUrlForItem(this.props.item);
|
||||||
var firstImage = this.props.item.get('multi_media_descriptions')[0];
|
var firstImage = this.props.item.get('multi_media_descriptions')[0];
|
||||||
firstImage = firstImage || { resized_url: "https://res.cloudinary.com/lfvt7ps2n/image/upload/c_fit,h_172,w_226/v1421732950/http_www.asms.ru_bitrix_templates_main_images_nophoto_irnofq.png" } ;
|
firstImage = firstImage || { resized_url: "https://res.cloudinary.com/lfvt7ps2n/image/upload/c_fit,h_172,w_226/v1421732950/http_www.asms.ru_bitrix_templates_main_images_nophoto_irnofq.png" } ;
|
||||||
if (hidePrice) {
|
if (hidePrice) {
|
||||||
@@ -29,7 +31,7 @@ var SingleItem = React.createClass({
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return (
|
return (
|
||||||
|
<a href={itemUrl} onClick={stopPropagation}>
|
||||||
<div className="col-lg-3 col-md-3 col-sm-4 col-xs-6" onClick={itemClick}>
|
<div className="col-lg-3 col-md-3 col-sm-4 col-xs-6" onClick={itemClick}>
|
||||||
<div className="productbox">
|
<div className="productbox">
|
||||||
<img className="img-responsive" src={firstImage.resized_url} alt="product image" />
|
<img className="img-responsive" src={firstImage.resized_url} alt="product image" />
|
||||||
@@ -40,14 +42,22 @@ var SingleItem = React.createClass({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</a>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
stopPropagation: function(e){
|
||||||
|
e.stopPropagation();
|
||||||
|
e.nativeEvent.stopImmediatePropagation();
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
itemClick: function(e) {
|
itemClick: function(e) {
|
||||||
NavigationActions.goToItemDetails(this.props.item);
|
NavigationActions.goToItemDetails(this.props.item);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,16 @@ var MenuItemListComponent = React.createClass({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
menuItemUrl: function(menuItem) {
|
||||||
|
var url = "#"
|
||||||
|
if (menuItem.get) {
|
||||||
|
url = menuItem.get('url');
|
||||||
|
} else {
|
||||||
|
url = menuItem.url;
|
||||||
|
}
|
||||||
|
return url;
|
||||||
|
},
|
||||||
|
|
||||||
getInitialState: function() {
|
getInitialState: function() {
|
||||||
var state = MenuItemStore.getState();
|
var state = MenuItemStore.getState();
|
||||||
var cartState = CartStore.getWholeCartState();
|
var cartState = CartStore.getWholeCartState();
|
||||||
@@ -44,6 +54,7 @@ var MenuItemListComponent = React.createClass({
|
|||||||
MenuItemActions.unsetMenuItemHover();
|
MenuItemActions.unsetMenuItemHover();
|
||||||
NavigationActions.goToMenuItem(menuItem);
|
NavigationActions.goToMenuItem(menuItem);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
return false;
|
||||||
},
|
},
|
||||||
_onCartClick: function(e) {
|
_onCartClick: function(e) {
|
||||||
NavigationActions.goToCart();
|
NavigationActions.goToCart();
|
||||||
@@ -121,16 +132,16 @@ var MenuItemListComponent = React.createClass({
|
|||||||
|
|
||||||
{this.state.menuItems.map(function(menuItem) {
|
{this.state.menuItems.map(function(menuItem) {
|
||||||
return <li className="mydropdown menu-large" onMouseLeave={self.onMouseOut} onMouseOver={self.onMouseOver.bind(self, menuItem)}>
|
return <li className="mydropdown menu-large" onMouseLeave={self.onMouseOut} onMouseOver={self.onMouseOver.bind(self, menuItem)}>
|
||||||
<a href="#" className="dropdown-toggle " id={menuItem.get('title').toLowerCase().replace(/\s+/g, '')} onClick={self.onMenuItemClick.bind(self, menuItem)} >{menuItem.get('title')}</a>
|
<a href={self.menuItemUrl(menuItem)} className="dropdown-toggle " id={menuItem.get('title').toLowerCase().replace(/\s+/g, '')} onClick={self.onMenuItemClick.bind(self, menuItem)} >{menuItem.get('title')}</a>
|
||||||
<ul className={menuItem.get('id') !== self.state.hoveredMenuItem ? "dropdown-menu megamenu row hide": "dropdown-menu megamenu row"}>
|
<ul className={menuItem.get('id') !== self.state.hoveredMenuItem ? "dropdown-menu megamenu row hide": "dropdown-menu megamenu row"}>
|
||||||
{menuItem.get('menu_sub_items').map(function(menuSubItem) {
|
{menuItem.get('menu_sub_items').map(function(menuSubItem) {
|
||||||
return (
|
return (
|
||||||
<li className="col-sm-3" key={menuSubItem.id}>
|
<li className="col-sm-3" key={menuSubItem.id}>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li className="dropdown-header"><a href="#" onClick={self.onMenuItemClick.bind(self, menuSubItem)}><p>{menuSubItem.title}</p></a></li>
|
<li className="dropdown-header"><a href={self.menuItemUrl(menuSubItem)} onClick={self.onMenuItemClick.bind(self, menuSubItem)}><p>{menuSubItem.title}</p></a></li>
|
||||||
{menuSubItem.menu_sub_sub_items.map(function(menuSubSubItem) {
|
{menuSubItem.menu_sub_sub_items.map(function(menuSubSubItem) {
|
||||||
return (<li><a href="#" onClick={self.onMenuItemClick.bind(self, menuSubSubItem)}>{menuSubSubItem.title}</a></li>)
|
return (<li><a href={self.menuItemUrl(menuSubSubItem)} onClick={self.onMenuItemClick.bind(self, menuSubSubItem)}>{menuSubSubItem.title}</a></li>)
|
||||||
})}
|
})}
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
@@ -189,7 +200,7 @@ var MenuItemListComponent = React.createClass({
|
|||||||
*/}
|
*/}
|
||||||
{this.state.menuItems.map(function(menuItem) {
|
{this.state.menuItems.map(function(menuItem) {
|
||||||
return <li className="dropdown menu-large">
|
return <li className="dropdown menu-large">
|
||||||
<a href="#" className="dropdown-toggle " data-toggle="dropdown" role="button" aria-expanded="false">
|
<a href={self.menuItemUrl(menuItem)} className="dropdown-toggle " data-toggle="dropdown" role="button" aria-expanded="false">
|
||||||
{menuItem.get('title')} <b className="caret" /> </a>
|
{menuItem.get('title')} <b className="caret" /> </a>
|
||||||
<ul className="dropdown-menu megamenu row">
|
<ul className="dropdown-menu megamenu row">
|
||||||
|
|
||||||
@@ -198,9 +209,9 @@ var MenuItemListComponent = React.createClass({
|
|||||||
<li className="col-sm-3" key={menuSubItem.id}>
|
<li className="col-sm-3" key={menuSubItem.id}>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li className="dropdown-header"><a href="#" onClick={self.onMenuItemClick.bind(self, menuSubItem)}><p>{menuSubItem.title}</p></a></li>
|
<li className="dropdown-header"><a href={self.menuItemUrl(menuSubItem)} onClick={self.onMenuItemClick.bind(self, menuSubItem)}><p>{menuSubItem.title}</p></a></li>
|
||||||
{menuSubItem.menu_sub_sub_items.map(function(menuSubSubItem) {
|
{menuSubItem.menu_sub_sub_items.map(function(menuSubSubItem) {
|
||||||
return (<li><a href="#" onClick={self.onMenuItemClick.bind(self, menuSubSubItem)}>{menuSubSubItem.title}</a></li>)
|
return (<li><a href={self.menuItemUrl(menuSubSubItem)} onClick={self.onMenuItemClick.bind(self, menuSubSubItem)}>{menuSubSubItem.title}</a></li>)
|
||||||
})}
|
})}
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ var SearchBox = React.createClass({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
render: function() {
|
render: function() {
|
||||||
var large = (<form style={ {marginLeft: '60px', width: '100%'} } className="form-inline">
|
var large = (<form onSubmit={this.onSearchClick} style={ {marginLeft: '60px', width: '100%'} } className="form-inline">
|
||||||
<div className="left-inner-addon">
|
<div className="left-inner-addon">
|
||||||
<i className="glyphicon glyphicon-search"></i>
|
<i className="glyphicon glyphicon-search"></i>
|
||||||
<input style={{width: '75%'}} type="search" onKeyPress={this.onKeyPress}
|
<input style={{width: '75%'}} type="search" onKeyPress={this.onKeyPress}
|
||||||
@@ -57,7 +57,7 @@ var SearchBox = React.createClass({
|
|||||||
</div>
|
</div>
|
||||||
</form>);
|
</form>);
|
||||||
|
|
||||||
var small = (<form className="form-inline">
|
var small = (<form onSubmit={this.onSearchClick} className="form-inline">
|
||||||
<span className="left-inner-addon">
|
<span className="left-inner-addon">
|
||||||
<i style={{positon: "absolute", zIndex: "600" }} className="glyphicon glyphicon-search"></i>
|
<i style={{positon: "absolute", zIndex: "600" }} className="glyphicon glyphicon-search"></i>
|
||||||
<input style={{ width: "100%"}} type="search" onKeyPress={this.onKeyPress}
|
<input style={{ width: "100%"}} type="search" onKeyPress={this.onKeyPress}
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ var StartPage = React.createClass({
|
|||||||
<AllItemsInGroup />
|
<AllItemsInGroup />
|
||||||
<h2>Preporučeno</h2>
|
<h2>Preporučeno</h2>
|
||||||
<RandomItems />
|
<RandomItems />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<GAInitiailizer />
|
<GAInitiailizer />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ module.exports = {
|
|||||||
PikpayKey: "Ribica",
|
PikpayKey: "Ribica",
|
||||||
|
|
||||||
Slugify: function(text) {
|
Slugify: function(text) {
|
||||||
|
if(!text) {
|
||||||
|
text = "";
|
||||||
|
}
|
||||||
return text.toString().toLowerCase()
|
return text.toString().toLowerCase()
|
||||||
.replace(/š/g,'s')
|
.replace(/š/g,'s')
|
||||||
.replace(/[čć]/g,'c')
|
.replace(/[čć]/g,'c')
|
||||||
|
|||||||
@@ -53,8 +53,13 @@ var NavigationStore = _.extend({}, EventEmitter.prototype, {
|
|||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
getUrlForItem: function(item) {
|
||||||
|
return '/artikal/' + item.get('id') +'/' + Globals.Slugify(item.get('name'))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
2
front-ui/build/robots.txt
Normal file
2
front-ui/build/robots.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
User-agent: *
|
||||||
|
Disallow:
|
||||||
Reference in New Issue
Block a user