summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/about/brochure.ejs22
-rw-r--r--views/partials/edit-subscription.ejs51
-rw-r--r--views/partials/scripts.ejs1
-rw-r--r--views/profile.ejs82
-rw-r--r--views/staff/_nav.ejs1
-rw-r--r--views/staff/subscriptions/index.ejs36
-rw-r--r--views/staff/subscriptions/show.ejs12
7 files changed, 164 insertions, 41 deletions
diff --git a/views/about/brochure.ejs b/views/about/brochure.ejs
index e75f8c6..49b03db 100644
--- a/views/about/brochure.ejs
+++ b/views/about/brochure.ejs
@@ -33,8 +33,14 @@
<li> Each new floor plan can have up to [[- plans.basic.basic_project_limit ]] exhibitions
<li> VValls logo appears when embedding an exhibition on a web page
<li>
- <!-- check current subscription plan -->
- <button>Buy Now</button>
+ [[ if (! logged_in) { ]]
+ <button href="/signup">Sign Up</button>
+ [[ } else if (! user.plan_level || user.plan_level < plan.level) { ]]
+ <button href="https://vvalls.recurly.com/subscribe/basic/[[- user._id ]]/[[- user.username ]]">Buy Now</button>
+ [[ } else if (user.plan_level == plan.level) { ]]
+ Current Level
+ [[ } else { ]]
+ [[ } ]]
</ul>
</div>
@@ -49,8 +55,13 @@
<li> Includes planning for 3D objects in the room
<li> No VValls logo on embed
<li>
- <!-- check current subscription plan -->
- <button>Buy Now</button>
+ [[ if (! logged_in) { ]]
+ <button href="/signup">Sign Up</button>
+ [[ } else if (! user.plan_level || user.plan_level < plan.level) { ]]
+ <button href="https://vvalls.recurly.com/subscribe/pro/[[- user._id ]]/[[- user.username ]]">Buy Now</button>
+ [[ } else if (user.plan_level == plan.level) { ]]
+ Current Level
+ [[ } ]]
</ul>
</div>
@@ -112,6 +123,9 @@
text-align: center;
margin-bottom: 10px;
}
+.about_plan ul {
+ margin-bottom: 60px;
+}
.planbox li {
list-style-type: none;
margin-bottom: 5px;
diff --git a/views/partials/edit-subscription.ejs b/views/partials/edit-subscription.ejs
new file mode 100644
index 0000000..adc3f71
--- /dev/null
+++ b/views/partials/edit-subscription.ejs
@@ -0,0 +1,51 @@
+<div class="mediaDrawer fixed animate editSubscription">
+ <span class="close">X</span>
+ <div id="form_container">
+ <form enctype="multipart/form-data" method="post">
+ <input type="hidden" name="_csrf" value="[[- token ]]">
+ <ul>
+ <li class="section_break">
+ <h3>Edit Subscription</h3>
+ </li>
+ <div id="free_plan">
+ You are currently using the free plan. For access to all of Vvalls features,
+ consider upgrading to a paid plan.
+ <p>
+ <a href="/about/brochure">View the Plans</a>
+ </div>
+ <div id="free_plan">
+ Your current plan level is <span id="user_plan_type"></span>
+
+ <table>
+ <tr>
+ <td>Basic plan</td>
+ <td></td>
+ <td>@ $<span></span>/<span></span></td>
+ </tr>
+ <tr>
+ <td>Additional basic layouts</td>
+ <td></td>
+ <td>@ $<span></span>/<span></span></td>
+ <td>Buy more</td>
+ </tr>
+ <tr>
+ <td>Additional PRO layouts</td>
+ <td></td>
+ <td>$<span></span>/<span></span></td>
+ <td>Buy more</td>
+ </tr>
+ <tr>
+ <td>Total</td>
+ <td></td>
+ <td>$<span></span>/<span></span></td>
+ </tr>
+ </table>
+
+ <button>Upgrade your subscription</button>
+
+ <button>Cancel your subscription</button>
+ </li>
+ </ul>
+ </form>
+ </div>
+</div>
diff --git a/views/partials/scripts.ejs b/views/partials/scripts.ejs
index fc94992..04bd945 100644
--- a/views/partials/scripts.ejs
+++ b/views/partials/scripts.ejs
@@ -95,6 +95,7 @@
<script type="text/javascript" src="/assets/javascripts/ui/site/LayoutsModal.js"></script>
<script type="text/javascript" src="/assets/javascripts/ui/site/EditProjectModal.js"></script>
<script type="text/javascript" src="/assets/javascripts/ui/site/EditProfileModal.js"></script>
+<script type="text/javascript" src="/assets/javascripts/ui/site/EditSubscriptionModal.js"></script>
<script type="text/javascript" src="/assets/javascripts/ui/site/DocumentModal.js"></script>
<script type="text/javascript" src="/assets/javascripts/ui/site/HomeView.js"></script>
diff --git a/views/profile.ejs b/views/profile.ejs
index 88af6b0..e149847 100644
--- a/views/profile.ejs
+++ b/views/profile.ejs
@@ -9,48 +9,53 @@
[[- include partials/header ]]
<div class="profilepage">
- [[ if (profile.photo && profile.photo.length) { ]]
- <div class="profilePic" style="background-image:url([[- profile.photo ]])">
- </div>
- [[ } else { ]]
- <div class="profilePic noPic">
- <span class="holder">
- <span class="ion-ios7-person-outline"></span>
- [[ if (isOwnProfile) { ]]
- <div>click to add profile pic</div>
- <input id="profile_avatar" name="avatar" class="element file" type="file">
- [[ } ]]
- </span>
- </div>
+ [[ if (profile.photo && profile.photo.length) { ]]
+ <div class="profilePic" style="background-image:url([[- profile.photo ]])">
+ </div>
+ [[ } else { ]]
+ <div class="profilePic noPic">
+ <span class="holder">
+ <span class="ion-ios7-person-outline"></span>
+ [[ if (isOwnProfile) { ]]
+ <div>click to add profile pic</div>
+ <input id="profile_avatar" name="avatar" class="element file" type="file">
[[ } ]]
- <div class="bio">
- <div class="holder">
- <h2>[[- profile.displayName ]]</h2>
- [[ if (profile.location) { ]]
- <span>
- [[- profile.location ]]
- </span>
- [[ } ]]
- [[ if (profile.website && profile.website.length) { ]]
- <span>
- <a href="[[- profile.website ]]" target="_blank">[[- profile.website ]]</a>
- </span>
- [[ } ]]
- [[ if (profile.twitterName && profile.twitterName.length) { ]]
- <span>
- <a href="https://twitter.com/[[- profile.twitterName ]]" target="_blank">@[[- profile.twitterName ]]</a>
- </span>
- [[ } ]]
- </div>
- </div>
-
+ </span>
+ </div>
+ [[ } ]]
+ <div class="bio">
+ <div class="holder">
+ <h2>[[- profile.displayName ]]</h2>
+ [[ if (profile.location) { ]]
+ <span>
+ [[- profile.location ]]
+ </span>
+ [[ } ]]
+ [[ if (profile.website && profile.website.length) { ]]
+ <span>
+ <a href="[[- profile.website ]]" target="_blank">[[- profile.website ]]</a>
+ </span>
+ [[ } ]]
+ [[ if (profile.twitterName && profile.twitterName.length) { ]]
+ <span>
+ <a href="https://twitter.com/[[- profile.twitterName ]]" target="_blank">@[[- profile.twitterName ]]</a>
+ </span>
+ [[ } ]]
+ [[ if (profile.plan_level == 1) { ]]
+ <span class="plan_level premium">PREMIUM</span>
+ [[ } else if (profile.plan_level == 2) { ]]
+ <span class="plan_level pro">PRO</span>
+ [[ } ]]
+ </div>
+ </div>
[[ if (projects.length) { ]]
+
<h1>[[- profile.username ]] has [[- projectCount ]] project[[- projectCount != 1 ? "s" : "" ]]</h1>
-
[[ include projects/list-projects ]]
+
[[ } else { ]]
-
+
<h1>Welcome to VVALLS</h1>
<div class="projectList about">
<h2>
@@ -69,8 +74,11 @@
<h3>This person has no projects.</h3>
[[ } ]]
</div>
+
[[ } ]]
- </div>
+
+ </div>
+ [[ include partials/edit-subscription ]]
[[ include partials/edit-profile ]]
[[ include projects/layouts-modal ]]
[[ include projects/edit-project ]]
diff --git a/views/staff/_nav.ejs b/views/staff/_nav.ejs
index db7bedb..e79ff69 100644
--- a/views/staff/_nav.ejs
+++ b/views/staff/_nav.ejs
@@ -4,4 +4,5 @@
<a href="/staff/projects">projects</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/subscriptions/index.ejs b/views/staff/subscriptions/index.ejs
new file mode 100644
index 0000000..d1c0588
--- /dev/null
+++ b/views/staff/subscriptions/index.ejs
@@ -0,0 +1,36 @@
+[[ include ../_header ]]
+
+ <h1>Users</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>
+ </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