Skip to content

Commit

Permalink
Merge theme into ecomm
Browse files Browse the repository at this point in the history
  • Loading branch information
Jed Mao committed Apr 4, 2014
2 parents 1ee2a90 + 1aaea82 commit 37841c9
Show file tree
Hide file tree
Showing 19 changed files with 622 additions and 513 deletions.
6 changes: 6 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
<li data-ui-sref-active="active">
<a data-ui-sref="i18n.style-guide" data-translate="index.styleGuide">Style Guide</a>
</li>
<li data-ui-sref-active="active">
<a data-ui-sref="i18n.about" data-translate="index.about">About</a>
</li>
<li data-ui-sref-active="active">
<a data-ui-sref="i18n.contact" data-translate="index.contact">Contact</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span data-translate="index.dropdown"></span> <b class="caret"></b></a>
<ul class="dropdown-menu">
Expand Down
27 changes: 25 additions & 2 deletions app/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,26 @@ angular.module('volusionApp')
}]
}
})
.state('i18n.about', {
url: '/about',
templateUrl: 'views/about.html',
controller: 'AboutCtrl',
resolve: {
translations: ['translate', function(translate) {
return translate.addParts('about');
}]
}
})
.state('i18n.contact', {
url: '/contact',
templateUrl: 'views/contact.html',
controller: 'ContactCtrl',
resolve: {
translations: ['translate', function(translate) {
return translate.addParts('contact');
}]
}
})
.state('i18n.category', {
url: '/:categoryName/c/:categoryId',
templateUrl: 'views/category.html',
Expand Down Expand Up @@ -114,13 +134,16 @@ angular.module('volusionApp')
$templateCache.put('views/i18n.html', require('./views/i18n.html'));
$templateCache.put('views/home.html', require('./views/home.html'));
$templateCache.put('views/style-guide.html', require('./views/style-guide.html'));
$templateCache.put('views/about.html', require('./views/about.html'));
$templateCache.put('views/contact.html', require('./views/contact.html'));
$templateCache.put('views/category.html', require('./views/category.html'));
$templateCache.put('views/product.html', require('./views/product.html'));
})
.factory('storage', require('./services/storage'))
.controller('IndexCtrl', require('./controllers/index'))
.controller('HomeCtrl', require('./controllers/home'))
.controller('StyleGuideCtrl', require('./controllers/style-guide'))
.controller('AboutCtrl', require('./controllers/about'))
.controller('ContactCtrl', require('./controllers/contact'))
.controller('CategoryCtrl', require('./controllers/category'))
.controller('ProductCtrl', require('./controllers/product'))
.controller('IndexCtrl', require('./controllers/index'));
.controller('ProductCtrl', require('./controllers/product'));
15 changes: 15 additions & 0 deletions app/scripts/controllers/about.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

module.exports = [
'$scope',
function(
$scope) {

$scope.awesomeThings = [
'HTML5 Boilerplate',
'AngularJS',
'Karma'
];

}
];
15 changes: 15 additions & 0 deletions app/scripts/controllers/contact.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

module.exports = [
'$scope',
function(
$scope) {

$scope.awesomeThings = [
'HTML5 Boilerplate',
'AngularJS',
'Karma'
];

}
];
5 changes: 4 additions & 1 deletion app/scripts/controllers/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

