Permalink
Browse files

appify

  • Loading branch information...
1 parent 6b6dd8a commit 80bc068d8f197b8bb30c7f03adf31995ae591b5c @maccman committed Jan 1, 2012
Showing with 1,254 additions and 307 deletions.
  1. +5 −2 Gemfile
  2. +22 −3 Gemfile.lock
  3. BIN app/assets/images/blacky.png
  4. BIN app/assets/images/larrow.png
  5. BIN app/assets/images/new.png
  6. BIN app/assets/images/rarrow.png
  7. BIN app/assets/images/star.png
  8. BIN app/assets/images/starb.png
  9. BIN app/assets/images/stard.png
  10. BIN app/assets/images/whitey.png
  11. +10 −0 app/assets/javascripts/app/controllers/activity.js.coffee
  12. +13 −0 app/assets/javascripts/app/controllers/messages.js.coffee
  13. +50 −0 app/assets/javascripts/app/controllers/messages/article.js.coffee
  14. +26 −0 app/assets/javascripts/app/controllers/messages/aside.js.coffee
  15. +7 −0 app/assets/javascripts/app/controllers/nav.js.coffee
  16. +10 −0 app/assets/javascripts/app/controllers/starred.js.coffee
  17. +19 −4 app/assets/javascripts/app/index.js.coffee
  18. +3 −0 app/assets/javascripts/app/models/conversation.js.coffee
  19. +3 −0 app/assets/javascripts/app/models/message.js.coffee
  20. +8 −0 app/assets/javascripts/app/views/messages/article.jst.eco
  21. +5 −0 app/assets/javascripts/app/views/messages/article/compose.jst.eco
  22. +3 −0 app/assets/javascripts/app/views/messages/article/item.jst.eco
  23. +12 −0 app/assets/javascripts/app/views/messages/aside.jst.eco
  24. +6 −0 app/assets/javascripts/app/views/messages/aside/item.jst.eco
  25. +17 −0 app/assets/javascripts/app/views/nav.jst.eco
  26. +5 −0 app/assets/stylesheets/app/messages.css.styl
  27. +123 −0 app/assets/stylesheets/app/messages/article.css.styl
  28. +78 −0 app/assets/stylesheets/app/messages/aside.css.styl
  29. +28 −0 app/assets/stylesheets/app/nav.css.styl
  30. +6 −203 app/assets/stylesheets/application.css.styl
  31. +56 −0 app/assets/stylesheets/scaffold.css
  32. +16 −0 app/controllers/authorize_controller.rb
  33. +48 −0 app/controllers/messages_controller.rb
  34. +2 −0 app/helpers/authorize_helper.rb
  35. +2 −0 app/helpers/messages_helper.rb
  36. +2 −0 app/models/message.rb
  37. +1 −91 app/views/app/index.html.erb
  38. +98 −0 app/views/app/static.html.erb
  39. +4 −0 config/application.yml
  40. +4 −0 config/initializers/omniauth.rb
  41. +7 −0 config/routes.rb
  42. +11 −0 db/migrate/20120101190943_create_messages.rb
  43. +3 −4 doc/TODO.md
  44. +11 −0 test/fixtures/messages.yml
  45. +7 −0 test/functional/authorize_controller_test.rb
  46. +49 −0 test/functional/messages_controller_test.rb
  47. +4 −0 test/unit/helpers/authorize_helper_test.rb
  48. +4 −0 test/unit/helpers/messages_helper_test.rb
  49. +7 −0 test/unit/message_test.rb
  50. +82 −0 vendor/assets/javascripts/gfx.js
  51. +296 −0 vendor/assets/javascripts/gfx/effects.js
  52. +81 −0 vendor/assets/javascripts/gfx/overlay.js
