Skip to content

Commit

Permalink
upgrade jade to pug
Browse files Browse the repository at this point in the history
  • Loading branch information
dshuffma-ibm committed Apr 17, 2017
1 parent e7a66da commit 5dcfe0e
Show file tree
Hide file tree
Showing 16 changed files with 28 additions and 49 deletions.
7 changes: 3 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ if (process.env.VCAP_APPLICATION) {

// --- Pathing and Module Setup --- //
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.engine('.html', require('jade').__express);
app.set('view engine', 'pug');
app.use(compression());
app.use(cookieParser());
app.use(serve_static(path.join(__dirname, 'public')));
Expand All @@ -60,8 +59,8 @@ app.use(cors());
//---------------------
// Cache Busting Hash
//---------------------
process.env.cachebust_js = Date.now(); //i'm just making 1 hash against all js for easier jade implementation
process.env.cachebust_css = Date.now(); //i'm just making 1 hash against all css for easier jade implementation
process.env.cachebust_js = Date.now(); //i'm just making 1 hash against all js for easier pug implementation
process.env.cachebust_css = Date.now(); //i'm just making 1 hash against all css for easier pug implementation
logger.debug('cache busting hash js', process.env.cachebust_js, 'css', process.env.cachebust_css);

// ============================================================================================================================
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"express-session": "1.14.*",
"fabric-ca-client": "1.0.0-alpha.0",
"fabric-client": "1.0.0-alpha",
"jade": "1.11.*",
"pug": "2.0.0-beta11",
"serve-static": "1.11.*",
"winston": "2.2.*",
"ws": "1.1.*"
Expand Down
2 changes: 1 addition & 1 deletion routes/site_router.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
var express = require('express');
var router = express.Router();

//anything in here gets passed to JADE template engine
//anything in here gets passed to Pug template engine
function build_bag(req) {
return {
e: process.error, //send any setup errors
Expand Down
23 changes: 5 additions & 18 deletions views/login.jade → views/login.pug
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
extends ./template/layout.jade
extends ./template/layout.pug


// --------------- Header -------------- //
block custom_header
// --------------- Header -------------- //
script(type='text/javascript').
$(document).ready(function(){

});


// --------------- Navigation Bar -------------- //
block navpanel
include ./template/nav.jade
// --------------- Navigation Bar -------------- //
include ./template/nav.pug


// --------------- Main Stuff -------------- //
block content
// --------------- Main Stuff -------------- //
#notificationWrap

#contentPanel
Expand Down Expand Up @@ -74,16 +74,3 @@ block content
hr
input(type="text" placeholder="username" value="admin" name="username")
button(type="submit") Login


//#test(style="position: relative;")
#marbleWrap
div.ball#proposeMarbleStable.hideBorders
div.ball#marbleBorderTop
div.ball#marbleBorderBottom
div.ball#marbleBorderLeft
div.ball#marbleBorderRight
#dummy
//block footer
include ./template/blockchain.jade
22 changes: 11 additions & 11 deletions views/marbles.jade → views/marbles.pug
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
extends ./template/layout.jade
extends ./template/layout.pug


// --------------- Header -------------- //
block custom_header
// --------------- Header -------------- //
script(src='/js/ui_events.js?v=#{bag.jshash}')
script(src='/js/websocket.js?v=#{bag.jshash}')
script(src='/js/startup.js?v=#{bag.jshash}')
Expand All @@ -13,13 +13,13 @@ block custom_header
});


// --------------- Navigation Bar -------------- //
block navpanel
include ./template/nav.jade
// --------------- Navigation Bar -------------- //
include ./template/nav.pug


// --------------- Main Stuff -------------- //
block content
// --------------- Main Stuff -------------- //
#notificationsWrap
#noticeScrollWrap
#emptyNotifications.hint No Notifications
Expand All @@ -32,19 +32,19 @@ block content
#contentPanel

// --------------- Home Panel
include ./panel_home.jade
include ./panel_home.pug

// --------------- Create Panel
include ./panel_create.jade
include ./panel_create.pug

// --------------- Start Up Walk Through Panel
include ./panel_startup.jade
include ./panel_startup.pug

// --------------- Walk Transaction Panel
include ./panel_tx_story.jade
include ./panel_tx_story.pug

// --------------- Settings Panel
include ./panel_settings.jade
include ./panel_settings.pug

block footer
include ./template/blockchain.jade
include ./template/blockchain.pug
File renamed without changes.
2 changes: 1 addition & 1 deletion views/panel_create.jade → views/panel_create.pug
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//br
legend
include ./template/color_options.jade
include ./template/color_options.pug

br
legend
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions views/template/error.jade → views/template/error.pug
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
extends ./layout.jade
extends ./layout.pug


// --------------- Header -------------- //
block custom_header
// --------------- Header -------------- //
script(type='text/javascript').
$(document).ready(function(){

});


// --------------- Navigation Bar -------------- //
block navpanel
// --------------- Navigation Bar -------------- //
#logo Marbles P?


// --------------- Main Stuff -------------- //
block content
// --------------- Main Stuff -------------- //
#contentPanel

h1 Error: #{bag.error.status}
Expand Down
11 changes: 2 additions & 9 deletions views/template/layout.jade → views/template/layout.pug
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
-////////////////////////////////////////////////// Functions //////////////////////////////////////////////////
-//Print Object Out Formatted
mixin debug(variable)
br
br
pre #{JSON.stringify(variable, null, "\t")}

-////////////////////////////////////////////////// HTML //////////////////////////////////////////////////
-//Begin HTML
doctype html
Expand All @@ -27,7 +20,7 @@ html
script(src='/js/blockchain.js?v=#{bag.jshash}')
script(src='/js/ui_building.js?v=#{bag.jshash}')
script(type='text/javascript').
var bag = !{JSON.stringify(bag)}; //throw jade json over to JS
var bag = !{JSON.stringify(bag)}; //throw json over to JS
console.log('bag', bag);
$(document).ready(function(){
$(".colorInput").click(function(){ //do not remove! no idea why but this helps safari open the color picker
Expand All @@ -53,4 +46,4 @@ html
block footer

#leftEverything
include ../panel_audit.jade
include ../panel_audit.pug
File renamed without changes.

0 comments on commit 5dcfe0e

Please sign in to comment.