end
end
+ if params[:nearby]
+ if @user
+ changesets = changesets.where(:user_id => @user.nearby)
+ elsif request.format == :html
+ require_user
+ return
+ end
+ end
+
if params[:bbox]
bbox = BoundingBox.from_bbox_params(params)
elsif params[:minlon] and params[:minlat] and params[:maxlon] and params[:maxlat]
@title = t 'changeset.list.title_friend'
@heading = t 'changeset.list.heading_friend'
@description = t 'changeset.list.description_friend'
+ elsif params[:nearby] and @user
+ @title = t 'changeset.list.title_nearby'
+ @heading = t 'changeset.list.heading_nearby'
+ @description = t 'changeset.list.description_nearby'
elsif user and bbox
@title = t 'changeset.list.title_user_bbox', :user => user.display_name, :bbox => bbox.to_s
@heading = t 'changeset.list.heading_user_bbox', :user => user.display_name, :bbox => bbox.to_s
},
:order => 'created_at DESC',
:per_page => 20)
+ elsif params[:friends]
+ if @user
+ @title = t 'diary_entry.list.title_friends'
+ @entry_pages, @entries = paginate(:diary_entries, :include => :user,
+ :conditions => {
+ :user_id => @user.friend_users.public,
+ :visible => true
+ },
+ :order => 'created_at DESC',
+ :per_page => 20)
+ else
+ require_user
+ return
+ end
+ elsif params[:nearby]
+ if @user
+ @title = t 'diary_entry.list.title_nearby'
+ @entry_pages, @entries = paginate(:diary_entries, :include => :user,
+ :conditions => {
+ :user_id => @user.nearby,
+ :visible => true
+ },
+ :order => 'created_at DESC',
+ :per_page => 20)
+ else
+ require_user
+ return
+ end
else
@title = t 'diary_entry.list.title'
@entry_pages, @entries = paginate(:diary_entries, :include => :user,
<% if friends.empty? %>
<%= t 'user.view.no friends' %>
<% else %>
- <%= link_to t('user.view.friends_changesets'), {:controller => 'browse', :action => 'friends'} %><br/><br/>
+ <%= link_to t('user.view.friends_changesets'), {:controller => 'browse', :action => 'friends'} %><br/>
+ <%= link_to t('user.view.friends_diaries'), {:controller => 'diary', :action => 'friends'} %><br/><br/>
<table id="friends">
<%= render :partial => "contact", :collection => friends %>
</table>
<% if nearby.empty? %>
<%= t 'user.view.no nearby users' %>
<% else %>
+ <%= link_to t('user.view.nearby_changesets'), {:controller => 'browse', :action => 'nearby'} %><br/>
+ <%= link_to t('user.view.nearby_diaries'), {:controller => 'diary', :action => 'nearby'} %><br/><br/>
<table id="nearbyusers">
<%= render :partial => "contact", :collection => nearby %>
</table>
title_bbox: "Changesets within %{bbox}"
title_user_bbox: "Changesets by %{user} within %{bbox}"
title_friend: "Changesets by your friends"
-
+ title_nearby: "Changesets by nearby users"
heading: "Changesets"
heading_user: "Changesets"
heading_bbox: "Changesets"
heading_user_bbox: "Changesets"
heading_friend: "Changesets"
-
+ heading_nearby: "Changesets"
description: "Recent changes"
description_user: "Changesets by %{user}"
description_bbox: "Changesets within %{bbox}"
description_user_bbox: "Changesets by %{user} within %{bbox}"
description_friend: "Changesets by your friends"
+ description_nearby: "Changesets by nearby users"
timeout:
sorry: "Sorry, the list of changesets you requested took too long to retrieve."
diary_entry:
title: New Diary Entry
list:
title: "Users' diaries"
+ title_friends: "Friends' diaries"
+ title_nearby: "Nearby Users' diaries"
user_title: "%{user}'s diary"
in_language_title: "Diary Entries in %{language}"
new: New Diary Entry
delete_user: "delete this user"
confirm: "Confirm"
friends_changesets: "Browse all changesets by friends"
+ friends_diaries: "Browse all diary entries by friends"
+ nearby_changesets: "Browse all changesets by nearby users"
+ nearby_diaries: "Browse all diary entries by nearby users"
popup:
your location: "Your location"
nearby mapper: "Nearby mapper"
match '/user/:display_name/edits' => 'changeset#list'
match '/user/:display_name/edits/feed' => 'changeset#feed', :format => :atom
match '/browse/friends' => 'changeset#list', :friends => true
+ match '/browse/nearby' => 'changeset#list', :nearby => true
match '/browse/changesets' => 'changeset#list'
match '/browse/changesets/feed' => 'changeset#feed', :format => :atom
match '/browse' => 'changeset#list'
# diary pages
match '/diary/new' => 'diary_entry#new'
+ match '/diary/friends' => 'diary_entry#list', :friends => true
+ match '/diary/nearby' => 'diary_entry#list', :nearby => true
match '/user/:display_name/diary/rss' => 'diary_entry#rss', :format => :rss
match '/diary/:language/rss' => 'diary_entry#rss', :format => :rss
match '/diary/rss' => 'diary_entry#rss', :format => :rss