summaryrefslogtreecommitdiff
path: root/stashbox/templates
diff options
context:
space:
mode:
Diffstat (limited to 'stashbox/templates')
-rw-r--r--stashbox/templates/admin_folder.html13
-rw-r--r--stashbox/templates/admin_users.html32
-rw-r--r--stashbox/templates/base.html55
-rw-r--r--stashbox/templates/folder_edit.html14
-rw-r--r--stashbox/templates/index.html35
-rw-r--r--stashbox/templates/user_add.html (renamed from stashbox/templates/useradd.html)0
-rw-r--r--stashbox/templates/user_edit.html10
-rw-r--r--stashbox/templates/usersadmin.html25
8 files changed, 140 insertions, 44 deletions
diff --git a/stashbox/templates/admin_folder.html b/stashbox/templates/admin_folder.html
new file mode 100644
index 0000000..b3e8d42
--- /dev/null
+++ b/stashbox/templates/admin_folder.html
@@ -0,0 +1,13 @@
+$def with (users, form_update)
+
+<div class="span4">
+ <header>
+ <h2>Update folder</h2>
+ </header>
+
+ <form action="" method="post">
+ $:form_update.render_css()
+ </form>
+
+</div>
+
diff --git a/stashbox/templates/admin_users.html b/stashbox/templates/admin_users.html
new file mode 100644
index 0000000..d51602b
--- /dev/null
+++ b/stashbox/templates/admin_users.html
@@ -0,0 +1,32 @@
+$def with (users, form)
+
+<div class="span8">
+ <h2>Users</h2>
+ <table class="table">
+ <tr>
+ <th>User</th>
+ <th>Password</th>
+ <th></th>
+ </tr>
+ $for user in users:
+ <tr>
+ <td><a href="/user/$user.id/edit/">$user.username</a></td>
+ <td>$user.password</td>
+ <td>
+ <form action="/user/$user.id/delete/" method="POST">
+ <input type="submit" class="btn" value="Delete" />
+ </form>
+ </td>
+ </tr>
+ </table>
+
+</div>
+
+<div class="span4">
+ <h2>Add a user</h2>
+
+ <form action="" method="post">
+ $:form.render_css()
+ </form>
+
+</div>
diff --git a/stashbox/templates/base.html b/stashbox/templates/base.html
index 7171658..e6dc781 100644
--- a/stashbox/templates/base.html
+++ b/stashbox/templates/base.html
@@ -3,12 +3,61 @@ $def with (page)
<!DOCTYPE html>
<html lang="en">
<head>
- <title>Shareguard</title>
- <link rel="stylesheet" type="text/css" href="/static/main.css" />
+ <title>Mustache</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <link href="/static/css/bootstrap.min.css" rel="stylesheet" media="screen">
+ <link href="/static/css/bootstrap-responsive.css" rel="stylesheet">
+ <link href="/static/css/stashbox.css" rel="stylesheet">
</head>
<body>
-$:page
+ <div class="navbar navbar-inverse navbar-fixed-top">
+ <div class="navbar-inner">
+ <div class="container-fluid">
+ <button type="button" 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>
+ </button>
+ <a class="brand" href="/">Mustache</a>
+ <div class="nav-collapse collapse">
+ <ul class="nav nav-tabs">
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">
+ Admin
+ <b class="caret"></b>
+ </a>
+ <ul class="dropdown-menu">
+ <li><a href="/admin/users/">Users</a></li>
+ </ul>
+ </li>
+ </ul>
+ </div><!--/.nav-collapse -->
+ </div>
+ </div>
+ </div>
+ <div class="container-fluid">
+
+ $if context['messages']:
+ <div id="messageBox" class="row-fluid">
+ <div class="span9">
+ $for message in context['messages']:
+ <div class="alert">
+ <button type="button" class="close" data-dismiss="alert">&times;</button>
+ $message
+ </div>
+ </div>
+ $ context['messages'] = []
+ </div>
+
+ <div class="row-fluid">
+ $:page
+ </div>
+
+ </div> <!-- /container -->
+
+ <script src="http://code.jquery.com/jquery.js"></script>
+ <script src="/static/js/bootstrap.min.js"></script>
</body>
</html>
diff --git a/stashbox/templates/folder_edit.html b/stashbox/templates/folder_edit.html
new file mode 100644
index 0000000..70dbadc
--- /dev/null
+++ b/stashbox/templates/folder_edit.html
@@ -0,0 +1,14 @@
+$def with (users, form_update, form_new_user)
+
+<div class="main">
+
+<div class="span4">
+ <header>
+ <h2>Update folder</h2>
+ </header>
+
+ <form action="" method="post">
+ $:form_update.render_css()
+ </form>
+
+</div>
diff --git a/stashbox/templates/index.html b/stashbox/templates/index.html
index 9c59de9..e219959 100644
--- a/stashbox/templates/index.html
+++ b/stashbox/templates/index.html
@@ -1,37 +1,40 @@
-$def with (boxes, form)
+$def with (folders, form)
-<div class="main">
+<div class="span8">
<header>
- <h1>Existing folders</h1>
+ <h2>Existing folders</h2>
</header>
- <form action="" method="post">
-
- <table class="itemlist">
+ <table class="table">
<tr>
<th>Folder</th>
<th>Owner</th>
<th>Users</th>
+ <th></th>
</tr>
- $for box in boxes:
+ $for folder in folders:
<tr>
- <td><a href="/admin/folder/$box['id']/">$box['name']</a></td>
- <td>$box['owner']</td>
+ <td><a href="/folder/$folder['id']/edit/">$folder['name']</a></td>
+ <td>$folder['owner']</td>
+ <td>
+ ${", ".join(folder['users'])}
+ </td>
<td>
- ${", ".join(box['users'])}
+ $ folder_id = folder['id']
+ <form id="delete_folder_$folder_id" action="/folder/$folder_id/delete/" method="POST">
+ <input type="submit" class="btn" value="Delete" />
+ </form>
</td>
</tr>
</table>
-
</div>
-<div class="right">
+<div class="span4">
<header>
- <h1>Add a folder</h1>
+ <h2>Add a folder</h2>
</header>
- <form action="" method="post">
- $:form.render()
+ <form id="add_folder" action="" method="POST">
+ $:form.render_css()
</form>
-
</div>
diff --git a/stashbox/templates/useradd.html b/stashbox/templates/user_add.html
index a916386..a916386 100644
--- a/stashbox/templates/useradd.html
+++ b/stashbox/templates/user_add.html
diff --git a/stashbox/templates/user_edit.html b/stashbox/templates/user_edit.html
new file mode 100644
index 0000000..da41862
--- /dev/null
+++ b/stashbox/templates/user_edit.html
@@ -0,0 +1,10 @@
+$def with (form)
+
+<div class="span4">
+ <h2>Edit user</h2>
+
+ <form action="" method="post">
+ $:form.render_css()
+ </form>
+
+</div>
diff --git a/stashbox/templates/usersadmin.html b/stashbox/templates/usersadmin.html
deleted file mode 100644
index a916386..0000000
--- a/stashbox/templates/usersadmin.html
+++ /dev/null
@@ -1,25 +0,0 @@
-$def with (users, form)
-
-<div class="main">
-
- <table class="itemlist">
- <tr>
- <th>User</th>
- <th>Password</th>
- </tr>
- $for user in users:
- <tr>
- <td>$user.username</td>
- <td>$user.password</td>
- </tr>
- </table>
-
-</div>
-
-<div class="right">
-
- <form action="" method="post">
- $:form.render()
- </form>
-
-</div>