Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Azat Mardanov
committed
Sep 29, 2013
0 parents
commit b868048
Showing
50 changed files
with
8,155 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
|
||
/** | ||
* Module dependencies. | ||
*/ | ||
|
||
var express = require('express'); | ||
var routes = require('./routes'); | ||
var tasks = require('./routes/tasks'); | ||
var http = require('http'); | ||
var path = require('path'); | ||
var mongoskin = require('mongoskin'); | ||
var db = mongoskin.db('mongodb://localhost:27017/todo?auto_reconnect', {safe:true}); | ||
var app = express(); | ||
app.use(function(req, res, next) { | ||
req.db = {}; | ||
req.db.tasks = db.collection('tasks'); | ||
next(); | ||
}) | ||
app.locals.appname = 'Express.js Todo App' | ||
// all environments | ||
|
||
|
||
app.set('port', process.env.PORT || 3000); | ||
app.set('views', __dirname + '/views'); | ||
app.set('view engine', 'jade'); | ||
app.use(express.favicon()); | ||
app.use(express.logger('dev')); | ||
app.use(express.bodyParser()); | ||
app.use(express.methodOverride()); | ||
|
||
app.use(require('less-middleware')({ src: __dirname + '/public', compress: true })); | ||
app.use(express.static(path.join(__dirname, 'public'))); | ||
|
||
app.use(app.router); | ||
|
||
// development only | ||
if ('development' == app.get('env')) { | ||
app.use(express.errorHandler()); | ||
} | ||
|
||
app.get('/', routes.index); | ||
app.get('/tasks', tasks.list); | ||
app.post('/tasks', tasks.add); | ||
app.all('*', function(req, res){ | ||
res.send(404); | ||
}) | ||
http.createServer(app).listen(app.get('port'), function(){ | ||
console.log('Express server listening on port ' + app.get('port')); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "application-name", | ||
"version": "0.0.1", | ||
"private": true, | ||
"scripts": { | ||
"start": "node app.js" | ||
}, | ||
"dependencies": { | ||
"express": "3.3.5", | ||
"jade": "*", | ||
"mongoskin": "~0.6.0", | ||
"less-middleware": "~0.1.12" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// | ||
// Alerts | ||
// -------------------------------------------------- | ||
|
||
|
||
// Base styles | ||
// ------------------------- | ||
|
||
.alert { | ||
padding: @alert-padding; | ||
margin-bottom: @line-height-computed; | ||
border: 1px solid transparent; | ||
border-radius: @alert-border-radius; | ||
|
||
// Headings for larger alerts | ||
h4 { | ||
margin-top: 0; | ||
// Specified for the h4 to prevent conflicts of changing @headingsColor | ||
color: inherit; | ||
} | ||
// Provide class for links that match alerts | ||
.alert-link { | ||
font-weight: @alert-link-font-weight; | ||
} | ||
|
||
// Improve alignment and spacing of inner content | ||
> p, | ||
> ul { | ||
margin-bottom: 0; | ||
} | ||
> p + p { | ||
margin-top: 5px; | ||
} | ||
} | ||
|
||
// Dismissable alerts | ||
// | ||
// Expand the right padding and account for the close button's positioning. | ||
|
||
.alert-dismissable { | ||
padding-right: (@alert-padding + 20); | ||
|
||
// Adjust close link position | ||
.close { | ||
position: relative; | ||
top: -2px; | ||
right: -21px; | ||
color: inherit; | ||
} | ||
} | ||
|
||
// Alternate styles | ||
// | ||
// Generate contextual modifier classes for colorizing the alert. | ||
|
||
.alert-success { | ||
.alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); | ||
} | ||
.alert-info { | ||
.alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); | ||
} | ||
.alert-warning { | ||
.alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); | ||
} | ||
.alert-danger { | ||
.alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// | ||
// Badges | ||
// -------------------------------------------------- | ||
|
||
|
||
// Base classes | ||
.badge { | ||
display: inline-block; | ||
min-width: 10px; | ||
padding: 3px 7px; | ||
font-size: @font-size-small; | ||
font-weight: @badge-font-weight; | ||
color: @badge-color; | ||
line-height: @badge-line-height; | ||
vertical-align: baseline; | ||
white-space: nowrap; | ||
text-align: center; | ||
background-color: @badge-bg; | ||
border-radius: @badge-border-radius; | ||
|
||
// Empty badges collapse automatically (not available in IE8) | ||
&:empty { | ||
display: none; | ||
} | ||
} | ||
|
||
// Hover state, but only for links | ||
a.badge { | ||
&:hover, | ||
&:focus { | ||
color: @badge-link-hover-color; | ||
text-decoration: none; | ||
cursor: pointer; | ||
} | ||
} | ||
|
||
// Quick fix for labels/badges in buttons | ||
.btn .badge { | ||
position: relative; | ||
top: -1px; | ||
} | ||
|
||
// Account for counters in navs | ||
a.list-group-item.active > .badge, | ||
.nav-pills > .active > a > .badge { | ||
color: @badge-active-color; | ||
background-color: @badge-active-bg; | ||
} | ||
.nav-pills > li > a > .badge { | ||
margin-left: 3px; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/*! | ||
* Bootstrap v3.0.0 | ||
* | ||
* Copyright 2013 Twitter, Inc | ||
* Licensed under the Apache License v2.0 | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Designed and built with all the love in the world by @mdo and @fat. | ||
*/ | ||
|
||
// Core variables and mixins | ||
|
||
@import "variables.less"; | ||
@import "mixins.less"; | ||
|
||
// Reset | ||
@import "normalize.less"; | ||
@import "print.less"; | ||
|
||
// Core CSS | ||
@import "scaffolding.less"; | ||
@import "type.less"; | ||
@import "code.less"; | ||
@import "grid.less"; | ||
@import "tables.less"; | ||
@import "forms.less"; | ||
@import "buttons.less"; | ||
|
||
// Components | ||
@import "component-animations.less"; | ||
@import "glyphicons.less"; | ||
@import "dropdowns.less"; | ||
@import "button-groups.less"; | ||
@import "input-groups.less"; | ||
@import "navs.less"; | ||
@import "navbar.less"; | ||
@import "breadcrumbs.less"; | ||
@import "pagination.less"; | ||
@import "pager.less"; | ||
@import "labels.less"; | ||
@import "badges.less"; | ||
@import "jumbotron.less"; | ||
@import "thumbnails.less"; | ||
@import "alerts.less"; | ||
@import "progress-bars.less"; | ||
@import "media.less"; | ||
@import "list-group.less"; | ||
@import "panels.less"; | ||
@import "wells.less"; | ||
@import "close.less"; | ||
|
||
// Components w/ JavaScript | ||
@import "modals.less"; | ||
@import "tooltip.less"; | ||
@import "popovers.less"; | ||
@import "carousel.less"; | ||
|
||
// Utility classes | ||
@import "utilities.less"; | ||
@import "responsive-utilities.less"; | ||
|
||
@import "bootswatch.less"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
// Simplex 3.0.0 | ||
// Bootswatch | ||
// ----------------------------------------------------- | ||
|
||
@import url("//fonts.googleapis.com/css?family=Josefin+Sans:300,400,700"); | ||
|
||
.btn-shadow(@color) { | ||
#gradient > .vertical-three-colors(lighten(@color, 15%), @color, 6%, darken(@color, 4%)); | ||
border: 1px solid darken(@color, 10%); | ||
} | ||
|
||
// Navbar ===================================================================== | ||
|
||
.navbar { | ||
border-bottom: 1px solid #dfdfdf; | ||
font-family: @font-family-alt; | ||
|
||
&-nav > li > a { | ||
padding-top: @navbar-padding-vertical + 2px; | ||
padding-bottom: @navbar-padding-vertical - 2px; | ||
} | ||
|
||
&-brand { | ||
padding: 14px 15px 8px; | ||
} | ||
} | ||
|
||
// Buttons ==================================================================== | ||
|
||
.btn { | ||
font-family: @font-family-alt; | ||
} | ||
|
||
.btn-default, | ||
.btn-default:hover { | ||
.btn-shadow(@btn-default-bg); | ||
} | ||
|
||
.btn-primary, | ||
.btn-primary:hover { | ||
.btn-shadow(@btn-primary-bg); | ||
} | ||
|
||
.btn-success, | ||
.btn-success:hover { | ||
.btn-shadow(@btn-success-bg); | ||
} | ||
|
||
.btn-info, | ||
.btn-info:hover { | ||
.btn-shadow(@btn-info-bg); | ||
} | ||
|
||
.btn-warning, | ||
.btn-warning:hover { | ||
.btn-shadow(@btn-warning-bg); | ||
} | ||
|
||
.btn-danger, | ||
.btn-danger:hover { | ||
.btn-shadow(@btn-danger-bg); | ||
} | ||
|
||
// Typography ================================================================= | ||
|
||
@font-family-alt: "Josefin Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; | ||
|
||
h1, h2, h3, h4, h5, h6 { | ||
font-family: @font-family-alt; | ||
} | ||
|
||
// Tables ===================================================================== | ||
|
||
// Forms ====================================================================== | ||
|
||
.has-warning { | ||
.help-block, | ||
.control-label { | ||
color: @brand-danger; | ||
} | ||
|
||
.form-control, | ||
.form-control:focus { | ||
border-color: @brand-danger; | ||
} | ||
} | ||
|
||
.has-error { | ||
.help-block, | ||
.control-label { | ||
color: @brand-primary; | ||
} | ||
|
||
.form-control, | ||
.form-control:focus { | ||
border-color: @brand-primary; | ||
} | ||
} | ||
|
||
.has-success { | ||
.help-block, | ||
.control-label { | ||
color: @brand-success; | ||
} | ||
|
||
.form-control, | ||
.form-control:focus { | ||
border-color: @brand-success; | ||
} | ||
} | ||
|
||
// Navs ======================================================================= | ||
|
||
.pagination { | ||
|
||
.active > a, | ||
.active > a:hover { | ||
border-color: #ddd; | ||
} | ||
} | ||
|
||
// Indicators ================================================================= | ||
|
||
// Progress bars ============================================================== | ||
|
||
// Containers ================================================================= |
Oops, something went wrong.