diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml
index 93a03ac51..1d03d1c76 100644
--- a/app/views/layouts/_header.html.haml
+++ b/app/views/layouts/_header.html.haml
@@ -20,7 +20,7 @@
%li= link_to "Posts", posts_path
%li= link_to "Forums", forums_path
- %li.divider-vertical
+ %li.divider-vertical
- if member_signed_in?
%li.dropdown<
@@ -29,23 +29,23 @@
Your Stuff (#{current_member.notifications.unread_count})
- else
Your Stuff
- %b.caret
- %ul.dropdown-menu
- %li= link_to "Profile", member_path(current_member)
- %li= link_to "Gardens", gardens_by_owner_path(:owner => current_member.slug)
- %li= link_to "Plantings", plantings_by_owner_path(:owner => current_member.slug)
- %li= link_to "Seeds", seeds_by_owner_path(:owner => current_member.slug)
- %li= link_to "Posts", posts_by_author_path(:author => current_member.slug)
- %li= link_to "Account", orders_path
- %li
- - if current_member.notifications.unread_count > 0
- = link_to("Inbox (#{current_member.notifications.unread_count})", notifications_path)
- - else
- = link_to("Inbox", notifications_path)
+ %b.caret
+ %ul.dropdown-menu
+ %li= link_to "Profile", member_path(current_member)
+ %li= link_to "Gardens", gardens_by_owner_path(:owner => current_member.slug)
+ %li= link_to "Plantings", plantings_by_owner_path(:owner => current_member.slug)
+ %li= link_to "Seeds", seeds_by_owner_path(:owner => current_member.slug)
+ %li= link_to "Posts", posts_by_author_path(:author => current_member.slug)
+ %li= link_to "Account", orders_path
+ %li
+ - if current_member.notifications.unread_count > 0
+ = link_to("Inbox (#{current_member.notifications.unread_count})", notifications_path)
+ - else
+ = link_to("Inbox", notifications_path)
- %li= link_to "Shop", shop_path
- - if current_member.has_role?(:admin)
- %li= link_to "Admin", admin_path
+ %li= link_to "Shop", shop_path
+ - if current_member.has_role?(:admin)
+ %li= link_to "Admin", admin_path
%li= link_to "Sign out", destroy_member_session_path, :method => :delete
diff --git a/app/views/members/show.html.haml b/app/views/members/show.html.haml
index 72a208186..c1de4ac55 100644
--- a/app/views/members/show.html.haml
+++ b/app/views/members/show.html.haml
@@ -44,12 +44,9 @@
- if @member.location.to_s != ''
%h4 Location
%p
- = image_tag("http://maps.google.com/maps/api/staticmap?size=200x200&maptype=roadmap&sensor=false&markers=color:green|label:A|#{@member.latitude},#{@member.longitude}&zoom=12", :alt => "Map showing #{@member.location}", :width => 200, :height => 200 )
+ = link_to image_tag("http://maps.google.com/maps/api/staticmap?size=200x200&maptype=roadmap&sensor=false&markers=color:green|label:A|#{@member.latitude},#{@member.longitude}&zoom=12", :alt => "Map showing #{@member.location}", :width => 200, :height => 200 ), place_path(@member.location)
%br/
- Location:
- = @member.location
- %br/
- = link_to 'Find members near here', place_path(@member.location)
+ = link_to @member.location, place_path(@member.location)
.span9
%p
diff --git a/app/views/places/show.html.haml b/app/views/places/show.html.haml
index a123cc1cf..b90e90352 100644
--- a/app/views/places/show.html.haml
+++ b/app/views/places/show.html.haml
@@ -21,14 +21,13 @@
= Growstuff::Application.config.site_name
members near #{@place}
-%p
- = form_tag(search_places_path, :method => :get, :class => 'form-inline') do
- = label_tag :distance, "Find members within", :class => 'control-label'
- = text_field_tag :distance, @distance, :class => 'input-mini'
- = select_tag :units, options_for_select({"miles" => :mi, "km" => :km}, @units), :class => 'input-small'
- = label_tag :place, "of", :class => 'control-label'
- = text_field_tag :new_place, @place
- = submit_tag "Search", :class => 'btn btn-primary'
+= form_tag(search_places_path, :method => :get, :class => 'form-inline') do
+ = label_tag :distance, "Find members within", :class => 'control-label'
+ = text_field_tag :distance, @distance, :class => 'input-mini'
+ = select_tag :units, options_for_select({"miles" => :mi, "km" => :km}, @units), :class => 'input-small'
+ = label_tag :place, "of", :class => 'control-label'
+ = text_field_tag :new_place, @place
+ = submit_tag "Search", :class => 'btn btn-primary'
- if !@nearby_members.empty?
%ul.thumbnails
diff --git a/app/views/seeds/_form.html.haml b/app/views/seeds/_form.html.haml
index 169463bc7..b049429b5 100644
--- a/app/views/seeds/_form.html.haml
+++ b/app/views/seeds/_form.html.haml
@@ -31,7 +31,7 @@
- else
from
=succeed "." do
- = current_member.location
+ = link_to current_member.location, place_path(current_member.location)
=link_to "Change your location.", edit_member_registration_path
%span.help-block
Are you interested in trading or swapping seeds with other
diff --git a/app/views/seeds/index.html.haml b/app/views/seeds/index.html.haml
index b22edee0e..e87ce2eaf 100644
--- a/app/views/seeds/index.html.haml
+++ b/app/views/seeds/index.html.haml
@@ -43,7 +43,10 @@
%td= seed.tradable? ? seed.tradable_to : ''
%td
- if seed.tradable?
- = seed.owner.location.blank? ? "unspecified" : seed.owner.location
+ - if seed.owner.location.blank?
+ unspecified
+ - else
+ = link_to seed.owner.location, place_path(seed.owner.location)
%td= link_to 'Details', seed, :class => 'btn btn-mini'
%div.pagination
diff --git a/app/views/seeds/show.html.haml b/app/views/seeds/show.html.haml
index e60be8987..07e0c5bc3 100644
--- a/app/views/seeds/show.html.haml
+++ b/app/views/seeds/show.html.haml
@@ -23,7 +23,7 @@
- else
(from
= succeed ")" do
- = @seed.owner.location
+ = link_to @seed.owner.location, place_path(@seed.owner.location)
%p
%b Description:
diff --git a/spec/views/members/show.html.haml_spec.rb b/spec/views/members/show.html.haml_spec.rb
index 4c3c66e15..d498b4322 100644
--- a/spec/views/members/show.html.haml_spec.rb
+++ b/spec/views/members/show.html.haml_spec.rb
@@ -173,6 +173,10 @@ describe "members/show" do
it "shows a map" do
assert_select "img", :src => /maps\.google\.com/
end
+
+ it 'includes a link to places page' do
+ assert_select 'a', :href => place_path(@member.location)
+ end
end
context "no location stated" do
diff --git a/spec/views/seeds/index.html.haml_spec.rb b/spec/views/seeds/index.html.haml_spec.rb
index b1b9a9173..02d9d2b44 100644
--- a/spec/views/seeds/index.html.haml_spec.rb
+++ b/spec/views/seeds/index.html.haml_spec.rb
@@ -39,6 +39,7 @@ describe "seeds/index" do
it "shows location of seed owner" do
assert_select "tr>td", :text => @owner.location, :count => 2
+ assert_select 'a', :href => place_path(@owner.location)
end
end
end
diff --git a/spec/views/seeds/new.html.haml_spec.rb b/spec/views/seeds/new.html.haml_spec.rb
index 80d6090fa..d9807277b 100644
--- a/spec/views/seeds/new.html.haml_spec.rb
+++ b/spec/views/seeds/new.html.haml_spec.rb
@@ -37,6 +37,7 @@ describe "seeds/new" do
it 'shows the location' do
render
rendered.should contain "from #{@member.location}."
+ assert_select 'a', :href => place_path(@member.location)
end
it 'links to change location' do
diff --git a/spec/views/seeds/show.html.haml_spec.rb b/spec/views/seeds/show.html.haml_spec.rb
index 8a5e4f8a9..d736e1152 100644
--- a/spec/views/seeds/show.html.haml_spec.rb
+++ b/spec/views/seeds/show.html.haml_spec.rb
@@ -31,6 +31,7 @@ describe "seeds/show" do
it "shows location of seed owner" do
render
rendered.should contain @owner.location
+ assert_select 'a', :href => place_path(@owner.location)
end
context 'with no location' do