Permalink
Browse files

Basic edit-in-place for about bio

  • Loading branch information...
1 parent 79a796d commit bfd2b91f4e1abd42934e18855599ebdb71cf3bc2 @jasonkuhrt committed Aug 30, 2012
View
@@ -15,5 +15,5 @@ module.exports = (object)->
public: "#{__dirname}/public"
if isNode
- object.settings.urls.db = process.env.MONGOHQ_URL or object.settings.urls.db_production
+ object.settings.urls.db = process.env.MONGOHQ_URL or object.settings.urls.db_local
object.settings.port = process.env.PORT or 9898
View
@@ -10,6 +10,7 @@ require './client/vendor/soundmanager2.js'
require './client/vendor/angular/angular.js'
require './client/vendor/angular/angular-resource.js'
require './client/vendor/angular/angular-sanitize.js'
+require './client/directives/ng_editable.coffee'
require './client/directives/ng_translate.coffee'
require './client/directives/ng_if.coffee'
require './client/directives/ng_progress_bar.coffee'
@@ -45,6 +46,7 @@ vrapp = angular.module('vr', [
$routeProvider.when('/works', {templateUrl: 'partials/works.html', controller: WorksController})
$routeProvider.when('/works/:work', {templateUrl: 'partials/work.html', controller: WorkController})
$routeProvider.when('/about', {templateUrl: 'partials/about.html', controller: AboutController})
+ $routeProvider.when('/admin', {templateUrl: 'partials/admin.html', controller: AdminController})
$routeProvider.otherwise({redirectTo: '/home'})
$locationProvider.html5Mode(true)
])
View
@@ -47,6 +47,19 @@ window.WorkController = ($scope, $resource, $routeParams, $rootScope)->
$scope.poster_url = "#{$scope.settings.urls.assets}/works/#{$scope.work.slug}/poster_280.jpg"
# WorkController.$inject = ['$scope', '$resource', '$routeParams', '$rootScope']
-window.AboutController = ($rootScope)->
+window.AboutController = ($scope, $rootScope, $resource)->
$rootScope.page_title = " • About"
+
+ Bio = $resource('/json/bio')
+ $scope.bio = Bio.get()
+
+ $scope.$on 'save', (e, data)->
+ $scope.bio.html = data.content
+ $scope.bio.$save()
+
+
# AboutController.$inject = ['$rootScope']
+#
+window.AdminController = ($rootScope)->
+ $rootScope.page_title = " • Admin"
+# AdminController.$inject = ['$rootScope']
@@ -0,0 +1,15 @@
+((angular) ->
+
+ ngEditableDirective =
+ restrict: "A"
+ transclude: yes
+ link: (scope, el, attrs)->
+ el[0].contentEditable = "true"
+ el.blur (e)->
+ scope.$emit 'save', { id: el[0].id, content: el.html() }
+
+ ng = angular.module("ng")
+ ng.directive "ngEditable", -> ngEditableDirective
+
+)(angular)
+
View
32,906 public/app.js

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1 +1 @@
-<div class="image-container"><img src="https://thievishfilms.s3.amazonaws.com/assets/vanya_rose_portrait.jpg" class="vanya-rose-portrait"/></div><article class="biography"><p>Vanya Rose studied theatre and visual arts from an early age, spending her childhood between the classrooms of a French colonial school in Montreal, the wilds of the Eastern Townships, and the hallways of the Chelsea Hotel in New York. After acting in and creating theatre productions with the Garrick Players, Vanya began formal theatre training at 15 with Stanislavsky disciple Polina Klimovitskaya. She went on to train in performance at NYU's Tisch School of the Arts, however, soon changed her attention to directing, completing her degree at McGill University in English/Theatre with first class honours, receiving numerous prizes for her directing and stage adaptations. Parallel to her studies, she began to act in film, allowing her the opportunity to observe approaches to filmmaking of directors from around the world.</p><p>After spending a number of years living in Europe, where she created several theatre productions, she returned to Montreal in order to complete a master's degree in theatre directing with an FRSC grant for excellence. It was while creating her thesis production that her thesis director recommended she explore filmmaking and she has continued to do so since.</p><p>In 2008, she completed MONTREAL STORIES, three poetic portraits that take place throughout the 20th century, starring Lise Roy, Gabriel Gascon, Kaniehtiio Horn and Rebecca Windheim. In 2009, Vanya was selected as one of 5 directors to attend the competitive CFC's Directors’ Lab. Upon her return to Montreal, Vanya completed IMPOSSIBLE starring Tyler Hynes and Charlotte Le Bon which premiered at the prestigious event, Cinéma du Québec à Paris, and has recently finished her newest short AT THE BOTTOM OF THE HILL, starring Hélène Joy and which Vanya produced with her production company, time's thievish progress to eternity FILMS. Presently, Vanya is finalising the final draft of her first feature-length film which will star Ms Joy and Liane Balaban.</p></article>
+<div class="image-container"><img src="https://thievishfilms.s3.amazonaws.com/assets/vanya_rose_portrait.jpg" class="vanya-rose-portrait"/></div><article id="bio" ng-editable="true" ng-bind-html="bio.html" class="biography"></article>
@@ -0,0 +1 @@
+<form><input type="password" placeholder="Type in your password"/></form>
@@ -1,6 +1,3 @@
.image-container
img.vanya-rose-portrait(src="https://thievishfilms.s3.amazonaws.com/assets/vanya_rose_portrait.jpg")
-article.biography
- p Vanya Rose studied theatre and visual arts from an early age, spending her childhood between the classrooms of a French colonial school in Montreal, the wilds of the Eastern Townships, and the hallways of the Chelsea Hotel in New York. After acting in and creating theatre productions with the Garrick Players, Vanya began formal theatre training at 15 with Stanislavsky disciple Polina Klimovitskaya. She went on to train in performance at NYU's Tisch School of the Arts, however, soon changed her attention to directing, completing her degree at McGill University in English/Theatre with first class honours, receiving numerous prizes for her directing and stage adaptations. Parallel to her studies, she began to act in film, allowing her the opportunity to observe approaches to filmmaking of directors from around the world.
- p After spending a number of years living in Europe, where she created several theatre productions, she returned to Montreal in order to complete a master's degree in theatre directing with an FRSC grant for excellence. It was while creating her thesis production that her thesis director recommended she explore filmmaking and she has continued to do so since.
- p In 2008, she completed MONTREAL STORIES, three poetic portraits that take place throughout the 20th century, starring Lise Roy, Gabriel Gascon, Kaniehtiio Horn and Rebecca Windheim. In 2009, Vanya was selected as one of 5 directors to attend the competitive CFC's Directors’ Lab. Upon her return to Montreal, Vanya completed IMPOSSIBLE starring Tyler Hynes and Charlotte Le Bon which premiered at the prestigious event, Cinéma du Québec à Paris, and has recently finished her newest short AT THE BOTTOM OF THE HILL, starring Hélène Joy and which Vanya produced with her production company, time's thievish progress to eternity FILMS. Presently, Vanya is finalising the final draft of her first feature-length film which will star Ms Joy and Liane Balaban.
+article#bio.biography(ng-editable="true", ng-bind-html="bio.html")
@@ -0,0 +1,2 @@
+form
+ input(type="password", placeholder="Type in your password")
View
@@ -41,6 +41,14 @@ module.exports = (app)->
app.get '/json/blog', (req,res)->
app.tvr.posts (blog)-> res.json blog.posts
+ app.get '/json/bio', (req,res)->
+ app.db.collection('info').findOne {}, (err, info)->
+ res.json info.bio
+
+ app.post '/json/bio', (req,res)->
+ if req.body.html?
+ app.db.collection('info').update {}, {$set:{"bio.html": req.body.html}}
+
app.get '/json/blog/:filter_on/:filter_with', postsFilteredBy

0 comments on commit bfd2b91

Please sign in to comment.