summaryrefslogtreecommitdiff
path: root/views/staff
diff options
context:
space:
mode:
Diffstat (limited to 'views/staff')
-rw-r--r--views/staff/_blueprints.ejs21
-rw-r--r--views/staff/_gallery.ejs38
-rw-r--r--views/staff/_header.ejs2
-rw-r--r--views/staff/_layouts.ejs22
-rw-r--r--views/staff/_nav.ejs10
-rw-r--r--views/staff/_pagination.ejs2
-rw-r--r--views/staff/_projects.ejs3
-rw-r--r--views/staff/_users.ejs21
-rw-r--r--views/staff/blueprints/index.ejs13
-rw-r--r--views/staff/blueprints/show.ejs59
-rw-r--r--views/staff/blueprints/show_404.ejs9
-rw-r--r--views/staff/index.ejs6
-rw-r--r--views/staff/layouts/index.ejs13
-rw-r--r--views/staff/layouts/show.ejs61
-rw-r--r--views/staff/layouts/show_404.ejs9
-rw-r--r--views/staff/media/index.ejs7
-rw-r--r--views/staff/media/show.ejs7
-rw-r--r--views/staff/media/show_404.ejs9
-rw-r--r--views/staff/plans/_form.ejs154
-rw-r--r--views/staff/plans/edit.ejs13
-rw-r--r--views/staff/plans/index.ejs65
-rw-r--r--views/staff/plans/new.ejs13
-rw-r--r--views/staff/projects/index.ejs7
-rw-r--r--views/staff/projects/show.ejs22
-rw-r--r--views/staff/projects/show_404.ejs7
-rw-r--r--views/staff/subscriptions/index.ejs39
-rw-r--r--views/staff/subscriptions/show.ejs12
-rw-r--r--views/staff/users/index.ejs7
-rw-r--r--views/staff/users/media.ejs15
-rw-r--r--views/staff/users/show.ejs46
-rw-r--r--views/staff/users/show_404.ejs14
31 files changed, 646 insertions, 80 deletions
diff --git a/views/staff/_blueprints.ejs b/views/staff/_blueprints.ejs
new file mode 100644
index 0000000..58fe2a3
--- /dev/null
+++ b/views/staff/_blueprints.ejs
@@ -0,0 +1,21 @@
+<table id="users">
+[[ blueprints.forEach(function(blueprint){ ]]
+ <tr>
+ <td>
+ <a href="/staff/blueprints/[[- blueprint.slug ]]">[[- blueprint.name ]]</a>
+ </td>
+ <td class="editLinks">
+ <a href="/blueprint/[[- blueprint.slug ]]">[view]</a>
+<!--
+ <a href="/api/rooms/[[- blueprint.slug ]]">[api]</a>
+ -->
+ </td>
+ <td>
+ <a href="/staff/users/[[- blueprint.user.username ]]">[[- blueprint.user.username ]]</a>
+ </td>
+ <td>
+ [[- blueprint.date ]]
+ </td>
+ </tr>
+[[ }) ]]
+</table>
diff --git a/views/staff/_gallery.ejs b/views/staff/_gallery.ejs
new file mode 100644
index 0000000..d5948e3
--- /dev/null
+++ b/views/staff/_gallery.ejs
@@ -0,0 +1,38 @@
+[[ media.forEach(function(media){ ]]
+ <div class="media">
+ [[ if (media.type == "image") { ]]
+ <a class="medialink" href="[[- media.url ]]" target="_blank"><img src="[[- media.url ]]"></a>
+ [[ } else { ]]
+ <a class="medialink" href="[[- media.url ]]" target="_blank">[[- media.shortUrl ]]</a>
+ [[ } ]]
+ <br>
+ <a href="/staff/media/[[- media._id ]]">[view]</a>
+ <a href="/staff/users/[[- media.user.username ]]">[[- media.user.username ]]</a>
+ [[- media.date ]]
+ </div>
+[[ }) ]]
+</table>
+
+<style>
+.media {
+ height: 28vw;
+ width: 24vw;
+ margin: 1vw;
+ display: inline-block;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.staff .body a.medialink {
+ width: 24vw;
+ height: 24vw;
+ display: block;
+ overflow: hidden;
+ color: #00f;
+ border: 0;
+ text-decoration: underline;
+}
+.staff .body a.medialink img {
+ max-width: 100%;
+}
+</style> \ No newline at end of file
diff --git a/views/staff/_header.ejs b/views/staff/_header.ejs
index 3bbf4f1..a73c12e 100644
--- a/views/staff/_header.ejs
+++ b/views/staff/_header.ejs
@@ -1,7 +1,7 @@
<!doctype html>
<html>
<head>
- <title>vvalls | staff</title>
+ <title>VValls | staff</title>
[[ include ../partials/meta ]]
<link rel="stylesheet" href="/assets/javascripts/vendor/bower_components/jquery-jsonview/dist/jquery.jsonview.css"></script>
<link rel="stylesheet" href="/assets/stylesheets/staff.css"></script>
diff --git a/views/staff/_layouts.ejs b/views/staff/_layouts.ejs
new file mode 100644
index 0000000..d97883b
--- /dev/null
+++ b/views/staff/_layouts.ejs
@@ -0,0 +1,22 @@
+<table id="users">
+[[ layouts.forEach(function(layout){ ]]
+ <tr>
+ <td>
+ <a href="/staff/layouts/[[- layout.slug ]]">[[- layout.name ]]</a>
+ </td>
+ <td class="editLinks">
+ <a href="/layout/[[- layout.slug ]]">[view]</a>
+ <a href="/layout/[[- layout.slug ]]/edit">[edit]</a>
+<!--
+ <a href="/api/rooms/[[- layout.slug ]]">[api]</a>
+ -->
+ </td>
+ <td>
+ <a href="/staff/users/[[- layout.user.username ]]">[[- layout.user.username ]]</a>
+ </td>
+ <td>
+ [[- layout.date ]]
+ </td>
+ </tr>
+[[ }) ]]
+</table>
diff --git a/views/staff/_nav.ejs b/views/staff/_nav.ejs
new file mode 100644
index 0000000..702a374
--- /dev/null
+++ b/views/staff/_nav.ejs
@@ -0,0 +1,10 @@
+<nav>
+ <a href="/staff">home</a>
+ <a href="/staff/users">users</a>
+ <a href="/staff/projects">projects</a>
+ <a href="/staff/layouts">layouts</a>
+ <a href="/staff/blueprints">blueprints</a>
+ <a href="/staff/media">media</a>
+ <a href="/staff/plans">plans</a>
+<!-- <a href="/staff/subscriptions">subscriptions</a> -->
+</nav> \ No newline at end of file
diff --git a/views/staff/_pagination.ejs b/views/staff/_pagination.ejs
index 6c3bfb1..7d85c71 100644
--- a/views/staff/_pagination.ejs
+++ b/views/staff/_pagination.ejs
@@ -10,7 +10,7 @@
[[ if (pagination.next_page !== -1) { ]]
<a href="?[[- pagination.query ]]&offset=[[- pagination.next_page ]]">Next page &rarr;</a>
[[ } else { ]]
- &rarr;
+ ->
[[ } ]]
</div>
diff --git a/views/staff/_projects.ejs b/views/staff/_projects.ejs
index 0fdfcf5..2c3eb9f 100644
--- a/views/staff/_projects.ejs
+++ b/views/staff/_projects.ejs
@@ -7,11 +7,10 @@
<td class="editLinks">
<a href="/project/[[- project.slug ]]">[view]</a>
<a href="/project/[[- project.slug ]]/edit">[edit]</a>
+ <a href="/api/rooms/[[- project.slug ]]">[api]</a>
</td>
<td>
- [[ if (project.user) { ]]
<a href="/staff/users/[[- project.user.username ]]">[[- project.user.username ]]</a>
- [[ } ]]
</td>
<td>
[[- project.date ]]
diff --git a/views/staff/_users.ejs b/views/staff/_users.ejs
index d46058f..ee988ab 100644
--- a/views/staff/_users.ejs
+++ b/views/staff/_users.ejs
@@ -1,3 +1,18 @@
+<nav class="subnav">
+ sort by <a href="?sort=date">join date</a> ... <a href="?sort=last_seen">recent</a> ... <a href="?sort=name">name</a> ... jump to a letter:
+ <span class="alphabet">
+ [[ "abcdefghijklmnopqrstuvwxyz?".split("").forEach(function(letter){ ]]
+ <a href="?sort=name&initial=[[- letter ]]">[[- letter.toUpperCase() ]]</a>
+ [[ }) ]]
+ </span>
+</nav>
+
+[[ if (! users.length || opt.error) { ]]
+<div class="error">
+ [[- opt.error ]]
+</div>
+[[ } ]]
+
<table id="users">
[[ users.forEach(function(user){ ]]
<tr>
@@ -5,6 +20,10 @@
<a href="/staff/users/[[- user.username ]]"><div style="background-image:url([[- user.photo ]])" class="avatar"></div></a>
</td>
<td>
+ [[- user.plan_type ]]
+ [[- user.last_charged ]]
+ </td>
+ <td>
<a href="/staff/users/[[- user.username ]]">[[- user.username ]]</a>
</td>
<td>
@@ -12,6 +31,8 @@
</td>
<td class="editLinks">
<a href="/profile/[[- user.username ]]">[view profile]</a>
+ <a href="/staff/users/[[- user.username ]]/media">[view media]</a>
+ <a href="https://vvalls.recurly.com/accounts/[[- user._id ]]">[recurly]</a>
</td>
<td>
[[- user.last_seen ]]
diff --git a/views/staff/blueprints/index.ejs b/views/staff/blueprints/index.ejs
new file mode 100644
index 0000000..2206a1c
--- /dev/null
+++ b/views/staff/blueprints/index.ejs
@@ -0,0 +1,13 @@
+[[ include ../_header ]]
+
+ <h1>Blueprints</h1>
+
+[[ include ../_nav ]]
+
+ <hr>
+
+[[ include ../_pagination ]]
+[[ include ../_blueprints ]]
+[[ include ../_pagination ]]
+
+[[ include ../_footer ]]
diff --git a/views/staff/blueprints/show.ejs b/views/staff/blueprints/show.ejs
new file mode 100644
index 0000000..5fd9db6
--- /dev/null
+++ b/views/staff/blueprints/show.ejs
@@ -0,0 +1,59 @@
+[[ include ../_header ]]
+
+ <h1>[[- blueprint.name ]]</h1>
+
+[[ include ../_nav ]]
+
+ <hr>
+
+ <table>
+ <tr>
+ <td>
+ <a href="/staff/blueprints/[[- blueprint.slug ]]">[[- blueprint.name ]]</a>
+ </td>
+ <td class="editLinks">
+ <a href="/blueprint/[[- blueprint.slug ]]">[view]</a>
+ <a href="/blueprint/[[- blueprint.slug ]]/edit">[edit]</a>
+<!--
+ <a href="/api/rooms/[[- blueprint.slug ]]">[api]</a>
+ -->
+ </td>
+ <td>
+ [[- blueprint.date ]]
+ </td>
+ </tr>
+ <tr>
+ <td>
+ [[ if (blueprintUser.photo) { ]]
+ <a href="/staff/users/[[- blueprintUser.username ]]"><div style="background-image:url([[- blueprintUser.photo ]])" class="avatar"></div></a>
+ [[ } ]]
+ <a href="/staff/users/[[- blueprintUser.username ]]">[[- blueprintUser.username ]]</a>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="999">
+ <img src="[[- blueprint.url ]]" style="max-width: 400px">
+ </td>
+ </tr>
+ <tr>
+ <td>Width</td>
+ <td>[[- blueprint.width ]]</td>
+ </tr>
+ <tr>
+ <td>Height</td>
+ <td>[[- blueprint.height ]]</td>
+ </tr>
+ <tr>
+ <td>Scale</td>
+ <td>[[- blueprint.scale ]]</td>
+ </tr>
+ </table>
+
+ <br><br>
+ <div id="actions">
+ </div>
+
+ <br>
+ <br>
+
+[[ include ../_footer ]]
diff --git a/views/staff/blueprints/show_404.ejs b/views/staff/blueprints/show_404.ejs
new file mode 100644
index 0000000..0ffca86
--- /dev/null
+++ b/views/staff/blueprints/show_404.ejs
@@ -0,0 +1,9 @@
+[[ include ../_header ]]
+
+ <h1>Blueprint not found</h1>
+
+[[ include ../_nav ]]
+
+ <hr>
+
+[[ include ../_footer ]]
diff --git a/views/staff/index.ejs b/views/staff/index.ejs
index 5ca7269..1b73641 100644
--- a/views/staff/index.ejs
+++ b/views/staff/index.ejs
@@ -2,11 +2,7 @@
<h1>Staff Area</h1>
- <nav>
- <a href="/staff/users">users</a>
- <a href="/staff/projects">projects</a>
- <a href="/staff/media">media</a>
- </nav>
+ [[ include _nav ]]
<hr>
diff --git a/views/staff/layouts/index.ejs b/views/staff/layouts/index.ejs
new file mode 100644
index 0000000..71f5dc7
--- /dev/null
+++ b/views/staff/layouts/index.ejs
@@ -0,0 +1,13 @@
+[[ include ../_header ]]
+
+ <h1>Layouts</h1>
+
+[[ include ../_nav ]]
+
+ <hr>
+
+[[ include ../_pagination ]]
+[[ include ../_layouts ]]
+[[ include ../_pagination ]]
+
+[[ include ../_footer ]]
diff --git a/views/staff/layouts/show.ejs b/views/staff/layouts/show.ejs
new file mode 100644
index 0000000..2742c1f
--- /dev/null
+++ b/views/staff/layouts/show.ejs
@@ -0,0 +1,61 @@
+[[ include ../_header ]]
+
+ <h1>[[- layout.name ]]</h1>
+
+[[ include ../_nav ]]
+
+ <hr>
+
+ <table>
+ <tr>
+ <td>
+ <a href="/staff/layouts/[[- layout.slug ]]">[[- layout.name ]]</a>
+ </td>
+ <td class="editLinks">
+ <a href="/layout/[[- layout.slug ]]">[view]</a>
+ <a href="/layout/[[- layout.slug ]]/edit">[edit]</a>
+<!--
+ <a href="/api/rooms/[[- layout.slug ]]">[api]</a>
+ -->
+ </td>
+ <td>
+ [[- layout.date ]]
+ </td>
+<!--
+ <td>
+ [[- layout.privacy ? "private" : "" ]]
+ </td>
+ -->
+ </tr>
+ <tr>
+ <td>
+ [[ if (layoutUser.photo) { ]]
+ <a href="/staff/users/[[- layoutUser.username ]]"><div style="background-image:url([[- layoutUser.photo ]])" class="avatar"></div></a>
+ [[ } ]]
+ <a href="/staff/users/[[- layoutUser.username ]]">[[- layoutUser.username ]]</a>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="999" class="description">
+ "[[- layout.description ]]"
+ </td>
+ </tr>
+ <tr>
+ <th>
+ stock layout?
+ </th>
+ <td id="isStockLayout">
+ [[- layout.is_stock ? "yes" : "no" ]]
+ </td>
+ </tr>
+ </table>
+
+ <br><br>
+ <div id="actions">
+ <button id="toggle-stock" data-stock="[[- !! (layout.is_stock) ]]">Make this layout Stock</button>
+ </div>
+
+ <br>
+ <br>
+
+[[ include ../_footer ]]
diff --git a/views/staff/layouts/show_404.ejs b/views/staff/layouts/show_404.ejs
new file mode 100644
index 0000000..5d24aa8
--- /dev/null
+++ b/views/staff/layouts/show_404.ejs
@@ -0,0 +1,9 @@
+[[ include ../_header ]]
+
+ <h1>Layout not found</h1>
+
+[[ include ../_nav ]]
+
+ <hr>
+
+[[ include ../_footer ]]
diff --git a/views/staff/media/index.ejs b/views/staff/media/index.ejs
index 516af2d..3805c8e 100644
--- a/views/staff/media/index.ejs
+++ b/views/staff/media/index.ejs
@@ -2,12 +2,7 @@
<h1>Media</h1>
- <nav>
- <a href="/staff">home</a>
- <a href="/staff/users">users</a>
- <a href="/staff/projects">projects</a>
- <a href="/staff/media">media</a>
- </nav>
+[[ include ../_nav ]]
<hr>
diff --git a/views/staff/media/show.ejs b/views/staff/media/show.ejs
index 76dcd32..9d05cb9 100644
--- a/views/staff/media/show.ejs
+++ b/views/staff/media/show.ejs
@@ -2,12 +2,7 @@
<h1>Media: [[- media.type ]]</h1>
- <nav>
- <a href="/staff">home</a>
- <a href="/staff/users">users</a>
- <a href="/staff/projects">projects</a>
- <a href="/staff/media">media</a>
- </nav>
+[[ include ../_nav ]]
<hr>
diff --git a/views/staff/media/show_404.ejs b/views/staff/media/show_404.ejs
index f07cef2..c6bac6f 100644
--- a/views/staff/media/show_404.ejs
+++ b/views/staff/media/show_404.ejs
@@ -2,13 +2,8 @@
<h1>Media not found</h1>
- <nav>
- <a href="/staff">home</a>
- <a href="/staff/users">users</a>
- <a href="/staff/projects">projects</a>
- <a href="/staff/media">media</a>
- </nav>
-
+[[ include ../_nav ]]
+
<hr>
[[ include ../_footer ]]
diff --git a/views/staff/plans/_form.ejs b/views/staff/plans/_form.ejs
new file mode 100644
index 0000000..85375fa
--- /dev/null
+++ b/views/staff/plans/_form.ejs
@@ -0,0 +1,154 @@
+<input type="hidden" id="_csrf" name="_csrf" value="[[- token ]]">
+
+<ul>
+
+<li class="section_break">
+ <h3>New Plan</h3>
+</li>
+
+<li>
+ <label for="plan_name">Name</label>
+ <div><input id="plan_name" name="name" type="text" value="[[- plan.name ]]"></div>
+</li>
+
+<li>
+ <label for="plan_slug">Slug</label>
+ <div><input id="plan_slug" name="slug" type="text" value="[[- plan.slug ]]"></div>
+</li>
+
+<li>
+ <label for="plan_level">Level</label>
+ <div><input id="plan_level" name="level" type="number" min="0" value="[[- plan.level ]]"></div>
+</li>
+
+<!-- - - - - -->
+
+<li class="section_break">
+ <h3>Plan Pricing</h3>
+</li>
+
+<li>
+ <label for="plan_monthly_price">Monthly Price</label>
+ <div><input id="plan_monthly_price" name="monthly_price" type="number" min="0" value="[[- plan.monthly_price ]]"></div>
+</li>
+
+<li>
+ <label for="plan_yearly_price">Yearly Price</label>
+ <div><input id="plan_yearly_price" name="yearly_price" type="number" min="0" value="[[- plan.yearly_price ]]"></div>
+</li>
+
+<p>
+ <i>Note:</i> Pricing should be in cents, i.e. a price of $10.00 should be entered as 1000.
+</p>
+
+<!-- - - - - -->
+
+<li class="section_break">
+ <h3>Additional Template Pricing</h3>
+</li>
+
+<li>
+ <label for="plan_basic_layout_monthly_price">Basic Template Price (Monthly)</label>
+ <div><input id="plan_basic_layout_monthly_price" name="basic_layout_monthly_price" type="number" min="0" value="[[- plan.basic_layout_monthly_price ]]"></div>
+</li>
+
+<li>
+ <label for="plan_basic_layout_yearly_price">Basic Template Price (Yearly)</label>
+ <div><input id="plan_basic_layout_yearly_price" name="basic_layout_yearly_price" type="number" min="0" value="[[- plan.basic_layout_yearly_price ]]"></div>
+</li>
+
+<li>
+ <label for="plan_pro_layout_monthly_price">Pro Template Price (Monthly)</label>
+ <div><input id="plan_pro_layout_monthly_price" name="pro_layout_monthly_price" type="number" min="0" value="[[- plan.pro_layout_monthly_price ]]"></div>
+</li>
+
+<li>
+ <label for="plan_pro_layout_yearly_price">Pro Template Price (Yearly)</label>
+ <div><input id="plan_pro_layout_yearly_price" name="pro_layout_yearly_price" type="number" min="0" value="[[- plan.pro_layout_yearly_price ]]"></div>
+</li>
+
+<!-- - - - - -->
+
+<li class="section_break">
+ <h3>Per-Plan Template Limits</h3>
+</li>
+
+<li>
+ <label for="plan_basic_layout_limit">Basic Template Limit</label>
+ <div><input id="plan_basic_layout_limit" name="basic_layout_limit" type="number" min="0" value="[[- plan.basic_layout_limit ]]"></div>
+</li>
+
+<li>
+ <label for="plan_pro_layout_limit">Pro Template Limit</label>
+ <div><input id="plan_pro_layout_limit" name="pro_layout_limit" type="number" min="0" value="[[- plan.pro_layout_limit ]]"></div>
+</li>
+
+<!-- - - - - -->
+
+<li class="section_break">
+ <h3>Per-Plan Project Limits</h3>
+</li>
+
+<li>
+ <label for="plan_stock_project_limit">Stock Project Limit</label>
+ <div><input id="plan_stock_project_limit" name="stock_project_limit" type="number" min="0" value="[[- plan.stock_project_limit ]]"></div>
+</li>
+
+<li>
+ <label for="plan_basic_project_limit">Basic Project Limit</label>
+ <div><input id="plan_basic_project_limit" name="basic_project_limit" type="number" min="0" value="[[- plan.basic_project_limit ]]"></div>
+</li>
+
+<li>
+ <label for="plan_pro_project_limit">Pro Project Limit</label>
+ <div><input id="plan_pro_project_limit" name="pro_project_limit" type="number" min="0" value="[[- plan.pro_project_limit ]]"></div>
+</li>
+
+<!-- - - - - -->
+
+<li class="section_break">
+ <h3>Permissions</h3>
+</li>
+
+<div>
+<li>
+ <input name="permissions_basic_editor" type="hidden" value="0">
+ <input id="plan_permissions_basic_editor" name="permissions_basic_editor" type="checkbox" value="1" [[ if (plan.permissions.basic_editor) { ]]checked[[ } ]]>
+ <label for="plan_permissions_basic_editor">Basic Editor</label>
+</li>
+
+<li>
+ <input name="permissions_pro_editor" type="hidden" value="0">
+ <input id="plan_permissions_pro_editor" name="permissions_pro_editor" type="checkbox" value="1" [[ if (plan.permissions.pro_editor) { ]]checked[[ } ]]>
+ <label for="plan_permissions_pro_editor">Pro Editor</label>
+</li>
+
+<li>
+ <input name="permissions_sculpture" type="hidden" value="0">
+ <input id="plan_permissions_sculpture" name="permissions_sculpture" type="checkbox" value="1" [[ if (plan.permissions.sculpture) { ]]checked[[ } ]]>
+ <label for="plan_permissions_sculpture">3D Objects</label>
+</li>
+
+<li>
+ <input name="permissions_collaborators" type="hidden" value="0">
+ <input id="plan_permissions_collaborators" name="permissions_collaborators" type="checkbox" value="1" [[ if (plan.permissions.collaborators) { ]]checked[[ } ]]>
+ <label for="plan_permissions_collaborators">Collaborators</label>
+</li>
+
+<li>
+ <input name="permissions_no_logo" type="hidden" value="0">
+ <input id="plan_permissions_no_logo" name="permissions_no_logo" type="checkbox" value="1" [[ if (plan.permissions.no_logo) { ]]checked[[ } ]]>
+ <label for="plan_permissions_no_logo">No Logo</label>
+</li>
+
+<p>
+ These permissions should harmonize with the restrictions on layouts set above.
+</p>
+
+</div>
+
+<li>
+ <input type="submit" value="Save Changes">
+</li>
+
+</ul>
diff --git a/views/staff/plans/edit.ejs b/views/staff/plans/edit.ejs
new file mode 100644
index 0000000..9848873
--- /dev/null
+++ b/views/staff/plans/edit.ejs
@@ -0,0 +1,13 @@
+[[ include ../_header ]]
+
+ <h1>Edit Plan</h1>
+
+[[ include ../_nav ]]
+
+ <hr>
+
+<form action="" method="post">
+[[- include _form ]]
+</form>
+
+[[ include ../_footer ]]
diff --git a/views/staff/plans/index.ejs b/views/staff/plans/index.ejs
new file mode 100644
index 0000000..16fcf14
--- /dev/null
+++ b/views/staff/plans/index.ejs
@@ -0,0 +1,65 @@
+[[ include ../_header ]]
+
+ <h1>Plans</h1>
+
+[[ include ../_nav ]]
+
+ <hr>
+
+<table>
+ <tr>
+ <td>
+ </td>
+ [[ plans.forEach(function(plan){ ]]
+ <td style="text-align:right; min-width: 100px;">
+ <b style="text-transform:uppercase">[[- plan.name ]]</b>
+ </td>
+ [[ }) ]]
+ </tr>
+
+ <tr class="editLinks">
+ <td>
+ <a href="/staff/plans/new">New Plan</a>
+ </td>
+ [[ plans.forEach(function(plan){ ]]
+ <td style="text-align:right">
+ [<a href="/staff/plans/[[- plan.slug ]]">edit</a>]
+ </td>
+ [[ }) ]]
+ </tr>
+
+ [[ fields.forEach(function(field){ ]]
+ <tr>
+ <td style="text-transform:capitalize">[[- field.replace(/_/g," ") ]]</td>
+ [[ plans.forEach(function(plan){ ]]
+ <td style="text-align:right">
+ [[ if (field.indexOf("_price") != -1) { ]]
+ [[- plan[field] == 0 ? "" : "$" + (plan[field]/100).toFixed(2) ]]
+ [[ } else { ]]
+ [[- plan[field] ]]
+ [[ } ]]
+ </td>
+ [[ }) ]]
+ </tr>
+ [[ }) ]]
+
+ <tr>
+ <td style="border-bottom: 1px dotted #888;" colspan='10'></td>
+ </tr>
+
+ [[ permissions.forEach(function(permission){ ]]
+ <tr>
+ <td style="text-transform:capitalize">[[- permission.replace(/_/g," ") ]]</td>
+ [[ plans.forEach(function(plan){ ]]
+ <td style="text-align:right">
+ [[- plan.permissions[permission] ? "<b>x</b>" : " " ]]
+ </td>
+ [[ }) ]]
+ </tr>
+ [[ }) ]]
+</table>
+<br clear="all">
+
+ <hr>
+
+[[ include ../_footer ]]
diff --git a/views/staff/plans/new.ejs b/views/staff/plans/new.ejs
new file mode 100644
index 0000000..297d3d6
--- /dev/null
+++ b/views/staff/plans/new.ejs
@@ -0,0 +1,13 @@
+[[ include ../_header ]]
+
+ <h1>New Plan</h1>
+
+[[ include ../_nav ]]
+
+ <hr>
+
+<form action="" method="post">
+[[- include _form ]]
+</form>
+
+[[ include ../_footer ]]
diff --git a/views/staff/projects/index.ejs b/views/staff/projects/index.ejs
index 482ea25..e4ba469 100644
--- a/views/staff/projects/index.ejs
+++ b/views/staff/projects/index.ejs
@@ -2,12 +2,7 @@
<h1>Projects</h1>
- <nav>
- <a href="/staff">home</a>
- <a href="/staff/users">users</a>
- <a href="/staff/projects">projects</a>
- <a href="/staff/media">media</a>
- </nav>
+[[ include ../_nav ]]
<hr>
diff --git a/views/staff/projects/show.ejs b/views/staff/projects/show.ejs
index 687f0c2..b090a41 100644
--- a/views/staff/projects/show.ejs
+++ b/views/staff/projects/show.ejs
@@ -2,13 +2,8 @@
<h1>[[- project.name ]]</h1>
- <nav>
- <a href="/staff">home</a>
- <a href="/staff/users">users</a>
- <a href="/staff/projects">projects</a>
- <a href="/staff/media">media</a>
- </nav>
-
+[[ include ../_nav ]]
+
<hr>
<table>
@@ -41,8 +36,21 @@
"[[- project.description ]]"
</td>
</tr>
+ <tr>
+ <th>
+ featured?
+ </th>
+ <td id="isFeaturedProject">
+ [[- project.featured ? "yes" : "no" ]]
+ </td>
+ </tr>
</table>
+ <br><br>
+ <div id="actions">
+ <button id="toggle-featured" data-featured="[[- !! project.featured ]]">Feature this Project</button>
+ </div>
+
<br>
<br>
<table id="iframe-embed" class="projectList">
diff --git a/views/staff/projects/show_404.ejs b/views/staff/projects/show_404.ejs
index 70320c0..f5e1658 100644
--- a/views/staff/projects/show_404.ejs
+++ b/views/staff/projects/show_404.ejs
@@ -2,12 +2,7 @@
<h1>Project not found</h1>
- <nav>
- <a href="/staff">home</a>
- <a href="/staff/users">users</a>
- <a href="/staff/projects">projects</a>
- <a href="/staff/media">media</a>
- </nav>
+[[ include ../_nav ]]
<hr>
diff --git a/views/staff/subscriptions/index.ejs b/views/staff/subscriptions/index.ejs
new file mode 100644
index 0000000..adf148c
--- /dev/null
+++ b/views/staff/subscriptions/index.ejs
@@ -0,0 +1,39 @@
+[[ include ../_header ]]
+
+ <h1>Subscriptions</h1>
+
+[[ include ../_nav ]]
+
+ <hr>
+
+[[ include ../_pagination ]]
+
+<table id="users">
+[[ subscriptions.forEach(function(subscription){ ]]
+ <tr>
+ <td>
+ <a href="/staff/subscriptions/[[- subscription._id ]]"><div style="background-image:url([[- subscription.user.photo ]])" class="avatar"></div></a>
+ </td>
+ <td>
+ <a href="/staff/subscriptions/[[- subscription._id ]]">[[- subscription.user.username ]]</a>
+ </td>
+ <td>
+ [[- subscription.user.displayName ]]
+ </td>
+ <td class="editLinks">
+ <a href="/profile/[[- user.username ]]">[view profile]</a>
+ </td>
+ <td>
+ [[- subscription.user.last_seen ]]
+ </td>
+ <td>
+ [[- subscription.plan_code ]]
+ </td>
+ </tr>
+[[ }) ]]
+</table>
+
+
+[[ include ../_pagination ]]
+
+[[ include ../_footer ]]
diff --git a/views/staff/subscriptions/show.ejs b/views/staff/subscriptions/show.ejs
new file mode 100644
index 0000000..e2839a6
--- /dev/null
+++ b/views/staff/subscriptions/show.ejs
@@ -0,0 +1,12 @@
+[[ include ../_header ]]
+ <h1>User: [[- subscription.user.username ]]</h1>
+
+[[ include ../_nav ]]
+
+ <hr>
+
+<pre>
+info to show..
+- link to recurly profile
+- link to vvalls profile
+- subscription tier + add-ons
diff --git a/views/staff/users/index.ejs b/views/staff/users/index.ejs
index f14d666..1795dde 100644
--- a/views/staff/users/index.ejs
+++ b/views/staff/users/index.ejs
@@ -2,12 +2,7 @@
<h1>Users</h1>
- <nav>
- <a href="/staff">home</a>
- <a href="/staff/users">users</a>
- <a href="/staff/projects">projects</a>
- <a href="/staff/media">media</a>
- </nav>
+[[ include ../_nav ]]
<hr>
diff --git a/views/staff/users/media.ejs b/views/staff/users/media.ejs
index b13e5fb..8927c00 100644
--- a/views/staff/users/media.ejs
+++ b/views/staff/users/media.ejs
@@ -1,18 +1,13 @@
[[ include ../_header ]]
- <h1>Users</h1>
+<h1>User Media: [[- profile.username ]]</h1>
- <nav>
- <a href="/staff">home</a>
- <a href="/staff/users">users</a>
- <a href="/staff/projects">projects</a>
- <a href="/staff/media">media</a>
- </nav>
-
- <hr>
+[[ include ../_nav ]]
+
+<hr>
[[ include ../_pagination ]]
-[[ include ../_media ]]
+[[ include ../_gallery ]]
[[ include ../_pagination ]]
[[ include ../_footer ]]
diff --git a/views/staff/users/show.ejs b/views/staff/users/show.ejs
index 8e9b447..a434b57 100644
--- a/views/staff/users/show.ejs
+++ b/views/staff/users/show.ejs
@@ -1,12 +1,7 @@
[[ include ../_header ]]
<h1>User: [[- profile.username ]]</h1>
- <nav>
- <a href="/staff">home</a>
- <a href="/staff/users">users</a>
- <a href="/staff/projects">projects</a>
- <a href="/staff/media">media</a>
- </nav>
+[[ include ../_nav ]]
<hr>
@@ -22,12 +17,38 @@
[[- profile.displayName ]]
</td>
<td class="editLinks">
- <a href="/profile/[[- profile.username ]]">[view profile]</a>
- <a href="/staff/users/[[- profile.username ]]/media">[view media]</a>
+ <a href="/profile/[[- profile.username ]]">[profile]</a>
+ <a href="/staff/users/[[- profile.username ]]/media">[media]</a>
+ [[ if (profile.subscription) { ]]
+ <a href="https://vvalls.recurly.com/accounts/[[- profile._id ]]">[recurly]</a>
+ [[ } ]]
</td>
</tr>
</table>
+
+ [[ if (profile.subscription) { ]]
+ <h2>Subscription</h2>
+ <table>
+ <tr>
+ <th>
+ plan
+ </th>
+ <td>
+ [[- profile.plan_code ]]
+ </td>
+ </tr>
+ <tr>
+ <th>
+ last charged
+ </th>
+ <td>
+ [[- profile.last_charged ]]
+ </td>
+ </tr>
+ </table>
+ [[ } ]]
+
<h2>Profile</h2>
<table>
@@ -80,12 +101,21 @@
[[- profile.isStaff ? "yes" : "no" ]]
</td>
</tr>
+ <tr>
+ <th>
+ is artist?
+ </th>
+ <td id="is-artist">
+ [[- profile.isArtist ? "yes" : "no" ]]
+ </td>
+ </tr>
</table>
<br><br>
<div id="actions">
[[ if (String(user._id) != String(profile._id)) { ]]
<button id="toggle-staff" data-isStaff="[[- !! profile.isStaff ]]">Make Staff</button>
+ <button id="toggle-artist" data-isArtist="[[- !! profile.isArtist ]]">Make Artist</button>
[[ } ]]
</div>
diff --git a/views/staff/users/show_404.ejs b/views/staff/users/show_404.ejs
index bcd0271..11663fa 100644
--- a/views/staff/users/show_404.ejs
+++ b/views/staff/users/show_404.ejs
@@ -1,13 +1,9 @@
[[ include ../_header ]]
- <h1>User not found</h1>
- <nav>
- <a href="/staff">home</a>
- <a href="/staff/users">users</a>
- <a href="/staff/projects">projects</a>
- <a href="/staff/media">media</a>
- </nav>
-
- <hr>
+<h1>User not found</h1>
+
+[[ include ../_nav ]]
+
+<hr>
[[ include ../_footer ]]