social_engine 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +13 -0
- data/LICENSE.txt +20 -0
- data/README.md +340 -0
- data/VERSION +1 -0
- data/app/controllers/comments_controller.rb +13 -0
- data/app/controllers/favorites_controller.rb +21 -0
- data/app/controllers/ratings_controller.rb +15 -0
- data/app/controllers/reputation_actions_controller.rb +13 -0
- data/app/controllers/social_engine_controller.rb +32 -0
- data/app/controllers/votes_controller.rb +15 -0
- data/app/helpers/social_engine_helper.rb +82 -0
- data/app/models/comment.rb +10 -0
- data/app/models/favorite.rb +4 -0
- data/app/models/friending.rb +21 -0
- data/app/models/rating.rb +6 -0
- data/app/models/reputation.rb +24 -0
- data/app/models/reputation_action.rb +15 -0
- data/app/models/social_engine/commentable.rb +14 -0
- data/app/models/social_engine/favoriteable.rb +14 -0
- data/app/models/social_engine/friendable.rb +56 -0
- data/app/models/social_engine/helpers.rb +37 -0
- data/app/models/social_engine/rateable.rb +33 -0
- data/app/models/social_engine/reputatable.rb +14 -0
- data/app/models/social_engine/sociable.rb +17 -0
- data/app/models/social_engine/social_user.rb +16 -0
- data/app/models/social_engine/voteable.rb +28 -0
- data/app/models/vote.rb +13 -0
- data/app/views/comments/_comment.haml +11 -0
- data/app/views/comments/_form.haml +8 -0
- data/app/views/comments/_list.haml +4 -0
- data/app/views/comments/new.haml +1 -0
- data/app/views/common/_user_attributes.haml +6 -0
- data/app/views/favorites/_widget.haml +8 -0
- data/app/views/ratings/_form.haml +6 -0
- data/app/views/ratings/_rating.haml +3 -0
- data/app/views/ratings/new.haml +1 -0
- data/app/views/reputation_actions/_form.haml +5 -0
- data/app/views/reputation_actions/edit.haml +3 -0
- data/app/views/reputation_actions/index.haml +21 -0
- data/app/views/reputation_actions/new.haml +9 -0
- data/app/views/third_party/_fb_friend_box.html.erb +5 -0
- data/app/views/third_party/_fb_javascript_sdk.html.erb +13 -0
- data/app/views/third_party/_fb_og_tags.html.erb +10 -0
- data/app/views/third_party/_fblike.html.erb +3 -0
- data/app/views/third_party/_tweetme.html.erb +6 -0
- data/app/views/votes/_widget.haml +13 -0
- data/config/routes.rb +3 -0
- data/lib/generators/social_engine/install/USAGE +17 -0
- data/lib/generators/social_engine/install/install_generator.rb +34 -0
- data/lib/generators/social_engine/install/templates/create_comments_table.rb +23 -0
- data/lib/generators/social_engine/install/templates/create_favorites_table.rb +19 -0
- data/lib/generators/social_engine/install/templates/create_friendings_table.rb +20 -0
- data/lib/generators/social_engine/install/templates/create_ratings_table.rb +21 -0
- data/lib/generators/social_engine/install/templates/create_reputation_actions_table.rb +14 -0
- data/lib/generators/social_engine/install/templates/create_reputations_table.rb +19 -0
- data/lib/generators/social_engine/install/templates/create_votes_table.rb +21 -0
- data/lib/generators/social_engine/install/templates/formtastic.css +145 -0
- data/lib/generators/social_engine/install/templates/social_engine.css +26 -0
- data/lib/generators/social_engine/install/templates/social_engine_yetting.yml +89 -0
- data/lib/generators/social_engine/user_reputation/templates/add_reputation_to_users_table.rb +9 -0
- data/lib/generators/social_engine/user_reputation/user_reputation_generator.rb +22 -0
- data/lib/social_engine.rb +11 -0
- data/lib/social_engine/core_ext/array.rb +13 -0
- data/lib/social_engine/core_ext/hash.rb +26 -0
- data/lib/social_engine/engine.rb +44 -0
- data/lib/social_engine/railties/tasks.rake +0 -0
- data/social_engine.gemspec +126 -0
- metadata +211 -0
data/app/models/vote.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
class Vote < ActiveRecord::Base
|
2
|
+
belongs_to :voteable, :polymorphic=>true
|
3
|
+
validates_uniqueness_of :voteable_type, :scope=> SocialEngine::Helpers::Fingerprint.fingerprint_type(:voteable_id),
|
4
|
+
:if => Proc.new { |x| SocialEngineYetting.fingerprint_method != "none" }
|
5
|
+
|
6
|
+
def up?
|
7
|
+
self.value>0
|
8
|
+
end
|
9
|
+
|
10
|
+
def down?
|
11
|
+
self.value<0
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
.se-comment{:id=>div_id(comment)}
|
2
|
+
.se-comment-body
|
3
|
+
=comment.comment
|
4
|
+
-if options[:show_posted_by] or options[:date]
|
5
|
+
.se-comment-info
|
6
|
+
-if options[:show_posted_by]
|
7
|
+
.se-comment-posted-by
|
8
|
+
\Posted by #{comment.name}
|
9
|
+
-if options[:date]
|
10
|
+
.se-comment-date
|
11
|
+
=comment.created_at.strftime(options[:date])
|
@@ -0,0 +1,8 @@
|
|
1
|
+
.se-comment-form
|
2
|
+
=semantic_form_for [commentable,comment] do |f|
|
3
|
+
= f.inputs do
|
4
|
+
-unless current_user
|
5
|
+
= render "common/user_attributes", options: options, f: f
|
6
|
+
= f.input :comment, :label=> options[:comment][:label]
|
7
|
+
= f.buttons do
|
8
|
+
=f.commit_button options[:comment][:button_text]
|
@@ -0,0 +1 @@
|
|
1
|
+
=render "comments/form", commentable: @commentable, comment: Comment.new
|
@@ -0,0 +1,6 @@
|
|
1
|
+
-if options[:name]
|
2
|
+
= f.input :unauthenticated_name, :label=> options[:name][:label], :required=>options[:name][:required]
|
3
|
+
-if options[:email]
|
4
|
+
= f.input :unauthenticated_email, :label=> options[:email][:label], :required=>options[:email][:required]
|
5
|
+
-if options[:website]
|
6
|
+
= f.input :unauthenticated_website, :label=> options[:website][:label], :required=>options[:website][:required]
|
@@ -0,0 +1,8 @@
|
|
1
|
+
- if current_user
|
2
|
+
.se-favorite{:id=>"favorite-#{div_id(favoriteable)}"}
|
3
|
+
- if current_user.favorites.include?(favorite)
|
4
|
+
=button_to options[:remove_text], "/#{favoriteable.class.to_s.underscore.pluralize}/#{favoriteable.id}/favorites/#{favorite.id}", :method=>:delete, :class=>"se-favorite-delete"
|
5
|
+
- else
|
6
|
+
=semantic_form_for [favoriteable,Favorite.new] do |f|
|
7
|
+
= f.buttons do
|
8
|
+
=f.commit_button options[:add_text], :class=>"se-favorite-add"
|
@@ -0,0 +1 @@
|
|
1
|
+
=render "ratings/form", rateable: @rateable, rating: Rating.new
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#se-reputation-actions-list
|
2
|
+
%h1 Reputation Actions
|
3
|
+
#se-new-reputation-action-link
|
4
|
+
=link_to "Add New Reputation Action", new_reputation_action_url
|
5
|
+
%table{:id=>"businesses-table"}
|
6
|
+
%thead
|
7
|
+
%tr
|
8
|
+
%th Name
|
9
|
+
%th Value
|
10
|
+
%th
|
11
|
+
%th
|
12
|
+
%tbody
|
13
|
+
- @reputation_actions.each do |rep_action|
|
14
|
+
%tr
|
15
|
+
%td= rep_action.name
|
16
|
+
%td= rep_action.value
|
17
|
+
%td= link_to "Edit", edit_reputation_action_url(rep_action)
|
18
|
+
%td= link_to "Edit", edit_reputation_action_url(rep_action), :method=>"destroy", :confirm=>"Are you sure you want to delete"
|
19
|
+
|
20
|
+
|
21
|
+
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<div class="<%=options[:div_class]%>">
|
2
|
+
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
|
3
|
+
<fb:like-box href="<%=options[:fb_page_url]%>" width="<%=options[:width]%>" show_faces="<%=options[:faces]%>" stream="<%=options[:stream]%>" header="<%=options[:header]%>">
|
4
|
+
</fb:like-box>
|
5
|
+
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<div id="fb-root"></div>
|
2
|
+
<script>
|
3
|
+
window.fbAsyncInit = function() {
|
4
|
+
FB.init({appId: '<%=options[:app_id]%>', status: true, cookie: true,
|
5
|
+
xfbml: true});
|
6
|
+
};
|
7
|
+
(function() {
|
8
|
+
var e = document.createElement('script'); e.async = true;
|
9
|
+
e.src = document.location.protocol +
|
10
|
+
'//connect.facebook.net/en_US/all.js';
|
11
|
+
document.getElementById('fb-root').appendChild(e);
|
12
|
+
}());
|
13
|
+
</script>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<meta property="og:title" content="<%=options[:title]%>" />
|
2
|
+
<meta property="og:type" content="<%=options[:type]%>" />
|
3
|
+
<meta property="og:url" content="<%=options[:url]%>" />
|
4
|
+
<meta property="og:image" content="<%=options[:image]%>" />
|
5
|
+
<meta property="og:site_name" content="<%=options[:site_name]%>" />
|
6
|
+
<% if options[:app_id] %>
|
7
|
+
<meta property="fb:app_id" content="<%=options[:app_id]%>" />
|
8
|
+
<% else %>
|
9
|
+
<meta property="fb:admins" content="<%=options[:admins]%>" />
|
10
|
+
<% end %>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<div class="<%=options[:div_class]%>">
|
2
|
+
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="<%= options[:url] %>" layout="<%=options[:layout]%>" show_faces="<%=options[:faces]%>" width="<%=options[:width]%>" action="<%=options[:action]%>" font="<%=options[:font]%>" colorscheme="<%=options[:colorscheme]%>"></fb:like>
|
3
|
+
</div>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<div class="<%=options[:div_class]%>">
|
2
|
+
<a href="http://twitter.com/share" class="twitter-share-button" data-count="<%=options[:count] %>"
|
3
|
+
<% if options[:url] %> data-url="<%=options[:url] %>"<% end %>
|
4
|
+
<% if options[:text] %> data-text="<%=options[:text] %>"<% end %>
|
5
|
+
<% if options[:via] %> data-via="<%=options[:via]%>"<% end %>
|
6
|
+
>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
.se-vote-widget
|
2
|
+
.se-vote-up
|
3
|
+
=semantic_form_for [voteable,Vote.new(value:1)] do |f|
|
4
|
+
= f.input :value, :as=>:hidden
|
5
|
+
= f.buttons do
|
6
|
+
=f.commit_button options[:upvote_text]
|
7
|
+
.se-vote-score
|
8
|
+
=voteable.vote_sum
|
9
|
+
.se-vote-down
|
10
|
+
=semantic_form_for [voteable,Vote.new(value:-1)] do |f|
|
11
|
+
= f.input :value, :as=>:hidden
|
12
|
+
= f.buttons do
|
13
|
+
=f.commit_button options[:downvote_text]
|
data/config/routes.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
Description:
|
2
|
+
This generator creates your db migrations, configuration file and css used by social_engine
|
3
|
+
|
4
|
+
Example:
|
5
|
+
rails generate social_engine
|
6
|
+
|
7
|
+
This will create:
|
8
|
+
db/migrations/create_comments_table.rb
|
9
|
+
db/migrations/create_votes_table.rb
|
10
|
+
db/migrations/create_ratings_table.rb
|
11
|
+
db/migrations/create_favorites_table.rb
|
12
|
+
db/migrations/create_reputations_table.rb
|
13
|
+
db/migrations/create_reputation_actions_table.rb
|
14
|
+
db/migrations/create_friendings_table.rb
|
15
|
+
public/stylesheets/social_engine.css
|
16
|
+
public/stylesheets/formtastic.css
|
17
|
+
config/yettings/social_engine.yml
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
require 'rails/generators/migration'
|
3
|
+
|
4
|
+
module SocialEngine
|
5
|
+
class InstallGenerator < Rails::Generators::Base
|
6
|
+
include Rails::Generators::Migration
|
7
|
+
source_root File.join(File.dirname(__FILE__), 'templates')
|
8
|
+
|
9
|
+
def self.next_migration_number(dirname)
|
10
|
+
sleep 1
|
11
|
+
if ActiveRecord::Base.timestamped_migrations
|
12
|
+
Time.now.utc.strftime("%Y%m%d%H%M%S")
|
13
|
+
else
|
14
|
+
"%.3d" % (current_migration_number(dirname) + 1)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def create_migration_file
|
19
|
+
migration_template 'create_comments_table.rb', 'db/migrate/create_comments_table.rb'
|
20
|
+
migration_template 'create_votes_table.rb', 'db/migrate/create_votes_table.rb'
|
21
|
+
migration_template 'create_ratings_table.rb', 'db/migrate/create_ratings_table.rb'
|
22
|
+
migration_template 'create_favorites_table.rb', 'db/migrate/create_favorites_table.rb'
|
23
|
+
migration_template 'create_reputations_table.rb', 'db/migrate/create_reputations_table.rb'
|
24
|
+
migration_template 'create_reputation_actions_table.rb', 'db/migrate/create_reputation_actions_table.rb'
|
25
|
+
migration_template 'create_friendings_table.rb', 'db/migrate/create_friendings_table.rb'
|
26
|
+
end
|
27
|
+
|
28
|
+
def create_static_assets
|
29
|
+
copy_file "social_engine_yetting.yml", "config/yettings/social_engine.yml"
|
30
|
+
copy_file "social_engine.css", "public/stylesheets/social_engine.css"
|
31
|
+
copy_file "formtastic.css", "public/stylesheets/formtastic.css"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class CreateCommentsTable < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :comments, :force => true do |t|
|
4
|
+
t.string :commentable_type
|
5
|
+
t.integer :commentable_id
|
6
|
+
t.integer :user_id
|
7
|
+
t.text :comment
|
8
|
+
t.string :unauthenticated_name
|
9
|
+
t.string :unauthenticated_email
|
10
|
+
t.string :unauthenticated_website
|
11
|
+
t.string :ip_address
|
12
|
+
t.string :session_hash
|
13
|
+
t.string :browser_fingerprint
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
add_index :comments, [:commentable_type, :commentable_id, :ip_address, :browser_fingerprint], :name => "comments_index", :unique => false
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.down
|
20
|
+
remove_index :comments, :name=> :comments_index
|
21
|
+
drop_table :comments
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class CreateFavoritesTable < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :favorites, :force => true do |t|
|
4
|
+
t.string :favoriteable_type
|
5
|
+
t.integer :favoriteable_id
|
6
|
+
t.integer :user_id
|
7
|
+
t.string :ip_address
|
8
|
+
t.string :session_hash
|
9
|
+
t.string :browser_fingerprint
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
add_index :favorites, [:favoriteable_type, :favoriteable_id, :ip_address, :browser_fingerprint], :name => "favorites_index", :unique => false
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.down
|
16
|
+
remove_index :favorites, :name=> :favorites_index
|
17
|
+
drop_table :favorites
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class CreateFriendingsTable < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :friendings, :force => true do |t|
|
4
|
+
t.integer :friendor_id
|
5
|
+
t.integer :friendee_id
|
6
|
+
t.boolean :confirmed, :default => false
|
7
|
+
t.boolean :rejected, :default => false
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
|
11
|
+
add_index :friendings, :friendor_id
|
12
|
+
add_index :friendings, :friendee_id
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.down
|
16
|
+
remove_index :friendings, :friendor_id
|
17
|
+
remove_index :friendings, :friendee_id
|
18
|
+
drop_table :friendings
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class CreateRatingsTable < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :ratings, :force => true do |t|
|
4
|
+
t.string :rateable_type
|
5
|
+
t.integer :rateable_id
|
6
|
+
t.integer :value
|
7
|
+
t.integer :user_id
|
8
|
+
t.string :ip_address
|
9
|
+
t.string :session_hash
|
10
|
+
t.string :browser_fingerprint
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
|
14
|
+
add_index :ratings, [:rateable_type, :rateable_id, :ip_address, :browser_fingerprint], :name => "ratings_index", :unique => false
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.down
|
18
|
+
remove_index :ratings, :name=> :ratings_index
|
19
|
+
drop_table :ratings
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateReputationActionsTable < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :reputation_actions, :force => true do |t|
|
4
|
+
t.string :name
|
5
|
+
t.text :description
|
6
|
+
t.integer :value
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.down
|
12
|
+
drop_table :reputation_actions
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class CreateReputationsTable < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :reputations, :force => true do |t|
|
4
|
+
t.integer :user_id
|
5
|
+
t.integer :reputation_action_id
|
6
|
+
t.integer :value
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
|
10
|
+
add_index :reputations, [:user_id,:reputation_action_id], :name => "user_reputation", :unique => false
|
11
|
+
add_index :reputations, :reputation_action_id
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.down
|
15
|
+
remove_index :reputations, :reputation_action_id
|
16
|
+
remove_index :reputations, :name=> :user_reputation
|
17
|
+
drop_table :reputations
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class CreateVotesTable < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :votes, :force => true do |t|
|
4
|
+
t.string :voteable_type
|
5
|
+
t.integer :voteable_id
|
6
|
+
t.integer :user_id
|
7
|
+
t.integer :value
|
8
|
+
t.string :ip_address
|
9
|
+
t.string :session_hash
|
10
|
+
t.string :browser_fingerprint
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
|
14
|
+
add_index :votes, [:voteable_type, :voteable_id, :ip_address, :browser_fingerprint], :name => "votes_index", :unique => false
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.down
|
18
|
+
remove_index :votes, :name=> :votes_index
|
19
|
+
drop_table :votes
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,145 @@
|
|
1
|
+
/* -------------------------------------------------------------------------------------------------
|
2
|
+
|
3
|
+
It's *strongly* suggested that you don't modify this file. Instead, load a new stylesheet after
|
4
|
+
this one in your layouts (eg formtastic_changes.css) and override the styles to suit your needs.
|
5
|
+
This will allow you to update formtastic.css with new releases without clobbering your own changes.
|
6
|
+
|
7
|
+
This stylesheet forms part of the Formtastic Rails Plugin
|
8
|
+
(c) 2008 Justin French
|
9
|
+
|
10
|
+
--------------------------------------------------------------------------------------------------*/
|
11
|
+
|
12
|
+
|
13
|
+
/* NORMALIZE AND RESET - obviously inspired by Yahoo's reset.css, but scoped to just form.formtastic
|
14
|
+
--------------------------------------------------------------------------------------------------*/
|
15
|
+
form.formtastic, form.formtastic ul, form.formtastic ol, form.formtastic li, form.formtastic fieldset, form.formtastic legend, form.formtastic input, form.formtastic textarea, form.formtastic select, form.formtastic p { margin:0; padding:0; }
|
16
|
+
form.formtastic fieldset { border:0; }
|
17
|
+
form.formtastic em, form.formtastic strong { font-style:normal; font-weight:normal; }
|
18
|
+
form.formtastic ol, form.formtastic ul { list-style:none; }
|
19
|
+
form.formtastic abbr, form.formtastic acronym { border:0; font-variant:normal; }
|
20
|
+
form.formtastic input, form.formtastic textarea, form.formtastic select { font-family:inherit; font-size:inherit; font-weight:inherit; }
|
21
|
+
form.formtastic input, form.formtastic textarea, form.formtastic select { font-size:100%; }
|
22
|
+
form.formtastic legend { white-space:normal; color:#000; }
|
23
|
+
|
24
|
+
|
25
|
+
/* SEMANTIC ERRORS
|
26
|
+
--------------------------------------------------------------------------------------------------*/
|
27
|
+
form.formtastic ul.errors { color:#cc0000; margin:0.5em 0 1.5em 25%; list-style:square; }
|
28
|
+
form.formtastic ul.errors li { padding:0; border:none; display:list-item; }
|
29
|
+
|
30
|
+
|
31
|
+
/* FIELDSETS & LISTS
|
32
|
+
--------------------------------------------------------------------------------------------------*/
|
33
|
+
form.formtastic fieldset { overflow:auto; } /* clearing contained floats */
|
34
|
+
form.formtastic fieldset.inputs { }
|
35
|
+
form.formtastic fieldset.buttons { padding-left:25%; }
|
36
|
+
form.formtastic fieldset ol { }
|
37
|
+
form.formtastic fieldset.buttons li { float:left; padding-right:0.5em; }
|
38
|
+
|
39
|
+
/* INPUT LIs
|
40
|
+
--------------------------------------------------------------------------------------------------*/
|
41
|
+
form.formtastic fieldset > ol > li { padding:0.5em 0; margin-top:-0.5em; margin-bottom:1em; } /* padding and negative margin juggling is for Firefox */
|
42
|
+
form.formtastic fieldset > ol > li { overflow:auto; } /* clearing contained floats */
|
43
|
+
|
44
|
+
form.formtastic fieldset > ol > li.required { }
|
45
|
+
form.formtastic fieldset > ol > li.optional { }
|
46
|
+
form.formtastic fieldset > ol > li.error { }
|
47
|
+
|
48
|
+
|
49
|
+
/* LABELS
|
50
|
+
--------------------------------------------------------------------------------------------------*/
|
51
|
+
form.formtastic fieldset > ol > li label { display:block; width:25%; float:left; padding-top:.2em; }
|
52
|
+
form.formtastic fieldset > ol > li > li label { line-height:100%; padding-top:0; }
|
53
|
+
form.formtastic fieldset > ol > li > li label input { line-height:100%; vertical-align:middle; margin-top:-0.1em;}
|
54
|
+
|
55
|
+
|
56
|
+
/* NESTED FIELDSETS AND LEGENDS (radio, check boxes and date/time inputs use nested fieldsets)
|
57
|
+
--------------------------------------------------------------------------------------------------*/
|
58
|
+
form.formtastic fieldset > ol > li fieldset { position:relative; }
|
59
|
+
form.formtastic fieldset > ol > li fieldset legend { position:absolute; width:95%; left: 0px; }
|
60
|
+
form.formtastic fieldset > ol > li fieldset legend span { position:absolute; }
|
61
|
+
form.formtastic fieldset > ol > li fieldset legend.label label { position:absolute; }
|
62
|
+
form.formtastic fieldset > ol > li fieldset ol { float:left; width:74%; margin:0; padding:0 0 0 25%; }
|
63
|
+
form.formtastic fieldset > ol > li fieldset ol li { padding:0; border:0; }
|
64
|
+
|
65
|
+
|
66
|
+
/* INLINE HINTS
|
67
|
+
--------------------------------------------------------------------------------------------------*/
|
68
|
+
form.formtastic fieldset > ol > li p.inline-hints { color:#666; margin:0.5em 0 0 25%; }
|
69
|
+
|
70
|
+
|
71
|
+
/* INLINE ERRORS
|
72
|
+
--------------------------------------------------------------------------------------------------*/
|
73
|
+
form.formtastic fieldset > ol > li p.inline-errors { color:#cc0000; margin:0.5em 0 0 25%; }
|
74
|
+
form.formtastic fieldset > ol > li ul.errors { color:#cc0000; margin:0.5em 0 0 25%; list-style:square; }
|
75
|
+
form.formtastic fieldset > ol > li ul.errors li { padding:0; border:none; display:list-item; }
|
76
|
+
|
77
|
+
|
78
|
+
/* STRING, NUMERIC, PASSWORD, EMAIL, URL, PHONE & SEARCH OVERRIDES
|
79
|
+
--------------------------------------------------------------------------------------------------*/
|
80
|
+
form.formtastic fieldset > ol > li.string input,
|
81
|
+
form.formtastic fieldset > ol > li.password input,
|
82
|
+
form.formtastic fieldset > ol > li.numeric input,
|
83
|
+
form.formtastic fieldset > ol > li.email input,
|
84
|
+
form.formtastic fieldset > ol > li.url input,
|
85
|
+
form.formtastic fieldset > ol > li.phone input,
|
86
|
+
form.formtastic fieldset > ol > li.search input { width:72%; }
|
87
|
+
|
88
|
+
form.formtastic fieldset > ol > li.string input[size],
|
89
|
+
form.formtastic fieldset > ol > li.password input[size],
|
90
|
+
form.formtastic fieldset > ol > li.numeric input[size],
|
91
|
+
form.formtastic fieldset > ol > li.email input[size],
|
92
|
+
form.formtastic fieldset > ol > li.url input[size],
|
93
|
+
form.formtastic fieldset > ol > li.phone input[size],
|
94
|
+
form.formtastic fieldset > ol > li.search input[size] { width:auto; max-width:72%; }
|
95
|
+
|
96
|
+
|
97
|
+
/* TEXTAREA OVERRIDES
|
98
|
+
--------------------------------------------------------------------------------------------------*/
|
99
|
+
form.formtastic fieldset > ol > li.text textarea { width:72%; }
|
100
|
+
form.formtastic fieldset > ol > li.text textarea[cols] { width:auto; max-width:72%; }
|
101
|
+
|
102
|
+
|
103
|
+
/* HIDDEN OVERRIDES
|
104
|
+
--------------------------------------------------------------------------------------------------*/
|
105
|
+
form.formtastic fieldset ol li.hidden { display:none; }
|
106
|
+
|
107
|
+
/* BOOLEAN OVERRIDES
|
108
|
+
--------------------------------------------------------------------------------------------------*/
|
109
|
+
form.formtastic fieldset > ol > li.boolean label { padding-left:25%; width:auto; }
|
110
|
+
form.formtastic fieldset > ol > li.boolean label input { margin:0 0.5em 0 0.2em; }
|
111
|
+
|
112
|
+
|
113
|
+
/* RADIO OVERRIDES
|
114
|
+
--------------------------------------------------------------------------------------------------*/
|
115
|
+
form.formtastic fieldset > ol > li.radio { }
|
116
|
+
form.formtastic fieldset > ol > li.radio fieldset { overflow:visible; }
|
117
|
+
form.formtastic fieldset > ol > li.radio fieldset ol { margin-bottom:-0.5em; }
|
118
|
+
form.formtastic fieldset > ol > li.radio fieldset ol li { margin:0.1em 0 0.5em 0; overflow:visible; }
|
119
|
+
form.formtastic fieldset > ol > li.radio fieldset ol li label { float:none; width:100%; }
|
120
|
+
form.formtastic fieldset > ol > li.radio fieldset ol li label input { margin-right:0.2em; }
|
121
|
+
|
122
|
+
|
123
|
+
/* CHECK BOXES (COLLECTION) OVERRIDES
|
124
|
+
--------------------------------------------------------------------------------------------------*/
|
125
|
+
form.formtastic fieldset > ol > li.check_boxes { }
|
126
|
+
form.formtastic fieldset > ol > li.check_boxes fieldset { overflow:visible; }
|
127
|
+
form.formtastic fieldset > ol > li.check_boxes fieldset ol { margin-bottom:-0.5em; }
|
128
|
+
form.formtastic fieldset > ol > li.check_boxes fieldset ol li { margin:0.1em 0 0.5em 0; overflow:visible; }
|
129
|
+
form.formtastic fieldset > ol > li.check_boxes fieldset ol li label { float:none; width:100%; }
|
130
|
+
form.formtastic fieldset > ol > li.check_boxes fieldset ol li label input { margin-right:0.2em; }
|
131
|
+
|
132
|
+
|
133
|
+
/* DATE & TIME OVERRIDES
|
134
|
+
--------------------------------------------------------------------------------------------------*/
|
135
|
+
form.formtastic fieldset > ol > li.date fieldset ol li,
|
136
|
+
form.formtastic fieldset > ol > li.time fieldset ol li,
|
137
|
+
form.formtastic fieldset > ol > li.datetime fieldset ol li { float:left; width:auto; margin:0 .3em 0 0; }
|
138
|
+
|
139
|
+
form.formtastic fieldset > ol > li.date fieldset ol li label,
|
140
|
+
form.formtastic fieldset > ol > li.time fieldset ol li label,
|
141
|
+
form.formtastic fieldset > ol > li.datetime fieldset ol li label { display:none; }
|
142
|
+
|
143
|
+
form.formtastic fieldset > ol > li.date fieldset ol li label input,
|
144
|
+
form.formtastic fieldset > ol > li.time fieldset ol li label input,
|
145
|
+
form.formtastic fieldset > ol > li.datetime fieldset ol li label input { display:inline; margin:0; padding:0; }
|