Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Better option formatting in admin

  • Loading branch information...
commit 9effca746349f79e0acf0ab1033fdc0884ae2f44 1 parent 0120957
@parente authored
Showing with 3 additions and 4 deletions.
  1. +2 −3 hbag/admin/admin.html
  2. +1 −1  hbag/admin/admin.py
View
5 hbag/admin/admin.html
@@ -4,7 +4,7 @@
<meta charset="utf-8" />
<title>Handler Bag Admin</title>
<style type="text/css">
- textarea { margin-left: 2.25em; width: 90%; height: 50px;}
+ textarea { margin-left: 2.25em; width: 90%; height: 100px;}
</style>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js"></script>
<script type="text/javascript">
@@ -24,7 +24,6 @@
var options = dojo.attr(item, 'value');
data[key].options = options;
});
- console.log(data);
clearTimeout(tok);
status.innerHTML = 'Saving ...'
dojo.xhrPost({
@@ -53,7 +52,7 @@
<p>
<input type="checkbox" id="{{ key }}" name="{{ key }}" {{ 'checked' if info['enabled'] else '' }}/>
<label for="{{ key }}">{{ escape(key) }} - {{ escape(info['description']) or 'no description' }}</label><br />
- <textarea id="{{ key }}_options" name="{{ key }}">{{ json_encode(info['options']) }}</textarea>
+ <textarea id="{{ key }}_options" name="{{ key }}">{{ json.dumps(info['options'], sort_keys=True, indent=2) }}</textarea>
</p>
{% end %}
</fieldset>
View
2  hbag/admin/admin.py
@@ -17,7 +17,7 @@ def get(self, *args, **kwargs):
db = self.application.refresh_handlers_in_db()
# show all handlers but ourselves
items = (item for item in db.iteritems() if item[0] != 'admin')
- self.render('admin.html', items=items)
+ self.render('admin.html', items=items, json=json)
@tornado.web.authenticated
@users.requireRole('admin')
Please sign in to comment.
Something went wrong with that request. Please try again.