From b35fd30de3fef1d3e6ecb0ce8c39b0ae8f4c6278 Mon Sep 17 00:00:00 2001 From: varmanr Date: Tue, 27 Aug 2013 18:44:01 +0400 Subject: [PATCH 1/3] Like-button --- .../templates/default/ubic-service-sass.erb | 2 +- www/sass/_likers.scss | 4 +++ www/sass/blocks/_mini-like.scss | 15 +++++------ www/sass/main.scss | 1 + www/templates/like.html | 26 +++++++------------ www/templates/partials.html | 16 ++++++++++++ www/templates/quest/big.html | 5 ++-- 7 files changed, 40 insertions(+), 29 deletions(-) create mode 100644 www/sass/_likers.scss diff --git a/cookbooks/questhub/templates/default/ubic-service-sass.erb b/cookbooks/questhub/templates/default/ubic-service-sass.erb index d9335498..8e95be24 100644 --- a/cookbooks/questhub/templates/default/ubic-service-sass.erb +++ b/cookbooks/questhub/templates/default/ubic-service-sass.erb @@ -2,7 +2,7 @@ use parent qw(Ubic::Service::SimpleDaemon); __PACKAGE__->new({ - bin => '/opt/vagrant_ruby/bin/sass --watch sass/main.scss:css/main.css --sourcemap', + bin => '/opt/vagrant_ruby/bin/sass --poll --watch sass/main.scss:css/main.css --sourcemap', cwd => '/play/www', stdout => '/data/sass.log', stderr => '/data/sass.err.log', diff --git a/www/sass/_likers.scss b/www/sass/_likers.scss new file mode 100644 index 00000000..e00bed72 --- /dev/null +++ b/www/sass/_likers.scss @@ -0,0 +1,4 @@ +.likers { + font-size: 12px; + color: $dark-grey; +} \ No newline at end of file diff --git a/www/sass/blocks/_mini-like.scss b/www/sass/blocks/_mini-like.scss index 1997ecd6..57fb5919 100644 --- a/www/sass/blocks/_mini-like.scss +++ b/www/sass/blocks/_mini-like.scss @@ -4,14 +4,11 @@ } } -.like-button { - @include border-radius(9px); - @include badge(); - padding: 2px 9px; - color: white; - background-color: lighten($like-color, 30%); +.like-icon { + color: $like-color; + margin-right: 3px; } -.like-button-liked { - background-color: $like-color; -} +.like-button { + color: $dark-grey; +} \ No newline at end of file diff --git a/www/sass/main.scss b/www/sass/main.scss index 01293214..d4b126d4 100644 --- a/www/sass/main.scss +++ b/www/sass/main.scss @@ -57,3 +57,4 @@ @import 'feed/item'; @import 'comment'; +@import 'likers'; diff --git a/www/templates/like.html b/www/templates/like.html index 76a08d7e..6b0eef91 100644 --- a/www/templates/like.html +++ b/www/templates/like.html @@ -1,18 +1,10 @@ -<% if (obj.list.length || !my) { %> - <% if (currentUser && !my) { %> - <% if (meGusta) { %> - <% } else { %> - <% } %><% } %><% if (currentUser && !my) { %> - <% } %> + +<% if (currentUser && !my) { %> + • + <% if (_.contains(list,currentUser)) { %> + Unlike + <% } else { %> + Like + <% } %> <% } %> + \ No newline at end of file diff --git a/www/templates/partials.html b/www/templates/partials.html index f46a29a0..a76545e1 100644 --- a/www/templates/partials.html +++ b/www/templates/partials.html @@ -4,7 +4,23 @@ + + + - + - +