From 4d4add72dec5d5f1db96430fe2de21c09451ebea Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 9 Oct 2014 17:26:24 -0400 Subject: feature projects, show featured projects on homepage, fix profile sort --- views/staff/projects/show.ejs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'views/staff/projects/show.ejs') diff --git a/views/staff/projects/show.ejs b/views/staff/projects/show.ejs index 687f0c2..1034b31 100644 --- a/views/staff/projects/show.ejs +++ b/views/staff/projects/show.ejs @@ -41,8 +41,21 @@ "[[- project.description ]]" + + + featured? + + + [[- project.featured ? "yes" : "no" ]] + + +

+
+ +
+

-- cgit v1.2.3-70-g09d2 From 5dd9742da846e8db863a951f1502d0edf5a3f90b Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 7 Jan 2015 18:02:13 -0500 Subject: forms for editing plans --- server/lib/schemas/Plan.js | 6 +-- server/lib/views/staff.js | 22 ++++++++ views/about/brochure.ejs | 4 +- views/staff/_nav.ejs | 6 +++ views/staff/media/index.ejs | 7 +-- views/staff/media/show.ejs | 7 +-- views/staff/media/show_404.ejs | 9 +--- views/staff/plans/_form.ejs | 109 ++++++++++++++++++++++++++++++++++++++ views/staff/plans/edit.ejs | 13 +++++ views/staff/plans/index.ejs | 54 +++++++++++++++++++ views/staff/plans/new.ejs | 15 ++++++ views/staff/projects/index.ejs | 7 +-- views/staff/projects/show.ejs | 9 +--- views/staff/projects/show_404.ejs | 7 +-- views/staff/users/index.ejs | 7 +-- views/staff/users/media.ejs | 13 ++--- views/staff/users/show.ejs | 7 +-- views/staff/users/show_404.ejs | 16 +++--- 18 files changed, 244 insertions(+), 74 deletions(-) create mode 100644 views/staff/_nav.ejs create mode 100644 views/staff/plans/_form.ejs create mode 100644 views/staff/plans/edit.ejs create mode 100644 views/staff/plans/index.ejs create mode 100644 views/staff/plans/new.ejs (limited to 'views/staff/projects/show.ejs') diff --git a/server/lib/schemas/Plan.js b/server/lib/schemas/Plan.js index 1057bb2..1208672 100644 --- a/server/lib/schemas/Plan.js +++ b/server/lib/schemas/Plan.js @@ -22,9 +22,9 @@ var PlanSchema = new mongoose.Schema({ basic_layout_limit: { type: Number }, pro_layout_limit: { type: Number }, - stock_layout_project_limit: { type: Number }, - basic_layout_project_limit: { type: Number }, - pro_layout_project_limit: { type: Number }, + stock_project_limit: { type: Number }, + basic_project_limit: { type: Number }, + pro_project_limit: { type: Number }, permissions: { basic_editor: { type: Boolean, default: false }, diff --git a/server/lib/views/staff.js b/server/lib/views/staff.js index 49f492b..c3739e9 100644 --- a/server/lib/views/staff.js +++ b/server/lib/views/staff.js @@ -4,6 +4,8 @@ var User = require('../schemas/User'), Project = require('../schemas/Project'), Media = require('../schemas/Media'), Collaborator = require('../schemas/Collaborator'), + Plan = require('../schemas/Plan'), + Subscription = require('../schemas/Subscription'), config = require('../../../config'), middleware = require('../middleware'), util = require('../util'), @@ -540,6 +542,26 @@ var staff = module.exports = { res.render('staff/media/show_404') } }, + }, + + plans: { + index: function(req, res){ + res.locals.fields = ( + "monthly_price yearly_price basic_layout_monthly_price basic_layout_yearly_price " + + "pro_layout_monthly_price pro_layout_yearly_price " + + "basic_layout_limit pro_layout_limit stock_project_limit basic_project_limit pro_project_limit" + ).split(" ") + + res.locals.permissions = "basic_editor pro_editor solids collaborators no_logo".split(" ") + + res.render('staff/plans/index') + }, + new: function(req, res){ + res.render('staff/plans/new') + }, + edit: function(req, res){ + res.render('staff/plans/edit') + }, } } diff --git a/views/about/brochure.ejs b/views/about/brochure.ejs index 00083cf..d816dc4 100644 --- a/views/about/brochure.ejs +++ b/views/about/brochure.ejs @@ -35,7 +35,7 @@ -
+

[[- plans.pro.name ]]

  • $[[- plans.pro.monthly_price ]]/mo or $[[- plans.pro.yearly_price ]]/year @@ -57,7 +57,7 @@
