mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-02-18 22:58:32 -05:00
Added links to places pages
Committing with broken tests and pushing to github just so people can take a look at what we're doing.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
- else
|
||||
(from
|
||||
= succeed ")" do
|
||||
= @seed.owner.location
|
||||
= link_to @seed.owner.location, place_path(@seed.owner.location)
|
||||
|
||||
%p
|
||||
%b Description:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user