Permalink
Browse files

Nav bar write and sign in/up buttons fixed.

  • Loading branch information...
1 parent 5759f2d commit 993f4fde046901178607af93674f5912698dd157 @robertmilner committed Mar 22, 2012
@@ -25,11 +25,4 @@ body {
a {
color: $black;
text-decoration: none;
-}
-.btn {
- margin: 15px;
- padding: 10px;
- @include border_radius(10px);
- @include box_shadow_inset(0px, 0px, 0px, 0px, rgba(0, 0, 0, 0.1));
-/* @include gradient;*/
}
@@ -28,27 +28,41 @@ header {
h1 {
font: bold 24px/32px "Helvetica Neue", Helvetica, Arial, sans-serif;
text-align: center;
- padding: 5px 0;
+ padding: 6px 0;
letter-spacing: -2px;
@include text_shadow(0, 3px, 0, $red_shade);
}
ul {
position: absolute;
top: 0;
right: 0;
- margin: 0;
+ margin: 5px 2%;
li {
float: left;
- a {
- img {
- height: auto;
- width: 40%;
+ a.btn {
+ font-size: 13px;
+ height: 26px;
+ display: block;
+ margin-left: 10px;
+ padding: 4px 8px;
+ background-color: $red_shade;
+ @include border_radius(10px);
+ &:hover {
+ @include box_shadow_inset(0, 0, 2px, 1px, rgba(0, 0, 0, 0.2));
}
}
+ a.btn-write {
+ height: 26px;
+ width: 26px;
+ display: block;
+ padding: 4px;
+ background-color: $red_shade;
+ @include border_radius(10px);
+ background-image: url('../write.svg');
+ background-size: 26px;
+ background-repeat: no-repeat;
+ background-position: center center;
+ }
}
}
-}
-
-.btn-create {
- background-color: $red_shade;
}
@@ -82,13 +82,17 @@ section {
}
.favorite {
border-left: 0;
- input.btn-favorite {
- width: 40px;
+ form {
+ text-align: center;
+ }
+ .btn-favorite {
+ width: 36px;
height: auto;
+ margin-top: -4px;
opacity: 0.2;
}
- input.btn-favorite.active {
- opacity: 1;
+ .btn-favorite.true {
+ opacity: 0.8;
}
}
.location {
@@ -1,7 +1,15 @@
module PagesHelper
- def favorited(excuse, user)
- "active" if excuse.favorites.find_by_favorable_id(excuse.id) == user.favorites.find_by_favorable_id(excuse.id)
+ def favorited_image_tag(excuse, user)
+ # need to figure out how to check if current excuse is favorited by the current user
+ # this is currently not working
+ if excuse.user == user.favorites
+ image_tag "heart_red.svg", :class => "btn-favorite true", :alt => ""
+ else
+ image_tag "heart_black.svg", :class => "btn-favorite", :alt => ""
+ end
end
+
+
end
@@ -10,16 +10,16 @@
%h3 Favorite
= form_tag favorites_path do
= hidden_field_tag :excuse, excuse.id
- %input{ :type => "image", :src => "/assets/heart_black.svg", :alt => "Yeah favorite!", :class => "btn-favorite #{favorited(excuse, @current_user)}" }
+ = favorited_image_tag(excuse, @current_user)
.location
%h3 Location
%ul
- %li= link_to excuse.location.name, "search/#{excuse.location.name.parameterize}"
+ %li= link_to excuse.location.name, "/location/#{excuse.location.name.parameterize}"
.tags
%h3 Tags
%ul
- excuse.tags.each do |tag|
- %li.tag= link_to tag.name, "tag/#{tag.name}", :rel => "tag"
+ %li.tag= link_to tag.name, "/tag/#{tag.name}", :rel => "tag"
- else
.item
@@ -31,16 +31,16 @@
%h3 Favorite
= form_tag favorites_path do
= hidden_field_tag :excuse, excuse.id
- %input{ :type => "image", :src => "/assets/heart_black.svg", :alt => "Yeah favorite!", :class => "btn-favorite" }
+ = favorited_image_tag(excuse, @current_user)
.location
%h3 Location
%ul
- %li= link_to excuse.location.name, "search/#{excuse.location.name.parameterize}"
+ %li= link_to excuse.location.name, "/location/#{excuse.location.name.parameterize}"
.tags
%h3 Tags
%ul
- excuse.tags.each do |tag|
- %li.tag= link_to tag.name, "tag/#{tag.name}", :rel => "tag"
+ %li.tag= link_to tag.name, "/tag/#{tag.name}", :rel => "tag"
- else
.item.active There's no excuse for no excuses! There's only an excuse for Oh, Excuses... Why don't you create one?
@@ -6,17 +6,17 @@
%span.nav_label Home
%li
- = link_to (image_tag "/assets/search.svg"), app_search_url, :class => "icon", :rel => "tooltip", :title => "Search by words"
+ = link_to (image_tag "/assets/search.svg"), app_search_url, :class => "icon", :rel => "tooltip", :title => "Search excuses by words"
%span.nav_label Search
%li
- = link_to (image_tag "/assets/location.svg"), app_location_url, :class => "icon", :rel => "tooltip", :title => "Search by location"
+ = link_to (image_tag "/assets/location.svg"), app_location_url, :class => "icon", :rel => "tooltip", :title => "Search excuses by location"
%span.nav_label Location
%li
- = link_to (image_tag "/assets/tag.svg"), app_tag_url, :class => "icon", :rel => "tooltip", :title => "Search by tags"
+ = link_to (image_tag "/assets/tag.svg"), app_tag_url, :class => "icon", :rel => "tooltip", :title => "Search excuses by tags"
%span.nav_label Tag
%li
- = link_to (image_tag "/assets/account.svg"), app_user_url, :class => "icon", :rel => "tooltip", :title => "View your account"
+ = link_to (image_tag "/assets/account.svg"), app_user_url, :class => "icon", :rel => "tooltip", :title => "View excuses your account"
%span.nav_label Account
@@ -3,8 +3,8 @@
- if session[:user_id]
%ul
- %li= link_to (image_tag "/assets/write.svg"), new_excuse_path, :class => "btn btn-create icon"
+ %li= link_to "", new_excuse_path, :title => "Write an excuse", :class => "btn btn-write"
- else
%ul
- %li= link_to "Sign Up", new_user_path
- %li= link_to "Login", login_path
+ %li= link_to "Sign Up", new_user_path, :title => "Create an account", :class => "btn"
+ %li= link_to "Login", login_path, :title => "Login to your excuse", :class => "btn"
@@ -0,0 +1 @@
+# $('.btn-favorite').addClass('active');
View
@@ -3,9 +3,11 @@
# pages_controller
get '/excuse' => 'pages#excuse', :as => :app_excuse
get '/search' => 'pages#search', :as => :app_search
+ get '/search/:search' => 'pages#search'
get '/location' => 'pages#location', :as => :app_location
get '/location/:search' => 'pages#location'
get '/tag' => 'pages#tag', :as => :app_tag
+ get '/tag/:search' => 'pages#tag'
get '/favorite' => 'pages#favorite', :as => :app_favorite
get '/user' => 'pages#user', :as => :app_user

0 comments on commit 993f4fd

Please sign in to comment.