├── Procfile
├── .gitignore
├── public
├── img
│ ├── blog.png
│ ├── wine.png
│ ├── discuss.png
│ ├── github.png
│ ├── twitter.png
│ ├── download.png
│ ├── glyphicons-halflings.png
│ └── glyphicons-halflings-white.png
├── pics
│ ├── momo.jpg
│ ├── calera.jpg
│ ├── hugel.jpg
│ ├── ponzi.jpg
│ ├── shafer.jpg
│ ├── argiano.jpg
│ ├── bouscat.jpg
│ ├── capineto.png
│ ├── caronne.jpg
│ ├── dinastia.jpg
│ ├── ex_umbris.jpg
│ ├── fourvines.jpg
│ ├── generic.jpg
│ ├── lan_rioja.jpg
│ ├── margerum.jpg
│ ├── petalos.jpg
│ ├── quivira.jpg
│ ├── rex_hill.jpg
│ ├── viticcio.jpg
│ ├── block_nine.jpg
│ ├── le_doyenne.jpg
│ ├── morizottes.jpg
│ ├── saint_cosme.jpg
│ ├── waterbrook.jpg
│ ├── bodega_lurton.jpg
│ └── domaine_serene.jpg
├── css
│ ├── img
│ │ └── bg.jpg
│ ├── styles.css
│ ├── bootstrap-responsive.min.css
│ └── bootstrap-responsive.css
├── js
│ ├── views
│ │ ├── about.js
│ │ ├── home.js
│ │ ├── header.js
│ │ ├── paginator.js
│ │ ├── winelist.js
│ │ └── winedetails.js
│ ├── utils.js
│ ├── models
│ │ └── models.js
│ └── main.js
├── tpl
│ ├── WineListItemView.html
│ ├── AboutView.html
│ ├── HomeView.html
│ ├── HeaderView.html
│ └── WineView.html
├── index.html
├── dashboard.html
└── lib
│ ├── underscore-min.js
│ ├── backbone-min.js
│ └── bootstrap.min.js
├── package.json
├── server.js
├── readme.md
├── serverwithanalytics.js
└── routes
└── wines.js
/Procfile:
--------------------------------------------------------------------------------
1 | web: node serverwithanalytics.js
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /.idea
3 | Procfile
4 | .gitignore
5 |
--------------------------------------------------------------------------------
/public/img/blog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/img/blog.png
--------------------------------------------------------------------------------
/public/img/wine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/img/wine.png
--------------------------------------------------------------------------------
/public/pics/momo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/momo.jpg
--------------------------------------------------------------------------------
/public/css/img/bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/css/img/bg.jpg
--------------------------------------------------------------------------------
/public/img/discuss.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/img/discuss.png
--------------------------------------------------------------------------------
/public/img/github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/img/github.png
--------------------------------------------------------------------------------
/public/img/twitter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/img/twitter.png
--------------------------------------------------------------------------------
/public/pics/calera.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/calera.jpg
--------------------------------------------------------------------------------
/public/pics/hugel.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/hugel.jpg
--------------------------------------------------------------------------------
/public/pics/ponzi.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/ponzi.jpg
--------------------------------------------------------------------------------
/public/pics/shafer.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/shafer.jpg
--------------------------------------------------------------------------------
/public/img/download.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/img/download.png
--------------------------------------------------------------------------------
/public/pics/argiano.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/argiano.jpg
--------------------------------------------------------------------------------
/public/pics/bouscat.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/bouscat.jpg
--------------------------------------------------------------------------------
/public/pics/capineto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/capineto.png
--------------------------------------------------------------------------------
/public/pics/caronne.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/caronne.jpg
--------------------------------------------------------------------------------
/public/pics/dinastia.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/dinastia.jpg
--------------------------------------------------------------------------------
/public/pics/ex_umbris.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/ex_umbris.jpg
--------------------------------------------------------------------------------
/public/pics/fourvines.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/fourvines.jpg
--------------------------------------------------------------------------------
/public/pics/generic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/generic.jpg
--------------------------------------------------------------------------------
/public/pics/lan_rioja.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/lan_rioja.jpg
--------------------------------------------------------------------------------
/public/pics/margerum.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/margerum.jpg
--------------------------------------------------------------------------------
/public/pics/petalos.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/petalos.jpg
--------------------------------------------------------------------------------
/public/pics/quivira.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/quivira.jpg
--------------------------------------------------------------------------------
/public/pics/rex_hill.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/rex_hill.jpg
--------------------------------------------------------------------------------
/public/pics/viticcio.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/viticcio.jpg
--------------------------------------------------------------------------------
/public/pics/block_nine.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/block_nine.jpg
--------------------------------------------------------------------------------
/public/pics/le_doyenne.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/le_doyenne.jpg
--------------------------------------------------------------------------------
/public/pics/morizottes.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/morizottes.jpg
--------------------------------------------------------------------------------
/public/pics/saint_cosme.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/saint_cosme.jpg
--------------------------------------------------------------------------------
/public/pics/waterbrook.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/waterbrook.jpg
--------------------------------------------------------------------------------
/public/pics/bodega_lurton.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/bodega_lurton.jpg
--------------------------------------------------------------------------------
/public/pics/domaine_serene.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/pics/domaine_serene.jpg
--------------------------------------------------------------------------------
/public/img/glyphicons-halflings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/img/glyphicons-halflings.png
--------------------------------------------------------------------------------
/public/img/glyphicons-halflings-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/butchland/nodecellar/master/public/img/glyphicons-halflings-white.png
--------------------------------------------------------------------------------
/public/js/views/about.js:
--------------------------------------------------------------------------------
1 | window.AboutView = Backbone.View.extend({
2 |
3 | initialize:function () {
4 | this.render();
5 | },
6 |
7 | render:function () {
8 | $(this.el).html(this.template());
9 | return this;
10 | }
11 |
12 | });
--------------------------------------------------------------------------------
/public/js/views/home.js:
--------------------------------------------------------------------------------
1 | window.HomeView = Backbone.View.extend({
2 |
3 | initialize:function () {
4 | this.render();
5 | },
6 |
7 | render:function () {
8 | $(this.el).html(this.template());
9 | return this;
10 | }
11 |
12 | });
--------------------------------------------------------------------------------
/public/tpl/WineListItemView.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | <%= name %>
4 | <%= year %> <%= grapes %>
5 | <%= region %>, <%= country %>
6 |
7 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "wine-cellar",
3 | "description": "Wine Cellar Application",
4 | "version": "0.0.1",
5 | "private": true,
6 | "dependencies": {
7 | "express": "3.x",
8 | "mongodb": "1.1.8",
9 | "socket.io": "0.9.10"
10 | },
11 | "engines": {
12 | "node": "0.8.4",
13 | "npm": "1.1.49"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/public/js/views/header.js:
--------------------------------------------------------------------------------
1 | window.HeaderView = Backbone.View.extend({
2 |
3 | initialize: function () {
4 | this.render();
5 | },
6 |
7 | render: function () {
8 | $(this.el).html(this.template());
9 | return this;
10 | },
11 |
12 | selectMenuItem: function (menuItem) {
13 | $('.nav li').removeClass('active');
14 | if (menuItem) {
15 | $('.' + menuItem).addClass('active');
16 | }
17 | }
18 |
19 | });
--------------------------------------------------------------------------------
/public/js/views/paginator.js:
--------------------------------------------------------------------------------
1 | window.Paginator = Backbone.View.extend({
2 |
3 | className: "pagination pagination-centered",
4 |
5 | initialize:function () {
6 | this.model.bind("reset", this.render, this);
7 | this.render();
8 | },
9 |
10 | render:function () {
11 |
12 | var items = this.model.models;
13 | var len = items.length;
14 | var pageCount = Math.ceil(len / 8);
15 |
16 | $(this.el).html('
');
17 |
18 | for (var i=0; i < pageCount; i++) {
19 | $('ul', this.el).append("" + (i+1) + "");
20 | }
21 |
22 | return this;
23 | }
24 | });
--------------------------------------------------------------------------------
/server.js:
--------------------------------------------------------------------------------
1 | var express = require('express'),
2 | path = require('path'),
3 | http = require('http'),
4 | wine = require('./routes/wines');
5 |
6 | var app = express();
7 |
8 | app.configure(function () {
9 | app.set('port', process.env.PORT || 3000);
10 | app.use(express.logger('dev')); /* 'default', 'short', 'tiny', 'dev' */
11 | app.use(express.bodyParser()),
12 | app.use(express.static(path.join(__dirname, 'public')));
13 | });
14 |
15 | app.get('/wines', wine.findAll);
16 | app.get('/wines/:id', wine.findById);
17 | app.post('/wines', wine.addWine);
18 | app.put('/wines/:id', wine.updateWine);
19 | app.delete('/wines/:id', wine.deleteWine);
20 |
21 | http.createServer(app).listen(app.get('port'), function () {
22 | console.log("Express server listening on port " + app.get('port'));
23 | });
24 |
--------------------------------------------------------------------------------
/public/js/views/winelist.js:
--------------------------------------------------------------------------------
1 | window.WineListView = Backbone.View.extend({
2 |
3 | initialize: function () {
4 | this.render();
5 | },
6 |
7 | render: function () {
8 | var wines = this.model.models;
9 | var len = wines.length;
10 | var startPos = (this.options.page - 1) * 8;
11 | var endPos = Math.min(startPos + 8, len);
12 |
13 | $(this.el).html('');
14 |
15 | for (var i = startPos; i < endPos; i++) {
16 | $('.thumbnails', this.el).append(new WineListItemView({model: wines[i]}).render().el);
17 | }
18 |
19 | $(this.el).append(new Paginator({model: this.model, page: this.options.page}).render().el);
20 |
21 | return this;
22 | }
23 | });
24 |
25 | window.WineListItemView = Backbone.View.extend({
26 |
27 | tagName: "li",
28 |
29 | initialize: function () {
30 | this.model.bind("change", this.render, this);
31 | this.model.bind("destroy", this.close, this);
32 | },
33 |
34 | render: function () {
35 | $(this.el).html(this.template(this.model.toJSON()));
36 | return this;
37 | }
38 |
39 | });
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # Node Cellar Sample Application with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB #
2 |
3 | "Node Cellar" is a sample CRUD application built with with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB.
4 |
5 | The application allows you to browse through a list of wines, as well as add, update, and delete wines.
6 |
7 | This application is further documented [here](http://coenraets.org/blog).
8 |
9 | The application is also hosted online. You can test it [here](http://nodecellar.coenraets.org).
10 |
11 |
12 | ## To run the application on your own Heroku account:##
13 |
14 | 1. Install the [Heroku Toolbelt](http://toolbelt.heroku.com)
15 |
16 | 2. [Sign up](http://heroku.com/signup) for a Heroku account
17 |
18 | 3. Login to Heroku from the `heroku` CLI:
19 |
20 | $ heroku login
21 |
22 | 4. Create a new app on Heroku:
23 |
24 | $ heroku create
25 |
26 | 5. Add the [MongoLab Heroku Add-on](http://addons.heroku.com/mongolab)
27 |
28 | $ heroku addons:add mongolab
29 |
30 | 6. Upload the app to Heroku:
31 |
32 | $ git push heroku master
33 |
34 | 7. Open the app in your browser:
35 |
36 | $ heroku open
37 |
38 |
--------------------------------------------------------------------------------
/public/tpl/AboutView.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |

4 |
Download the source code
5 |
The source code for this application is available in this repository on GitHub.
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |

14 |
Comments and questions
15 |
I love to hear your feedback. Post your questions and comments on the blog post associated with this
16 | application.
17 |
18 |
19 |
20 |
21 |
22 |
23 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/public/js/utils.js:
--------------------------------------------------------------------------------
1 | window.utils = {
2 |
3 | // Asynchronously load templates located in separate .html files
4 | loadTemplate: function(views, callback) {
5 |
6 | var deferreds = [];
7 |
8 | $.each(views, function(index, view) {
9 | if (window[view]) {
10 | deferreds.push($.get('tpl/' + view + '.html', function(data) {
11 | window[view].prototype.template = _.template(data);
12 | }));
13 | } else {
14 | alert(view + " not found");
15 | }
16 | });
17 |
18 | $.when.apply(null, deferreds).done(callback);
19 | },
20 |
21 | displayValidationErrors: function (messages) {
22 | for (var key in messages) {
23 | if (messages.hasOwnProperty(key)) {
24 | this.addValidationError(key, messages[key]);
25 | }
26 | }
27 | this.showAlert('Warning!', 'Fix validation errors and try again', 'alert-warning');
28 | },
29 |
30 | addValidationError: function (field, message) {
31 | var controlGroup = $('#' + field).parent().parent();
32 | controlGroup.addClass('error');
33 | $('.help-inline', controlGroup).html(message);
34 | },
35 |
36 | removeValidationError: function (field) {
37 | var controlGroup = $('#' + field).parent().parent();
38 | controlGroup.removeClass('error');
39 | $('.help-inline', controlGroup).html('');
40 | },
41 |
42 | showAlert: function(title, text, klass) {
43 | $('.alert').removeClass("alert-error alert-warning alert-success alert-info");
44 | $('.alert').addClass(klass);
45 | $('.alert').html('' + title + ' ' + text);
46 | $('.alert').show();
47 | },
48 |
49 | hideAlert: function() {
50 | $('.alert').hide();
51 | }
52 |
53 | };
--------------------------------------------------------------------------------
/serverwithanalytics.js:
--------------------------------------------------------------------------------
1 | var express = require('express'),
2 | path = require('path'),
3 | http = require('http'),
4 | io = require('socket.io'),
5 | wine = require('./routes/wines');
6 |
7 | var app = express();
8 |
9 | app.configure(function () {
10 | app.set('port', process.env.PORT || 3000);
11 | app.use(express.logger('dev'));
12 | app.use(express.bodyParser())
13 | app.use(express.static(path.join(__dirname, 'public')));
14 | });
15 |
16 | var server = http.createServer(app);
17 | io = io.listen(server);
18 |
19 |
20 | io.configure(function () {
21 | io.set('authorization', function (handshakeData, callback) {
22 | if (handshakeData.xdomain) {
23 | callback('Cross-domain connections are not allowed');
24 | } else {
25 | callback(null, true);
26 | }
27 | });
28 | });
29 |
30 | server.listen(app.get('port'), function () {
31 | console.log("Express server listening on port " + app.get('port'));
32 | });
33 |
34 | app.get('/wines', wine.findAll);
35 | app.get('/wines/:id', wine.findById);
36 | app.post('/wines', wine.addWine);
37 | app.put('/wines/:id', wine.updateWine);
38 | app.delete('/wines/:id', wine.deleteWine);
39 |
40 | io.sockets.on('connection', function (socket) {
41 |
42 | socket.on('message', function (message) {
43 | console.log("Got message: " + message);
44 | ip = socket.handshake.address.address;
45 | url = message;
46 | io.sockets.emit('pageview', { 'connections': Object.keys(io.connected).length, 'ip': '***.***.***.' + ip.substring(ip.lastIndexOf('.') + 1), 'url': url, 'xdomain': socket.handshake.xdomain, 'timestamp': new Date()});
47 | });
48 |
49 | socket.on('disconnect', function () {
50 | console.log("Socket disconnected");
51 | io.sockets.emit('pageview', { 'connections': Object.keys(io.connected).length});
52 | });
53 |
54 | });
--------------------------------------------------------------------------------
/public/js/models/models.js:
--------------------------------------------------------------------------------
1 | window.Wine = Backbone.Model.extend({
2 |
3 | urlRoot: "/wines",
4 |
5 | idAttribute: "_id",
6 |
7 | initialize: function () {
8 | this.validators = {};
9 |
10 | this.validators.name = function (value) {
11 | return value.length > 0 ? {isValid: true} : {isValid: false, message: "You must enter a name"};
12 | };
13 |
14 | this.validators.grapes = function (value) {
15 | return value.length > 0 ? {isValid: true} : {isValid: false, message: "You must enter a grape variety"};
16 | };
17 |
18 | this.validators.country = function (value) {
19 | return value.length > 0 ? {isValid: true} : {isValid: false, message: "You must enter a country"};
20 | };
21 | },
22 |
23 | validateItem: function (key) {
24 | return (this.validators[key]) ? this.validators[key](this.get(key)) : {isValid: true};
25 | },
26 |
27 | // TODO: Implement Backbone's standard validate() method instead.
28 | validateAll: function () {
29 |
30 | var messages = {};
31 |
32 | for (var key in this.validators) {
33 | if(this.validators.hasOwnProperty(key)) {
34 | var check = this.validators[key](this.get(key));
35 | if (check.isValid === false) {
36 | messages[key] = check.message;
37 | }
38 | }
39 | }
40 |
41 | return _.size(messages) > 0 ? {isValid: false, messages: messages} : {isValid: true};
42 | },
43 |
44 | defaults: {
45 | _id: null,
46 | name: "",
47 | grapes: "",
48 | country: "USA",
49 | region: "California",
50 | year: "",
51 | description: "",
52 | picture: null
53 | }
54 | });
55 |
56 | window.WineCollection = Backbone.Collection.extend({
57 |
58 | model: Wine,
59 |
60 | url: "/wines"
61 |
62 | });
--------------------------------------------------------------------------------
/public/tpl/HomeView.html:
--------------------------------------------------------------------------------
1 |
2 |
Welcome to Node Cellar
3 |
A sample application built with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB
4 |
5 |
6 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/public/js/main.js:
--------------------------------------------------------------------------------
1 | var AppRouter = Backbone.Router.extend({
2 |
3 | routes: {
4 | "" : "home",
5 | "wines" : "list",
6 | "wines/page/:page" : "list",
7 | "wines/add" : "addWine",
8 | "wines/:id" : "wineDetails",
9 | "about" : "about"
10 | },
11 |
12 | initialize: function () {
13 | this.headerView = new HeaderView();
14 | $('.header').html(this.headerView.el);
15 | },
16 |
17 | home: function (id) {
18 | if (!this.homeView) {
19 | this.homeView = new HomeView();
20 | }
21 | $('#content').html(this.homeView.el);
22 | this.headerView.selectMenuItem('home-menu');
23 | },
24 |
25 | list: function(page) {
26 | var p = page ? parseInt(page, 10) : 1;
27 | var wineList = new WineCollection();
28 | wineList.fetch({success: function(){
29 | $("#content").html(new WineListView({model: wineList, page: p}).el);
30 | }});
31 | this.headerView.selectMenuItem('home-menu');
32 | },
33 |
34 | wineDetails: function (id) {
35 | var wine = new Wine({_id: id});
36 | wine.fetch({success: function(){
37 | $("#content").html(new WineView({model: wine}).el);
38 | }});
39 | this.headerView.selectMenuItem();
40 | },
41 |
42 | addWine: function() {
43 | var wine = new Wine();
44 | $('#content').html(new WineView({model: wine}).el);
45 | this.headerView.selectMenuItem('add-menu');
46 | },
47 |
48 | about: function () {
49 | if (!this.aboutView) {
50 | this.aboutView = new AboutView();
51 | }
52 | $('#content').html(this.aboutView.el);
53 | this.headerView.selectMenuItem('about-menu');
54 | }
55 |
56 | });
57 |
58 | utils.loadTemplate(['HomeView', 'HeaderView', 'WineView', 'WineListItemView', 'AboutView'], function() {
59 | app = new AppRouter();
60 | Backbone.history.start();
61 | });
--------------------------------------------------------------------------------
/public/tpl/HeaderView.html:
--------------------------------------------------------------------------------
1 |
41 |
--------------------------------------------------------------------------------
/public/css/styles.css:
--------------------------------------------------------------------------------
1 | .brand {
2 | font-family: 'Arvo';
3 | }
4 |
5 | a.plain:link {
6 | color: #333;
7 | text-decoration: none;
8 | }
9 |
10 | a.plain:active {
11 | color: #333;
12 | text-decoration: none;
13 | }
14 |
15 | a.plain:visited {
16 | color: #333;
17 | text-decoration: none;
18 | }
19 |
20 | a.plain:hover {
21 | color: #333;
22 | text-decoration: none;
23 | }
24 |
25 | .status-bar {
26 | height: 60px;
27 | }
28 |
29 | .about-icon {
30 | float: left;
31 | margin-right: 12px;
32 | }
33 |
34 | .footer {
35 | margin-top: 30px;
36 | padding-top: 10px;
37 | color: #999;
38 | border-top: solid 1px #ddd;
39 | }
40 |
41 | .footer > p {
42 | padding-top: 4px !important;
43 | padding-bottom: 4px !important;
44 | }
45 |
46 | h5 {
47 | width: 100%;
48 | white-space: nowrap;
49 | margin-bottom: 4px;
50 | }
51 |
52 | .thumbnail {
53 | min-width: 260px;
54 | }
55 |
56 | .thumbnails li {
57 | margin-left: 0px !important;
58 | margin-right: 20px !important;
59 | }
60 |
61 | legend {
62 | font-family: 'Andika';
63 | }
64 |
65 | .home-hero {
66 | font-family: "Andika";
67 | font-size: 36;
68 | color: white;
69 | background-image: url('img/bg.jpg');
70 | background-size: cover;
71 | background-repeat: no-repeat;
72 | margin-top: -19px;
73 | padding: 180px;
74 | text-align : center;
75 | text-shadow: 1px 1px 1px #000;
76 | }
77 |
78 | @media only screen and ( max-width : 1000px ) {
79 | .home-hero {
80 | padding:100px;
81 | }
82 | }
83 |
84 | @media only screen and ( max-width : 480px ) {
85 | .home-hero {
86 | padding:32px;
87 | }
88 | }
89 |
90 |
91 | .home-hero .btn {
92 | font-family: "arvo";
93 | width: 160px;
94 | margin: 10px 4px;
95 | }
96 |
97 | /* Social proof buttons from GitHub & Twitter */
98 | .bs-docs-social {
99 | padding: 15px 0;
100 | text-align: center;
101 | background-color: #f5f5f5;
102 | border-top: 1px solid #fff;
103 | border-bottom: 1px solid #ddd;
104 | }
105 |
106 | /* Quick links on Home */
107 | .bs-docs-social-buttons {
108 | margin-left: 0;
109 | margin-bottom: 0;
110 | padding-left: 0;
111 | list-style: none;
112 | }
113 |
114 | .bs-docs-social-buttons li {
115 | display: inline-block;
116 | padding: 5px 8px;
117 | line-height: 1;
118 | *display: inline;
119 | *zoom: 1;
120 | }
121 |
122 | .well h3 {
123 | margin-top: 0px;
124 | margin-bottom: 0px;
125 | }
126 |
--------------------------------------------------------------------------------
/public/js/views/winedetails.js:
--------------------------------------------------------------------------------
1 | window.WineView = Backbone.View.extend({
2 |
3 | initialize: function () {
4 | this.render();
5 | },
6 |
7 | render: function () {
8 | $(this.el).html(this.template(this.model.toJSON()));
9 | return this;
10 | },
11 |
12 | events: {
13 | "change" : "change",
14 | "click .save" : "beforeSave",
15 | "click .delete" : "deleteWine",
16 | "drop #picture" : "dropHandler"
17 | },
18 |
19 | change: function (event) {
20 | // Remove any existing alert message
21 | utils.hideAlert();
22 |
23 | // Apply the change to the model
24 | var target = event.target;
25 | var change = {};
26 | change[target.name] = target.value;
27 | this.model.set(change);
28 |
29 | // Run validation rule (if any) on changed item
30 | var check = this.model.validateItem(target.id);
31 | if (check.isValid === false) {
32 | utils.addValidationError(target.id, check.message);
33 | } else {
34 | utils.removeValidationError(target.id);
35 | }
36 | },
37 |
38 | beforeSave: function () {
39 | var self = this;
40 | var check = this.model.validateAll();
41 | if (check.isValid === false) {
42 | utils.displayValidationErrors(check.messages);
43 | return false;
44 | }
45 | this.saveWine();
46 | return false;
47 | },
48 |
49 | saveWine: function () {
50 | var self = this;
51 | console.log('before save');
52 | this.model.save(null, {
53 | success: function (model) {
54 | self.render();
55 | app.navigate('wines/' + model.id, false);
56 | utils.showAlert('Success!', 'Wine saved successfully', 'alert-success');
57 | },
58 | error: function () {
59 | utils.showAlert('Error', 'An error occurred while trying to delete this item', 'alert-error');
60 | }
61 | });
62 | },
63 |
64 | deleteWine: function () {
65 | this.model.destroy({
66 | success: function () {
67 | alert('Wine deleted successfully');
68 | window.history.back();
69 | }
70 | });
71 | return false;
72 | },
73 |
74 | dropHandler: function (event) {
75 | event.stopPropagation();
76 | event.preventDefault();
77 | var e = event.originalEvent;
78 | e.dataTransfer.dropEffect = 'copy';
79 | this.pictureFile = e.dataTransfer.files[0];
80 |
81 | // Read the image file from the local file system and display it in the img tag
82 | var reader = new FileReader();
83 | reader.onloadend = function () {
84 | $('#picture').attr('src', reader.result);
85 | };
86 | reader.readAsDataURL(this.pictureFile);
87 | }
88 |
89 | });
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Node Cellar
6 |
7 |
8 |
9 |
10 |
11 |
12 |
17 |
18 |
19 |
20 |
21 |
24 |
25 |
26 |
27 |
28 |
29 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
51 |
52 |
62 |
63 |
64 |
65 |
66 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/public/dashboard.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Node Cellar
6 |
7 |
8 |
9 |
10 |
11 |
12 |
17 |
18 |
19 |
20 |
21 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
Right Now
53 |
0
54 |
active visitors
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 | | URL | IP | Timestamp |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 | | URL | Page Views |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
131 |
132 |
133 |
--------------------------------------------------------------------------------
/public/tpl/WineView.html:
--------------------------------------------------------------------------------
1 |
108 |
109 |
110 |
111 |
112 | Success! Wine saved successfully
113 |
114 |
115 |
--------------------------------------------------------------------------------
/public/lib/underscore-min.js:
--------------------------------------------------------------------------------
1 | // Underscore.js 1.4.1
2 | // http://underscorejs.org
3 | // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
4 | // Underscore may be freely distributed under the MIT license.
5 | (function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=r.unshift,l=i.toString,c=i.hasOwnProperty,h=r.forEach,p=r.map,d=r.reduce,v=r.reduceRight,m=r.filter,g=r.every,y=r.some,b=r.indexOf,w=r.lastIndexOf,E=Array.isArray,S=Object.keys,x=s.bind,T=function(e){if(e instanceof T)return e;if(!(this instanceof T))return new T(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=T),exports._=T):e._=T,T.VERSION="1.4.1";var N=T.each=T.forEach=function(e,t,r){if(h&&e.forEach===h)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i2;if(d&&e.reduce===d)return r&&(t=T.bind(t,r)),i?e.reduce(t,n):e.reduce(t);N(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError("Reduce of empty array with no initial value");return n},T.reduceRight=T.foldr=function(e,t,n,r){var i=arguments.length>2;if(v&&e.reduceRight===v)return r&&(t=T.bind(t,r)),arguments.length>2?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=T.keys(e);s=o.length}N(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError("Reduce of empty array with no initial value");return n},T.find=T.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},T.filter=T.select=function(e,t,n){var r=[];return m&&e.filter===m?e.filter(t,n):(N(e,function(e,i,s){t.call(n,e,i,s)&&(r[r.length]=e)}),r)},T.reject=function(e,t,n){var r=[];return N(e,function(e,i,s){t.call(n,e,i,s)||(r[r.length]=e)}),r},T.every=T.all=function(e,t,r){t||(t=T.identity);var i=!0;return g&&e.every===g?e.every(t,r):(N(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=T.some=T.any=function(e,t,r){t||(t=T.identity);var i=!1;return y&&e.some===y?e.some(t,r):(N(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};T.contains=T.include=function(e,t){var n=!1;return b&&e.indexOf===b?e.indexOf(t)!=-1:(n=C(e,function(e){return e===t}),n)},T.invoke=function(e,t){var n=u.call(arguments,2);return T.map(e,function(e){return(T.isFunction(t)?t:e[t]).apply(e,n)})},T.pluck=function(e,t){return T.map(e,function(e){return e[t]})},T.where=function(e,t){return T.isEmpty(t)?[]:T.filter(e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},T.max=function(e,t,n){if(!t&&T.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&T.isEmpty(e))return-Infinity;var r={computed:-Infinity};return N(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>=r.computed&&(r={value:e,computed:o})}),r.value},T.min=function(e,t,n){if(!t&&T.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&T.isEmpty(e))return Infinity;var r={computed:Infinity};return N(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;or||n===void 0)return 1;if(n>>1;n.call(r,e[u])=0})})},T.difference=function(e){var t=a.apply(r,u.call(arguments,1));return T.filter(e,function(e){return!T.contains(t,e)})},T.zip=function(){var e=u.call(arguments),t=T.max(T.pluck(e,"length")),n=new Array(t);for(var r=0;r=0;n--)t=[e[n].apply(this,t)];return t[0]}},T.after=function(e,t){return e<=0?t():function(){if(--e<1)return t.apply(this,arguments)}},T.keys=S||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)T.has(e,n)&&(t[t.length]=n);return t},T.values=function(e){var t=[];for(var n in e)T.has(e,n)&&t.push(e[n]);return t},T.pairs=function(e){var t=[];for(var n in e)T.has(e,n)&&t.push([n,e[n]]);return t},T.invert=function(e){var t={};for(var n in e)T.has(e,n)&&(t[e[n]]=n);return t},T.functions=T.methods=function(e){var t=[];for(var n in e)T.isFunction(e[n])&&t.push(n);return t.sort()},T.extend=function(e){return N(u.call(arguments,1),function(t){for(var n in t)e[n]=t[n]}),e},T.pick=function(e){var t={},n=a.apply(r,u.call(arguments,1));return N(n,function(n){n in e&&(t[n]=e[n])}),t},T.omit=function(e){var t={},n=a.apply(r,u.call(arguments,1));for(var i in e)T.contains(n,i)||(t[i]=e[i]);return t},T.defaults=function(e){return N(u.call(arguments,1),function(t){for(var n in t)e[n]==null&&(e[n]=t[n])}),e},T.clone=function(e){return T.isObject(e)?T.isArray(e)?e.slice():T.extend({},e):e},T.tap=function(e,t){return t(e),e};var M=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof T&&(e=e._wrapped),t instanceof T&&(t=t._wrapped);var i=l.call(e);if(i!=l.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;n.push(e),r.push(t);var o=0,u=!0;if(i=="[object Array]"){o=e.length,u=o==t.length;if(u)while(o--)if(!(u=M(e[o],t[o],n,r)))break}else{var a=e.constructor,f=t.constructor;if(a!==f&&!(T.isFunction(a)&&a instanceof a&&T.isFunction(f)&&f instanceof f))return!1;for(var c in e)if(T.has(e,c)){o++;if(!(u=T.has(t,c)&&M(e[c],t[c],n,r)))break}if(u){for(c in t)if(T.has(t,c)&&!(o--))break;u=!o}}return n.pop(),r.pop(),u};T.isEqual=function(e,t){return M(e,t,[],[])},T.isEmpty=function(e){if(e==null)return!0;if(T.isArray(e)||T.isString(e))return e.length===0;for(var t in e)if(T.has(e,t))return!1;return!0},T.isElement=function(e){return!!e&&e.nodeType===1},T.isArray=E||function(e){return l.call(e)=="[object Array]"},T.isObject=function(e){return e===Object(e)},N(["Arguments","Function","String","Number","Date","RegExp"],function(e){T["is"+e]=function(t){return l.call(t)=="[object "+e+"]"}}),T.isArguments(arguments)||(T.isArguments=function(e){return!!e&&!!T.has(e,"callee")}),typeof /./!="function"&&(T.isFunction=function(e){return typeof e=="function"}),T.isFinite=function(e){return T.isNumber(e)&&isFinite(e)},T.isNaN=function(e){return T.isNumber(e)&&e!=+e},T.isBoolean=function(e){return e===!0||e===!1||l.call(e)=="[object Boolean]"},T.isNull=function(e){return e===null},T.isUndefined=function(e){return e===void 0},T.has=function(e,t){return c.call(e,t)},T.noConflict=function(){return e._=t,this},T.identity=function(e){return e},T.times=function(e,t,n){for(var r=0;r":">",'"':""","'":"'","/":"/"}};_.unescape=T.invert(_.escape);var D={escape:new RegExp("["+T.keys(_.escape).join("")+"]","g"),unescape:new RegExp("("+T.keys(_.unescape).join("|")+")","g")};T.each(["escape","unescape"],function(e){T[e]=function(t){return t==null?"":(""+t).replace(D[e],function(t){return _[e][t]})}}),T.result=function(e,t){if(e==null)return null;var n=e[t];return T.isFunction(n)?n.call(e):n},T.mixin=function(e){N(T.functions(e),function(t){var n=T[t]=e[t];T.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),F.call(this,n.apply(T,e))}})};var P=0;T.uniqueId=function(e){var t=P++;return e?e+t:t},T.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var H=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},j=/\\|'|\r|\n|\t|\u2028|\u2029/g;T.template=function(e,t,n){n=T.defaults({},n,T.templateSettings);var r=new RegExp([(n.escape||H).source,(n.interpolate||H).source,(n.evaluate||H).source].join("|")+"|$","g"),i=0,s="__p+='";e.replace(r,function(t,n,r,o,u){s+=e.slice(i,u).replace(j,function(e){return"\\"+B[e]}),s+=n?"'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?"'+\n((__t=("+r+"))==null?'':__t)+\n'":o?"';\n"+o+"\n__p+='":"",i=u+t.length}),s+="';\n",n.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{var o=new Function(n.variable||"obj","_",s)}catch(u){throw u.source=s,u}if(t)return o(t,T);var a=function(e){return o.call(this,e,T)};return a.source="function("+(n.variable||"obj")+"){\n"+s+"}",a},T.chain=function(e){return T(e).chain()};var F=function(e){return this._chain?T(e).chain():e};T.mixin(T),N(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];T.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],F.call(this,n)}}),N(["concat","join","slice"],function(e){var t=r[e];T.prototype[e]=function(){return F.call(this,t.apply(this._wrapped,arguments))}}),T.extend(T.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this);
--------------------------------------------------------------------------------
/routes/wines.js:
--------------------------------------------------------------------------------
1 | var mongo = require('mongodb');
2 |
3 | var Server = mongo.Server,
4 | Db = mongo.Db,
5 | BSON = mongo.BSONPure;
6 |
7 | var server = new Server('localhost', 27017, {auto_reconnect: true});
8 | db = new Db('winedb', server, {safe: true});
9 |
10 | db.open(function(err, db) {
11 | if(!err) {
12 | console.log("Connected to 'winedb' database");
13 | db.collection('wines', {safe:true}, function(err, collection) {
14 | if (err) {
15 | console.log("The 'wines' collection doesn't exist. Creating it with sample data...");
16 | populateDB();
17 | }
18 | });
19 | }
20 | });
21 |
22 | exports.findById = function(req, res) {
23 | var id = req.params.id;
24 | console.log('Retrieving wine: ' + id);
25 | db.collection('wines', function(err, collection) {
26 | collection.findOne({'_id':new BSON.ObjectID(id)}, function(err, item) {
27 | res.send(item);
28 | });
29 | });
30 | };
31 |
32 | exports.findAll = function(req, res) {
33 | db.collection('wines', function(err, collection) {
34 | collection.find().toArray(function(err, items) {
35 | res.send(items);
36 | });
37 | });
38 | };
39 |
40 | exports.addWine = function(req, res) {
41 | var wine = req.body;
42 | console.log('Adding wine: ' + JSON.stringify(wine));
43 | db.collection('wines', function(err, collection) {
44 | collection.insert(wine, {safe:true}, function(err, result) {
45 | if (err) {
46 | res.send({'error':'An error has occurred'});
47 | } else {
48 | console.log('Success: ' + JSON.stringify(result[0]));
49 | res.send(result[0]);
50 | }
51 | });
52 | });
53 | }
54 |
55 | exports.updateWine = function(req, res) {
56 | var id = req.params.id;
57 | var wine = req.body;
58 | delete wine._id;
59 | console.log('Updating wine: ' + id);
60 | console.log(JSON.stringify(wine));
61 | db.collection('wines', function(err, collection) {
62 | collection.update({'_id':new BSON.ObjectID(id)}, wine, {safe:true}, function(err, result) {
63 | if (err) {
64 | console.log('Error updating wine: ' + err);
65 | res.send({'error':'An error has occurred'});
66 | } else {
67 | console.log('' + result + ' document(s) updated');
68 | res.send(wine);
69 | }
70 | });
71 | });
72 | }
73 |
74 | exports.deleteWine = function(req, res) {
75 | var id = req.params.id;
76 | console.log('Deleting wine: ' + id);
77 | db.collection('wines', function(err, collection) {
78 | collection.remove({'_id':new BSON.ObjectID(id)}, {safe:true}, function(err, result) {
79 | if (err) {
80 | res.send({'error':'An error has occurred - ' + err});
81 | } else {
82 | console.log('' + result + ' document(s) deleted');
83 | res.send(req.body);
84 | }
85 | });
86 | });
87 | }
88 |
89 | /*--------------------------------------------------------------------------------------------------------------------*/
90 | // Populate database with sample data -- Only used once: the first time the application is started.
91 | // You'd typically not find this code in a real-life app, since the database would already exist.
92 | var populateDB = function() {
93 |
94 | var wines = [
95 | {
96 | name: "CHATEAU DE SAINT COSME",
97 | year: "2009",
98 | grapes: "Grenache / Syrah",
99 | country: "France",
100 | region: "Southern Rhone",
101 | description: "The aromas of fruit and spice give one a hint of the light drinkability of this lovely wine, which makes an excellent complement to fish dishes.",
102 | picture: "saint_cosme.jpg"
103 | },
104 | {
105 | name: "LAN RIOJA CRIANZA",
106 | year: "2006",
107 | grapes: "Tempranillo",
108 | country: "Spain",
109 | region: "Rioja",
110 | description: "A resurgence of interest in boutique vineyards has opened the door for this excellent foray into the dessert wine market. Light and bouncy, with a hint of black truffle, this wine will not fail to tickle the taste buds.",
111 | picture: "lan_rioja.jpg"
112 | },
113 | {
114 | name: "MARGERUM SYBARITE",
115 | year: "2010",
116 | grapes: "Sauvignon Blanc",
117 | country: "USA",
118 | region: "California Central Cosat",
119 | description: "The cache of a fine Cabernet in ones wine cellar can now be replaced with a childishly playful wine bubbling over with tempting tastes of black cherry and licorice. This is a taste sure to transport you back in time.",
120 | picture: "margerum.jpg"
121 | },
122 | {
123 | name: "OWEN ROE \"EX UMBRIS\"",
124 | year: "2009",
125 | grapes: "Syrah",
126 | country: "USA",
127 | region: "Washington",
128 | description: "A one-two punch of black pepper and jalapeno will send your senses reeling, as the orange essence snaps you back to reality. Don't miss this award-winning taste sensation.",
129 | picture: "ex_umbris.jpg"
130 | },
131 | {
132 | name: "REX HILL",
133 | year: "2009",
134 | grapes: "Pinot Noir",
135 | country: "USA",
136 | region: "Oregon",
137 | description: "One cannot doubt that this will be the wine served at the Hollywood award shows, because it has undeniable star power. Be the first to catch the debut that everyone will be talking about tomorrow.",
138 | picture: "rex_hill.jpg"
139 | },
140 | {
141 | name: "VITICCIO CLASSICO RISERVA",
142 | year: "2007",
143 | grapes: "Sangiovese Merlot",
144 | country: "Italy",
145 | region: "Tuscany",
146 | description: "Though soft and rounded in texture, the body of this wine is full and rich and oh-so-appealing. This delivery is even more impressive when one takes note of the tender tannins that leave the taste buds wholly satisfied.",
147 | picture: "viticcio.jpg"
148 | },
149 | {
150 | name: "CHATEAU LE DOYENNE",
151 | year: "2005",
152 | grapes: "Merlot",
153 | country: "France",
154 | region: "Bordeaux",
155 | description: "Though dense and chewy, this wine does not overpower with its finely balanced depth and structure. It is a truly luxurious experience for the senses.",
156 | picture: "le_doyenne.jpg"
157 | },
158 | {
159 | name: "DOMAINE DU BOUSCAT",
160 | year: "2009",
161 | grapes: "Merlot",
162 | country: "France",
163 | region: "Bordeaux",
164 | description: "The light golden color of this wine belies the bright flavor it holds. A true summer wine, it begs for a picnic lunch in a sun-soaked vineyard.",
165 | picture: "bouscat.jpg"
166 | },
167 | {
168 | name: "BLOCK NINE",
169 | year: "2009",
170 | grapes: "Pinot Noir",
171 | country: "USA",
172 | region: "California",
173 | description: "With hints of ginger and spice, this wine makes an excellent complement to light appetizer and dessert fare for a holiday gathering.",
174 | picture: "block_nine.jpg"
175 | },
176 | {
177 | name: "DOMAINE SERENE",
178 | year: "2007",
179 | grapes: "Pinot Noir",
180 | country: "USA",
181 | region: "Oregon",
182 | description: "Though subtle in its complexities, this wine is sure to please a wide range of enthusiasts. Notes of pomegranate will delight as the nutty finish completes the picture of a fine sipping experience.",
183 | picture: "domaine_serene.jpg"
184 | },
185 | {
186 | name: "BODEGA LURTON",
187 | year: "2011",
188 | grapes: "Pinot Gris",
189 | country: "Argentina",
190 | region: "Mendoza",
191 | description: "Solid notes of black currant blended with a light citrus make this wine an easy pour for varied palates.",
192 | picture: "bodega_lurton.jpg"
193 | },
194 | {
195 | name: "LES MORIZOTTES",
196 | year: "2009",
197 | grapes: "Chardonnay",
198 | country: "France",
199 | region: "Burgundy",
200 | description: "Breaking the mold of the classics, this offering will surprise and undoubtedly get tongues wagging with the hints of coffee and tobacco in perfect alignment with more traditional notes. Sure to please the late-night crowd with the slight jolt of adrenaline it brings.",
201 | picture: "morizottes.jpg"
202 | },
203 | {
204 | name: "ARGIANO NON CONFUNDITUR",
205 | year: "2009",
206 | grapes: "Cabernet Sauvignon",
207 | country: "Italy",
208 | region: "Tuscany",
209 | description: "Like a symphony, this cabernet has a wide range of notes that will delight the taste buds and linger in the mind.",
210 | picture: "argiano.jpg"
211 | },
212 | {
213 | name: "DINASTIA VIVANCO ",
214 | year: "2008",
215 | grapes: "Tempranillo",
216 | country: "Spain",
217 | region: "Rioja",
218 | description: "Whether enjoying a fine cigar or a nicotine patch, don't pass up a taste of this hearty Rioja, both smooth and robust.",
219 | picture: "dinastia.jpg"
220 | },
221 | {
222 | name: "PETALOS BIERZO",
223 | year: "2009",
224 | grapes: "Mencia",
225 | country: "Spain",
226 | region: "Castilla y Leon",
227 | description: "For the first time, a blend of grapes from two different regions have been combined in an outrageous explosion of flavor that cannot be missed.",
228 | picture: "petalos.jpg"
229 | },
230 | {
231 | name: "SHAFER RED SHOULDER RANCH",
232 | year: "2009",
233 | grapes: "Chardonnay",
234 | country: "USA",
235 | region: "California",
236 | description: "Keep an eye out for this winery in coming years, as their chardonnays have reached the peak of perfection.",
237 | picture: "shafer.jpg"
238 | },
239 | {
240 | name: "PONZI",
241 | year: "2010",
242 | grapes: "Pinot Gris",
243 | country: "USA",
244 | region: "Oregon",
245 | description: "For those who appreciate the simpler pleasures in life, this light pinot grigio will blend perfectly with a light meal or as an after dinner drink.",
246 | picture: "ponzi.jpg"
247 | },
248 | {
249 | name: "HUGEL",
250 | year: "2010",
251 | grapes: "Pinot Gris",
252 | country: "France",
253 | region: "Alsace",
254 | description: "Fresh as new buds on a spring vine, this dewy offering is the finest of the new generation of pinot grigios. Enjoy it with a friend and a crown of flowers for the ultimate wine tasting experience.",
255 | picture: "hugel.jpg"
256 | },
257 | {
258 | name: "FOUR VINES MAVERICK",
259 | year: "2011",
260 | grapes: "Zinfandel",
261 | country: "USA",
262 | region: "California",
263 | description: "o yourself a favor and have a bottle (or two) of this fine zinfandel on hand for your next romantic outing. The only thing that can make this fine choice better is the company you share it with.",
264 | picture: "fourvines.jpg"
265 | },
266 | {
267 | name: "QUIVIRA DRY CREEK VALLEY",
268 | year: "2009",
269 | grapes: "Zinfandel",
270 | country: "USA",
271 | region: "California",
272 | description: "Rarely do you find a zinfandel this oakey from the Sonoma region. The vintners have gone to extremes to duplicate the classic flavors that brought high praise in the early '90s.",
273 | picture: "quivira.jpg"
274 | },
275 | {
276 | name: "CALERA 35TH ANNIVERSARY",
277 | year: "2010",
278 | grapes: "Pinot Noir",
279 | country: "USA",
280 | region: "California",
281 | description: "Fruity and bouncy, with a hint of spice, this pinot noir is an excellent candidate for best newcomer from Napa this year.",
282 | picture: "calera.jpg"
283 | },
284 | {
285 | name: "CHATEAU CARONNE STE GEMME",
286 | year: "2010",
287 | grapes: "Cabernet Sauvignon",
288 | country: "France",
289 | region: "Bordeaux",
290 | description: "Find a sommelier with a taste for chocolate and he's guaranteed to have this cabernet on his must-have list.",
291 | picture: "caronne.jpg"
292 | },
293 | {
294 | name: "MOMO MARLBOROUGH",
295 | year: "2010",
296 | grapes: "Sauvignon Blanc",
297 | country: "New Zealand",
298 | region: "South Island",
299 | description: "Best served chilled with melon or a nice salty prosciutto, this sauvignon blanc is a staple in every Italian kitchen, if not on their wine list. Request the best, and you just may get it.",
300 | picture: "momo.jpg"
301 | },
302 | {
303 | name: "WATERBROOK",
304 | year: "2009",
305 | grapes: "Merlot",
306 | country: "USA",
307 | region: "Washington",
308 | description: "Legend has it the gods didn't share their ambrosia with mere mortals. This merlot may be the closest we've ever come to a taste of heaven.",
309 | picture: "waterbrook.jpg"
310 | }];
311 |
312 | db.collection('wines', function(err, collection) {
313 | collection.insert(wines, {safe:true}, function(err, result) {});
314 | });
315 |
316 | };
--------------------------------------------------------------------------------
/public/css/bootstrap-responsive.min.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap Responsive v2.1.1
3 | *
4 | * Copyright 2012 Twitter, Inc
5 | * Licensed under the Apache License v2.0
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Designed and built with all the love in the world @twitter by @mdo and @fat.
9 | */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade.in{top:auto}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .dropdown-menu a:hover{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:hover{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:block;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}}
10 |
--------------------------------------------------------------------------------
/public/lib/backbone-min.js:
--------------------------------------------------------------------------------
1 | // Backbone.js 0.9.2
2 |
3 | // (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
4 | // Backbone may be freely distributed under the MIT license.
5 | // For all details and documentation:
6 | // http://backbonejs.org
7 | (function(){var l=this,y=l.Backbone,z=Array.prototype.slice,A=Array.prototype.splice,g;g="undefined"!==typeof exports?exports:l.Backbone={};g.VERSION="0.9.2";var f=l._;!f&&"undefined"!==typeof require&&(f=require("underscore"));var i=l.jQuery||l.Zepto||l.ender;g.setDomLibrary=function(a){i=a};g.noConflict=function(){l.Backbone=y;return this};g.emulateHTTP=!1;g.emulateJSON=!1;var p=/\s+/,k=g.Events={on:function(a,b,c){var d,e,f,g,j;if(!b)return this;a=a.split(p);for(d=this._callbacks||(this._callbacks=
8 | {});e=a.shift();)f=(j=d[e])?j.tail:{},f.next=g={},f.context=c,f.callback=b,d[e]={tail:g,next:j?j.next:f};return this},off:function(a,b,c){var d,e,h,g,j,q;if(e=this._callbacks){if(!a&&!b&&!c)return delete this._callbacks,this;for(a=a?a.split(p):f.keys(e);d=a.shift();)if(h=e[d],delete e[d],h&&(b||c))for(g=h.tail;(h=h.next)!==g;)if(j=h.callback,q=h.context,b&&j!==b||c&&q!==c)this.on(d,j,q);return this}},trigger:function(a){var b,c,d,e,f,g;if(!(d=this._callbacks))return this;f=d.all;a=a.split(p);for(g=
9 | z.call(arguments,1);b=a.shift();){if(c=d[b])for(e=c.tail;(c=c.next)!==e;)c.callback.apply(c.context||this,g);if(c=f){e=c.tail;for(b=[b].concat(g);(c=c.next)!==e;)c.callback.apply(c.context||this,b)}}return this}};k.bind=k.on;k.unbind=k.off;var o=g.Model=function(a,b){var c;a||(a={});b&&b.parse&&(a=this.parse(a));if(c=n(this,"defaults"))a=f.extend({},c,a);b&&b.collection&&(this.collection=b.collection);this.attributes={};this._escapedAttributes={};this.cid=f.uniqueId("c");this.changed={};this._silent=
10 | {};this._pending={};this.set(a,{silent:!0});this.changed={};this._silent={};this._pending={};this._previousAttributes=f.clone(this.attributes);this.initialize.apply(this,arguments)};f.extend(o.prototype,k,{changed:null,_silent:null,_pending:null,idAttribute:"id",initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;b=this.get(a);return this._escapedAttributes[a]=f.escape(null==
11 | b?"":""+b)},has:function(a){return null!=this.get(a)},set:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c||(c={});if(!d)return this;d instanceof o&&(d=d.attributes);if(c.unset)for(e in d)d[e]=void 0;if(!this._validate(d,c))return!1;this.idAttribute in d&&(this.id=d[this.idAttribute]);var b=c.changes={},h=this.attributes,g=this._escapedAttributes,j=this._previousAttributes||{};for(e in d){a=d[e];if(!f.isEqual(h[e],a)||c.unset&&f.has(h,e))delete g[e],(c.silent?this._silent:
12 | b)[e]=!0;c.unset?delete h[e]:h[e]=a;!f.isEqual(j[e],a)||f.has(h,e)!=f.has(j,e)?(this.changed[e]=a,c.silent||(this._pending[e]=!0)):(delete this.changed[e],delete this._pending[e])}c.silent||this.change(c);return this},unset:function(a,b){(b||(b={})).unset=!0;return this.set(a,null,b)},clear:function(a){(a||(a={})).unset=!0;return this.set(f.clone(this.attributes),a)},fetch:function(a){var a=a?f.clone(a):{},b=this,c=a.success;a.success=function(d,e,f){if(!b.set(b.parse(d,f),a))return!1;c&&c(b,d)};
13 | a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,"read",this,a)},save:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c=c?f.clone(c):{};if(c.wait){if(!this._validate(d,c))return!1;e=f.clone(this.attributes)}a=f.extend({},c,{silent:!0});if(d&&!this.set(d,c.wait?a:c))return!1;var h=this,i=c.success;c.success=function(a,b,e){b=h.parse(a,e);if(c.wait){delete c.wait;b=f.extend(d||{},b)}if(!h.set(b,c))return false;i?i(h,a):h.trigger("sync",h,a,c)};c.error=g.wrapError(c.error,
14 | h,c);b=this.isNew()?"create":"update";b=(this.sync||g.sync).call(this,b,this,c);c.wait&&this.set(e,a);return b},destroy:function(a){var a=a?f.clone(a):{},b=this,c=a.success,d=function(){b.trigger("destroy",b,b.collection,a)};if(this.isNew())return d(),!1;a.success=function(e){a.wait&&d();c?c(b,e):b.trigger("sync",b,e,a)};a.error=g.wrapError(a.error,b,a);var e=(this.sync||g.sync).call(this,"delete",this,a);a.wait||d();return e},url:function(){var a=n(this,"urlRoot")||n(this.collection,"url")||t();
15 | return this.isNew()?a:a+("/"==a.charAt(a.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},change:function(a){a||(a={});var b=this._changing;this._changing=!0;for(var c in this._silent)this._pending[c]=!0;var d=f.extend({},a.changes,this._silent);this._silent={};for(c in d)this.trigger("change:"+c,this,this.get(c),a);if(b)return this;for(;!f.isEmpty(this._pending);){this._pending=
16 | {};this.trigger("change",this,a);for(c in this.changed)!this._pending[c]&&!this._silent[c]&&delete this.changed[c];this._previousAttributes=f.clone(this.attributes)}this._changing=!1;return this},hasChanged:function(a){return!arguments.length?!f.isEmpty(this.changed):f.has(this.changed,a)},changedAttributes:function(a){if(!a)return this.hasChanged()?f.clone(this.changed):!1;var b,c=!1,d=this._previousAttributes,e;for(e in a)if(!f.isEqual(d[e],b=a[e]))(c||(c={}))[e]=b;return c},previous:function(a){return!arguments.length||
17 | !this._previousAttributes?null:this._previousAttributes[a]},previousAttributes:function(){return f.clone(this._previousAttributes)},isValid:function(){return!this.validate(this.attributes)},_validate:function(a,b){if(b.silent||!this.validate)return!0;var a=f.extend({},this.attributes,a),c=this.validate(a,b);if(!c)return!0;b&&b.error?b.error(this,c,b):this.trigger("error",this,c,b);return!1}});var r=g.Collection=function(a,b){b||(b={});b.model&&(this.model=b.model);b.comparator&&(this.comparator=b.comparator);
18 | this._reset();this.initialize.apply(this,arguments);a&&this.reset(a,{silent:!0,parse:b.parse})};f.extend(r.prototype,k,{model:o,initialize:function(){},toJSON:function(a){return this.map(function(b){return b.toJSON(a)})},add:function(a,b){var c,d,e,g,i,j={},k={},l=[];b||(b={});a=f.isArray(a)?a.slice():[a];c=0;for(d=a.length;c=b))this.iframe=i('').hide().appendTo("body")[0].contentWindow,this.navigate(a);this._hasPushState?i(window).bind("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!b?i(window).bind("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,
30 | this.interval));this.fragment=a;a=window.location;b=a.pathname==this.options.root;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!b)return this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment),!0;this._wantsPushState&&this._hasPushState&&b&&a.hash&&(this.fragment=this.getHash().replace(s,""),window.history.replaceState({},document.title,a.protocol+"//"+a.host+this.options.root+this.fragment));if(!this.options.silent)return this.loadUrl()},
31 | stop:function(){i(window).unbind("popstate",this.checkUrl).unbind("hashchange",this.checkUrl);clearInterval(this._checkUrlInterval);m.started=!1},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(){var a=this.getFragment();a==this.fragment&&this.iframe&&(a=this.getFragment(this.getHash(this.iframe)));if(a==this.fragment)return!1;this.iframe&&this.navigate(a);this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(a){var b=this.fragment=this.getFragment(a);return f.any(this.handlers,
32 | function(a){if(a.route.test(b))return a.callback(b),!0})},navigate:function(a,b){if(!m.started)return!1;if(!b||!0===b)b={trigger:b};var c=(a||"").replace(s,"");this.fragment!=c&&(this._hasPushState?(0!=c.indexOf(this.options.root)&&(c=this.options.root+c),this.fragment=c,window.history[b.replace?"replaceState":"pushState"]({},document.title,c)):this._wantsHashChange?(this.fragment=c,this._updateHash(window.location,c,b.replace),this.iframe&&c!=this.getFragment(this.getHash(this.iframe))&&(b.replace||
33 | this.iframe.document.open().close(),this._updateHash(this.iframe.location,c,b.replace))):window.location.assign(this.options.root+a),b.trigger&&this.loadUrl(a))},_updateHash:function(a,b,c){c?a.replace(a.toString().replace(/(javascript:|#).*$/,"")+"#"+b):a.hash=b}});var v=g.View=function(a){this.cid=f.uniqueId("view");this._configure(a||{});this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()},F=/^(\S+)\s*(.*)$/,w="model,collection,el,id,attributes,className,tagName".split(",");
34 | f.extend(v.prototype,k,{tagName:"div",$:function(a){return this.$el.find(a)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();return this},make:function(a,b,c){a=document.createElement(a);b&&i(a).attr(b);c&&i(a).html(c);return a},setElement:function(a,b){this.$el&&this.undelegateEvents();this.$el=a instanceof i?a:i(a);this.el=this.$el[0];!1!==b&&this.delegateEvents();return this},delegateEvents:function(a){if(a||(a=n(this,"events"))){this.undelegateEvents();
35 | for(var b in a){var c=a[b];f.isFunction(c)||(c=this[a[b]]);if(!c)throw Error('Method "'+a[b]+'" does not exist');var d=b.match(F),e=d[1],d=d[2],c=f.bind(c,this),e=e+(".delegateEvents"+this.cid);""===d?this.$el.bind(e,c):this.$el.delegate(d,e,c)}}},undelegateEvents:function(){this.$el.unbind(".delegateEvents"+this.cid)},_configure:function(a){this.options&&(a=f.extend({},this.options,a));for(var b=0,c=w.length;b').appendTo(document.body),this.options.backdrop!="static"&&this.$backdrop.click(a.proxy(this.hide,this)),e&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),e?this.$backdrop.one(a.support.transition.end,b):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,a.proxy(this.removeBackdrop,this)):this.removeBackdrop()):b&&b()}},a.fn.modal=function(c){return this.each(function(){var d=a(this),e=d.data("modal"),f=a.extend({},a.fn.modal.defaults,d.data(),typeof c=="object"&&c);e||d.data("modal",e=new b(this,f)),typeof c=="string"?e[c]():f.show&&e.show()})},a.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},a.fn.modal.Constructor=b,a(function(){a("body").on("click.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());b.preventDefault(),e.modal(f).one("hide",function(){c.focus()})})})}(window.jQuery),!function(a){function d(){e(a(b)).removeClass("open")}function e(b){var c=b.attr("data-target"),d;return c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,"")),d=a(c),d.length||(d=b.parent()),d}var b="[data-toggle=dropdown]",c=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};c.prototype={constructor:c,toggle:function(b){var c=a(this),f,g;if(c.is(".disabled, :disabled"))return;return f=e(c),g=f.hasClass("open"),d(),g||(f.toggleClass("open"),c.focus()),!1},keydown:function(b){var c,d,f,g,h,i;if(!/(38|40|27)/.test(b.keyCode))return;c=a(this),b.preventDefault(),b.stopPropagation();if(c.is(".disabled, :disabled"))return;g=e(c),h=g.hasClass("open");if(!h||h&&b.keyCode==27)return c.click();d=a("[role=menu] li:not(.divider) a",g);if(!d.length)return;i=d.index(d.filter(":focus")),b.keyCode==38&&i>0&&i--,b.keyCode==40&&i a",this.$body=a("body"),this.refresh(),this.process()}b.prototype={constructor:b,refresh:function(){var b=this,c;this.offsets=a([]),this.targets=a([]),c=this.$body.find(this.selector).map(function(){var b=a(this),c=b.data("target")||b.attr("href"),d=/^#\w/.test(c)&&a(c);return d&&d.length&&[[d.position().top,c]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},process:function(){var a=this.$scrollElement.scrollTop()+this.options.offset,b=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,c=b-this.$scrollElement.height(),d=this.offsets,e=this.targets,f=this.activeTarget,g;if(a>=c)return f!=(g=e.last()[0])&&this.activate(g);for(g=d.length;g--;)f!=e[g]&&a>=d[g]&&(!d[g+1]||a<=d[g+1])&&this.activate(e[g])},activate:function(b){var c,d;this.activeTarget=b,a(this.selector).parent(".active").removeClass("active"),d=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',c=a(d).parent("li").addClass("active"),c.parent(".dropdown-menu").length&&(c=c.closest("li.dropdown").addClass("active")),c.trigger("activate")}},a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("scrollspy"),f=typeof c=="object"&&c;e||d.data("scrollspy",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.defaults={offset:10},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),!function(a){var b=function(b){this.element=a(b)};b.prototype={constructor:b,show:function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target"),e,f,g;d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,""));if(b.parent("li").hasClass("active"))return;e=c.find(".active a").last()[0],g=a.Event("show",{relatedTarget:e}),b.trigger(g);if(g.isDefaultPrevented())return;f=a(d),this.activate(b.parent("li"),c),this.activate(f,f.parent(),function(){b.trigger({type:"shown",relatedTarget:e})})},activate:function(b,c,d){function g(){e.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),f?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var e=c.find("> .active"),f=d&&a.support.transition&&e.hasClass("fade");f?e.one(a.support.transition.end,g):g(),e.removeClass("in")}},a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("tab");e||d.data("tab",e=new b(this)),typeof c=="string"&&e[c]()})},a.fn.tab.Constructor=b,a(function(){a("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})})}(window.jQuery),!function(a){var b=function(a,b){this.init("tooltip",a,b)};b.prototype={constructor:b,init:function(b,c,d){var e,f;this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.enabled=!0,this.options.trigger=="click"?this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this)):this.options.trigger!="manual"&&(e=this.options.trigger=="hover"?"mouseenter":"focus",f=this.options.trigger=="hover"?"mouseleave":"blur",this.$element.on(e+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(f+"."+this.type,this.options.selector,a.proxy(this.leave,this))),this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(b){return b=a.extend({},a.fn[this.type].defaults,b,this.$element.data()),b.delay&&typeof b.delay=="number"&&(b.delay={show:b.delay,hide:b.delay}),b},enter:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);if(!c.options.delay||!c.options.delay.show)return c.show();clearTimeout(this.timeout),c.hoverState="in",this.timeout=setTimeout(function(){c.hoverState=="in"&&c.show()},c.options.delay.show)},leave:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!c.options.delay||!c.options.delay.hide)return c.hide();c.hoverState="out",this.timeout=setTimeout(function(){c.hoverState=="out"&&c.hide()},c.options.delay.hide)},show:function(){var a,b,c,d,e,f,g;if(this.hasContent()&&this.enabled){a=this.tip(),this.setContent(),this.options.animation&&a.addClass("fade"),f=typeof this.options.placement=="function"?this.options.placement.call(this,a[0],this.$element[0]):this.options.placement,b=/in/.test(f),a.remove().css({top:0,left:0,display:"block"}).appendTo(b?this.$element:document.body),c=this.getPosition(b),d=a[0].offsetWidth,e=a[0].offsetHeight;switch(b?f.split(" ")[1]:f){case"bottom":g={top:c.top+c.height,left:c.left+c.width/2-d/2};break;case"top":g={top:c.top-e,left:c.left+c.width/2-d/2};break;case"left":g={top:c.top+c.height/2-e/2,left:c.left-d};break;case"right":g={top:c.top+c.height/2-e/2,left:c.left+c.width}}a.css(g).addClass(f).addClass("in")}},setContent:function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},hide:function(){function d(){var b=setTimeout(function(){c.off(a.support.transition.end).remove()},500);c.one(a.support.transition.end,function(){clearTimeout(b),c.remove()})}var b=this,c=this.tip();return c.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d():c.remove(),this},fixTitle:function(){var a=this.$element;(a.attr("title")||typeof a.attr("data-original-title")!="string")&&a.attr("data-original-title",a.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(b){return a.extend({},b?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||(typeof c.title=="function"?c.title.call(b[0]):c.title),a},tip:function(){return this.$tip=this.$tip||a(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}},a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("tooltip"),f=typeof c=="object"&&c;e||d.data("tooltip",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.tooltip.Constructor=b,a.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'',trigger:"hover",title:"",delay:0,html:!0}}(window.jQuery),!function(a){var b=function(a,b){this.init("popover",a,b)};b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype,{constructor:b,setContent:function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content > *")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-content")||(typeof c.content=="function"?c.content.call(b[0]):c.content),a},tip:function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}}),a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("popover"),f=typeof c=="object"&&c;e||d.data("popover",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.defaults=a.extend({},a.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:''})}(window.jQuery),!function(a){var b=function(b,c){this.options=a.extend({},a.fn.affix.defaults,c),this.$window=a(window).on("scroll.affix.data-api",a.proxy(this.checkPosition,this)),this.$element=a(b),this.checkPosition()};b.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var b=a(document).height(),c=this.$window.scrollTop(),d=this.$element.offset(),e=this.options.offset,f=e.bottom,g=e.top,h="affix affix-top affix-bottom",i;typeof e!="object"&&(f=g=e),typeof g=="function"&&(g=e.top()),typeof f=="function"&&(f=e.bottom()),i=this.unpin!=null&&c+this.unpin<=d.top?!1:f!=null&&d.top+this.$element.height()>=b-f?"bottom":g!=null&&c<=g?"top":!1;if(this.affixed===i)return;this.affixed=i,this.unpin=i=="bottom"?d.top-c:null,this.$element.removeClass(h).addClass("affix"+(i?"-"+i:""))},a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("affix"),f=typeof c=="object"&&c;e||d.data("affix",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.defaults={offset:0},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(window.jQuery),!function(a){var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function f(){e.trigger("closed").remove()}var c=a(this),d=c.attr("data-target"),e;d||(d=c.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),e=a(d),b&&b.preventDefault(),e.length||(e=c.hasClass("alert")?c:c.parent()),e.trigger(b=a.Event("close"));if(b.isDefaultPrevented())return;e.removeClass("in"),a.support.transition&&e.hasClass("fade")?e.on(a.support.transition.end,f):f()},a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("alert");e||d.data("alert",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.alert.Constructor=c,a(function(){a("body").on("click.alert.data-api",b,c.prototype.close)})}(window.jQuery),!function(a){var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.button.defaults,c)};b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.data(),e=c.is("input")?"val":"html";a+="Text",d.resetText||c.data("resetText",c[e]()),c[e](d[a]||this.options[a]),setTimeout(function(){a=="loadingText"?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons-radio"]');a&&a.find(".active").removeClass("active"),this.$element.toggleClass("active")},a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("button"),f=typeof c=="object"&&c;e||d.data("button",e=new b(this,f)),c=="toggle"?e.toggle():c&&e.setState(c)})},a.fn.button.defaults={loadingText:"loading..."},a.fn.button.Constructor=b,a(function(){a("body").on("click.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle")})})}(window.jQuery),!function(a){var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.collapse.defaults,c),this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.prototype={constructor:b,dimension:function(){var a=this.$element.hasClass("width");return a?"width":"height"},show:function(){var b,c,d,e;if(this.transitioning)return;b=this.dimension(),c=a.camelCase(["scroll",b].join("-")),d=this.$parent&&this.$parent.find("> .accordion-group > .in");if(d&&d.length){e=d.data("collapse");if(e&&e.transitioning)return;d.collapse("hide"),e||d.data("collapse",null)}this.$element[b](0),this.transition("addClass",a.Event("show"),"shown"),a.support.transition&&this.$element[b](this.$element[0][c])},hide:function(){var b;if(this.transitioning)return;b=this.dimension(),this.reset(this.$element[b]()),this.transition("removeClass",a.Event("hide"),"hidden"),this.$element[b](0)},reset:function(a){var b=this.dimension();return this.$element.removeClass("collapse")[b](a||"auto")[0].offsetWidth,this.$element[a!==null?"addClass":"removeClass"]("collapse"),this},transition:function(b,c,d){var e=this,f=function(){c.type=="show"&&e.reset(),e.transitioning=0,e.$element.trigger(d)};this.$element.trigger(c);if(c.isDefaultPrevented())return;this.transitioning=1,this.$element[b]("in"),a.support.transition&&this.$element.hasClass("collapse")?this.$element.one(a.support.transition.end,f):f()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("collapse"),f=typeof c=="object"&&c;e||d.data("collapse",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.collapse.defaults={toggle:!0},a.fn.collapse.Constructor=b,a(function(){a("body").on("click.collapse.data-api","[data-toggle=collapse]",function(b){var c=a(this),d,e=c.attr("data-target")||b.preventDefault()||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),f=a(e).data("collapse")?"toggle":c.data();c[a(e).hasClass("in")?"addClass":"removeClass"]("collapsed"),a(e).collapse(f)})})}(window.jQuery),!function(a){var b=function(b,c){this.$element=a(b),this.options=c,this.options.slide&&this.slide(this.options.slide),this.options.pause=="hover"&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.prototype={cycle:function(b){return b||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},to:function(b){var c=this.$element.find(".item.active"),d=c.parent().children(),e=d.index(c),f=this;if(b>d.length-1||b<0)return;return this.sliding?this.$element.one("slid",function(){f.to(b)}):e==b?this.pause().cycle():this.slide(b>e?"next":"prev",a(d[b]))},pause:function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g=b=="next"?"left":"right",h=b=="next"?"first":"last",i=this,j=a.Event("slide",{relatedTarget:e[0]});this.sliding=!0,f&&this.pause(),e=e.length?e:this.$element.find(".item")[h]();if(e.hasClass("active"))return;if(a.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(j);if(j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),this.$element.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)})}else{this.$element.trigger(j);if(j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this}},a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("carousel"),f=a.extend({},a.fn.carousel.defaults,typeof c=="object"&&c),g=typeof c=="string"?c:f.slide;e||d.data("carousel",e=new b(this,f)),typeof c=="number"?e.to(c):g?e[g]():f.interval&&e.cycle()})},a.fn.carousel.defaults={interval:5e3,pause:"hover"},a.fn.carousel.Constructor=b,a(function(){a("body").on("click.carousel.data-api","[data-slide]",function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=!e.data("modal")&&a.extend({},e.data(),c.data());e.carousel(f),b.preventDefault()})})}(window.jQuery),!function(a){var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.typeahead.defaults,c),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.$menu=a(this.options.menu).appendTo("body"),this.source=this.options.source,this.shown=!1,this.listen()};b.prototype={constructor:b,select:function(){var a=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(a)).change(),this.hide()},updater:function(a){return a},show:function(){var b=a.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight});return this.$menu.css({top:b.top+b.height,left:b.left}),this.$menu.show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(b){var c;return this.query=this.$element.val(),!this.query||this.query.length"+b+""})},render:function(b){var c=this;return b=a(b).map(function(b,d){return b=a(c.options.item).attr("data-value",d),b.find("a").html(c.highlighter(d)),b[0]}),b.first().addClass("active"),this.$menu.html(b),this},next:function(b){var c=this.$menu.find(".active").removeClass("active"),d=c.next();d.length||(d=a(this.$menu.find("li")[0])),d.addClass("active")},prev:function(a){var b=this.$menu.find(".active").removeClass("active"),c=b.prev();c.length||(c=this.$menu.find("li").last()),c.addClass("active")},listen:function(){this.$element.on("blur",a.proxy(this.blur,this)).on("keypress",a.proxy(this.keypress,this)).on("keyup",a.proxy(this.keyup,this)),(a.browser.chrome||a.browser.webkit||a.browser.msie)&&this.$element.on("keydown",a.proxy(this.keydown,this)),this.$menu.on("click",a.proxy(this.click,this)).on("mouseenter","li",a.proxy(this.mouseenter,this))},move:function(a){if(!this.shown)return;switch(a.keyCode){case 9:case 13:case 27:a.preventDefault();break;case 38:a.preventDefault(),this.prev();break;case 40:a.preventDefault(),this.next()}a.stopPropagation()},keydown:function(b){this.suppressKeyPressRepeat=!~a.inArray(b.keyCode,[40,38,9,13,27]),this.move(b)},keypress:function(a){if(this.suppressKeyPressRepeat)return;this.move(a)},keyup:function(a){switch(a.keyCode){case 40:case 38:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}a.stopPropagation(),a.preventDefault()},blur:function(a){var b=this;setTimeout(function(){b.hide()},150)},click:function(a){a.stopPropagation(),a.preventDefault(),this.select()},mouseenter:function(b){this.$menu.find(".active").removeClass("active"),a(b.currentTarget).addClass("active")}},a.fn.typeahead=function(c){return this.each(function(){var d=a(this),e=d.data("typeahead"),f=typeof c=="object"&&c;e||d.data("typeahead",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.typeahead.defaults={source:[],items:8,menu:'',item:'',minLength:1},a.fn.typeahead.Constructor=b,a(function(){a("body").on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(b){var c=a(this);if(c.data("typeahead"))return;b.preventDefault(),c.typeahead(c.data())})})}(window.jQuery)
--------------------------------------------------------------------------------
/public/css/bootstrap-responsive.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap Responsive v2.1.1
3 | *
4 | * Copyright 2012 Twitter, Inc
5 | * Licensed under the Apache License v2.0
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Designed and built with all the love in the world @twitter by @mdo and @fat.
9 | */
10 |
11 | .clearfix {
12 | *zoom: 1;
13 | }
14 |
15 | .clearfix:before,
16 | .clearfix:after {
17 | display: table;
18 | line-height: 0;
19 | content: "";
20 | }
21 |
22 | .clearfix:after {
23 | clear: both;
24 | }
25 |
26 | .hide-text {
27 | font: 0/0 a;
28 | color: transparent;
29 | text-shadow: none;
30 | background-color: transparent;
31 | border: 0;
32 | }
33 |
34 | .input-block-level {
35 | display: block;
36 | width: 100%;
37 | min-height: 30px;
38 | -webkit-box-sizing: border-box;
39 | -moz-box-sizing: border-box;
40 | box-sizing: border-box;
41 | }
42 |
43 | .hidden {
44 | display: none;
45 | visibility: hidden;
46 | }
47 |
48 | .visible-phone {
49 | display: none !important;
50 | }
51 |
52 | .visible-tablet {
53 | display: none !important;
54 | }
55 |
56 | .hidden-desktop {
57 | display: none !important;
58 | }
59 |
60 | .visible-desktop {
61 | display: inherit !important;
62 | }
63 |
64 | @media (min-width: 768px) and (max-width: 979px) {
65 | .hidden-desktop {
66 | display: inherit !important;
67 | }
68 | .visible-desktop {
69 | display: none !important ;
70 | }
71 | .visible-tablet {
72 | display: inherit !important;
73 | }
74 | .hidden-tablet {
75 | display: none !important;
76 | }
77 | }
78 |
79 | @media (max-width: 767px) {
80 | .hidden-desktop {
81 | display: inherit !important;
82 | }
83 | .visible-desktop {
84 | display: none !important;
85 | }
86 | .visible-phone {
87 | display: inherit !important;
88 | }
89 | .hidden-phone {
90 | display: none !important;
91 | }
92 | }
93 |
94 | @media (min-width: 1200px) {
95 | .row {
96 | margin-left: -30px;
97 | *zoom: 1;
98 | }
99 | .row:before,
100 | .row:after {
101 | display: table;
102 | line-height: 0;
103 | content: "";
104 | }
105 | .row:after {
106 | clear: both;
107 | }
108 | [class*="span"] {
109 | float: left;
110 | min-height: 1px;
111 | margin-left: 30px;
112 | }
113 | .container,
114 | .navbar-static-top .container,
115 | .navbar-fixed-top .container,
116 | .navbar-fixed-bottom .container {
117 | width: 1170px;
118 | }
119 | .span12 {
120 | width: 1170px;
121 | }
122 | .span11 {
123 | width: 1070px;
124 | }
125 | .span10 {
126 | width: 970px;
127 | }
128 | .span9 {
129 | width: 870px;
130 | }
131 | .span8 {
132 | width: 770px;
133 | }
134 | .span7 {
135 | width: 670px;
136 | }
137 | .span6 {
138 | width: 570px;
139 | }
140 | .span5 {
141 | width: 470px;
142 | }
143 | .span4 {
144 | width: 370px;
145 | }
146 | .span3 {
147 | width: 270px;
148 | }
149 | .span2 {
150 | width: 170px;
151 | }
152 | .span1 {
153 | width: 70px;
154 | }
155 | .offset12 {
156 | margin-left: 1230px;
157 | }
158 | .offset11 {
159 | margin-left: 1130px;
160 | }
161 | .offset10 {
162 | margin-left: 1030px;
163 | }
164 | .offset9 {
165 | margin-left: 930px;
166 | }
167 | .offset8 {
168 | margin-left: 830px;
169 | }
170 | .offset7 {
171 | margin-left: 730px;
172 | }
173 | .offset6 {
174 | margin-left: 630px;
175 | }
176 | .offset5 {
177 | margin-left: 530px;
178 | }
179 | .offset4 {
180 | margin-left: 430px;
181 | }
182 | .offset3 {
183 | margin-left: 330px;
184 | }
185 | .offset2 {
186 | margin-left: 230px;
187 | }
188 | .offset1 {
189 | margin-left: 130px;
190 | }
191 | .row-fluid {
192 | width: 100%;
193 | *zoom: 1;
194 | }
195 | .row-fluid:before,
196 | .row-fluid:after {
197 | display: table;
198 | line-height: 0;
199 | content: "";
200 | }
201 | .row-fluid:after {
202 | clear: both;
203 | }
204 | .row-fluid [class*="span"] {
205 | display: block;
206 | float: left;
207 | width: 100%;
208 | min-height: 30px;
209 | margin-left: 2.564102564102564%;
210 | *margin-left: 2.5109110747408616%;
211 | -webkit-box-sizing: border-box;
212 | -moz-box-sizing: border-box;
213 | box-sizing: border-box;
214 | }
215 | .row-fluid [class*="span"]:first-child {
216 | margin-left: 0;
217 | }
218 | .row-fluid .span12 {
219 | width: 100%;
220 | *width: 99.94680851063829%;
221 | }
222 | .row-fluid .span11 {
223 | width: 91.45299145299145%;
224 | *width: 91.39979996362975%;
225 | }
226 | .row-fluid .span10 {
227 | width: 82.90598290598291%;
228 | *width: 82.8527914166212%;
229 | }
230 | .row-fluid .span9 {
231 | width: 74.35897435897436%;
232 | *width: 74.30578286961266%;
233 | }
234 | .row-fluid .span8 {
235 | width: 65.81196581196582%;
236 | *width: 65.75877432260411%;
237 | }
238 | .row-fluid .span7 {
239 | width: 57.26495726495726%;
240 | *width: 57.21176577559556%;
241 | }
242 | .row-fluid .span6 {
243 | width: 48.717948717948715%;
244 | *width: 48.664757228587014%;
245 | }
246 | .row-fluid .span5 {
247 | width: 40.17094017094017%;
248 | *width: 40.11774868157847%;
249 | }
250 | .row-fluid .span4 {
251 | width: 31.623931623931625%;
252 | *width: 31.570740134569924%;
253 | }
254 | .row-fluid .span3 {
255 | width: 23.076923076923077%;
256 | *width: 23.023731587561375%;
257 | }
258 | .row-fluid .span2 {
259 | width: 14.52991452991453%;
260 | *width: 14.476723040552828%;
261 | }
262 | .row-fluid .span1 {
263 | width: 5.982905982905983%;
264 | *width: 5.929714493544281%;
265 | }
266 | .row-fluid .offset12 {
267 | margin-left: 105.12820512820512%;
268 | *margin-left: 105.02182214948171%;
269 | }
270 | .row-fluid .offset12:first-child {
271 | margin-left: 102.56410256410257%;
272 | *margin-left: 102.45771958537915%;
273 | }
274 | .row-fluid .offset11 {
275 | margin-left: 96.58119658119658%;
276 | *margin-left: 96.47481360247316%;
277 | }
278 | .row-fluid .offset11:first-child {
279 | margin-left: 94.01709401709402%;
280 | *margin-left: 93.91071103837061%;
281 | }
282 | .row-fluid .offset10 {
283 | margin-left: 88.03418803418803%;
284 | *margin-left: 87.92780505546462%;
285 | }
286 | .row-fluid .offset10:first-child {
287 | margin-left: 85.47008547008548%;
288 | *margin-left: 85.36370249136206%;
289 | }
290 | .row-fluid .offset9 {
291 | margin-left: 79.48717948717949%;
292 | *margin-left: 79.38079650845607%;
293 | }
294 | .row-fluid .offset9:first-child {
295 | margin-left: 76.92307692307693%;
296 | *margin-left: 76.81669394435352%;
297 | }
298 | .row-fluid .offset8 {
299 | margin-left: 70.94017094017094%;
300 | *margin-left: 70.83378796144753%;
301 | }
302 | .row-fluid .offset8:first-child {
303 | margin-left: 68.37606837606839%;
304 | *margin-left: 68.26968539734497%;
305 | }
306 | .row-fluid .offset7 {
307 | margin-left: 62.393162393162385%;
308 | *margin-left: 62.28677941443899%;
309 | }
310 | .row-fluid .offset7:first-child {
311 | margin-left: 59.82905982905982%;
312 | *margin-left: 59.72267685033642%;
313 | }
314 | .row-fluid .offset6 {
315 | margin-left: 53.84615384615384%;
316 | *margin-left: 53.739770867430444%;
317 | }
318 | .row-fluid .offset6:first-child {
319 | margin-left: 51.28205128205128%;
320 | *margin-left: 51.175668303327875%;
321 | }
322 | .row-fluid .offset5 {
323 | margin-left: 45.299145299145295%;
324 | *margin-left: 45.1927623204219%;
325 | }
326 | .row-fluid .offset5:first-child {
327 | margin-left: 42.73504273504273%;
328 | *margin-left: 42.62865975631933%;
329 | }
330 | .row-fluid .offset4 {
331 | margin-left: 36.75213675213675%;
332 | *margin-left: 36.645753773413354%;
333 | }
334 | .row-fluid .offset4:first-child {
335 | margin-left: 34.18803418803419%;
336 | *margin-left: 34.081651209310785%;
337 | }
338 | .row-fluid .offset3 {
339 | margin-left: 28.205128205128204%;
340 | *margin-left: 28.0987452264048%;
341 | }
342 | .row-fluid .offset3:first-child {
343 | margin-left: 25.641025641025642%;
344 | *margin-left: 25.53464266230224%;
345 | }
346 | .row-fluid .offset2 {
347 | margin-left: 19.65811965811966%;
348 | *margin-left: 19.551736679396257%;
349 | }
350 | .row-fluid .offset2:first-child {
351 | margin-left: 17.094017094017094%;
352 | *margin-left: 16.98763411529369%;
353 | }
354 | .row-fluid .offset1 {
355 | margin-left: 11.11111111111111%;
356 | *margin-left: 11.004728132387708%;
357 | }
358 | .row-fluid .offset1:first-child {
359 | margin-left: 8.547008547008547%;
360 | *margin-left: 8.440625568285142%;
361 | }
362 | input,
363 | textarea,
364 | .uneditable-input {
365 | margin-left: 0;
366 | }
367 | .controls-row [class*="span"] + [class*="span"] {
368 | margin-left: 30px;
369 | }
370 | input.span12,
371 | textarea.span12,
372 | .uneditable-input.span12 {
373 | width: 1156px;
374 | }
375 | input.span11,
376 | textarea.span11,
377 | .uneditable-input.span11 {
378 | width: 1056px;
379 | }
380 | input.span10,
381 | textarea.span10,
382 | .uneditable-input.span10 {
383 | width: 956px;
384 | }
385 | input.span9,
386 | textarea.span9,
387 | .uneditable-input.span9 {
388 | width: 856px;
389 | }
390 | input.span8,
391 | textarea.span8,
392 | .uneditable-input.span8 {
393 | width: 756px;
394 | }
395 | input.span7,
396 | textarea.span7,
397 | .uneditable-input.span7 {
398 | width: 656px;
399 | }
400 | input.span6,
401 | textarea.span6,
402 | .uneditable-input.span6 {
403 | width: 556px;
404 | }
405 | input.span5,
406 | textarea.span5,
407 | .uneditable-input.span5 {
408 | width: 456px;
409 | }
410 | input.span4,
411 | textarea.span4,
412 | .uneditable-input.span4 {
413 | width: 356px;
414 | }
415 | input.span3,
416 | textarea.span3,
417 | .uneditable-input.span3 {
418 | width: 256px;
419 | }
420 | input.span2,
421 | textarea.span2,
422 | .uneditable-input.span2 {
423 | width: 156px;
424 | }
425 | input.span1,
426 | textarea.span1,
427 | .uneditable-input.span1 {
428 | width: 56px;
429 | }
430 | .thumbnails {
431 | margin-left: -30px;
432 | }
433 | .thumbnails > li {
434 | margin-left: 30px;
435 | }
436 | .row-fluid .thumbnails {
437 | margin-left: 0;
438 | }
439 | }
440 |
441 | @media (min-width: 768px) and (max-width: 979px) {
442 | .row {
443 | margin-left: -20px;
444 | *zoom: 1;
445 | }
446 | .row:before,
447 | .row:after {
448 | display: table;
449 | line-height: 0;
450 | content: "";
451 | }
452 | .row:after {
453 | clear: both;
454 | }
455 | [class*="span"] {
456 | float: left;
457 | min-height: 1px;
458 | margin-left: 20px;
459 | }
460 | .container,
461 | .navbar-static-top .container,
462 | .navbar-fixed-top .container,
463 | .navbar-fixed-bottom .container {
464 | width: 724px;
465 | }
466 | .span12 {
467 | width: 724px;
468 | }
469 | .span11 {
470 | width: 662px;
471 | }
472 | .span10 {
473 | width: 600px;
474 | }
475 | .span9 {
476 | width: 538px;
477 | }
478 | .span8 {
479 | width: 476px;
480 | }
481 | .span7 {
482 | width: 414px;
483 | }
484 | .span6 {
485 | width: 352px;
486 | }
487 | .span5 {
488 | width: 290px;
489 | }
490 | .span4 {
491 | width: 228px;
492 | }
493 | .span3 {
494 | width: 166px;
495 | }
496 | .span2 {
497 | width: 104px;
498 | }
499 | .span1 {
500 | width: 42px;
501 | }
502 | .offset12 {
503 | margin-left: 764px;
504 | }
505 | .offset11 {
506 | margin-left: 702px;
507 | }
508 | .offset10 {
509 | margin-left: 640px;
510 | }
511 | .offset9 {
512 | margin-left: 578px;
513 | }
514 | .offset8 {
515 | margin-left: 516px;
516 | }
517 | .offset7 {
518 | margin-left: 454px;
519 | }
520 | .offset6 {
521 | margin-left: 392px;
522 | }
523 | .offset5 {
524 | margin-left: 330px;
525 | }
526 | .offset4 {
527 | margin-left: 268px;
528 | }
529 | .offset3 {
530 | margin-left: 206px;
531 | }
532 | .offset2 {
533 | margin-left: 144px;
534 | }
535 | .offset1 {
536 | margin-left: 82px;
537 | }
538 | .row-fluid {
539 | width: 100%;
540 | *zoom: 1;
541 | }
542 | .row-fluid:before,
543 | .row-fluid:after {
544 | display: table;
545 | line-height: 0;
546 | content: "";
547 | }
548 | .row-fluid:after {
549 | clear: both;
550 | }
551 | .row-fluid [class*="span"] {
552 | display: block;
553 | float: left;
554 | width: 100%;
555 | min-height: 30px;
556 | margin-left: 2.7624309392265194%;
557 | *margin-left: 2.709239449864817%;
558 | -webkit-box-sizing: border-box;
559 | -moz-box-sizing: border-box;
560 | box-sizing: border-box;
561 | }
562 | .row-fluid [class*="span"]:first-child {
563 | margin-left: 0;
564 | }
565 | .row-fluid .span12 {
566 | width: 100%;
567 | *width: 99.94680851063829%;
568 | }
569 | .row-fluid .span11 {
570 | width: 91.43646408839778%;
571 | *width: 91.38327259903608%;
572 | }
573 | .row-fluid .span10 {
574 | width: 82.87292817679558%;
575 | *width: 82.81973668743387%;
576 | }
577 | .row-fluid .span9 {
578 | width: 74.30939226519337%;
579 | *width: 74.25620077583166%;
580 | }
581 | .row-fluid .span8 {
582 | width: 65.74585635359117%;
583 | *width: 65.69266486422946%;
584 | }
585 | .row-fluid .span7 {
586 | width: 57.18232044198895%;
587 | *width: 57.12912895262725%;
588 | }
589 | .row-fluid .span6 {
590 | width: 48.61878453038674%;
591 | *width: 48.56559304102504%;
592 | }
593 | .row-fluid .span5 {
594 | width: 40.05524861878453%;
595 | *width: 40.00205712942283%;
596 | }
597 | .row-fluid .span4 {
598 | width: 31.491712707182323%;
599 | *width: 31.43852121782062%;
600 | }
601 | .row-fluid .span3 {
602 | width: 22.92817679558011%;
603 | *width: 22.87498530621841%;
604 | }
605 | .row-fluid .span2 {
606 | width: 14.3646408839779%;
607 | *width: 14.311449394616199%;
608 | }
609 | .row-fluid .span1 {
610 | width: 5.801104972375691%;
611 | *width: 5.747913483013988%;
612 | }
613 | .row-fluid .offset12 {
614 | margin-left: 105.52486187845304%;
615 | *margin-left: 105.41847889972962%;
616 | }
617 | .row-fluid .offset12:first-child {
618 | margin-left: 102.76243093922652%;
619 | *margin-left: 102.6560479605031%;
620 | }
621 | .row-fluid .offset11 {
622 | margin-left: 96.96132596685082%;
623 | *margin-left: 96.8549429881274%;
624 | }
625 | .row-fluid .offset11:first-child {
626 | margin-left: 94.1988950276243%;
627 | *margin-left: 94.09251204890089%;
628 | }
629 | .row-fluid .offset10 {
630 | margin-left: 88.39779005524862%;
631 | *margin-left: 88.2914070765252%;
632 | }
633 | .row-fluid .offset10:first-child {
634 | margin-left: 85.6353591160221%;
635 | *margin-left: 85.52897613729868%;
636 | }
637 | .row-fluid .offset9 {
638 | margin-left: 79.8342541436464%;
639 | *margin-left: 79.72787116492299%;
640 | }
641 | .row-fluid .offset9:first-child {
642 | margin-left: 77.07182320441989%;
643 | *margin-left: 76.96544022569647%;
644 | }
645 | .row-fluid .offset8 {
646 | margin-left: 71.2707182320442%;
647 | *margin-left: 71.16433525332079%;
648 | }
649 | .row-fluid .offset8:first-child {
650 | margin-left: 68.50828729281768%;
651 | *margin-left: 68.40190431409427%;
652 | }
653 | .row-fluid .offset7 {
654 | margin-left: 62.70718232044199%;
655 | *margin-left: 62.600799341718584%;
656 | }
657 | .row-fluid .offset7:first-child {
658 | margin-left: 59.94475138121547%;
659 | *margin-left: 59.838368402492065%;
660 | }
661 | .row-fluid .offset6 {
662 | margin-left: 54.14364640883978%;
663 | *margin-left: 54.037263430116376%;
664 | }
665 | .row-fluid .offset6:first-child {
666 | margin-left: 51.38121546961326%;
667 | *margin-left: 51.27483249088986%;
668 | }
669 | .row-fluid .offset5 {
670 | margin-left: 45.58011049723757%;
671 | *margin-left: 45.47372751851417%;
672 | }
673 | .row-fluid .offset5:first-child {
674 | margin-left: 42.81767955801105%;
675 | *margin-left: 42.71129657928765%;
676 | }
677 | .row-fluid .offset4 {
678 | margin-left: 37.01657458563536%;
679 | *margin-left: 36.91019160691196%;
680 | }
681 | .row-fluid .offset4:first-child {
682 | margin-left: 34.25414364640884%;
683 | *margin-left: 34.14776066768544%;
684 | }
685 | .row-fluid .offset3 {
686 | margin-left: 28.45303867403315%;
687 | *margin-left: 28.346655695309746%;
688 | }
689 | .row-fluid .offset3:first-child {
690 | margin-left: 25.69060773480663%;
691 | *margin-left: 25.584224756083227%;
692 | }
693 | .row-fluid .offset2 {
694 | margin-left: 19.88950276243094%;
695 | *margin-left: 19.783119783707537%;
696 | }
697 | .row-fluid .offset2:first-child {
698 | margin-left: 17.12707182320442%;
699 | *margin-left: 17.02068884448102%;
700 | }
701 | .row-fluid .offset1 {
702 | margin-left: 11.32596685082873%;
703 | *margin-left: 11.219583872105325%;
704 | }
705 | .row-fluid .offset1:first-child {
706 | margin-left: 8.56353591160221%;
707 | *margin-left: 8.457152932878806%;
708 | }
709 | input,
710 | textarea,
711 | .uneditable-input {
712 | margin-left: 0;
713 | }
714 | .controls-row [class*="span"] + [class*="span"] {
715 | margin-left: 20px;
716 | }
717 | input.span12,
718 | textarea.span12,
719 | .uneditable-input.span12 {
720 | width: 710px;
721 | }
722 | input.span11,
723 | textarea.span11,
724 | .uneditable-input.span11 {
725 | width: 648px;
726 | }
727 | input.span10,
728 | textarea.span10,
729 | .uneditable-input.span10 {
730 | width: 586px;
731 | }
732 | input.span9,
733 | textarea.span9,
734 | .uneditable-input.span9 {
735 | width: 524px;
736 | }
737 | input.span8,
738 | textarea.span8,
739 | .uneditable-input.span8 {
740 | width: 462px;
741 | }
742 | input.span7,
743 | textarea.span7,
744 | .uneditable-input.span7 {
745 | width: 400px;
746 | }
747 | input.span6,
748 | textarea.span6,
749 | .uneditable-input.span6 {
750 | width: 338px;
751 | }
752 | input.span5,
753 | textarea.span5,
754 | .uneditable-input.span5 {
755 | width: 276px;
756 | }
757 | input.span4,
758 | textarea.span4,
759 | .uneditable-input.span4 {
760 | width: 214px;
761 | }
762 | input.span3,
763 | textarea.span3,
764 | .uneditable-input.span3 {
765 | width: 152px;
766 | }
767 | input.span2,
768 | textarea.span2,
769 | .uneditable-input.span2 {
770 | width: 90px;
771 | }
772 | input.span1,
773 | textarea.span1,
774 | .uneditable-input.span1 {
775 | width: 28px;
776 | }
777 | }
778 |
779 | @media (max-width: 767px) {
780 | body {
781 | padding-right: 20px;
782 | padding-left: 20px;
783 | }
784 | .navbar-fixed-top,
785 | .navbar-fixed-bottom,
786 | .navbar-static-top {
787 | margin-right: -20px;
788 | margin-left: -20px;
789 | }
790 | .container-fluid {
791 | padding: 0;
792 | }
793 | .dl-horizontal dt {
794 | float: none;
795 | width: auto;
796 | clear: none;
797 | text-align: left;
798 | }
799 | .dl-horizontal dd {
800 | margin-left: 0;
801 | }
802 | .container {
803 | width: auto;
804 | }
805 | .row-fluid {
806 | width: 100%;
807 | }
808 | .row,
809 | .thumbnails {
810 | margin-left: 0;
811 | }
812 | .thumbnails > li {
813 | float: none;
814 | margin-left: 0;
815 | }
816 | [class*="span"],
817 | .row-fluid [class*="span"] {
818 | display: block;
819 | float: none;
820 | width: 100%;
821 | margin-left: 0;
822 | -webkit-box-sizing: border-box;
823 | -moz-box-sizing: border-box;
824 | box-sizing: border-box;
825 | }
826 | .span12,
827 | .row-fluid .span12 {
828 | width: 100%;
829 | -webkit-box-sizing: border-box;
830 | -moz-box-sizing: border-box;
831 | box-sizing: border-box;
832 | }
833 | .input-large,
834 | .input-xlarge,
835 | .input-xxlarge,
836 | input[class*="span"],
837 | select[class*="span"],
838 | textarea[class*="span"],
839 | .uneditable-input {
840 | display: block;
841 | width: 100%;
842 | min-height: 30px;
843 | -webkit-box-sizing: border-box;
844 | -moz-box-sizing: border-box;
845 | box-sizing: border-box;
846 | }
847 | .input-prepend input,
848 | .input-append input,
849 | .input-prepend input[class*="span"],
850 | .input-append input[class*="span"] {
851 | display: inline-block;
852 | width: auto;
853 | }
854 | .controls-row [class*="span"] + [class*="span"] {
855 | margin-left: 0;
856 | }
857 | .modal {
858 | position: fixed;
859 | top: 20px;
860 | right: 20px;
861 | left: 20px;
862 | width: auto;
863 | margin: 0;
864 | }
865 | .modal.fade.in {
866 | top: auto;
867 | }
868 | }
869 |
870 | @media (max-width: 480px) {
871 | .nav-collapse {
872 | -webkit-transform: translate3d(0, 0, 0);
873 | }
874 | .page-header h1 small {
875 | display: block;
876 | line-height: 20px;
877 | }
878 | input[type="checkbox"],
879 | input[type="radio"] {
880 | border: 1px solid #ccc;
881 | }
882 | .form-horizontal .control-label {
883 | float: none;
884 | width: auto;
885 | padding-top: 0;
886 | text-align: left;
887 | }
888 | .form-horizontal .controls {
889 | margin-left: 0;
890 | }
891 | .form-horizontal .control-list {
892 | padding-top: 0;
893 | }
894 | .form-horizontal .form-actions {
895 | padding-right: 10px;
896 | padding-left: 10px;
897 | }
898 | .modal {
899 | top: 10px;
900 | right: 10px;
901 | left: 10px;
902 | }
903 | .modal-header .close {
904 | padding: 10px;
905 | margin: -10px;
906 | }
907 | .carousel-caption {
908 | position: static;
909 | }
910 | }
911 |
912 | @media (max-width: 979px) {
913 | body {
914 | padding-top: 0;
915 | }
916 | .navbar-fixed-top,
917 | .navbar-fixed-bottom {
918 | position: static;
919 | }
920 | .navbar-fixed-top {
921 | margin-bottom: 20px;
922 | }
923 | .navbar-fixed-bottom {
924 | margin-top: 20px;
925 | }
926 | .navbar-fixed-top .navbar-inner,
927 | .navbar-fixed-bottom .navbar-inner {
928 | padding: 5px;
929 | }
930 | .navbar .container {
931 | width: auto;
932 | padding: 0;
933 | }
934 | .navbar .brand {
935 | padding-right: 10px;
936 | padding-left: 10px;
937 | margin: 0 0 0 -5px;
938 | }
939 | .nav-collapse {
940 | clear: both;
941 | }
942 | .nav-collapse .nav {
943 | float: none;
944 | margin: 0 0 10px;
945 | }
946 | .nav-collapse .nav > li {
947 | float: none;
948 | }
949 | .nav-collapse .nav > li > a {
950 | margin-bottom: 2px;
951 | }
952 | .nav-collapse .nav > .divider-vertical {
953 | display: none;
954 | }
955 | .nav-collapse .nav .nav-header {
956 | color: #777777;
957 | text-shadow: none;
958 | }
959 | .nav-collapse .nav > li > a,
960 | .nav-collapse .dropdown-menu a {
961 | padding: 9px 15px;
962 | font-weight: bold;
963 | color: #777777;
964 | -webkit-border-radius: 3px;
965 | -moz-border-radius: 3px;
966 | border-radius: 3px;
967 | }
968 | .nav-collapse .btn {
969 | padding: 4px 10px 4px;
970 | font-weight: normal;
971 | -webkit-border-radius: 4px;
972 | -moz-border-radius: 4px;
973 | border-radius: 4px;
974 | }
975 | .nav-collapse .dropdown-menu li + li a {
976 | margin-bottom: 2px;
977 | }
978 | .nav-collapse .nav > li > a:hover,
979 | .nav-collapse .dropdown-menu a:hover {
980 | background-color: #f2f2f2;
981 | }
982 | .navbar-inverse .nav-collapse .nav > li > a:hover,
983 | .navbar-inverse .nav-collapse .dropdown-menu a:hover {
984 | background-color: #111111;
985 | }
986 | .nav-collapse.in .btn-group {
987 | padding: 0;
988 | margin-top: 5px;
989 | }
990 | .nav-collapse .dropdown-menu {
991 | position: static;
992 | top: auto;
993 | left: auto;
994 | display: block;
995 | float: none;
996 | max-width: none;
997 | padding: 0;
998 | margin: 0 15px;
999 | background-color: transparent;
1000 | border: none;
1001 | -webkit-border-radius: 0;
1002 | -moz-border-radius: 0;
1003 | border-radius: 0;
1004 | -webkit-box-shadow: none;
1005 | -moz-box-shadow: none;
1006 | box-shadow: none;
1007 | }
1008 | .nav-collapse .dropdown-menu:before,
1009 | .nav-collapse .dropdown-menu:after {
1010 | display: none;
1011 | }
1012 | .nav-collapse .dropdown-menu .divider {
1013 | display: none;
1014 | }
1015 | .nav-collapse .nav > li > .dropdown-menu:before,
1016 | .nav-collapse .nav > li > .dropdown-menu:after {
1017 | display: none;
1018 | }
1019 | .nav-collapse .navbar-form,
1020 | .nav-collapse .navbar-search {
1021 | float: none;
1022 | padding: 10px 15px;
1023 | margin: 10px 0;
1024 | border-top: 1px solid #f2f2f2;
1025 | border-bottom: 1px solid #f2f2f2;
1026 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
1027 | -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
1028 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
1029 | }
1030 | .navbar-inverse .nav-collapse .navbar-form,
1031 | .navbar-inverse .nav-collapse .navbar-search {
1032 | border-top-color: #111111;
1033 | border-bottom-color: #111111;
1034 | }
1035 | .navbar .nav-collapse .nav.pull-right {
1036 | float: none;
1037 | margin-left: 0;
1038 | }
1039 | .nav-collapse,
1040 | .nav-collapse.collapse {
1041 | height: 0;
1042 | overflow: hidden;
1043 | }
1044 | .navbar .btn-navbar {
1045 | display: block;
1046 | }
1047 | .navbar-static .navbar-inner {
1048 | padding-right: 10px;
1049 | padding-left: 10px;
1050 | }
1051 | }
1052 |
1053 | @media (min-width: 980px) {
1054 | .nav-collapse.collapse {
1055 | height: auto !important;
1056 | overflow: visible !important;
1057 | }
1058 | }
1059 |
--------------------------------------------------------------------------------