From 7562a585d47e79fa5fa8a32885f7b4bd29da4a39 Mon Sep 17 00:00:00 2001 From: ryderr Date: Tue, 30 Sep 2014 15:42:25 -0400 Subject: fixed header --- views/partials/header.ejs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'views/partials/header.ejs') diff --git a/views/partials/header.ejs b/views/partials/header.ejs index a48c5e1..d46155f 100644 --- a/views/partials/header.ejs +++ b/views/partials/header.ejs @@ -1,3 +1,4 @@ +
diff --git a/views/controls/reader/media-player.ejs b/views/controls/reader/media-player.ejs index ca03ec8..0ca89c5 100644 --- a/views/controls/reader/media-player.ejs +++ b/views/controls/reader/media-player.ejs @@ -1,13 +1,13 @@
- - + + - - + + diff --git a/views/home.ejs b/views/home.ejs index a6f5a88..51d5a92 100755 --- a/views/home.ejs +++ b/views/home.ejs @@ -17,7 +17,7 @@
Create 3D Rooms
-
+
Watch video.
diff --git a/views/partials/header.ejs b/views/partials/header.ejs index 1b7b498..ea579cc 100644 --- a/views/partials/header.ejs +++ b/views/partials/header.ejs @@ -69,7 +69,7 @@ [[ } ]] [[ if (opt.editing) { ]] - + [[ } ]] [[ } else { ]] diff --git a/views/partials/sign-in.ejs b/views/partials/sign-in.ejs index 98f0acc..08c9e99 100644 --- a/views/partials/sign-in.ejs +++ b/views/partials/sign-in.ejs @@ -5,7 +5,7 @@
- +
  • @@ -38,7 +38,7 @@
    - +
  • diff --git a/views/profile.ejs b/views/profile.ejs index 9cfb40d..22c824c 100644 --- a/views/profile.ejs +++ b/views/profile.ejs @@ -14,7 +14,7 @@
  • [[ } else { ]]
    - +
    [[ } ]]
    -- cgit v1.2.3-70-g09d2 From 94f19d836cfc80cd9d4fcfed17c1e2f025002994 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 7 Nov 2014 18:29:00 -0500 Subject: alias login -> signin --- public/assets/javascripts/ui/_router.js | 2 ++ server/index.js | 2 ++ server/lib/auth/index.js | 3 +-- views/partials/header.ejs | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) (limited to 'views/partials/header.ejs') diff --git a/public/assets/javascripts/ui/_router.js b/public/assets/javascripts/ui/_router.js index 7337357..4219a28 100644 --- a/public/assets/javascripts/ui/_router.js +++ b/public/assets/javascripts/ui/_router.js @@ -20,6 +20,7 @@ var SiteRouter = Router.extend({ "/": 'home', "/home": 'home', "/login": 'signin', + "/signin": 'signin', "/signup": 'signup', "/auth/usernameTaken": 'usernameTaken', @@ -47,6 +48,7 @@ var SiteRouter = Router.extend({ "/": 'home', "/home": 'home', "/login": 'signin', + "/signin": 'signin', "/signup": 'signup', "/auth/usernameTaken": 'usernameTaken', "/auth/password": 'passwordReset', diff --git a/server/index.js b/server/index.js index 90b724c..c2b3421 100644 --- a/server/index.js +++ b/server/index.js @@ -82,6 +82,8 @@ site.route = function () { app.get('/home', views.demoHome); app.get('/login', views.modal); app.get('/logout', auth.logout); + app.get('/signin', views.modal); + app.get('/signout', auth.logout); app.get('/signup', views.modal); app.post('/auth/signin', auth.loggedInLocal); app.post('/auth/signup', auth.signup); diff --git a/server/lib/auth/index.js b/server/lib/auth/index.js index c2275ff..0c46105 100644 --- a/server/lib/auth/index.js +++ b/server/lib/auth/index.js @@ -30,14 +30,13 @@ var auth = { callbackURL: 'http://' + config.host + '/auth/twitter/callback' }, auth.insertTwitterUser)); - /* passport.use(new FacebookStrategy({ clientID: process.env.VVALLS_FACEBOOK_KEY || '719828821410310', clientSecret: process.env.VVALLS_FACEBOOK_SECRET || 'f9aba78e08f37f621eadb88b1409d48c', callbackURL: 'http://' + config.host + '/auth/facebook/callback', enableProof: false, }, auth.insertFacebookUser)); - */ + auth.mail.init() }, diff --git a/views/partials/header.ejs b/views/partials/header.ejs index ea579cc..ce5bab9 100644 --- a/views/partials/header.ejs +++ b/views/partials/header.ejs @@ -74,7 +74,7 @@ [[ } else { ]] - + [[ } ]]
    \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 5adac681bdb43b8b709795fa501689fb9ae8a4e1 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 28 Jan 2015 19:18:27 -0500 Subject: many methods --- package.json | 1 + server/lib/api/subscription.js | 124 ++++++++++++++++++++++++++++++++---- server/lib/middleware.js | 2 +- server/lib/schemas/Subscription.js | 6 +- server/lib/views/staff.js | 2 +- server/lib/webhook/webhook.js | 2 +- views/about/brochure.ejs | 15 +++-- views/partials/header.ejs | 1 + views/staff/_users.ejs | 1 + views/staff/plans/_form.ejs | 5 ++ views/staff/subscriptions/index.ejs | 2 +- views/staff/users/show.ejs | 1 + 12 files changed, 135 insertions(+), 27 deletions(-) (limited to 'views/partials/header.ejs') diff --git a/package.json b/package.json index 8afb96e..e89fcd9 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "express-subdomains": "0.0.5", "html-entities": "~1.0.10", "intro.js": "^0.9.0", + "js2xml": "^1.0.0", "knox": "~0.8.10", "lodash": "~2.4.1", "marked": "~0.3.2", diff --git a/server/lib/api/subscription.js b/server/lib/api/subscription.js index 83644cf..40aa715 100644 --- a/server/lib/api/subscription.js +++ b/server/lib/api/subscription.js @@ -9,7 +9,22 @@ var _ = require('lodash'), Layout = require('../schemas/Layout'), Subscription = require('../schemas/Subscription'); +var plan_levels = { + free: 0, + basic: 1, + pro: 2, +} + var subscription = module.exports = { + middleware: { + ensureSubscription: function(req, res, next){ + Subscription.findOne({ user_id: req.user._id }, function(err, data){ + if (err) { return next() } + req.subscription = data + next() + }) + }, + } /* index: function(req, res){ @@ -18,30 +33,115 @@ var subscription = module.exports = { }) }, */ - middleware: { - fetchAccount: function(req, res, next){ - recurly.subscriptions.listByAccount(req.user._id, function(data){ - }) - }, - }, // synchronise an account with recurly.. - // useful when testing locally (if webhooks do not fire) + // useful when testing locally (where webhooks cannot be received) sync: function(req, res){ - // fetch req.user._id + var subscriber = req.subscription || new Subscription () + var user = req.user + recurly.subscriptions.listByAccount(req.user._id, function(data){ + if (data.description !== 200) { + res.json({ error: "no account" }) + return + } + if (! data.subscriptions.subscription) { + res.json({ error: "account error" }) + return + } + + var plan = data.subscriptions.subscription.plan.plan_code.split("-") + var plan_type = plan[0] + var plan_period = plan[1] + + user.plan_type = plan_type + user.plan_level = plan_levels[plan_type] + + subscriber.uuid = data.subscriptions.subscription.uuid + subscriber.user_id = user._id + subscriber.plan_type = plan_type + subscriber.plan_period = plan_period + subscriber.plan_level = plan_levels[plan_type] + + var add_ons = data.subscriptions.subscription.subscription_add_ons.subscription_add_on + if (add_ons) { + if (add_ons.add_on_code) { + add_ons = [ add_ons ] + } + // TODO: handle multiple add-ons.. presumably this will work + add_ons.forEach(function(add_on){ + var add_on_type = add_on.add_on_code.split("-")[1] + if (add_on_type == "basic") { + subscriber.basic_layouts = parseInt( add_on.quantity._ ) + } + if (add_on_type == "pro") { + subscriber.pro_layouts = parseInt( add_on.quantity._ ) + } + }) + } + else { + subscriber.basic_layouts = 0 + subscriber.pro_layouts = 0 + } + + subscriber.save(function(){ + user.save(function(){ + res.render(subscriber) + }) + }) + }) }, show: function(req, res){ - // fetch from recurly + res.json(req.subscription || { error: "no subscription" }) }, update: function(req, res){ - // update plan_type on recurly - // update add_ons on recurly + if (! req.subscription ) { + return res.json({ error: "no subscription" }) + } + if (! (req.body.plan_type in plan_levels)) { + return res.json({ error: "bad input" }) + } + var subscriber = req.subscription + + // change.. + // data.plan_code + // data.subscription_add_ons = [] + // add_on.add_on_code + // add_on.quantity + var basic_layouts = max(0, parseInt(req.body.basic_layouts)) + var pro_layouts = max(0, parseInt(req.body.pro_layouts)) + + var data = {} + data.plan_code = req.body.plan_type + "_monthly" + data.subscription_add_ons = [] + + if (plan_levels[req.body.plan_type]) { + data.subscription_add_ons.push({ add_on_code: "extra-basic-layout", quantity: basic_layouts }) + } + + if (req.body.plan_type == "pro") { + data.subscription_add_ons.push({ add_on_code: "extra-pro-layout", quantity: pro_layouts }) + } + + + recurly.subscriptions.update(subscriber.uuid, data, function(){ + return res.json(subscriber) + }) }, destroy: function(req, res){ - // destroy on recurly + if (! req.subscription ) { + return res.json({ error: "no subscription" }) + } + var subscriber = req.subscription + + recurly.subscriptions.cancel(subscriber.uuid, function(){ + subscriber.remove(function(){ + req.user.plan_code = 0 + req.user.plan_type = "free" + }) + }) }, }; \ No newline at end of file diff --git a/server/lib/middleware.js b/server/lib/middleware.js index 797d677..7dfe821 100644 --- a/server/lib/middleware.js +++ b/server/lib/middleware.js @@ -59,7 +59,7 @@ var middleware = { res.locals.opt = {} next() }, - + ensureProject: function (req, res, next) { if (req.params.slug) { Project.findOne({ slug: req.params.slug }, function(err, project){ diff --git a/server/lib/schemas/Subscription.js b/server/lib/schemas/Subscription.js index b766555..24c5096 100644 --- a/server/lib/schemas/Subscription.js +++ b/server/lib/schemas/Subscription.js @@ -13,10 +13,8 @@ var SubscriptionSchema = new mongoose.Schema({ plan_period: { type: String, default: "monthly" }, subscription_uuid: { type: String }, - subscription_add_ons: [{ - name: { type: String }, - quantity: { type: Number }, - }], + basic_layouts: { type: Number, default: 0 }, + pro_layouts: { type: Number, default: 0 }, history: [{ action: { type: String }, diff --git a/server/lib/views/staff.js b/server/lib/views/staff.js index 74dd7cd..67193fe 100644 --- a/server/lib/views/staff.js +++ b/server/lib/views/staff.js @@ -154,7 +154,7 @@ var staff = module.exports = { }, ensurePlans: function(req, res, next){ - Plan.find(function (err, plans) { + Plan.find({}).sort({ 'level': -1 }).exec(function (err, plans) { res.locals.plans = (plans || []).map(staff.helpers.plan) res.locals.plans.sort(function(a,b){ return a.monthly_price }) next() diff --git a/server/lib/webhook/webhook.js b/server/lib/webhook/webhook.js index 4f23d0b..a871a3a 100644 --- a/server/lib/webhook/webhook.js +++ b/server/lib/webhook/webhook.js @@ -149,6 +149,6 @@ var subscribe = module.exports = { route: function(app){ app.post('/subscribe/webhook', subscribe.handle); - app.get('/subscribe/list/:id', subscribe.list); + app.get('/subscribe/list/:id', subscribe.middleware.ensureSubscription, subscribe.list); }, } diff --git a/views/about/brochure.ejs b/views/about/brochure.ejs index 49b03db..1dad763 100644 --- a/views/about/brochure.ejs +++ b/views/about/brochure.ejs @@ -34,12 +34,11 @@
  • VValls logo appears when embedding an exhibition on a web page
  • [[ if (! logged_in) { ]] - - [[ } else if (! user.plan_level || user.plan_level < plan.level) { ]] - + + [[ } else if (! user.plan_level) { ]] + [[ } else if (user.plan_level == plan.level) { ]] Current Level - [[ } else { ]] [[ } ]]
  • @@ -56,11 +55,13 @@
  • No VValls logo on embed
  • [[ if (! logged_in) { ]] - - [[ } else if (! user.plan_level || user.plan_level < plan.level) { ]] - + + [[ } else if (! user.plan_level) { ]] + [[ } else if (user.plan_level == plan.level) { ]] Current Level + [[ } else if (user.plan_level < plan.level) { ]] + [[ } ]] diff --git a/views/partials/header.ejs b/views/partials/header.ejs index ce5bab9..2acf2bc 100644 --- a/views/partials/header.ejs +++ b/views/partials/header.ejs @@ -64,6 +64,7 @@ [[ if (profile && String(user._id) == String(profile._id)) { ]] Settings + Subscription [[ } else if (! profile) { ]] Profile [[ } ]] diff --git a/views/staff/_users.ejs b/views/staff/_users.ejs index d46058f..053e289 100644 --- a/views/staff/_users.ejs +++ b/views/staff/_users.ejs @@ -12,6 +12,7 @@ [view profile] + [recurly] [[- user.last_seen ]] diff --git a/views/staff/plans/_form.ejs b/views/staff/plans/_form.ejs index ae5ca5a..b55c5cd 100644 --- a/views/staff/plans/_form.ejs +++ b/views/staff/plans/_form.ejs @@ -16,6 +16,11 @@
  • +
  • + +
    +
  • +
  • diff --git a/views/staff/subscriptions/index.ejs b/views/staff/subscriptions/index.ejs index d1c0588..3efffb5 100644 --- a/views/staff/subscriptions/index.ejs +++ b/views/staff/subscriptions/index.ejs @@ -1,6 +1,6 @@ [[ include ../_header ]] -

    Users

    +

    Subscriptions

    [[ include ../_nav ]] diff --git a/views/staff/users/show.ejs b/views/staff/users/show.ejs index 4ce1d9a..d6a21d5 100644 --- a/views/staff/users/show.ejs +++ b/views/staff/users/show.ejs @@ -19,6 +19,7 @@ [view profile] [view media] + [view on recurly] -- cgit v1.2.3-70-g09d2 From 83649f62ecbd92cc8a27ca47ac141cc3a81210a1 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 18 Aug 2015 19:40:50 -0400 Subject: fixed close button --- public/assets/javascripts/ui/blueprint/BlueprintScaler.js | 4 +++- public/assets/javascripts/ui/blueprint/BlueprintUploader.js | 1 + public/assets/javascripts/ui/lib/ModalView.js | 5 +++++ views/controls/editor/media-drawer.ejs | 2 -- views/partials/header.ejs | 4 +++- 5 files changed, 12 insertions(+), 4 deletions(-) (limited to 'views/partials/header.ejs') diff --git a/public/assets/javascripts/ui/blueprint/BlueprintScaler.js b/public/assets/javascripts/ui/blueprint/BlueprintScaler.js index 5bd2229..cd370ef 100644 --- a/public/assets/javascripts/ui/blueprint/BlueprintScaler.js +++ b/public/assets/javascripts/ui/blueprint/BlueprintScaler.js @@ -1,7 +1,9 @@ var BlueprintScaler = ModalFormView.extend(AnimatedView.prototype).extend({ el: ".blueprintScaler", - + + fixedClose: true, + action: "/api/blueprint/scale", events: { diff --git a/public/assets/javascripts/ui/blueprint/BlueprintUploader.js b/public/assets/javascripts/ui/blueprint/BlueprintUploader.js index 676976f..6d13817 100644 --- a/public/assets/javascripts/ui/blueprint/BlueprintUploader.js +++ b/public/assets/javascripts/ui/blueprint/BlueprintUploader.js @@ -39,6 +39,7 @@ var BlueprintUploader = UploadView.extend({ this.parent.scaler.pick(data[0]) } else { + this.parent.scaler.hideClose() this.show() } }, diff --git a/public/assets/javascripts/ui/lib/ModalView.js b/public/assets/javascripts/ui/lib/ModalView.js index 6f1c729..e0070ce 100644 --- a/public/assets/javascripts/ui/lib/ModalView.js +++ b/public/assets/javascripts/ui/lib/ModalView.js @@ -35,6 +35,11 @@ var ModalView = View.extend({ $("body").removeClass("noOverflow"); }, + hideClose: function(){ + $("#fixed_close").removeClass("active") + $("#fixed_close").unbind("click", this.hide.bind(this)) + }, + close: function(){ if (window.isModalView) { window.location.pathname = "/" diff --git a/views/controls/editor/media-drawer.ejs b/views/controls/editor/media-drawer.ejs index bb623f2..8070941 100644 --- a/views/controls/editor/media-drawer.ejs +++ b/views/controls/editor/media-drawer.ejs @@ -3,8 +3,6 @@ -X -

    Your Media diff --git a/views/partials/header.ejs b/views/partials/header.ejs index 2acf2bc..bb8fc6e 100644 --- a/views/partials/header.ejs +++ b/views/partials/header.ejs @@ -78,4 +78,6 @@ [[ } ]] -

    \ No newline at end of file + + +X \ No newline at end of file -- cgit v1.2.3-70-g09d2 From 685d5fd7b32ac868a0b2d8ac8a2a1b4120f274cf Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 27 Aug 2015 11:57:51 -0400 Subject: fork orthopolyline --- .../rectangles/engine/map/tools/ortho.js | 2 +- .../javascripts/rectangles/engine/shapes/ortho.js | 41 ++++++++++++++++++++++ .../rectangles/engine/shapes/polyline.js | 21 +++++++---- .../rectangles/engine/shapes/shapelist.js | 14 ++++++-- .../javascripts/ui/blueprint/BlueprintSettings.js | 3 +- .../javascripts/ui/blueprint/BlueprintUploader.js | 2 +- .../javascripts/ui/blueprint/BlueprintView.js | 22 ++++++++++++ public/assets/stylesheets/app.css | 4 +-- views/partials/header.ejs | 2 ++ views/partials/scripts.ejs | 1 + views/profile.ejs | 2 ++ 11 files changed, 99 insertions(+), 15 deletions(-) create mode 100644 public/assets/javascripts/rectangles/engine/shapes/ortho.js (limited to 'views/partials/header.ejs') diff --git a/public/assets/javascripts/rectangles/engine/map/tools/ortho.js b/public/assets/javascripts/rectangles/engine/map/tools/ortho.js index 6ced728..374c822 100644 --- a/public/assets/javascripts/rectangles/engine/map/tools/ortho.js +++ b/public/assets/javascripts/rectangles/engine/map/tools/ortho.js @@ -48,7 +48,7 @@ var OrthoPolylineTool = MapTool.extend(function (base) { } else { map.ui.placing = true - shapes.workline = new Polyline () + shapes.workline = new OrthoPolyline () shapes.workline.add(p) first_point = prev_point = p horizontal = false diff --git a/public/assets/javascripts/rectangles/engine/shapes/ortho.js b/public/assets/javascripts/rectangles/engine/shapes/ortho.js new file mode 100644 index 0000000..8a8f928 --- /dev/null +++ b/public/assets/javascripts/rectangles/engine/shapes/ortho.js @@ -0,0 +1,41 @@ +// An OrthoPolyline is a Polyline where all angles are 90 degrees. + +var OrthoPolyline = Polyline.extend(function(base){ + var exports = {} + exports.type = function(){ + return "ortho" + } + exports.instantiate = function(){ + return new OrthoPolyline + } + exports.canCloseWith = function(p){ + return (this.points.length > 2 && this.points[0].distanceTo( p ) < 10/map.zoom) + } + exports.draw = function(ctx, fillStyle, strokeStyle){ + var points = this.points + if (! points.length) return + if (points.length == 1) { + ctx.fillStyle = "#f80" + map.draw.dot_at(this.points[0].a, points[0].b, 5) + } + if (points.length > 1) { + ctx.fillStyle = fillStyle + ctx.strokeStyle = strokeStyle + ctx.lineWidth = 2 / map.zoom + ctx.beginPath() + ctx.moveTo(points[0].a, points[0].b) + points.forEach(function(point, i){ + i && ctx.lineTo(point.a, point.b) + }) + strokeStyle && ctx.stroke() + if (! map.ui.placing || this.closed) { + fillStyle && ctx.fill() + } + } + } + exports.close = function(){ + this.points[this.points.length] = this.points[0] + this.closed = true + } + return exports +}) diff --git a/public/assets/javascripts/rectangles/engine/shapes/polyline.js b/public/assets/javascripts/rectangles/engine/shapes/polyline.js index fc6cad7..65e22ad 100644 --- a/public/assets/javascripts/rectangles/engine/shapes/polyline.js +++ b/public/assets/javascripts/rectangles/engine/shapes/polyline.js @@ -9,6 +9,12 @@ var Polyline = Fiber.extend(function(base){ this.mx_points = [] this.closed = false } + exports.type = function(){ + return "polyline" + } + exports.instantiate = function(){ + return new Polyline + } exports.add = function(p){ this.points.push( p ) this.mx_points.push( new MX.Point(p) ) @@ -25,19 +31,19 @@ var Polyline = Fiber.extend(function(base){ exports.getHeadAtIndex = function(index){ if (index == 0) { return null } if (index == this.points.length-1) { return this.clone() } - var head = new Polyline() + var head = this.instantiate() head.points = this.points.slice(0, index+1) return head } exports.getTailAtIndex = function(index){ if (index == this.points.length-1) { return null } if (index == 0) { return this.clone() } - var tail = new Polyline() + var tail = this.instantiate() tail.points = this.points.slice(index, this.points.length) return tail } exports.clone = function(){ - var clone = new Polyline() + var clone = this.instantiate() clone.points = this.points.concat() } exports.hasPointNear = function(p){ @@ -148,10 +154,13 @@ var Polyline = Fiber.extend(function(base){ return segments } exports.serialize = function(){ - return this.points.map(function(point){ return [point.a, point.b] }) + return { + type: this.type(), + points: this.points.map(function(point){ return [point.a, point.b] }), + } } - exports.deserialize = function(points){ - this.points = points.map(function(point){ return new vec2(point[0], point[1]) }) + exports.deserialize = function(data){ + this.points = (data.points || data).map(function(point){ return new vec2(point[0], point[1]) }) } exports.reset = function(){ this.mx_points.forEach(function(mx){ scene.remove(mx) }) diff --git a/public/assets/javascripts/rectangles/engine/shapes/shapelist.js b/public/assets/javascripts/rectangles/engine/shapes/shapelist.js index 75ecae6..e5a70fb 100644 --- a/public/assets/javascripts/rectangles/engine/shapes/shapelist.js +++ b/public/assets/javascripts/rectangles/engine/shapes/shapelist.js @@ -87,9 +87,17 @@ var ShapeList = Fiber.extend(function(base){ }) } exports.deserialize = function(data){ - data && data.forEach(function(points){ - var line = new Polyline() - line.deserialize(points) + data && data.forEach(function(shape_data){ + var line + switch (shape_data.type) { + case 'ortho': + line = new OrthoPolyline() + break + default: + line = new Polyline() + break + } + line.deserialize(shape_data) shapes.add(line) }.bind(this)) } diff --git a/public/assets/javascripts/ui/blueprint/BlueprintSettings.js b/public/assets/javascripts/ui/blueprint/BlueprintSettings.js index 80c9355..8addb9c 100644 --- a/public/assets/javascripts/ui/blueprint/BlueprintSettings.js +++ b/public/assets/javascripts/ui/blueprint/BlueprintSettings.js @@ -93,10 +93,9 @@ var BlueprintSettings = FormView.extend(ToggleableView.prototype).extend({ fd.append( "_id", this.$id.val() ) fd.append( "name", this.$name.val() ) fd.append( "shapes", JSON.stringify( shapes.serialize() ) ) - fd.append( "startPosition", JSON.stringify( this.parent.startPosition ) ) + fd.append( "startPosition", JSON.stringify( this.parent.quantizeStartPosition() ) ) fd.append( "wallHeight", this.parent.info.$height.unitVal() ) fd.append( "units", this.parent.info.$units.val() ) - return fd }, diff --git a/public/assets/javascripts/ui/blueprint/BlueprintUploader.js b/public/assets/javascripts/ui/blueprint/BlueprintUploader.js index fe1073a..dc3c281 100644 --- a/public/assets/javascripts/ui/blueprint/BlueprintUploader.js +++ b/public/assets/javascripts/ui/blueprint/BlueprintUploader.js @@ -65,7 +65,7 @@ var BlueprintUploader = UploadView.extend({ var $el = $(e.currentTarget) var media = $el.data("media") this.hide() - this.parent.scaler.pick(media, true) + this.parent.scaler.pick(media) }, destroy: function(e){ diff --git a/public/assets/javascripts/ui/blueprint/BlueprintView.js b/public/assets/javascripts/ui/blueprint/BlueprintView.js index ecbb536..19b9e84 100644 --- a/public/assets/javascripts/ui/blueprint/BlueprintView.js +++ b/public/assets/javascripts/ui/blueprint/BlueprintView.js @@ -29,6 +29,28 @@ var BlueprintView = View.extend({ orbiting: true, startPosition: {}, + quantizeStartPosition: function(){ + // + var regions = RegionList.build() + var pos = this.startPosition + var startPositionIsInARoom = regions.some(function(region){ + return region.contains(pos.x, pos.z) + }) + if (startPositionIsInARoom) { + return this.startPosition + } + else { + var center = regions[0].center() + return { + x: center.a, + y: viewHeight, + z: center.b, + rotationX: 0, + rotationY: Math.PI/2, + } + } + }, + buildMap: function(){ // i forget if this has to be global map = new Map ({ diff --git a/public/assets/stylesheets/app.css b/public/assets/stylesheets/app.css index 634ea60..e4f1b27 100755 --- a/public/assets/stylesheets/app.css +++ b/public/assets/stylesheets/app.css @@ -1156,6 +1156,7 @@ form .paidPlan label { float: none; font-size: 16px; margin: 0 10px; } width: 100%; height: 100%; padding: 20px 0 40px 0; + text-align: center; } .templates-list, .userTemplatesList, @@ -1186,8 +1187,7 @@ form .paidPlan label { float: none; font-size: 16px; margin: 0 10px; } } .templates span { - display: block; - float: left; + display: inline-block; margin: 1vw 0; width:20%; padding: 2vw; diff --git a/views/partials/header.ejs b/views/partials/header.ejs index bb8fc6e..ce9ffae 100644 --- a/views/partials/header.ejs +++ b/views/partials/header.ejs @@ -64,7 +64,9 @@ [[ if (profile && String(user._id) == String(profile._id)) { ]] Settings + [[ } else if (! profile) { ]] Profile [[ } ]] diff --git a/views/partials/scripts.ejs b/views/partials/scripts.ejs index bac4120..da3f0ba 100644 --- a/views/partials/scripts.ejs +++ b/views/partials/scripts.ejs @@ -86,6 +86,7 @@ + diff --git a/views/profile.ejs b/views/profile.ejs index 63a07f5..d3ae10e 100644 --- a/views/profile.ejs +++ b/views/profile.ejs @@ -78,7 +78,9 @@ [[ } ]] + [[ include partials/edit-profile ]] [[ include projects/layouts-modal ]] [[ include projects/edit-project ]] -- cgit v1.2.3-70-g09d2