module.exports = [
'$scope',
function($scope) {
function(
$scope) {

$scope.awesomeThings = [
'HTML5 Boilerplate',
'AngularJS',
'Karma'
];

}
];
10 changes: 6 additions & 4 deletions app/scripts/controllers/index.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
'use strict';

module.exports = [
'$state',
'$scope',
'$state',
'$http',
'api',

function ($state, $scope, $http, api) {
function(
$scope,
$state,
$http,
api) {

$scope.$on('$stateChangeSuccess', function(event, toState) {
if (toState.name === 'i18n') {
$state.go('.home', null, { location: 'replace' });
}
});


$scope.global = {
cart: {
itemCount: 10
Expand Down
3 changes: 1 addition & 2 deletions app/scripts/controllers/style-guide.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

module.exports = [
function() {
}
function() {}
];
4 changes: 4 additions & 0 deletions app/translations/about/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"about": {
}
}
4 changes: 4 additions & 0 deletions app/translations/contact/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"contact": {
}
}
2 changes: 2 additions & 0 deletions app/translations/index/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"bootstrapTheme": "Bootstrap theme",
"home": "Home",
"styleGuide": "Style Guide",
"about": "About",
"contact": "Contact",
"dropdown": "Dropdown",
"action": "Action",
"anotherAction": "Another action",
Expand Down
1 change: 1 addition & 0 deletions app/views/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>This is the about view.</p>
88 changes: 43 additions & 45 deletions app/views/category.html
Original file line number Diff line number Diff line change
@@ -1,45 +1,43 @@
<div class="container">
<section class="category">
<h1>Category</h1>
<dl>
<dt>Id</dt>
<dd>{{category.id}}</dd>
<dt>Name</dt>
<dd>{{category.name}}</dd>
</dl>
</section>
<section class="category-subcategories">
<h2>Sub-Categories</h2>
<dl data-ng-repeat="subCategory in category.subCategories">
<dt>Id</dt>
<dd>{{subCategory.id}}</dd>
<dt>Name</dt>
<dd>{{subCategory.name}}</dd>
</dl>
</section>
<section class="category-products">
<h2>Products</h2>
<dl data-ng-repeat="product in category.products">
<dt>Id</dt>
<dd>{{product.id}}</dd>
<dt>Name</dt>
<dd>{{product.name}}</dd>
<dt>Url</dt>
<dd>{{product.url}}</dd>
<dt>Main Image Url</dt>
<dd>{{product.mainImageUrl}}</dd>
<dt>Code</dt>
<dd>{{product.code}}</dd>
<dt>Is On Sale</dt>
<dd>{{product.isOnSale}}</dd>
<dt>Is New</dt>
<dd>{{product.isNew}}</dd>
<dt>Regular Price</dt>
<dd>{{product.pricing.regularPrice}}</dd>
<dt>Sale Price</dt>
<dd>{{product.pricing.salePrice}}</dd>
<dt>List Price</dt>
<dd>{{product.pricing.listPrice}}</dd>
</dl>
</section>
</div>
<section class="category">
<h1>Category</h1>
<dl>
<dt>Id</dt>
<dd>{{category.id}}</dd>
<dt>Name</dt>
<dd>{{category.name}}</dd>
</dl>
</section>
<section class="category-subcategories">
<h2>Sub-Categories</h2>
<dl data-ng-repeat="subCategory in category.subCategories">
<dt>Id</dt>
<dd>{{subCategory.id}}</dd>
<dt>Name</dt>
<dd>{{subCategory.name}}</dd>
</dl>
</section>
<section class="category-products">
<h2>Products</h2>
<dl data-ng-repeat="product in category.products">
<dt>Id</dt>
<dd>{{product.id}}</dd>
<dt>Name</dt>
<dd>{{product.name}}</dd>
<dt>Url</dt>
<dd>{{product.url}}</dd>
<dt>Main Image Url</dt>
<dd>{{product.mainImageUrl}}</dd>
<dt>Code</dt>
<dd>{{product.code}}</dd>
<dt>Is On Sale</dt>
<dd>{{product.isOnSale}}</dd>
<dt>Is New</dt>
<dd>{{product.isNew}}</dd>
<dt>Regular Price</dt>
<dd>{{product.pricing.regularPrice}}</dd>
<dt>Sale Price</dt>
<dd>{{product.pricing.salePrice}}</dd>
<dt>List Price</dt>
<dd>{{product.pricing.listPrice}}</dd>
</dl>
</section>
1 change: 1 addition & 0 deletions app/views/contact.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>This is the contact view.</p>
4 changes: 1 addition & 3 deletions app/views/home.html
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<div class="container">
<p>This is the home view.</p>
</div>
<p>This is the home view.</p>
2 changes: 1 addition & 1 deletion app/views/i18n.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div data-ui-view=""></div>
<div class="container" data-ui-view=""></div>
Loading

0 comments on commit 37841c9

Please sign in to comment.