- Pro Floor plan: Trace an arbitrary floorplan. + Pro Floor plan: Trace an arbitrary floor plan.
diff --git a/views/staff/_nav.ejs b/views/staff/_nav.ejs new file mode 100644 index 0000000..2115e9f --- /dev/null +++ b/views/staff/_nav.ejs @@ -0,0 +1,6 @@ + \ No newline at end of file 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 @@

Media

- +[[ include ../_nav ]]
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 @@

Media: [[- media.type ]]

- +[[ include ../_nav ]]
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 @@

Media not found

- - +[[ include ../_nav ]] +
[[ include ../_footer ]] diff --git a/views/staff/plans/_form.ejs b/views/staff/plans/_form.ejs new file mode 100644 index 0000000..b97716f --- /dev/null +++ b/views/staff/plans/_form.ejs @@ -0,0 +1,109 @@ + +
+ + +
+ +
+ + +
+ + + +
+ + +
+ +
+ + +
+ + + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + + +
+ + +
+ +
+ + +
+ + + +
+ + +
+ +
+ + +
+ +
+ + +
+ + + +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ + + + diff --git a/views/staff/plans/edit.ejs b/views/staff/plans/edit.ejs new file mode 100644 index 0000000..503c97d --- /dev/null +++ b/views/staff/plans/edit.ejs @@ -0,0 +1,13 @@ +[[ include ../_header ]] + +

Edit Plan

+ +[[ include ../_nav ]] + +
+ +
+[[- include form ]] + + +[[ include ../_footer ]] diff --git a/views/staff/plans/index.ejs b/views/staff/plans/index.ejs new file mode 100644 index 0000000..aa6c35a --- /dev/null +++ b/views/staff/plans/index.ejs @@ -0,0 +1,54 @@ +[[ include ../_header ]] + +

Plans

+ +[[ include ../_nav ]] + +
+ +
+ + + [[ plans.forEach(function(plan){ ]] + + [[ }) ]] + + + + + [[ plans.forEach(function(plan){ ]] + + [[ }) ]] + + + [[ fields.forEach(function(field){ ]] + + + [[ plans.forEach(function(plan){ ]] + + [[ }) ]] + + [[ }) ]] + + [[ permissions.forEach(function(permission){ ]] + + + [[ plans.forEach(function(plan){ ]] + + [[ }) ]] + + [[ }) ]] + +
+ [[- plan.name ]] +
+ edit +
[[- field.replace(/_/," ") ]] + [[- plan[field] ]] +
[[- permission.replace(/_/," ") ]] + [[- plan.permissions[permission] ? "x" : " " ]] +
+ +
+ +[[ include ../_footer ]] diff --git a/views/staff/plans/new.ejs b/views/staff/plans/new.ejs new file mode 100644 index 0000000..d56a1c3 --- /dev/null +++ b/views/staff/plans/new.ejs @@ -0,0 +1,15 @@ +[[ include ../_header ]] + +

New Plan

+ +[[ include ../_nav ]] + +
+ +
+[[- include 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 @@

Projects

- +[[ include ../_nav ]]
diff --git a/views/staff/projects/show.ejs b/views/staff/projects/show.ejs index 1034b31..b090a41 100644 --- a/views/staff/projects/show.ejs +++ b/views/staff/projects/show.ejs @@ -2,13 +2,8 @@

[[- project.name ]]

- - +[[ include ../_nav ]] +
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 @@

Project not found

- +[[ include ../_nav ]]
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 @@

Users

- +[[ include ../_nav ]]
diff --git a/views/staff/users/media.ejs b/views/staff/users/media.ejs index c1097dd..8927c00 100644 --- a/views/staff/users/media.ejs +++ b/views/staff/users/media.ejs @@ -1,15 +1,10 @@ [[ include ../_header ]] -

User Media: [[- profile.username ]]

+

User Media: [[- profile.username ]]

- - -
+[[ include ../_nav ]] + +
[[ include ../_pagination ]] [[ include ../_gallery ]] diff --git a/views/staff/users/show.ejs b/views/staff/users/show.ejs index 8e9b447..4ce1d9a 100644 --- a/views/staff/users/show.ejs +++ b/views/staff/users/show.ejs @@ -1,12 +1,7 @@ [[ include ../_header ]]

User: [[- profile.username ]]

- +[[ include ../_nav ]]
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 ]] -

User not found

- - - -
+ +

User not found

+ +[[ include ../_nav ]] + +
[[ include ../_footer ]] -- cgit v1.2.3-70-g09d2