-$(document).ready(function () {
+function initializeChangesets(map) {
var changesets = [], rects = {};
- var map = L.map("changeset_list_map", {
- attributionControl: false,
- zoomControl: false
- }).addLayer(new L.OSM.Mapnik());
-
- L.OSM.zoom()
- .addTo(map);
-
var group = L.featureGroup().addTo(map);
$("[data-changeset]").each(function () {
unHighlightChangeset($(this).data("changeset").id);
}
});
-
- $(window).scroll(function() {
- if ($(window).scrollTop() > $('.content-heading').outerHeight() + $('#top-bar').outerHeight() ) {
- $('#changeset_list_map_wrapper').addClass('scrolled');
- } else {
- $('#changeset_list_map_wrapper').removeClass('scrolled');
- }
- });
-
- map.fitBounds(OSM.mapParams().bounds || group.getBounds());
-});
+}
initializeExport(map);
initializeBrowse(map, params);
initializeNotes(map, params);
+
+ if ('undefined' !== typeof initializeChangesets) initializeChangesets(map);
});
function updateLocation() {
/* Rules for the home page */
-.site-export #map,
-.site-index #map,
-.site-edit #map {
+#map {
height: 100%;
overflow: hidden;
}
.site-index,
.site-export,
-.site-edit {
+.site-edit,
+.changeset-list {
#content {
position: absolute;
top: $headerHeight;
/* Rules for the changeset list shown by the history tab etc */
-#changeset_list {
- width: 100%;
- ul {
- padding: $lineheight/2 0;
- margin-bottom: 0px;
- border-top: 1px solid #ccc;
- &:last-child {
- border-bottom: 1px solid #ccc;
- }
- }
- .selected {
- background: #FFFFC0;
- }
- .date,
- .user {
- border-left: 1px solid #ccc;
- padding-left: $lineheight/4;
- margin-right: $lineheight/4;
- }
-}
-
-#changeset_list_map_wrapper {
- position: absolute;
- width: 50%;
- height: 490px;
- top: 0;
- right: 0;
-}
-
-#changeset_list_map_wrapper.scrolled {
- position: fixed;
-}
-
-#changeset_list_map {
- position: absolute;
- bottom: $lineheight;
- top: $lineheight;
- right: $lineheight;
- left: $lineheight;
- border: 1px solid #ccc;
-}
-
-#changeset_list_map_wrapper.scrolled #changeset_list_map {
- margin-left: 93px;
-}
/* Rules for the data browser */
if bbox
changesets = conditions_bbox(changesets, bbox)
- bbox_link = render_to_string :partial => "bbox", :object => bbox
end
if user
if params[:friends] and @user
@title = t 'changeset.list.title_friend'
- @heading = t 'changeset.list.heading_friend'
- @description = t 'changeset.list.description_friend'
+ @heading = t 'changeset.list.title_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
- @description = t 'changeset.list.description_user_bbox', :user => user_link, :bbox => bbox_link
+ @heading = t 'changeset.list.title_nearby'
elsif user
@title = t 'changeset.list.title_user', :user => user.display_name
- @heading = t 'changeset.list.heading_user', :user => user.display_name
- @description = t 'changeset.list.description_user', :user => user_link
- elsif bbox
- @title = t 'changeset.list.title_bbox', :bbox => bbox.to_s
- @heading = t 'changeset.list.heading_bbox', :bbox => bbox.to_s
- @description = t 'changeset.list.description_bbox', :bbox => bbox_link
+ @heading = t('changeset.list.title_user', :user => user_link).html_safe
else
@title = t 'changeset.list.title'
- @heading = t 'changeset.list.heading'
- @description = t 'changeset.list.description'
+ @heading = t 'changeset.list.title'
end
@page = (params[:page] || 1).to_i
+++ /dev/null
-<div id="changeset_list_map">
-</div>
<% content_for :head do -%>
+ <%= javascript_include_tag "index" %>
<%= javascript_include_tag "changeset" %>
-<% end -%>
-
-<% content_for :heading do %>
-
- <h1><%= @heading %></h1>
- <ul class='secondary-actions clearfix'>
- <li><%= raw(@description) %></li>
- <% unless params[:friends] or params[:nearby] -%>
- <li><%= atom_link_to params.merge({ :page => nil, :action => :feed }) %></li>
- <% end -%>
- </ul>
-<% end %>
+ <% unless params[:friends] or params[:nearby] -%>
+ <%= auto_discovery_link_tag :atom, params.merge({ :page => nil, :action => :feed }) %>
+ <% end -%>
+<% end -%>
-<%= render :partial => 'changeset_paging_nav' %>
+<% content_for :sidebar do %>
+ <h2><%= @heading %></h2>
-<% if @edits.size > 0 %>
- <div id='changeset_list_map_wrapper'>
- <%= render :partial => 'map' %>
- </div>
- <div class='column-1'>
+ <% if @edits.size > 0 %>
<%= render :partial => 'changesets', :locals => { :showusername => !params.has_key?(:display_name) } %>
- </div>
- <%= render :partial => 'changeset_paging_nav' %>
-<% elsif @user and @user.display_name == params[:display_name] %>
- <h4><%= t('changeset.list.empty_user_html') %></h4>
-<% else %>
- <h4><%= t('changeset.list.empty_anon_html') %></h4>
+ <%= render :partial => 'changeset_paging_nav' %>
+ <% elsif @user and @user.display_name == params[:display_name] %>
+ <h4><%= t('changeset.list.empty_user_html') %></h4>
+ <% else %>
+ <h4><%= t('changeset.list.empty_anon_html') %></h4>
+ <% end %>
<% end %>
-<% unless params[:friends] or params[:nearby] -%>
- <% content_for :head do -%>
- <%= auto_discovery_link_tag :atom, params.merge({ :page => nil, :action => :feed }) %>
- <% end -%>
-<% end -%>
\ No newline at end of file
+<%= render :template => 'layouts/map' %>
list:
title: "Changesets"
title_user: "Changesets by %{user}"
- 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: "Browse recent contributions to the map"
- 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"
empty_user_html: "It looks you haven't made any edits yet. To get started, check out the <a href='http://wiki.openstreetmap.org/wiki/Beginners_Guide_1.3'>Beginners Guide</a>."
empty_anon_html: "No edits made yet."
timeout: