Permalink
Browse files

project flow create when logged in. animated share links in footer

  • Loading branch information...
1 parent 1c332a6 commit 05ef4c38830631be874bab625ff9d98b82fc11aa @smothers smothers committed Apr 29, 2012
View
@@ -59,6 +59,7 @@ gem 'ask_geo'
gem 'rabl'
gem 'jquery-rails'
gem 'haml-rails'
+gem 'coffee-filter'
gem 'simple_form'
# Really Misc
View
@@ -55,6 +55,9 @@ GEM
ffi (~> 1.0.6)
chunky_png (1.2.5)
coderay (1.0.6)
+ coffee-filter (0.1.1)
+ coffee-script (>= 2.2.0)
+ haml (>= 3.0.18)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
@@ -299,6 +302,7 @@ DEPENDENCIES
capybara
capybara-webkit
carrierwave
+ coffee-filter
coffee-rails (~> 3.2.1)
compass-h5bp
compass-rails
View
Binary file not shown.
@@ -1,6 +1,7 @@
class Ananta.Routers.ProjectFlowRouter extends Backbone.Router
initialize: (options) ->
- @projects = new Ananta.Collections.ProjectsCollection({})
+ Ananta.App.currentUser = new Ananta.Models.User(options.currentUser)
+ @projects = new Ananta.Collections.ProjectsCollection()
routes:
".*" : "index"
@@ -10,12 +10,17 @@ class Ananta.Views.ProjectFlow.ProjectNameFormView extends Backbone.View
initialize: (options) ->
_.bindAll(@, 'render')
+ @model = new Ananta.Models.Project
+ @model.urlRoot = "/#{Ananta.App.currentUser.id}"
render: ->
$(@el).html(@template())
@
submit: (e) ->
- @.trigger('removeProjectNameForm')
e.preventDefault()
e.stopPropagation()
+ @model.set('name', @$('input').val())
+ @model.save()
+ @collection.add(@model)
+ @.trigger('removeProjectNameForm')
@@ -526,6 +526,10 @@ input{
border-bottom: 0;
display: list-item; //TODO: wtf?
}
+ .modal-body{
+ padding-top: 0;
+ margin-top: -5px;
+ }
.facebook{
p{
color: #bbb;
@@ -619,6 +623,17 @@ input{
img {
margin-bottom: 4px;
}
+ .addthis_toolbox{
+ display: inline-block;
+ vertical-align: top;
+ margin-top: 1px;
+ position: relative;
+ width: 125px;
+ height: 25px;
+ a{
+ position: absolute;
+ }
+ }
}
}
@@ -1,10 +1,47 @@
+=content_for :javascripts do
+ :coffeescript
+ $(() ->
+ buttons = $("#footer .addthis_toolbox").children()
+ pre = 99
+ cur = 0
+ hover = false
+ time = 3000
+ $(buttons).fadeTo(0, 0.4);
+ $(buttons).hide()
+ transitionButtons = () =>
+ cur = if (pre+1) < buttons.length then (pre+1) else 0
+ $(buttons[pre]).fadeOut(500)
+ $(buttons[cur]).fadeIn(500)
+ pre = cur
+ recur = () =>
+ if hover
+ wait time, () => recur()
+ else
+ transitionButtons()
+ wait time, () => recur()
+ transitionButtons()
+ #
+ $("#footer .addthis_toolbox").live
+ mouseenter: =>
+ hover = true
+ $(buttons[cur]).fadeTo(300, 1.0);
+ mouseleave: =>
+ hover = false
+ $(buttons[cur]).fadeTo(300, 0.4);
+ )
+
.container
- %p.center
+ .center
ananta IO
= image_tag "/assets/copyleft.png", style: "height: 10px"
#{ Date.today.year }
&middot;
= link_to 'github', "https://github.com/ananta-io/ananta", target: "_blank"
&middot;
= link_to 'about', '/about'
-
+ &middot;
+ .addthis_toolbox.addthis_default_style
+ %a.addthis_button_facebook_like{"fb:like:layout" => "button_count"}
+ %a.addthis_button_tweet
+ %a.addthis_button_google_plusone{"g:plusone:size" => "medium"}
+ %script{:src => "http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4e07edfe1206c99f", :type => "text/javascript"}
@@ -1,3 +1,10 @@
+/
+ a . --.-- .--.
+ n _|_ | : :
+ a .-. .--. .-. .--. | .-. | | |
+ t ( ) | |( ) | | | ( ) | : ;
+ a `-'`-' `-`-'`-' `-`-'`-'`- --'-- `--'
+
%meta{ charset: "utf-8" }
-# Use the .htaccess and remove these lines to avoid edge case issues.
@@ -7,7 +14,7 @@
%meta{ name: "viewport", content: "width=device-width, initial-scale=1.0" }
%title
- = yield :title || "#{ controller.controller_name.titleize } - #{ controller.action_name.titleize }"
+ = yield :title || "#{ controller.controller_name.titleize } - #{ controller.action_name.titleize }"
%meta{ name: "description", content: "" }
%meta{ name: "author", content: "" }
@@ -4,7 +4,7 @@
:javascript
$(function() {
// Add project_flow to view
- Ananta.router = new Ananta.Routers.ProjectFlowRouter();
+ Ananta.router = new Ananta.Routers.ProjectFlowRouter({ 'currentUser' : #{render("users/base.json.rabl", object: current_user)} });
Backbone.history.start();
});
@@ -0,0 +1,7 @@
+object @user
+
+attributes :id, :username
+
+node(:avatar) do |user|
+ user.profile.avatar.image.small if user
+end
@@ -1 +1,3 @@
-extends 'users/show'
+collection @users
+
+extends 'users/base'
@@ -1,7 +1,3 @@
object @user
-attributes :id, :username
-
-node(:avatar) do |user|
- user.profile.avatar.image.small
-end
+extends 'users/base'

0 comments on commit 05ef4c3

Please sign in to comment.