diff --git a/.DS_Store b/.DS_Store
index 5008ddf..e6781fa 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/back-office/.DS_Store b/back-office/.DS_Store
new file mode 100644
index 0000000..074206a
Binary files /dev/null and b/back-office/.DS_Store differ
diff --git a/front-api/.DS_Store b/front-api/.DS_Store
index 6880bbc..359b89e 100644
Binary files a/front-api/.DS_Store and b/front-api/.DS_Store differ
diff --git a/front-ui/.DS_Store b/front-ui/.DS_Store
index 450365b..04afe53 100644
Binary files a/front-ui/.DS_Store and b/front-ui/.DS_Store differ
diff --git a/front-ui/app/.DS_Store b/front-ui/app/.DS_Store
index ca70ab5..69e3a4e 100644
Binary files a/front-ui/app/.DS_Store and b/front-ui/app/.DS_Store differ
diff --git a/front-ui/app/app.js b/front-ui/app/app.js
deleted file mode 100644
index 6e3cf9a..0000000
--- a/front-ui/app/app.js
+++ /dev/null
@@ -1,9 +0,0 @@
-var App = function() {
- this.bootstrap = function() {
- // here goes all app initialization and bootstraping logic
- // nothing at the moment
- };
-};
-
-var app = new App();
-module.exports = app;
diff --git a/front-ui/app/components/.DS_Store b/front-ui/app/components/.DS_Store
new file mode 100644
index 0000000..44861fd
Binary files /dev/null and b/front-ui/app/components/.DS_Store differ
diff --git a/front-ui/app/components/browsing/byCategory.js b/front-ui/app/components/browsing/byCategory.js
index 3ea5e97..9dc54c4 100644
--- a/front-ui/app/components/browsing/byCategory.js
+++ b/front-ui/app/components/browsing/byCategory.js
@@ -1,13 +1,13 @@
var React = require('react');
var ByCategory = React.createClass({
- render: function() {
- return (
-
-
Browse products by category
-
- );
- }
+ render: function() {
+ return (
+
+
Browse products by category
+
+ );
+ }
});
module.exports = ByCategory;
diff --git a/front-ui/app/components/items/.DS_Store b/front-ui/app/components/items/.DS_Store
new file mode 100644
index 0000000..a9a49cb
Binary files /dev/null and b/front-ui/app/components/items/.DS_Store differ
diff --git a/front-ui/app/components/allItems.js b/front-ui/app/components/items/allItems.js
similarity index 80%
rename from front-ui/app/components/allItems.js
rename to front-ui/app/components/items/allItems.js
index 38565a8..282b3b8 100644
--- a/front-ui/app/components/allItems.js
+++ b/front-ui/app/components/items/allItems.js
@@ -1,8 +1,8 @@
var React = require('react');
var ItemList = require('./itemList');
-var ItemStore = require('../stores/itemStore.js');
-var ItemActions = require('../actions/itemActions.js');
-var ItemCollection = require('../models/itemCollection');
+var ItemStore = require('../../stores/itemStore.js');
+var ItemActions = require('../../actions/itemActions.js');
+var ItemCollection = require('../../models/itemCollection');
var AllItems = React.createClass({
diff --git a/front-ui/app/components/itemList.js b/front-ui/app/components/items/itemList.js
similarity index 90%
rename from front-ui/app/components/itemList.js
rename to front-ui/app/components/items/itemList.js
index 46531fd..5f01bcb 100644
--- a/front-ui/app/components/itemList.js
+++ b/front-ui/app/components/items/itemList.js
@@ -1,6 +1,6 @@
var React = require('react');
var SingleItem = require('./singleItem');
-var ItemCollection = require('../models/itemCollection.js');
+var ItemCollection = require('../../models/itemCollection.js');
var ItemList = React.createClass({
diff --git a/front-ui/app/components/itemMultiMediaDescriptions.js b/front-ui/app/components/items/itemMultiMediaDescriptions.js
similarity index 100%
rename from front-ui/app/components/itemMultiMediaDescriptions.js
rename to front-ui/app/components/items/itemMultiMediaDescriptions.js
diff --git a/front-ui/app/components/items/itemPage.js b/front-ui/app/components/items/itemPage.js
index 4ae8c25..954cbc0 100644
--- a/front-ui/app/components/items/itemPage.js
+++ b/front-ui/app/components/items/itemPage.js
@@ -1,5 +1,5 @@
var React = require('react')
- ItemWithDetailsPage = require('../itemWithDetailsPage');
+ ItemWithDetailsPage = require('./itemWithDetailsPage');
var ItemPage = React.createClass({
render: function() {
return (
diff --git a/front-ui/app/components/itemWithDetailsPage.js b/front-ui/app/components/items/itemWithDetailsPage.js
similarity index 92%
rename from front-ui/app/components/itemWithDetailsPage.js
rename to front-ui/app/components/items/itemWithDetailsPage.js
index 0c8fe41..8f13493 100644
--- a/front-ui/app/components/itemWithDetailsPage.js
+++ b/front-ui/app/components/items/itemWithDetailsPage.js
@@ -1,9 +1,9 @@
var React = require('react'),
ItemMultiMediaDescriptions = require('./itemMultiMediaDescriptions'),
- ItemActions = require('../actions/itemActions'),
- ItemStore = require('../stores/itemStore');
+ ItemActions = require('../../actions/itemActions'),
+ ItemStore = require('../../stores/itemStore');
-var Item = require('../models/item');
+var Item = require('../../models/item');
var Router = require('react-router');
var Navigation = Router.Navigation;
diff --git a/front-ui/app/components/items/singleItem.js b/front-ui/app/components/items/singleItem.js
new file mode 100644
index 0000000..f9ee8f8
--- /dev/null
+++ b/front-ui/app/components/items/singleItem.js
@@ -0,0 +1,31 @@
+var React = require('react');
+var ItemActions = require('../../actions/itemActions');
+
+var Router = require('react-router');
+var Navigation = Router.Navigation;
+
+var SingleItem = React.createClass({
+ mixins: [Navigation],
+ render: function() {
+ var self = this;
+ var itemClick = this.itemClick;
+ var firstImage = this.props.item.get('multi_media_descriptions')[0];
+ firstImage = firstImage || { url: "http://res.cloudinary.com/lfvt7ps2n/image/upload/c_crop,g_center,w_300/v1421732950/http_www.asms.ru_bitrix_templates_main_images_nophoto_irnofq.png" } ;
+ return (
+
+

+
{ this.props.item.get('name') }
+
{ this.props.item.get('list_price') } KM
+
+ );
+ },
+
+ itemClick: function(e) {
+ // no need for this to go through ItemActions
+ //ItemActions.selectItem(this.props.item);
+ this.transitionTo('/artikal/' + this.props.item.get('id') +'/' + this.props.item.get('name'));
+ }
+});
+
+
+module.exports = SingleItem;
diff --git a/front-ui/app/components/rootApp.js b/front-ui/app/components/rootApp.js
index 780748a..55a9425 100644
--- a/front-ui/app/components/rootApp.js
+++ b/front-ui/app/components/rootApp.js
@@ -1,5 +1,5 @@
var React = require('react'),
- SectionsListComponent = require('./sectionsListComponent'),
+ SectionsListComponent = require('./shared/sectionsListComponent'),
Router = require('react-router'),
RouteHandler = Router.RouteHandler;
diff --git a/front-ui/app/components/sectionsListComponent.js b/front-ui/app/components/sectionsListComponent.js
deleted file mode 100644
index 50291a9..0000000
--- a/front-ui/app/components/sectionsListComponent.js
+++ /dev/null
@@ -1,172 +0,0 @@
-var React = require('react'),
- SectionCollection = require('../models/sectionCollection'),
- Section = require('../models/section'),
- Backbone = require('backbone');
-
-var Navigation = require('react-router').Navigation;
-
-Backbone.$ = $;
-
-var SectionsListComponent = React.createClass({
- mixins : [Navigation],
- getInitialState: function() {
- return {
- sections : [],
- hoveredSection : ''
- };
- },
- componentDidMount: function() {
- var sections = new SectionCollection();
- sections.fetch({success: function() {
- console.log('Loaded sections:' , sections);
- if(this.isMounted()) {
- this.setState({
- sections: sections.models
- });
- }
-
-
- }.bind(this)});
- },
- onMouseOver: function(section) {
- //console.log('mouse over!', section);
-
- this.setState({
- hoveredSection: section.get('id')
- });
- },
- onMouseOut: function() {
- this.setState({
- hoveredSection : ''
- });
- },
- onSectionClick: function(section) {
- //alert('clicked on section:'+ section.get('name'));
- this.transitionTo('/sekcija/'+ section.get('id') + '/' + section.get('name'));
- this.setState({
- hoveredSection : ''
- });
-
- return false;
- },
- onCategoryClick: function(category, section) {
-
- this.transitionTo('/sekcija/' + section.get('name') +'/kategorija/'+ category.id + '/' + category.name);
- this.setState({
- hoveredSection: ''
- });
- console.log('category', category.id);
- return false;
- },
- onSubcategoryClick: function(subcategory) {
-
- return false;
- },
- render: function() {
- var self = this;
- var style = {
- position: 'relative'
- };
- var abStyle = {
- position: 'absolute'
- };
- return (
-
-
- {this.state.sections.map(function(section) {
- return (
- -
-
- { section.get('name') }
-
-
-
-
- {section.get('categories').map(function(category) {
- return (
- -
- {category.name}
-
- {category.sub_categories.map(function(subCategory) {
-
- return (
- -
-
- {subCategory.name}
-
- )
- })}
-
-
-
- )
- })}
-
-
-
- )
- })}
-
-
- );
- }
-});
-/*
-var SectionItem = React.createClass({
- subCatClicked: function() {
- alert('you clicked on subcategory');
- },
- render: function() {
- var catStyle = {
- paddingLeft: '20px'
- };
- var subStyle = {
- paddingLeft: '20px'
- };
-
- var style = {
- paddingLeft: '30px'
- };
- var self = this;
-
- return (
-
-
- {this.props.data.get('name')}
-
- {
- this.props.data.get('categories').map(function(cat) {
- return (
{cat.name}
-
-
- { cat.sub_categories.map(function(sc) {
- return
{sc.name}
- }) }
-
)
- })
- }
-
-
- );
- }
-});
-
-var SectionsListComponent = React.createClass({
- render: function() {
- return (
-
-
-
- {this.props.sections.models.map(function(s){
- return
- })}
-
-
-
-
- );
- }
-});
-*/
-
-module.exports = SectionsListComponent;
diff --git a/front-ui/app/components/shared/.DS_Store b/front-ui/app/components/shared/.DS_Store
new file mode 100644
index 0000000..1938026
Binary files /dev/null and b/front-ui/app/components/shared/.DS_Store differ
diff --git a/front-ui/app/components/shared/sectionsListComponent.js b/front-ui/app/components/shared/sectionsListComponent.js
new file mode 100644
index 0000000..fac18ff
--- /dev/null
+++ b/front-ui/app/components/shared/sectionsListComponent.js
@@ -0,0 +1,115 @@
+var React = require('react'),
+ SectionCollection = require('../../models/sectionCollection'),
+ Section = require('../../models/section'),
+ Backbone = require('backbone');
+
+var Navigation = require('react-router').Navigation;
+
+Backbone.$ = $;
+
+var SectionsListComponent = React.createClass({
+ mixins : [Navigation],
+ getInitialState: function() {
+ return {
+ sections : [],
+ hoveredSection : ''
+ };
+ },
+ componentDidMount: function() {
+ var sections = new SectionCollection();
+ sections.fetch({success: function() {
+ console.log('Loaded sections:' , sections);
+ if(this.isMounted()) {
+ this.setState({
+ sections: sections.models
+ });
+ }
+
+
+ }.bind(this)});
+ },
+ onMouseOver: function(section) {
+ //console.log('mouse over!', section);
+
+ this.setState({
+ hoveredSection: section.get('id')
+ });
+ },
+ onMouseOut: function() {
+ this.setState({
+ hoveredSection : ''
+ });
+ },
+ onSectionClick: function(section) {
+ //alert('clicked on section:'+ section.get('name'));
+ this.transitionTo('/sekcija/'+ section.get('id') + '/' + section.get('name'));
+ this.setState({
+ hoveredSection : ''
+ });
+
+ return false;
+ },
+ onCategoryClick: function(category, section) {
+
+ this.transitionTo('/sekcija/' + section.get('name') +'/kategorija/'+ category.id + '/' + category.name);
+ this.setState({
+ hoveredSection: ''
+ });
+ console.log('category', category.id);
+ return false;
+ },
+ onSubcategoryClick: function(subcategory) {
+
+ return false;
+ },
+ render: function() {
+ var self = this;
+ var style = {
+ position: 'relative'
+ };
+ var abStyle = {
+ position: 'absolute'
+ };
+ return (
+
+
+ {this.state.sections.map(function(section) {
+ return (
+ -
+
+ { section.get('name') }
+
+
+
+
+ {section.get('categories').map(function(category) {
+ return (
+ -
+ {category.name}
+
+ {category.sub_categories.map(function(subCategory) {
+
+ return (
+ -
+
+ {subCategory.name}
+
+ )
+ })}
+
+
+
+ )
+ })}
+
+
+
+ )
+ })}
+
+
+ );
+ }
+});
+
+module.exports = SectionsListComponent;
diff --git a/front-ui/app/components/singleItem.js b/front-ui/app/components/singleItem.js
deleted file mode 100644
index 2cfba7c..0000000
--- a/front-ui/app/components/singleItem.js
+++ /dev/null
@@ -1,32 +0,0 @@
-var React = require('react');
-var ItemActions = require('../actions/itemActions');
-
-var Router = require('react-router');
-var Navigation = Router.Navigation;
-
-
-var SingleItem = React.createClass({
- mixins: [Navigation],
- render: function() {
- var self = this;
- var itemClick = this.itemClick;
- var firstImage = this.props.item.get('multi_media_descriptions')[0];
- firstImage = firstImage || { url: "http://res.cloudinary.com/lfvt7ps2n/image/upload/c_crop,g_center,w_300/v1421732950/http_www.asms.ru_bitrix_templates_main_images_nophoto_irnofq.png" } ;
- return (
-
-

-
{ this.props.item.get('name') }
-
{ this.props.item.get('list_price') } KM
-
- );
- },
-
- itemClick: function(e) {
- // no need for this to go through ItemActions
- //ItemActions.selectItem(this.props.item);
- this.transitionTo('/artikal/' + this.props.item.get('id') +'/' + this.props.item.get('name'));
- }
-});
-
-
-module.exports = SingleItem;
diff --git a/front-ui/app/components/startPage/startPage.js b/front-ui/app/components/startPage/startPage.js
index bbd692d..689a944 100644
--- a/front-ui/app/components/startPage/startPage.js
+++ b/front-ui/app/components/startPage/startPage.js
@@ -1,7 +1,7 @@
var React = require('react'),
Router = require('react-router'),
RouteHandler = Router.RouteHandler,
- AllItems = require('../allItems');
+ AllItems = require('../items/allItems');
var StartPage = React.createClass({
render : function() {
diff --git a/front-ui/app/externalApi.js b/front-ui/app/externalApi.js
new file mode 100644
index 0000000..4d03ec6
--- /dev/null
+++ b/front-ui/app/externalApi.js
@@ -0,0 +1,9 @@
+var App = function() {
+ this.bootstrap = function() {
+ // here goes all app initialization and bootstraping logic
+ // nothing at the moment
+ };
+};
+
+var app = new App();
+module.exports = app;
diff --git a/front-ui/app/rapp.js b/front-ui/app/rapp.js
deleted file mode 100644
index 67cb2c5..0000000
--- a/front-ui/app/rapp.js
+++ /dev/null
@@ -1,36 +0,0 @@
-var React = require('react');
-var Router = require('react-router'),
- Route = Router.Route, DefaultRoute = Router.DefaultRoute;
-var RouteHandler = Router.RouteHandler;
-var Navigation = Router.Navigation;
-
-
-var ItemWithDetailsPage = require('./components/itemWithDetailsPage');
-var ItemList = require('./components/itemList');
-var SectionsListComponent = require('./components/sectionsListComponent');
-var AllItems = require('./components/allItems');
-var RootApp = require('./components/rootApp');
-var StartPage = require('./components/startPage/startPage');
-var ByCategory = require('./components/browsing/byCategory');
-var BySection = require('./components/browsing/bySection');
-
-var ItemPage = require('./components/items/itemPage');
-
-
-var routes = (
-
-
-
-
-
-
-
-
-
-
-
- );
-
-Router.run(routes, function(Handler) {
- React.render(, document.body);
-});
diff --git a/front-ui/app/ribica.js b/front-ui/app/ribica.js
index e2a380f..c4aa540 100644
--- a/front-ui/app/ribica.js
+++ b/front-ui/app/ribica.js
@@ -1,9 +1,9 @@
var Backbone = require('backbone');
-var app = require('./app');
-var rapp = require('./rapp');
+var ExternalApi = require('./externalApi');
+var Routes = require('./routes');
Backbone.$ = $;
module.exports = {
- App : app,
- RApp: rapp
+ ExternalApi: ExternalApi,
+ Routes : Routes
}
diff --git a/front-ui/app/routes.js b/front-ui/app/routes.js
new file mode 100644
index 0000000..d2420ec
--- /dev/null
+++ b/front-ui/app/routes.js
@@ -0,0 +1,29 @@
+var React = require('react');
+var Router = require('react-router'),
+ Route = Router.Route, DefaultRoute = Router.DefaultRoute;
+var RouteHandler = Router.RouteHandler;
+var Navigation = Router.Navigation;
+
+var ItemWithDetailsPage = require('./components/items/itemWithDetailsPage');
+var ItemList = require('./components/items/itemList');
+var SectionsListComponent = require('./components/shared/sectionsListComponent');
+var AllItems = require('./components/items/allItems');
+var RootApp = require('./components/rootApp');
+var StartPage = require('./components/startPage/startPage');
+var ByCategory = require('./components/browsing/byCategory');
+var BySection = require('./components/browsing/bySection');
+
+var ItemPage = require('./components/items/itemPage');
+
+var routes = (
+
+
+
+
+
+
+ );
+
+Router.run(routes, function(Handler) {
+ React.render(, document.body);
+});