Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin area product details page enhanced #8

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions admin/routes/products.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Require needed modules
var moment = require('moment');
var Product = require('../../schemas/product');
var config = require('../../shop/config.json');

// Export functions
module.exports = {

Expand Down Expand Up @@ -33,7 +33,8 @@ module.exports = {
title: 'Editing ' + product.name,
logged: req.isAuthenticated(),
user: req.user,
product: product
product: product,
moment: moment
});
});
},
Expand Down
96 changes: 95 additions & 1 deletion admin/views/products/product.jade
Original file line number Diff line number Diff line change
@@ -1,5 +1,98 @@
extend ../layout
block content

.row
.page-header
h2 #{product.name}

form.row
.span6
h3 Details
table.table.table-striped.table-bordered
tbody
tr.success
th.span3 Name
td.span9 #{product.name}
tr
th SKU
td #{product.sku}
tr
th Category
td #{product.category}
tr
th UPC
td #{product.upc}
tr
th SEO
td #{product.seo}
tr
th Date
td #{moment(product.date).format("YYYY-MM-DD HH:mm")}
tr
th Featured
td #{product.featured}

h3 Pricing
table.table.table-bordered
tbody
tr
th.span3 Pricing
td.span9
table.table.table-condensed
tr
td List
td Retail
td % Saving
tr
td #{product.pricing.list}
td #{product.pricing.retail}
td #{product.pricing.pct_savings}


h3 Shipping
table.table.table-bordered
tbody
tr
th.span3 Weight
td.span9 #{product.shipping.weight}
tr
th.span3 Dimensions
td.span9
table.table.table-condensed
tr
td Width
td Height
td Depth
tr
td #{product.shipping.dimensions.width}
td #{product.shipping.dimensions.height}
td #{product.shipping.dimensions.depth}

.span6
h3 Images
img(src="http://placehold.it/450x350")
//- .row.center
ul.thumbnails
li
img.img-polaroid(src="http://placehold.it/100x60")
li
img.img-polaroid(src="http://placehold.it/100x60")
li
img.img-polaroid(src="http://placehold.it/100x60")
li
img.img-polaroid(src="http://placehold.it/100x60")


table.table.table-bordered
tbody
tr
th.span3 Details
td.span9 #{JSON.stringify(product.details)}





form(action="/products/#{product._id}", method="post", role="form", name="form").form-horizontal#form
.panel.panel-default
.panel-heading Details
Expand Down Expand Up @@ -45,4 +138,5 @@ block content
block scripts
script(src="/js/plugins/jquery.validate.min.js", type="text/javascript")
script(src="/js/plugins/typeahead.min.min.js")
script(src="/js/controller/product.js")
script(src="/js/controller/product.js")

