Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

collections dropdown

  • Loading branch information...
commit 6f8ba5758a1e9738e0be608f893bf4b0c2d07fca 1 parent 5f66768
@contra contra authored
View
6 client/css/bootstrap.css
@@ -3281,9 +3281,9 @@ input[type="submit"].btn.btn-mini {
width: 405px;
margin: -200px 0 0 -200px;
background-color: #ffffff;
- border: 1px solid #999;
- border: 1px solid rgba(0, 0, 0, 0.3);
- *border: 1px solid #999;
+ /*border: 1px solid #999;*/
+ /*border: 1px solid rgba(0, 0, 0, 0.3);*/
+ /*border: 1px solid #999;*/
/* IE6-7 */
-webkit-border-radius: 6px;
View
7 client/index.html
@@ -38,13 +38,8 @@
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
- <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </a>
<a class="brand" href="#">Smog</a>
- <div class="nav-collapse">
+ <div id="navigation" class="nav-collapse">
<ul class="nav">
<li>
<a id="login-link" href="#/login">Login</a>
View
7 client/js/home.coffee
@@ -0,0 +1,7 @@
+define ["smog/server", "templates/navigation", "smog/notify"], (server, templ, notify) ->
+ ->
+ server.getCollections (err, coll) ->
+ return notify.error "Error grabbing collections: #{err}" if err?
+ coll = (it.name.substring(it.name.indexOf('.')+1) for it in coll)
+ $('#navigation').html templ collections: coll
+ $('#content').html ''
View
3  client/js/login.coffee
@@ -11,4 +11,5 @@ define ["smog/server", "templates/login", "smog/notify"], (server, templ, notify
if err?
notify.error "Connection error: #{err}"
else
- notify.success 'Connection established!'
+ notify.success 'Connection established!'
+ window.location.hash = '#/home'
View
5 client/js/routes.coffee
@@ -1,2 +1,3 @@
-define ["smog/login"], (login) ->
- '/login': login
+define ["smog/login", "smog/home"], (login, home) ->
+ '/login': login
+ '/home': home
View
0  client/templates/collections.jade
No changes.
View
8 client/templates/navigation.jade
@@ -0,0 +1,8 @@
+ul.nav
+ li.dropdown
+ a(href="", class="dropdown-toggle", data-toggle="dropdown") Collections
+ b.caret
+ ul.dropdown-menu
+ each collection in collections
+ li
+ a(href="#/collection/#{collection}") #{collection}
View
2  lib/services/getCollections.coffee
@@ -3,4 +3,4 @@
module.exports = (reply, socket) ->
return reply "Not connected" unless socket.mongo?
- socket.mongo.database.collectionsInfo().toArray reply
+ socket.mongo.database.collectionNames reply
View
6 public/css/bootstrap.css
@@ -3281,9 +3281,9 @@ input[type="submit"].btn.btn-mini {
width: 405px;
margin: -200px 0 0 -200px;
background-color: #ffffff;
- border: 1px solid #999;
- border: 1px solid rgba(0, 0, 0, 0.3);
- *border: 1px solid #999;
+ /*border: 1px solid #999;*/
+ /*border: 1px solid rgba(0, 0, 0, 0.3);*/
+ /*border: 1px solid #999;*/
/* IE6-7 */
-webkit-border-radius: 6px;
View
7 public/index.html
@@ -38,13 +38,8 @@
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
- <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </a>
<a class="brand" href="#">Smog</a>
- <div class="nav-collapse">
+ <div id="navigation" class="nav-collapse">
<ul class="nav">
<li>
<a id="login-link" href="#/login">Login</a>
View
28 public/js/home.js
@@ -0,0 +1,28 @@
+// Generated by CoffeeScript 1.3.1
+(function() {
+
+ define(["smog/server", "templates/navigation", "smog/notify"], function(server, templ, notify) {
+ return function() {
+ return server.getCollections(function(err, coll) {
+ var it;
+ if (err != null) {
+ return notify.error("Error grabbing collections: " + err);
+ }
+ coll = (function() {
+ var _i, _len, _results;
+ _results = [];
+ for (_i = 0, _len = coll.length; _i < _len; _i++) {
+ it = coll[_i];
+ _results.push(it.name.substring(it.name.indexOf('.') + 1));
+ }
+ return _results;
+ })();
+ $('#navigation').html(templ({
+ collections: coll
+ }));
+ return $('#content').html('');
+ });
+ };
+ });
+
+}).call(this);
View
3  public/js/login.js
@@ -14,7 +14,8 @@
if (err != null) {
return notify.error("Connection error: " + err);
} else {
- return notify.success('Connection established!');
+ notify.success('Connection established!');
+ return window.location.hash = '#/home';
}
});
});
View
5 public/js/routes.js
@@ -1,9 +1,10 @@
// Generated by CoffeeScript 1.3.1
(function() {
- define(["smog/login"], function(login) {
+ define(["smog/login", "smog/home"], function(login, home) {
return {
- '/login': login
+ '/login': login,
+ '/home': home
};
});
View
1  public/templates/collections.js
@@ -0,0 +1 @@
+define(["ext/jade"],function(jade){return function anonymous(locals,attrs,escape,rethrow){var attrs=jade.attrs,escape=jade.escape,rethrow=jade.rethrow,buf=[];with(locals||{})var interp;return buf.join("")}})
View
1  public/templates/navigation.js
@@ -0,0 +1 @@
+define(["ext/jade"],function(jade){return function anonymous(locals,attrs,escape,rethrow){var attrs=jade.attrs,escape=jade.escape,rethrow=jade.rethrow,buf=[];with(locals||{}){var interp;buf.push("<ul"),buf.push(attrs({"class":"nav"},{})),buf.push("><li"),buf.push(attrs({"class":"dropdown"},{})),buf.push("><a"),buf.push(attrs({href:"","data-toggle":"dropdown","class":"dropdown-toggle"},{href:!0,"class":!0,"data-toggle":!0})),buf.push(">Collections<b"),buf.push(attrs({"class":"caret"},{})),buf.push("></b></a><ul"),buf.push(attrs({"class":"dropdown-menu"},{})),buf.push(">"),function(){if("number"==typeof collections.length)for(var a=0,b=collections.length;a<b;a++){var c=collections[a];buf.push("<li><a"),buf.push(attrs({href:"#/collection/"+c+""},{href:!0})),buf.push(">"+escape((interp=c)==null?"":interp)+"</a></li>")}else for(var a in collections){var c=collections[a];buf.push("<li><a"),buf.push(attrs({href:"#/collection/"+c+""},{href:!0})),buf.push(">"+escape((interp=c)==null?"":interp)+"</a></li>")}}.call(this),buf.push("</ul></li></ul>")}return buf.join("")}})
Please sign in to comment.
Something went wrong with that request. Please try again.