Permalink
Browse files

turbolinks go

  • Loading branch information...
jodyalbritton committed Oct 1, 2012
1 parent 73a16de commit bb36b5234bfd31413d7d470fb23ded3244c656f6
Showing 10,182 changed files with 115 additions and 1,288,207 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
View
@@ -43,6 +43,7 @@ gem 'remotipart'
gem 'girl_friday'
gem 'heroku'
gem 'fog'
+gem 'turbolinks'
group :development do
gem 'bullet'
View
@@ -275,6 +275,7 @@ GEM
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
+ turbolinks (0.1.5)
twitter-bootstrap-rails (2.1.3)
actionpack (>= 3.1)
less-rails (~> 2.2.3)
@@ -332,6 +333,7 @@ DEPENDENCIES
simple_form
therubyracer
thin
+ turbolinks
twitter-bootstrap-rails
uglifier (>= 1.0.3)
will_paginate
@@ -19,6 +19,7 @@
//= require rails.validations
//= require jquery.tokeninput
//= require jquery.remotipart
+//= require turbolinks
//= require_tree .
// Search form.
@@ -537,6 +537,7 @@ min-height: 40px;
.users-list {
min-height: 120px;
+ border: 1px solid #E3E3E3;
}
.list-username {
text-align: center;
@@ -554,15 +555,16 @@ min-height: 40px;
}
.user-item-main{
+
text-align: center;
- border-right: 1px solid #E3E3E3;
+
}
.item-user{
- border-top: 1px solid #E3E3E3;
-
+ padding-top: 10px;
+ border-bottom: 1px solid #E3E3E3;
}
/****************************************************************
@@ -1,10 +1,10 @@
module LikesHelper
def like_link_for(target)
- link_to "Give Props", like_path(:resource_name => target.class, :resource_id => target.id), :method => :post,:remote => true, :class => "icon-thumbs-up"
+ link_to "Give Props", like_path(:resource_name => target.class, :resource_id => target.id), :"data-no-turbolink"=>true, :method => :post,:remote => true, :class => "icon-thumbs-up"
end
def unlike_link_for(target)
- link_to "Undo Props", like_path(:resource_name => target.class, :resource_id => target.id), :method => :delete,:remote => true, :class => "icon-thumbs-down"
+ link_to "Undo Props", like_path(:resource_name => target.class, :resource_id => target.id), :"data-no-turbolink"=>true, :method => :delete,:remote => true, :class => "icon-thumbs-down"
end
end
View
@@ -1,20 +1,24 @@
class Activity < ActiveRecord::Base
-#feilds accesible
- attr_accessible :user, :target_id, :activity_type, :created_at, :updated_at, :target_type, :parent_id, :verb, :scope, :tag_list
+
+ #fields accesible
+ attr_accessible :user, :target_id, :activity_type, :created_at, :updated_at, :target_type, :parent_id, :verb, :scope, :tag_list
-#relations for the activity
+ #relations for the activity
belongs_to :user
belongs_to :target, :polymorphic => true
has_many :replies, :class_name => "Post", :foreign_key => "reply_to_id"
has_and_belongs_to_many :tags
+
+ #default scope and set per page limit for will_paginate
default_scope :order => 'activities.created_at DESC'
self.per_page = 10
+ #set the partial path for the observer
def to_partial_path()
"activities/#{target_type.downcase}"
end
- #actions
+ #Flatten, generate and process tags.
serialize :tag_list
before_save :generate_taglist
after_commit :process_tags
View
@@ -1,17 +1,20 @@
class Circle < ActiveRecord::Base
-
+ #fields accessible
attr_accessible :description, :name, :user_tokens
+ #set attribute reader
+ attr_reader :user_tokens
+ #relationships
belongs_to :author, :class_name => 'User'
-
has_many :relationships
has_many :users, :through => :relationships
- attr_reader :user_tokens
+ #validations
validates_length_of :name, :maximum => 15
+ #actions
after_create :create_new_relationship
def name_format
View
@@ -1,12 +1,14 @@
class Follow < ActiveRecord::Base
-
+ #call acts_as_follower gem
extend ActsAsFollower::FollowerLib
extend ActsAsFollower::FollowScopes
# NOTE: Follows belong to the "followable" interface, and also to followers
belongs_to :followable, :polymorphic => true
belongs_to :follower, :polymorphic => true
-
+
+
+ #call this method to block a user
def block!
self.update_attribute(:blocked, true)
end
View
@@ -1,24 +1,25 @@
class Group < ActiveRecord::Base
resourcify
+
attr_accessible :active, :description, :name, :privacy_level, :user, :gcategory_id, :avatar
+
+ #call carrierwave uploader
+ mount_uploader :avatar, AvatarUploader
+
+ #relationships
belongs_to :gcategory
belongs_to :user
has_many :memberships, dependent: :destroy
has_many :activities, :foreign_key => :parent_id, dependent: :destroy
- mount_uploader :avatar, AvatarUploader
-
validates_presence_of :name, :description
-
+ #actions
after_create :create_new_membership
-
-
-
private
def create_new_membership
View
@@ -1,7 +1,10 @@
class Membership < ActiveRecord::Base
- attr_accessible :user_id, :group_id
+ #fields accessible
+ attr_accessible :user_id, :group_id,:blocked, :pending
+
+ #relationships
belongs_to :user
belongs_to :group
- attr_accessible :blocked, :pending
+
end
View
@@ -1,13 +1,18 @@
class Message < ActiveRecord::Base
+
+ #fields accessible
attr_accessible :body, :sender_id, :subject, :user_tokens
+ #set attribute reader
+ attr_reader :user_tokens
+ #relationships
belongs_to :sender, :class_name => 'User'
has_many :recipients
has_many :users, :through => :recipients
- attr_reader :user_tokens
+ #create user tokens virtual attribute
def user_tokens=(ids)
self.user_ids = ids.split(",")
View
@@ -7,7 +7,7 @@ class Post < ActiveRecord::Base
include Likeable
mount_uploader :attachment, AttachmentUploader
- #associations
+ #relationships
belongs_to :in_reply_to, :class_name => "Activity", :foreign_key => "reply_to_id"
belongs_to :user
@@ -19,22 +19,6 @@ class Post < ActiveRecord::Base
validates_presence_of :content
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
end
@@ -1,11 +1,11 @@
<% if @activities.count == 0 %>
-<div class="row-fluid activity-item">
-<div class="alert alert-error">
- No recent activity.
-</div>
-</div>
+ <div class="row-fluid activity-item">
+ <div class="alert alert-error">
+ No recent activity.
+ </div>
+ </div>
<% else %>
-<%= render :partial => @activities , :as => :activity %>
+ <%= render :partial => @activities , :as => :activity %>
<% end %>
@@ -1,15 +1,12 @@
- <% activity = Activity.find(like_object)%>
- <div id="activity_like_<%= activity.id %>" class="activity-like-menu">
-
- <a href="javascript:toggleDiv('expanded_<%=activity.id %>');" class= "icon-resize-full"> Expand </a>
-
- <%- if current_user.likes? activity.target -%>
- <%= unlike_link_for activity.target %>
+<% activity = Activity.find(like_object)%>
+ <div id="activity_like_<%= activity.id %>" class="activity-like-menu">
+ <a href="javascript:toggleDiv('expanded_<%=activity.id %>');" class= "icon-resize-full"> Expand </a>
+ <%- if current_user.likes? activity.target -%>
+ <%= unlike_link_for activity.target %>
<%- else -%>
- <%= like_link_for activity.target %>
+ <%= like_link_for activity.target %>
<%- end -%>
- <%= link_to new_post_path(:reply_to_id => activity.id), :remote => true do %>
- <i class="icon-comment"></i> Reply
- <% end %>
-
- </div>
+ <%= link_to new_post_path(:reply_to_id => activity.id), :remote => true do %>
+ <i class="icon-comment"></i> Reply
+ <% end %>
+ </div>
@@ -1,42 +1,19 @@
<% unless activity.target.nil? %>
-
<div class="row-fluid activity-item">
-
- <div id="activity-sidebar" class="span2 activity-sidebar">
-
-
- <%= image_tag activity.user.profile.avatar.url(:thumb), :class => "avatar" %>
- <h4><%= link_to activity.user.username, activity.user %></h4>
- <i class="icon-time"></i> <%= time_ago_in_words(activity.created_at) %>
-
-
-
- </div>
- <div id="post-body" class="span8 activity-body">
- <div class="activity-content">
+ <div id="activity-sidebar" class="span2 activity-sidebar">
+ <%= image_tag activity.user.profile.avatar.url(:thumb), :class => "avatar" %>
+ <h4><%= link_to activity.user.username, activity.user %></h4>
+ <i class="icon-time"></i> <%= time_ago_in_words(activity.created_at) %>
+ </div>
+ <div id="post-body" class="span8 activity-body">
+ <div class="activity-content">
<p>
<%= link_to "Posted", activity.target %><%if activity.parent_id > 0%> to a group: <% end %>
<% if activity.target.reply_to_id %> in reply to: <% end %>
<%= (mention_linker(activity.target.content)).html_safe %> <% if activity.target.attachment? %> -Photo Attached <% end%>
</p>
- </div>
-
-
-
-
- <%= render "activities/likes", :like_object => activity %>
-
-
-
-
-
-
-
-
-
-
-
-
+ </div>
+ <%= render "activities/likes", :like_object => activity %>
<div id="expanded_<%= activity.id %>" class="expanded" Style="display:none;">
<div class="expanded-menu row-fluid">
<div class="expanded-like-count span2">
@@ -48,8 +25,7 @@
<div class="span2">
</div>
- <div class="span8">
-
+ <div class="span8">
<% activity.target.likes.each do |likeuser| %>
<%= image_tag likeuser.user.profile.avatar.url(:mini), :class => "avatar" %>
<% end %>
@@ -82,8 +58,7 @@
</div>
<% end %>
</div>
- </div>
-
+ </div>
</div>
<div class="span2 activity-logo" >
<div class="activity-logo visible-desktop">
@@ -92,11 +67,7 @@
</div>
</div>
<% else %>
-
<div class="content-removed">
Content Removed
</div>
-
-<% end %>
-
-
+<% end %>
@@ -1,20 +1,12 @@
<%= simple_form_for @circle do |f| %>
-
-
<%= f.error_notification %>
-
-
-
- <div class="form-inputs">
+<div class="form-inputs">
<%= f.input :name %>
<%= f.input :user_tokens, :label => "Circle Members", :as => 'string', :input_html => { data: {load: @circle.users.collect {|user| {:id => user.id, :name => user.username } }}}, :class=> "x-large"%>
-
<%= f.input :description %>
- </div>
+</div>
-<div class="form-actions">
-
+<div class="form-actions">
<%= f.button :submit, :class=>"btn btn-primary"%>
-
</div>
<% end %>
Oops, something went wrong.

0 comments on commit bb36b52

Please sign in to comment.