]> git.openstreetmap.org Git - rails.git/blob - app/views/dashboards/show.html.erb
3fe27b7798c2aeba837600ce2fbdea245f26f522
[rails.git] / app / views / dashboards / show.html.erb
1 <% content_for :heading do %>
2   <h1><%= t ".title" %></h1>
3 <% end %>
4
5 <div class="row">
6   <% if current_user and @user.id == current_user.id %>
7     <div class="col-md order-md-last">
8       <% if @user.home_lat.nil? or @user.home_lon.nil? %>
9         <div id="map" class="content_map">
10           <p id="no_home_location"><%= t(".no_home_location_html", :edit_profile_link => link_to(t(".edit_your_profile"), edit_profile_path)) %></p>
11         </div>
12       <% else %>
13         <% content_for :head do %>
14           <%= javascript_include_tag "user" %>
15         <% end %>
16         <% user_data = {
17              :lon => current_user.home_lon,
18              :lat => current_user.home_lat,
19              :icon => image_path("marker-red.png"),
20              :description => render(:partial => "popup", :object => current_user, :locals => { :type => "your location" })
21            } %>
22         <%= tag.div "", :id => "map", :class => "content_map", :data => { :user => user_data } %>
23       <% end %>
24
25       <% friends = @user.friends %>
26       <% nearby = @user.nearby - friends %>
27     </div>
28
29     <div class="col-md">
30       <h3><%= t ".my friends" %></h3>
31
32       <% if friends.empty? %>
33         <%= t ".no friends" %>
34       <% else %>
35         <ul class='secondary-actions clearfix'>
36           <li><%= link_to t(".friends_changesets"), friend_changesets_path %></li>
37           <li><%= link_to t(".friends_diaries"), friends_diary_entries_path %></li>
38         </ul>
39         <div id="friends-container">
40           <%= render :partial => "contact", :collection => friends, :locals => { :type => "friend" } %>
41         </div>
42       <% end %>
43
44       <hr>
45
46       <h3><%= t ".nearby users" %></h3>
47
48       <% if nearby.empty? %>
49         <%= t ".no nearby users" %>
50       <% else %>
51         <ul class='secondary-actions clearfix'>
52           <li><%= link_to t(".nearby_changesets"), nearby_changesets_path %></li>
53           <li><%= link_to t(".nearby_diaries"), nearby_diary_entries_path %></li>
54         </ul>
55         <div id="nearbyusers">
56           <%= render :partial => "contact", :collection => nearby, :locals => { :type => "nearby mapper" } %>
57         </div>
58       <% end %>
59     </div>
60   <% end %>
61 </div>