Skip to content

Commit

Permalink
Grunt, partials in templates
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-arapov committed Sep 27, 2013
1 parent b946773 commit be8c693
Show file tree
Hide file tree
Showing 43 changed files with 9,020 additions and 134 deletions.
85 changes: 85 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
module.exports = function (grunt) {

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '/* <%= pkg.name %>\n' +
'* <%= pkg.homepage %> \n' +
'* Copyright (c) <%= grunt.template.today("yyyy") %>' +
' <%= pkg.author.name %>\n' +
'* Licensed under AGPLv3. */'
},
jshint: {
files: ['Gruntfile.js', 'public/js/*.js'],
options: {
// options here to override JSHint defaults
globals: {
jQuery: true,
console: true,
module: true,
document: true
}
}
},
concat: {
js: {
src: ['<banner>',
'public/js/jquery.min.js',
'public/js/jquery.validate.min.js',
'public/js/ICanHaz.min.js',
'public/js/jsdeferred.js',
'public/js/bootstrap.min.js',
'public/js/underscore-min.js',
'public/js/wikinext.helper.js',
'public/js/wikinext.main.js',
'public/js/wikinext.register.js',
'public/js/jslint.js'],
dest: 'public/js/release/<%= pkg.name %>.js'
},
css: {
src: ['<banner>',
'public/css/dev/treeview.css',
'public/css/dev/docs.css',
'public/css/dev/bootstrap.min.css',
'public/css/dev/bootstrap-responsive.min.css',
'public/css/dev/font-awesome.min.css',
'public/css/dev/prettify.css'],
dest: 'public/css/release/<%= pkg.name %>.css'
}
},
clean: [
'public/js/release/*',
'public/css/release/*'
],
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: 'public/js/release/<%= pkg.name %>.js',
dest: 'public/js/release/<%= pkg.name %>.min.js'
}
},
cssmin: {
css: {
src: 'public/css/release/<%= pkg.name %>.css',
dest: 'public/css/release/<%= pkg.name %>.min.css'
}
}
});

// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-cssmin');

// Default task(s).
grunt.registerTask('default', ['clean', 'concat', 'uglify', 'cssmin']);