51 changes: 3 additions & 48 deletions shop/views/account/layout.jade
Original file line number Diff line number Diff line change
@@ -1,48 +1,3 @@
doctype 5
html(lang="en")
head
title #{store} | #{title}
link(href="/css/bootstrap.min.css", rel="stylesheet")
link(href="/css/main.css", rel="stylesheet")
body
.modal.hide.fade#modal
.navbar.navbar-static-top
.navbar-inner
.container
ul.nav
li
a(href="/") Home
li
a(href="/about") About
li
a(href="/contact") Contact
if (!locals.logged)
li
a(data-toggle="modal", data-target="#modal", href="/modals/register") Register
li
a(data-toggle="modal", data-target="#modal", href="/modals/login") Login
else
li
a(href="/account/home") Account
li
a(href="/account/logout") Logout
#cart
include ../cart/cart
.container
a(href="/")
img(src="/img/style/header.png")
.navbar
.navbar-inner
ul.nav
each category in categories
li
a(href="/category/#{category.seo}") #{category.name}
form.navbar-search.pull-right
input.search-query(type="text", placeholder="Search")
.main
block content
hr
script(src="http://code.jquery.com/jquery.min.js", type="text/javascript")
script(src="/js/bootstrap.min.js", type="text/javascript")
script(src="/js/controller/main.js")
block scripts
extends ..\layout
block category-nav
include ..\category-nav.jade
9 changes: 9 additions & 0 deletions shop/views/category-nav.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
block category-nav
.navbar
.navbar-inner
ul.nav
each category in categories
li
a(href="/category/#{category.seo}") #{category.name}
form.navbar-search.pull-right
input.search-query(type="text", placeholder="Search")
51 changes: 3 additions & 48 deletions shop/views/category/layout.jade
Original file line number Diff line number Diff line change
@@ -1,48 +1,3 @@
doctype 5
html(lang="en")
head
title #{store} | #{title}
link(href="/css/bootstrap.min.css", rel="stylesheet")
link(href="/css/main.css", rel="stylesheet")
body
.modal.hide.fade#modal
.navbar.navbar-static-top
.navbar-inner
.container
ul.nav
li
a(href="/") Home
li
a(href="/about") About
li
a(href="/contact") Contact
if (!locals.logged)
li
a(data-toggle="modal", data-target="#modal", href="/modals/register") Register
li
a(data-toggle="modal", data-target="#modal", href="/modals/login") Login
else
li
a(href="/account/home") Account
li
a(href="/account/logout") Logout
#cart
include ../cart/cart
.container
a(href="/")
img(src="/img/style/header.png")
.navbar
.navbar-inner
ul.nav
each category in categories
li
a(href="/category/#{category.seo}") #{category.name}
form.navbar-search.pull-right
input.search-query(type="text", placeholder="Search")
.main
block content
hr
script(src="http://code.jquery.com/jquery.min.js", type="text/javascript")
script(src="/js/bootstrap.min.js", type="text/javascript")
script(src="/js/controller/main.js")
block scripts
extends ..\layout
block category-nav
include ..\category-nav.jade
40 changes: 1 addition & 39 deletions shop/views/checkout/layout.jade
Original file line number Diff line number Diff line change
@@ -1,39 +1 @@
doctype 5
html(lang="en")
head
title #{store} | #{title}
link(href="/css/bootstrap.min.css", rel="stylesheet")
link(href="/css/main.css", rel="stylesheet")
body
.modal.hide.fade#modal
.navbar.navbar-static-top
.navbar-inner
.container
ul.nav
li
a(href="/") Home
li
a(href="/about") About
li
a(href="/contact") Contact
if (!locals.logged)
li
a(data-toggle="modal", data-target="#modal", href="/modals/register") Register
li
a(data-toggle="modal", data-target="#modal", href="/modals/login") Login
else
li
a(href="/account/home") Account
li
a(href="/account/logout") Logout
.container
a(href="/")
img(src="/img/style/header.png")
.main
block content
hr
script(src="http://code.jquery.com/jquery.min.js", type="text/javascript")
script(src="/js/bootstrap.min.js", type="text/javascript")
script(src="/js/plugins/jquery.validate.min.js", type="text/javascript")
script(src="/js/controller/main.js")
block scripts
extends ..\layout
41 changes: 41 additions & 0 deletions shop/views/layout.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
doctype 5
html(lang="en")
head
title #{store} | #{title}
link(href="/css/bootstrap.min.css", rel="stylesheet")
link(href="/css/main.css", rel="stylesheet")
body
.modal.hide.fade#modal
.navbar.navbar-static-top
.navbar-inner
.container
ul.nav
li
a(href="/") Home
li
a(href="/about") About
li
a(href="/contact") Contact
if (!locals.logged)
li
a(data-toggle="modal", data-target="#modal", href="/modals/register") Register
li
a(data-toggle="modal", data-target="#modal", href="/modals/login") Login
else
li
a(href="/account/home") Account
li
a(href="/account/logout") Logout
#cart
include cart/cart
.container
a(href="/")
img(src="/img/style/header.png")
block category-nav
.main
block content
hr
script(src="http://code.jquery.com/jquery.min.js", type="text/javascript")
script(src="/js/bootstrap.min.js", type="text/javascript")
script(src="/js/controller/main.js")
block scripts
51 changes: 3 additions & 48 deletions shop/views/main/layout.jade
Original file line number Diff line number Diff line change
@@ -1,48 +1,3 @@
doctype 5
html(lang="en")
head
title #{store} | #{title}
link(href="/css/bootstrap.min.css", rel="stylesheet")
link(href="/css/main.css", rel="stylesheet")
body
.modal.hide.fade#modal
.navbar.navbar-static-top
.navbar-inner
.container
ul.nav
li
a(href="/") Home
li
a(href="/about") About
li
a(href="/contact") Contact
if (!locals.logged)
li
a(data-toggle="modal", data-target="#modal", href="/modals/register") Register
li
a(data-toggle="modal", data-target="#modal", href="/modals/login") Login
else
li
a(href="/account/home") Account
li
a(href="/account/logout") Logout
#cart
include ../cart/cart
.container
a(href="/")
img(src="/img/style/header.png")
.navbar
.navbar-inner
ul.nav
each category in categories
li
a(href="/category/#{category.seo}") #{category.name}
form.navbar-search.pull-right
input.search-query(type="text", placeholder="Search")
.main
block content
hr
script(src="http://code.jquery.com/jquery.min.js", type="text/javascript")
script(src="/js/bootstrap.min.js", type="text/javascript")
script(src="/js/controller/main.js")
block scripts
extends ..\layout
block category-nav
include ..\category-nav.jade
Loading