Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug 790985 - index page for admin interface, r=bhearsum
- Loading branch information
Showing
40 changed files
with
259 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
test.done | ||
*.db | ||
.vagrant | ||
admin.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+180 Bytes
auslib/admin/static/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+178 Bytes
auslib/admin/static/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+120 Bytes
auslib/admin/static/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+110 Bytes
auslib/admin/static/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+119 Bytes
auslib/admin/static/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+101 Bytes
auslib/admin/static/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.27 KB
auslib/admin/static/css/smoothness/images/ui-icons_222222_256x240.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.27 KB
auslib/admin/static/css/smoothness/images/ui-icons_2e83ff_256x240.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.27 KB
auslib/admin/static/css/smoothness/images/ui-icons_cd0a0a_256x240.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
auslib/admin/static/css/smoothness/jquery-ui-1.9.2.custom.min.css
Large diffs are not rendered by default.
Oops, something went wrong.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,58 @@ | ||
<!DOCTYPE HTML> | ||
<html lang='en-US'> | ||
<head> | ||
<title>{% block title %}{% endblock %}</title> | ||
<link rel='stylesheet' type='text/css' href='{{ url_for('static', filename='ausadmin.css') }}' /> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>{% block title %}AUS3 Admin{% endblock %}</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="author" content="Mozilla"> | ||
|
||
<link rel='stylesheet' type='text/css' href='{{ url_for('static', filename='css/bootstrap.min.css') }}' /> | ||
<style> | ||
body { | ||
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */ | ||
} | ||
</style> | ||
<link rel='stylesheet' type='text/css' href='{{ url_for('static', filename='css/bootstrap-responsive.min.css') }}' /> | ||
<link rel='stylesheet' type='text/css' href='{{ url_for('static', filename='css/ausadmin.css') }}' /> | ||
{% block head %} | ||
{% endblock %} | ||
|
||
</head> | ||
|
||
<body> | ||
|
||
<div class="navbar navbar-inverse 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="/">AUS3 Admin</a> | ||
<div class="nav-collapse collapse"> | ||
<ul class="nav"> | ||
<!--<li class="active"><a href="/">Home</a></li>--> | ||
<li><a href="/rules.html">Rules</a></li> | ||
<li><a href="/releases.html">Releases</a></li> | ||
<li><a href="/permissions.html">Permissions</a></li> | ||
</ul> | ||
</div><!--/.nav-collapse --> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="container"> | ||
|
||
{% block content %}{% endblock %} | ||
|
||
</div> <!-- /container --> | ||
|
||
{% block bottom %} | ||
<script type='text/javascript'>var SCRIPT_ROOT = {{ request.script_root|tojson|safe }};</script> | ||
<script type='text/javascript' src='{{ url_for('static', filename='jquery-1.6.4.js') }}'></script> | ||
<script type='text/javascript' src='{{ url_for('static', filename='jquery.dataTables.1.9.0.min.js') }}'></script> | ||
<script type='text/javascript' src='{{ url_for('static', filename='ausadmin.js') }}'></script> | ||
{% block head %}{% endblock %} | ||
</head> | ||
<body> | ||
<div id='nav'> | ||
<a href='/rules.html'>Rules</a> | ||
<a href='/releases.html'>Releases</a> | ||
<a href='/permissions.html'>Permissions</a> | ||
</div> | ||
<div id='content'> | ||
{% block content %}{% endblock %} | ||
</div> | ||
</body> | ||
<script type='text/javascript' src='{{ url_for('static', filename='js/jquery-1.8.3.min.js') }}'></script> | ||
<script type='text/javascript' src='{{ url_for('static', filename='js/jquery.dataTables.1.9.0.min.js') }}'></script><!-- really needed on every page? --> | ||
<script type='text/javascript' src='{{ url_for('static', filename='js/ausadmin.js') }}'></script> | ||
{% endblock %} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
<form id='new_permission' | ||
onsubmit='addNewPermission("{{ username }}", $("#{{ form.permission.id }}").val(), $("#{{ form.options.id }}").val(), $("#permissions")); return false'> | ||
{{ form.permission.label()|safe }}: | ||
{{ form.permission.label()|safe }} | ||
{{ form.permission()|safe }} | ||
{{ form.options.label()|safe }}: | ||
{{ form.options.label()|safe }} | ||
{{ form.options()|safe }} | ||
<input type='submit' value='Add' /> | ||
|
||
<div> | ||
<button type="submit" class="btn">Add</button> | ||
</div> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<form onsubmit='redirect("{{ url_for("user_permissions.html") }}", {"username": $("#newuser").val()}); return false'> | ||
<label for='newuser'>Edit permissions for a new user:</label> | ||
<input type='text' id='newuser' name='newuser' /> | ||
<input type='submit' /> | ||
<label for='newuser'>Edit permissions for a new user</label> | ||
<input type='text' id='newuser' placeholder="username" name='newuser' /> | ||
<button type="submit" class="btn">Add!</button> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
{% set permission = form.permission.id %} | ||
<li id='{{ permission }}_li'> | ||
<div id='{{ permission }}_li'> | ||
<form id='{{ permission }}_form' onsubmit='submitPermissionForm("{{ username }}", $("#{{ permission }}_form"), $("#{{ permission }}_li")); return false;'> | ||
{{ form.permission.label()|safe }}: | ||
{{ form.permission.label()|safe }} | ||
{{ form.permission()|safe }} | ||
{{ form.options.label()|safe }}: | ||
{{ form.options.label()|safe }} | ||
{{ form.options()|safe }} | ||
{{ form.data_version()|safe }} | ||
<input type='submit' name='submit' value='Update' onclick='$("#{{ permission }}_form").data("clicked", "update");' /> | ||
<input type='submit' name='submit' value='Delete' onclick='$("#{{ permission }}_form").data("clicked", "delete"); '/> | ||
|
||
<div> | ||
<button class='btn' type='submit' name='submit' onclick='$("#{{ permission }}_form").data("clicked", "update");'>Update</button> | ||
<button class='btn' type='submit' name='submit' onclick='$("#{{ permission }}_form").data("clicked", "delete"); '>Delete</button> | ||
</div> | ||
|
||
</form> | ||
</li> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
{% if releases %} | ||
<h3>Below is a complete list of all of the releases. Click through to access the data field.</h3> | ||
<table id="Releases_table"> | ||
<tr> | ||
<th>Name</th> | ||
<th>Product</th> | ||
<th>Version</th> | ||
<th>Data</th> | ||
</tr> </thead> | ||
<table id="Releases_table" class="table"> | ||
<thead> | ||
<tr> | ||
<th>Name</th> | ||
<th>Product</th> | ||
<th>Version</th> | ||
<th>Data</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for row in releases %} | ||
{% include 'fragments/release_row.html' %} | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</form> | ||
{% else %} | ||
|
||
There were no releases provided. | ||
{% endif %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<ul id='permissions'> | ||
<div id='permissions'> | ||
{% for form in permissions %} | ||
{% include 'fragments/permission.html' %} | ||
{% endfor %} | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{% extends "base.html" %} | ||
{% block content %} | ||
|
||
<div class="row"> | ||
<div class="span4"> | ||
<h2>Rules</h2> | ||
<p>There are currently <strong>{{ count_rules }} rules</strong> in the database.</p> | ||
<p><a class="btn" href="/rules.html">Go there »</a></p> | ||
</div> | ||
<div class="span4"> | ||
<h2>Releases</h2> | ||
<p>There are currently <strong>{{ count_releases }} releases</strong> in the database.</p> | ||
<p><a class="btn" href="/releases.html">Go there »</a></p> | ||
</div> | ||
<div class="span4"> | ||
<h2>Permissions</h2> | ||
<p>There are currently | ||
<strong>{{ count_users }} users</strong> | ||
in the database.</p> | ||
<p><a class="btn" href="/permissions.html">Go there »</a></p> | ||
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
<h2>Recent changes</h2> | ||
<p>...</p> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from flask import render_template | ||
from auslib.admin.views.base import AdminView | ||
from auslib.admin.base import db | ||
|
||
|
||
class IndexPageView(AdminView): | ||
"""/index.html""" | ||
def get(self): | ||
data = { | ||
'count_rules': db.rules.countRules(), | ||
'count_releases': db.releases.countReleases(), | ||
'count_users': db.permissions.countAllUsers(), | ||
} | ||
return render_template('index.html', **data) |
Oops, something went wrong.