grunt.registerTask('test', ['jshint', 'qunit']);

};
27 changes: 24 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ var express = require('express')
, mustache = require('mustache')
, winston = require('winston')
, _ = require('underscore')
, rdfstore = require('./lib/rdfquery/jquery.rdfquery.js')
// , rdfstore = require('./lib/rdfquery/jquery.rdfquery.js')
, MongoStore = require('connect-mongodb') // sessions for express
, rdfstorejs = require('rdfstore')
// , rdfstorejs = require('rdfstore')
, jsonld = require('./lib/jsonld/jsonld.js')
, RDFa = require('./lib/jsonld/rdfa.js')
, path = require('path')
Expand Down Expand Up @@ -245,8 +245,17 @@ app.use(express.logger({stream: {
app.set('port', process.env.PORT || config.port);
app.enable('trust proxy');
app.use(express.logger('dev'));
app.set('views', __dirname + '/views');
app.set('view engine', 'hjs');

//partails using by default on all pages
app.set('partials', {
// navigation: "partials/navigation_wiki"
footer: "partials/footer"
});

app.enable('view cache');
app.set('views', __dirname + '/views');
app.engine('hjs', require('hogan-express'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.cookieParser("nothing is permitted"));
Expand Down Expand Up @@ -277,6 +286,18 @@ app.configure('production', function () {
app.use(express.errorHandler());
});

app.locals({
site: {
title: 'WikiNEXT',
description: 'Semantic Application Wiki Engine'
},
author: {
name: 'Pavel Arapov',
contact: 'pavel.arapov@gmail.com'
},
isDev: false
});

// Routes

var routes = require('./routes')(dao);
Expand Down
67 changes: 40 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,41 @@
{
"name": "wikinext-v2"
, "version": "0.0.1"
, "private": true
, "dependencies": {
"express": "*"
, "mustache": "0.4.0"
, "less": ">= 0.0.1"
, "jade": ">= 0.0.1"
, "jsdeferred": "0.4.0"
, "mongoskin": "0.3.6"
, "now": "0.8.1"
, "vie": "2.0.2"
, "jquery": "1.7.2"
, "connect-mongodb": "1.1.3"
, "formidable": "1.0.9"
, "everyauth": "*"
, "winston": "0.6.1"
, "share" : ">= 0.5.0-pre"
, "coffee-script": ">= 1.1.0"
, "request": ">= 2.1.1"
, "connect": "= 2.0.0"
, "underscore": "1.3.3"
, "jsdom" : "0.6.0"
, "rdfstore" : "0.7.0"
, "hjs" : "*"
}
}
"name": "wikinext",
"homepage": "http://wikinext.gexsoft.com",
"author": {
"name": "Pavel Arapov"
},
"version": "0.2.2",
"private": true,
"dependencies": {
"express": "*",
"less": ">= 0.0.1",
"jsdeferred": "0.4.0",
"mongoskin": "0.3.6",
"now": "0.8.1",
"vie": "2.0.2",
"jquery": "1.7.2",
"connect-mongodb": "1.1.3",
"formidable": "*",
"everyauth": "*",
"winston": "0.6.1",
"share": ">= 0.5.0-pre",
"coffee-script": ">= 1.1.0",
"request": ">= 2.1.1",
"connect": "= 2.0.0",
"underscore": "1.3.3",
"jsdom": "*",
"rdfstore": "0.7.0",
"hogan-express": "*",
"async": "*"
},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.6.3",
"grunt-contrib-nodeunit": "~0.2.0",
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-concat": "*",
"grunt-contrib-qunit": "*",
"grunt-contrib-clean": "*",
"grunt-contrib-cssmin": "*"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions public/css/bootstrap.css → public/css/dev/bootstrap.css
Original file line number Diff line number Diff line change
Expand Up @@ -2282,7 +2282,7 @@ table th[class*="span"],
*margin-right: .3em;
line-height: 14px;
vertical-align: text-top;
background-image: url("../img/glyphicons-halflings.png");
background-image: url("../../img/glyphicons-halflings.png");
background-position: 14px 14px;
background-repeat: no-repeat;
}
Expand All @@ -2306,7 +2306,7 @@ table th[class*="span"],
.dropdown-submenu:focus > a > [class^="icon-"],
.dropdown-submenu:hover > a > [class*=" icon-"],
.dropdown-submenu:focus > a > [class*=" icon-"] {
background-image: url("../img/glyphicons-halflings-white.png");
background-image: url("../../img/glyphicons-halflings-white.png");
}

.icon-glass {
Expand Down
9 changes: 9 additions & 0 deletions public/css/dev/bootstrap.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/css/docs.css → public/css/dev/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ form.bs-docs-example {
}
.bs-docs-sidenav .active .icon-chevron-right,
.bs-docs-sidenav .active a:hover .icon-chevron-right {
background-image: url(../img/glyphicons-halflings-white.png);
background-image: url(../../img/glyphicons-halflings-white.png);
opacity: 1;
}
.bs-docs-sidenav.affix {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions public/css/style.css → public/css/dev/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,27 @@
}

#toolbar button[data-tool='strong'] > i {
background-image: url(../img/bold.png);
background-image: url(../../img/bold.png);
}

#toolbar button[data-tool='em'] > i {
background-image: url(../img/italic.png);
background-image: url(../../img/italic.png);
}

#toolbar button[data-tool='u'] > i {
background-image: url(../img/underline.png);
background-image: url(../../img/underline.png);
}

#toolbar button[data-tool='del'] > i {
background-image: url(../img/strike.png);
background-image: url(../../img/strike.png);
}

#toolbar button[data-tool='save'] > i {
background-image: url(../img/file-save.png);
background-image: url(../../img/file-save.png);
}

#toolbar button[data-tool='font'] > i {
background-image: url(../img/text-font.png);
background-image: url(../../img/text-font.png);
}

#toolbar li > a.disabled {
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.
Binary file added public/css/img/bold.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/css/img/file-save.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/css/img/glyphicons-halflings-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/css/img/glyphicons-halflings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/css/img/icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/css/img/italic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/css/img/strike.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/css/img/text-font.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/css/img/underline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit be8c693

Please sign in to comment.