Skip to content

Commit

Permalink
added city nav bar
Browse files Browse the repository at this point in the history
  • Loading branch information
dladowitz committed Sep 29, 2013
1 parent ccd7a5f commit b744cf3
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 7 deletions.
35 changes: 34 additions & 1 deletion app/assets/stylesheets/courses.css.scss
Expand Up @@ -49,14 +49,15 @@ $site_green: rgba(114, 138, 66, .15);
width: 100%
}


.search {
background-color: rgba(200, 200, 200, .65);
box-shadow: 2px 2px 2px 2px rgba(100, 100, 100, .5);
border-radius: 5px;
overflow: hidden;
max-width: 1120px;
margin: 50px auto;
padding: 10px;
padding: 25px 10px 10px 10px;
z-index: 2;
position: relative;
}
Expand All @@ -67,8 +68,40 @@ $site_green: rgba(114, 138, 66, .15);
font-weight: 300;
padding: 10px;
color: #343D3A;
}

.hero_bar .search #cities {
// background-color: aqua;
width: 600px;
height: 40px;
font-size: 25px;
position: absolute;
bottom: 91px;
left: 562px;
}

.hero_bar .search #cities ul {
// background-color: rgba(255, 255, 255, .65);
border-radius: 5px;
float: left;
}

.hero_bar .search #cities ul li {
display: inline;
padding-right: 20px;
color: green;

}

.hero_bar .search #cities ul li a:visited {
color: green;
}

.hero_bar .search #cities ul li a:hover {
text-shadow: 0 0 1px green;
color: darkgreen;
}

.search_box {
width: 400px;
font-size: 20px;
Expand Down
1 change: 0 additions & 1 deletion app/assets/stylesheets/header.css
Expand Up @@ -45,7 +45,6 @@ a {
color: #A5BD49;
}


.header_bar .nav_bar li:hover {
text-shadow: 0 0 1px green;
color: #A5BD49;
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/courses_controller.rb
Expand Up @@ -10,7 +10,7 @@ def index
# @courses = get_courses_nearby(location = 'Saratoga, CA, USA', distance_in_mi = 60)
if params[:location]
#if we get a location we can look for courses nearby. This doesn't use the full text search currently. Need to add in.
@courses = get_courses_nearby(params[:location], 300).paginate(:page => params[:page], :per_page => 3)
@courses = get_courses_nearby(params[:location], 60).paginate(:page => params[:page], :per_page => 9)
else
#if we don't get a location.
@courses = Course.text_search(params[:query]).paginate(:page => params[:page], :per_page => 9)
Expand Down
8 changes: 8 additions & 0 deletions app/views/courses/index.html.erb
Expand Up @@ -2,6 +2,14 @@
<img class="hero_image" src="assets/courses/el_cap_hero_bar.jpg">
<div class="search">
<h1>Find Your Adventure</h1>
<div id="cities">
<ul>
<li><%= link_to "San Francisco", courses_path(:location => 'San Francisco, CA') %></li>
<li><%= link_to "San Jose",courses_path(:location => 'San Jose, CA') %></li>
<li><%= link_to "Los Angeles", courses_path(:location => 'Los Angeles, CA') %></li>
<li><%= link_to "Boulder", courses_path(:location => 'Boulder, CO') %></li>
</ul>
</div>

<!-- TODO delete old form -->
<!-- <form name="search" action="#" method="get">
Expand Down
8 changes: 4 additions & 4 deletions app/views/layouts/_footer.html.erb
Expand Up @@ -20,10 +20,10 @@
<div class="footer_column">
<h2>Locations</h2>
<ul>
<li><a href="#">Bay Area</a></li>
<li><a href="#">New York</a></li>
<li><a href="#">Boulder</a></li>
<li><a href="#">Los Angeles</a></li>
<li><%= link_to "San Francisco", courses_path(:location => 'San Francisco, CA') %></li>
<li><%= link_to "San Jose",courses_path(:location => 'San Jose, CA') %></li>
<li><%= link_to "Los Angeles", courses_path(:location => 'Los Angeles, CA') %></li>
<li><%= link_to "Boulder", courses_path(:location => 'Boulder, CO') %></li>
</ul>
</div>
</div>
Expand Down

0 comments on commit b744cf3

Please sign in to comment.