- if user and bbox
- @description = t 'changeset.list.description_user_bbox', :user => user.display_name, :bbox => bbox_link
- elsif user
- @description = t 'changeset.list.description_user', :user => user.display_name
- elsif bbox
- @description = t 'changeset.list.description_bbox', :bbox => bbox_link
- else
- @description = t 'changeset.list.description'
+ if bbox
+ changesets = conditions_bbox(changesets, bbox)
+ end
+
+ if user
+ user_link = render_to_string :partial => "user", :object => user
+ end
+
+ if params[:friends] and @user
+ @title = t 'changeset.list.title_friend'
+ @heading = t 'changeset.list.title_friend'
+ elsif params[:nearby] and @user
+ @title = t 'changeset.list.title_nearby'
+ @heading = t 'changeset.list.title_nearby'
+ elsif user
+ @title = t 'changeset.list.title_user', :user => user.display_name
+ @heading = t('changeset.list.title_user', :user => user_link).html_safe
+ else
+ @title = t 'changeset.list.title'
+ @heading = t 'changeset.list.title'
+ end
+
+ @page = (params[:page] || 1).to_i
+ @page_size = 20
+
+ @edits = changesets.order("changesets.created_at DESC").offset((@page - 1) * @page_size).limit(@page_size).preload(:user, :changeset_tags)
+
+ render :action => :list, :layout => map_layout