Skip to content

Commit

Permalink
added bootstrap css for sketch ui
Browse files Browse the repository at this point in the history
  • Loading branch information
bianchimro committed Aug 2, 2012
1 parent afe73f3 commit 92a069c
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 66 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Django==1.4
django-bootstrapped==0.1.0-dev
django-json-field==0.3
geopy==0.94.2
pymongo==2.2
Expand Down
92 changes: 58 additions & 34 deletions sketchproject/sketch_ui/templates/sketch_ui/base.html
Original file line number Diff line number Diff line change
@@ -1,41 +1,65 @@
<!doctype html>
<html lang="en">
<head>

<meta charset="utf-8">
<title>Sketch</title>
{% load bootstrap %}

<meta name="description" content="Sketch user interface">
<meta name="author" content="DDLab">

<!-- stylesheets here -->
<!--
<link rel="stylesheet" href="css/styles.css?v=1.0">
-->
<link rel="stylesheet" href="/static/sketch_ui/css/styles.css">
<!-- stylesheets end -->

<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

{% block css_1 %}
{% endblock %}
<!doctype html>
<html>
<head>
{% bootstrap_css %}
<link rel="stylesheet" href="/static/sketch_ui/css/styles.css">

<style>
body {
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
}
</style>
<title>{% block title %}{% endblock %}</title>
<script src="/static/sketch/js/jquery.js"></script>

</head>
<body>


<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="#">Sketch Browser</a>
<div class="nav-collapse">
<ul class="nav pull-left">
<li class="active"><a href="#serverpanel">Server info</a></li>
<li><a href="#querypanel">Query</a></li>
<li><a href="#importpanel">Import</a></li>
</ul>
<ul class="nav pull-right">
<li><p class="navbar-text">Welcome {{ user }} &nbsp;</p></li>
<li>

</head>
<form class="navbar-form" method="get" action="/logout/">
<input class="btn" type="submit" name="logout-button" value="Log me out"/>
</form>

<body>
</li>


{% block content %}
{% endblock %}
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>

<script src="/static/sketch/js/jquery.js"></script>
<script src="/static/sketch/js/sketch.js"></script>

{% block js_body %}
{% endblock %}
<div class="container">

{% block content %}{% endblock %}

</body>
</html>
</div> <!-- /container -->


{% bootstrap_js all %}
<script src="/static/sketch/js/sketch.js"></script>
{% block js_body %}
{% endblock %}

</body>
</html>
67 changes: 35 additions & 32 deletions sketchproject/sketch_ui/templates/sketch_ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,40 @@

{% block content %}

<h1>Sketch user interface :)</h1>
<p>Seems like you're logged in as {{ user }}</p>
<form method="get" action="/logout/">
<input type="submit" name="logout-button" value="Log me out"/>
</form>
<hr/>

<button id="test-meta-server">Test server meta info</button>
<button id="test-meta-db">Test db meta info</button>
<button id="test-meta-parsers">Test parsers meta info</button>
<hr/>

<button id="test-query">Test query</button><br/>
<label>Collection</label><input id="query-collection"/><br/>
<label>Command</label><input id="query-command"/><br/>
<label>Query</label><textarea style="width:500px;height:100px;" id="query-query"></textarea><br/>
<hr/>

<button id="test-objects">Test objects</button><br/>
<label>Collection</label><input id="objects-collection"/><br/>
<label>Query</label><textarea style="width:500px;height:100px;" id="objects-query"></textarea><br/>
<hr/>
<div id="serverpanel">
<h1>Server info</h1>
<button class="btn btn-info" id="test-meta-server">Server</button>
<button class="btn btn-info" id="test-meta-db">Db</button>
<button class="btn btn-info" id="test-meta-parsers">Parsers</button>
</div>
<hr/>

<button id="test-import">Test import</button><br/>
<label>Collection</label><input id="import-collection"/><br/>
<!-- #todo: radio or select -->
<label>Format</label>
<select id="import-format">
<option value="jsonlist">jsonlist</option>
<option value="jsontext">jsontext</option>
</select>
<br/>
<label>Data</label><textarea style="width:500px;height:200px;" id="import-data"></textarea><br/>
<br>
<label>Commit?</label><input type="checkbox" id="import-commit"/>
<div id="querypanel">
<h1>Query</h1>

<label>Collection</label><input id="objects-collection"/><br/>
<label>Query</label><textarea style="width:500px;height:100px;" id="objects-query"></textarea><br/>
<button class="btn" id="test-objects">Get objects</button><br/>
</div>
<hr/>
<div id="importpanel">
<h1>Import</h1>

<label>Collection</label><input id="import-collection"/><br/>
<!-- #todo: radio or select -->
<label>Format</label>
<select id="import-format">
<option value="jsonlist">jsonlist</option>
<option value="jsontext">jsontext</option>
</select>
<br/>
<label>Data</label><textarea style="width:500px;height:200px;" id="import-data"></textarea><br/>
<br>
<label>Commit?</label><input type="checkbox" id="import-commit"/>
<button class="btn btn-danger" id="test-import">Test import</button><br/>
</div>
<hr/>


Expand All @@ -51,6 +50,8 @@ <h1>Sketch user interface :)</h1>

<script>

$(document).ready(function(){

var sketch = new sketchjs.Sketch("http://localhost:8000", 'sketchdb');

//Helper function to log errors and results to our console div
Expand Down Expand Up @@ -178,6 +179,8 @@ <h1>Sketch user interface :)</h1>


});

});


</script>
Expand Down
1 change: 1 addition & 0 deletions sketchproject/sketchproject/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@

#json field
'json_field',
'bootstrapped',

#our apps
'sketch',
Expand Down

0 comments on commit 92a069c

Please sign in to comment.