Permalink
Browse files

updated look and feel of error page and admin pages.

  • Loading branch information...
1 parent 4baf95e commit 8bb37a90bbe8c99594db7aa3378f7749c8f8ecee @mikevalstar committed Oct 1, 2012
Showing with 84 additions and 59 deletions.
  1. +2 −1 app.js
  2. +3 −3 lib/AdminPages.js
  3. +1 −1 lib/ErrorHandler.js
  4. +1 −1 views/admin/index.jade
  5. +1 −1 views/admin/login.jade
  6. +1 −1 views/admin/post.jade
  7. +1 −1 views/admin/postlist.jade
  8. +74 −50 views/error.jade
View
@@ -64,7 +64,8 @@ pp.initPages(app, db);
// 404 Page
app.use(function(req, res, next){
- res.render('404.jade', {title: "404 - Page Not Found", showFullNav: false, status: 404, url: req.url });
+ res.status(404);
+ res.render('404.jade', {title: "404 - Page Not Found", url: req.url });
});
// Example error pages
View
@@ -105,7 +105,7 @@ AdminPages.prototype = {
var blogpost = this.db.model('blogPost');
- var query = blogpost.find().sort("posted", -1).limit(1000).exec(function(err, docs){
+ var query = blogpost.find().sort("-posted").limit(1000).exec(function(err, docs){
res.render('admin/postlist', {
title: 'Post Listing',
posts: docs,
@@ -136,7 +136,7 @@ AdminPages.prototype = {
}else{ // New Post
var newid = 1;
var blogpost = this.db.model('blogPost');
- blogpost.find().sort("sid", -1).limit(1).exec(function(err, doc){
+ blogpost.find().sort("-sid").limit(1).exec(function(err, doc){
if(err)
console.info(err);
@@ -203,7 +203,7 @@ AdminPages.prototype = {
// max id + 1
var newid = 1;
- blogpost.find().sort("sid", -1).limit(1).exec(function(err, doc){
+ blogpost.find().sort("-sid").limit(1).exec(function(err, doc){
if(err)
console.info(err);
View
@@ -73,7 +73,7 @@ exports = module.exports = function errorHandler(options){
}else{
// public error page render
// html
- if (~accept.indexOf('html')) {
+ if (~accept.indexOf('html')) {
res.render('error.jade', {
layout: false
});
@@ -1,4 +1,4 @@
-extends layout
+extends ../layout
block content
@@ -1,4 +1,4 @@
-extends layout
+extends ../layout
block content
@@ -1,4 +1,4 @@
-extends layout
+extends ../layout
block content
@@ -1,4 +1,4 @@
-extends layout
+extends ../layout
block content
View
@@ -1,56 +1,80 @@
!!! 5
html(lang="en")
-head
- title Error - Mike Valstar - Programming & Web Development
- link(rel='stylesheet', href='/css/css.css')
-
- script(src='http://code.jquery.com/jquery-1.7.min.js', type='text/javascript')
- script(src='/js/jquery.tweet.js', type='text/javascript')
- script(src='/js/jquery.ba-hashchange.min.js', type='text/javascript')
- script(src='/js/script.min.js', type='text/javascript')
- script(src='/js/mikevalstar.js', type='text/javascript')
-
- //if lt IE 9
- script(src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js")
-
- script(type="text/javascript")
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-1984894-13']);
+ head
+ meta(name="viewport", content="width=device-width, initial-scale=1.0")
+
+ title 500 - Mike Valstar - Programming & Web Development
+
+ link(rel="shortcut icon", href="/img/favicon.png")
+ link(rel="apple-touch-icon", href="/img/apple_logo_57.png")
+ link(rel="apple-touch-icon", sizes="72x72", href="/img/apple_logo_72.png")
+ link(rel="apple-touch-icon", sizes="114x114", href="/img/apple_logo_114.png")
+ link(rel="apple-touch-icon", sizes="144x144", href="/img/apple_logo_144.png")
+ link(rel="apple-touch-icon", sizes="256x256", href="/img/apple_logo_512.png")
+ link(rel="apple-touch-icon", sizes="512x512", href="/img/apple_logo_512.png")
+
+ link(href="/RSS", rel="alternate", type="application/rss+xml", title="Mike Valstar - Programming & Web Development")
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
+ link(rel='stylesheet', href='/css/style.css')
+
+ script(src='http://code.jquery.com/jquery-1.8.2.min.js', type='text/javascript')
+ script(src='/js/jquery.tweet.js', type='text/javascript')
+ script(src='/js/mikevalstar.js', type='text/javascript')
+
+ //if lt IE 9
+ script(src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js")
-body#mikevalstar
- #O
-
- #H
- h1: a(href="http://mikevalstar.com/") Mike Valstar
- #social
- //- a(href="#"): img(src="/img/rss.png", alt="RSS")
- a(href="https://github.com/mikevalstar"): img(src="/img/github.png", alt="Github")
- a(href="https://plus.google.com/107235391839316017795"): img(src="/img/google-plus.png", alt="Google+")
- a(href="http://twitter.com/#!/mikevalstar"): img(src="/img/twitter.png", alt="Twitter")
+ script(type="text/javascript")
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-1984894-13']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
- h2 Web Development, Programming, Random Thoughts
-
- #Nav
- ul
- li#NBlog: a(href="/Blog") Blog
- li#NProjects: a(href="/Projects") Projects
- li#NAbout: a(href="/About") About
- li#NTwitter: div Twitter Feed
- div.clear
-
- #C
- #CC
- h2 500 Error
+ body#mikevalstar
+ #O.container
+ #H.row
+ .span8
+ h1: a(href="http://mikevalstar.com/")
+ img(src="/img/logo_144.png")
+ | Mike Valstar
+ h4 Web Development, Programming, Random Thoughts
+ .span4
+ #social
+ a(href="/RSS"): i.icon-rss
+ a(href="https://github.com/mikevalstar"): i.icon-github
+ a(href="https://plus.google.com/107235391839316017795"): i.icon-google-plus
+ a(href="http://twitter.com/#!/mikevalstar"): i.icon-twitter
+ #twitter
+ Loading Twitter Status...
+
+ #N.row
+ .span11.offset1
+ ul
+ li#NBlog: a(href="/Blog") Blog
+ li#NProjects: a(href="/Projects") Projects
+ li#NAbout: a(href="/About") About
+ #C
+ .row
+ .span12
+ #CC
+ h2 500 Error
- - if(typeof(stack) != 'undefined')
- pre: code.stack!=stack
- - else
- There was an error rendering this page. Sorry for the inconvenience.
-
- #F Mike Valstar © 2011
+ - if(typeof(stack) != 'undefined')
+ pre: code.stack!=stack
+ - else
+ There was an error rendering this page. Sorry for the inconvenience.
+
+
+ #F
+ .container
+ .row
+ #Fnav.span8
+ ul
+ li: a(href="/Blog") Blog
+ li: a(href="/Projects") Projects
+ li: a(href="/About") About
+ .span4 Mike Valstar © 2012

0 comments on commit 8bb37a9

Please sign in to comment.