View
@@ -12,12 +12,15 @@ group :assets do
end
gem 'jquery-rails'
+gem 'omniauth'
+gem 'omniauth-google'
+gem 'omniauth-google-oauth2'
group :development do
gem 'sqlite3'
end
group :production do
gem 'pg'
- gem 'psych'
-end
+ # gem 'psych'
+end
View
@@ -1,6 +1,6 @@
GIT
remote: git://github.com/maccman/spine-rails.git
- revision: 0825b5ba0f44725cc026601a1c88808f19037627
+ revision: fc469c14379d57af842794d211044cce495fc9c0
specs:
spine-rails (0.0.9)
rails (>= 3.1.0)
@@ -37,6 +37,7 @@ GEM
activesupport (3.2.0.rc1)
i18n (~> 0.6)
multi_json (~> 1.0)
+ addressable (2.2.6)
arel (3.0.0.rc1)
builder (3.0.0)
coffee-rails (3.2.0)
@@ -56,6 +57,11 @@ GEM
eventmachine (0.12.10)
execjs (1.2.13)
multi_json (~> 1.0)
+ faraday (0.7.5)
+ addressable (~> 2.2.6)
+ multipart-post (~> 1.1.3)
+ rack (>= 1.1.0, < 2)
+ hashie (1.2.0)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.0.rc4)
@@ -69,10 +75,22 @@ GEM
treetop (~> 1.4.8)
mime-types (1.17.2)
multi_json (1.0.4)
+ multipart-post (1.1.4)
+ oauth2 (0.5.1)
+ faraday (~> 0.7.4)
+ multi_json (~> 1.0.3)
+ omniauth (1.0.1)
+ hashie (~> 1.2)
+ rack
+ omniauth-google-oauth2 (0.1.8)
+ omniauth (~> 1.0)
+ omniauth-oauth2
+ omniauth-oauth2 (1.0.0)
+ oauth2 (~> 0.5.0)
+ omniauth (~> 1.0)
pg (0.12.0)
rake-compiler (~> 0.7)
polyglot (0.3.3)
- psych (1.2.2)
rack (1.3.6)
rack-cache (1.1)
rack (>= 0.4)
@@ -130,8 +148,9 @@ DEPENDENCIES
coffee-rails (~> 3.2.0)
eco
jquery-rails
+ omniauth
+ omniauth-google-oauth2
pg
- psych
rails (= 3.2.0.rc1)
spine-rails!
sqlite3
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,10 @@
+class App.Activity extends Spine.Controller
+ # elements:
+ # '.items': items
+ #
+ # events:
+ # 'click .item': 'itemClick'
+
+ constructor: ->
+ super
+ # ...
@@ -0,0 +1,13 @@
+$ = Spine.$
+
+class App.Messages extends Spine.Controller
+ className: 'messages'
+
+ constructor: ->
+ super
+ @render()
+
+ render: ->
+ @append new App.Messages.Aside
+ @append $('<div />').addClass('vdivide')
+ @append new App.Messages.Article
@@ -0,0 +1,50 @@
+records = [
+ {
+ subject: 'New Email idea',
+ body: 'This is the new email idea',
+ avatar_url: 'https://secure.gravatar.com/avatar/11d44fdc7a81963600d079813ede2b69'
+ },
+
+ {
+ subject: 'New Email idea',
+ body: 'This is the new email idea',
+ avatar_url: 'https://secure.gravatar.com/avatar/11d44fdc7a81963600d079813ede2b69',
+ me: true
+ }
+]
+
+compose = {
+ avatar_url: 'https://secure.gravatar.com/avatar/11d44fdc7a81963600d079813ede2b69'
+}
+
+class Item extends Spine.Controller
+ className: 'item'
+
+ render: ->
+ @el.toggleClass('me', @record.me or false)
+ @html @view('messages/article/item')(@record)
+
+class Compose extends Spine.Controller
+ className: 'item me compose'
+
+ constructor: ->
+ super
+ @render()
+
+ render: ->
+ @html @view('messages/article/compose')(compose)
+
+class App.Messages.Article extends Spine.Controller
+ elements:
+ '.items': 'items'
+
+ constructor: ->
+ super
+
+ @replace @view('messages/article')()
+
+ @add(records)
+
+ add: (records) ->
+ for record in records
+ @items.append(new Item(record: record).render())
@@ -0,0 +1,26 @@
+records = [
+ {
+ subject: 'New Email idea',
+ body: 'This is the new email idea',
+ avatar_url: 'https://secure.gravatar.com/avatar/11d44fdc7a81963600d079813ede2b69'
+ }
+]
+
+class Item extends Spine.Controller
+ className: 'item active'
+
+ render: ->
+ @html @view('messages/aside/item')(@record)
+
+class App.Messages.Aside extends Spine.Controller
+ elements:
+ '.items': 'items'
+
+ constructor: ->
+ super
+ @replace @view('messages/aside')()
+ @add(records)
+
+ add: (records) ->
+ for record in records
+ @items.append(new Item(record: record).render())
@@ -0,0 +1,7 @@
+class App.Nav extends Spine.Controller
+ constructor: ->
+ super
+ @render()
+
+ render: ->
+ @replace @view('nav')()
@@ -0,0 +1,10 @@
+class App.Starred extends Spine.Controller
+ # elements:
+ # '.items': items
+ #
+ # events:
+ # 'click .item': 'itemClick'
+
+ constructor: ->
+ super
+ # ...
@@ -4,6 +4,8 @@
#= require spine/manager
#= require spine/ajax
#= require spine/route
+#= require gfx
+#= require gfx/effects
#= require_tree ./lib
#= require_self
@@ -15,10 +17,23 @@ class App extends Spine.Controller
constructor: ->
super
- # Initialize controllers:
- # @append(@items = new App.Items)
- # ...
+ @append new App.Nav
+ @append new App.Stack
- Spine.Route.setup()
+ Spine.Route.setup()
+
+class App.Stack extends Spine.Stack
+ constructor: ->
+ super
+
+ @activity = new App.Activity(stack: @)
+ @messages = new App.Messages(stack: @)
+ @starred = new App.Starred(stack: @)
+
+ @add(@activity)
+ @add(@messages)
+ @add(@starred)
+
+ @messages.active()
window.App = App
@@ -0,0 +1,3 @@
+class App.Conversation extends Spine.Model
+ @configure 'Conversation', 'from'
+ @extend Spine.Model.Ajax
@@ -0,0 +1,3 @@
+class App.Message extends Spine.Model
+ @configure 'Message', 'subject', 'body'
+ @extend Spine.Model.Ajax
@@ -0,0 +1,8 @@
+<article>
+ <header>
+ <span data-type="archive">Archive</span>
+ <span data-type="activity">Activity</span>
+ </header>
+
+ <div class="items"></div>
+</article>
@@ -0,0 +1,5 @@
+<img src="<%= @avatar_url %>">
+
+<div class="body">
+ <textarea autofocus></textarea>
+</div>
@@ -0,0 +1,3 @@
+<img src="<%= @avatar_url %>" />
+<div class="body"><%= @body %></div>
+<nav><a class="favourite"></a></nav>
@@ -0,0 +1,12 @@
+<aside>
+ <header>
+ <h2>Hermes</h2>
+ <img src="/assets/new.png">
+ </header>
+
+ <div class="search">
+ <input type="search" results="0" placeholder="Search..." incremental="true">
+ </div>
+
+ <div class="items"></div>
+</aside>
@@ -0,0 +1,6 @@
+<img src="<%= @avatar_url %>">
+
+<div>
+ <span class="subject"><%= @subject %></span>
+ <span class="body"><%= @body %></span>
+</div>
@@ -0,0 +1,17 @@
+<nav class="nav">
+ <div class="avatar">
+ <img src="https://secure.gravatar.com/avatar/baf018e2cc4616e4776d323215c7136c">
+ </div>
+
+ <div class="item">
+ <img src="/assets/messages.png">
+ </div>
+
+ <div class="item">
+ <img src="/assets/starred.png">
+ </div>
+
+ <div class="item">
+ <img src="/assets/broadcast.png">
+ </div>
+</nav>
@@ -0,0 +1,5 @@
+@import 'mixins'
+
+#app .messages
+ box-flex(1)
+ hbox()
Oops, something went wrong.

0 comments on commit 80bc068

Please sign in to comment.