From d8ed3009556f9190973bdf6fab0ef53ceea9573e Mon Sep 17 00:00:00 2001 From: Jordan Byron Date: Fri, 13 Jan 2012 22:22:32 -0500 Subject: [PATCH] Change the participate button a bit --- app/assets/javascripts/application.js | 4 ++++ .../stylesheets/partials/_activities.sass | 19 +++++++++++-------- app/decorators/activity_decorator.rb | 6 +++++- app/views/activities/_activity.html.haml | 3 --- vendor/assets/stylesheets/bootstrap.css | 2 +- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index c1eb458..43fd72f 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -10,3 +10,7 @@ //= require jquery.elastic //= require_tree '../../../vendor/assets/javascripts' //= require_tree . + +$(function(){ + $('a[rel~="twipsy"]').twipsy(); +}) \ No newline at end of file diff --git a/app/assets/stylesheets/partials/_activities.sass b/app/assets/stylesheets/partials/_activities.sass index 62960e6..958b9fe 100644 --- a/app/assets/stylesheets/partials/_activities.sass +++ b/app/assets/stylesheets/partials/_activities.sass @@ -10,14 +10,17 @@ div.activity float: right color: #666 a - font-size: 0.75em - color: #333 - &.participating:before - content: "" - float: left - width: 26px - height: 1em - background: asset-url("icons/check.png", image) no-repeat + font-size: 15px + color: #444 + padding: 5px 13px + &.participating + color: #0D6B0B + //:before + // content: "" + // float: left + // width: 26px + // height: 1em + // background: asset-url("icons/check.png", image) no-repeat &:hover color: #333 a diff --git a/app/decorators/activity_decorator.rb b/app/decorators/activity_decorator.rb index 870a4e8..d1c09cb 100644 --- a/app/decorators/activity_decorator.rb +++ b/app/decorators/activity_decorator.rb @@ -5,16 +5,20 @@ def registration_button h.content_tag(:span, :class => "registration") do if activity.registration_open? if activity.approved_participants.include?(h.current_user) - text = "Participating" + text = "You're Participating" css_class = "participating" + title = "Drop out" elsif activity.users.include?(h.current_user) text = "Pending Approval" + title = "Drop out" else text = "Participate" + title = "Join in" end h.link_to(text, h.register_activity_path(activity), :class => "clean-gray #{css_class if css_class}", + :rel => "twipsy", :title => title, :method => :post, :remote => true) else "Registration Closed" diff --git a/app/views/activities/_activity.html.haml b/app/views/activities/_activity.html.haml index 219e7c2..3377b5e 100644 --- a/app/views/activities/_activity.html.haml +++ b/app/views/activities/_activity.html.haml @@ -22,9 +22,6 @@ - @participants.each do |user| = link_to person_path(user), :class => "participant", :rel => "twipsy", :title => user.name do = user.icon(64) - :javascript - $('#participants a').twipsy(); - = activity.bottom(@activities, activities_path) diff --git a/vendor/assets/stylesheets/bootstrap.css b/vendor/assets/stylesheets/bootstrap.css index 2a6f085..555b405 100644 --- a/vendor/assets/stylesheets/bootstrap.css +++ b/vendor/assets/stylesheets/bootstrap.css @@ -16,7 +16,7 @@ position: absolute; visibility: visible; padding: 5px; - font-size: 16px; + font-size: 14px; z-index: 1000; filter: alpha(opacity=80); -khtml-opacity: 0.8;