Skip to content

Commit

Permalink
Make program background button behave more like a normal button
Browse files Browse the repository at this point in the history
Change from alert message to traditional button to get highlight and
rounded corner behavior. Also remove "Click here..." text.

Added word-wrap since the default bootstrap behavior is to not wrap text
for buttons, but we need this for buttons like this with longer text.
  • Loading branch information
jszwedko committed Aug 9, 2017
1 parent edf1d96 commit 7588751
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
9 changes: 5 additions & 4 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ h5.my-things {
top: 210px;
}

.btn {
white-space: normal !important; /* override bootstrap to wrap button text */
word-wrap: break-word;
}

.btn-primary {
color: #fff;
background-color: #396B80;
Expand Down Expand Up @@ -222,10 +227,6 @@ a.guidelines {
text-decoration: none;
}

.sidebar p#tagline:hover {
background-color: #9682bc;
}

.user-things dd {
margin-left: 20px;
}
Expand Down
4 changes: 2 additions & 2 deletions app/views/main/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
Last updated
= local_date(Time.now, '%B %e, %Y')
%a.guidelines{:href => "#guidelines", :"data-toggle" => "modal", :"data-target" => "#guidelines"}
%p.alert-message.block-message#tagline
%button.btn.btn-block.btn-primary#tagline
= t("defaults.tagline")
#content
= render :partial => "layouts/flash", :locals => {:flash => flash}
Expand All @@ -32,7 +32,7 @@
-# Corresponds to guideline div above
%div.hidden.visible-xs-block
%a.guidelines{:href => "#guidelines", :"data-toggle" => "modal", :"data-target" => "#guidelines"}
%p.alert-message.block-message#tagline
%button.btn.btn-block.btn-primary#tagline
= t("defaults.tagline")
#logos
.row
Expand Down
2 changes: 1 addition & 1 deletion app/views/main/unauthenticated.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.table-cell.sidebar
%h1
= image_tag "logos/adopt-a-drain.png", :alt => t("titles.main", :thing => t("defaults.thing").titleize), :title => t("titles.main", :thing => t("defaults.thing").titleize)
%p.alert-message.block-message#tagline
%button.btn.btn-block.btn-primary#tagline
= t("defaults.tagline")
#content
= render :partial => "sidebar/combo_form"
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ en:
thing: "drain"
things: "drains"
this_thing: "This %{thing}"
tagline: "What does it mean to adopt a drain? Click here to find out."
tagline: "What does it mean to adopt a drain?"
tos: "By signing up, you agree to the %{tos}."
voice_number: "415-555-1212"
zip: "94015-2013"
Expand Down
2 changes: 1 addition & 1 deletion test/controllers/main_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MainControllerTest < ActionController::TestCase
get :index
assert_response :success
assert_select 'title', 'Adopt-a-Drain San Francisco'
assert_select 'p#tagline', 'What does it mean to adopt a drain? Click here to find out.'
assert_select 'button#tagline', 'What does it mean to adopt a drain?'
end

test 'should show search form when signed in' do
Expand Down

0 comments on commit 7588751

Please sign in to comment.