]> git.openstreetmap.org Git - rails.git/blob - app/views/dashboards/show.html.erb
a198f534df1a685134beb19bbfaeb3bcf9a42f47
[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_location? %>
9         <div id="map" class="content_map border border-secondary-subtle">
10           <p class="m-3"><%= 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 border border-secondary-subtle rounded z-0", :data => { :user => user_data } %>
23       <% end %>
24     </div>
25
26     <div class="col-md">
27       <h2><%= t ".followings" %></h2>
28
29       <% if @followings.empty? %>
30         <%= t ".no followings" %>
31       <% else %>
32         <nav class='secondary-actions mb-3'>
33           <ul class='clearfix'>
34             <li><%= link_to t(".followed_changesets"), friend_changesets_path %></li>
35             <li><%= link_to t(".followed_diaries"), friends_diary_entries_path %></li>
36           </ul>
37         </nav>
38         <div>
39           <%= render :partial => "contact", :collection => @followings, :locals => { :type => "following" } %>
40         </div>
41       <% end %>
42
43       <hr>
44
45       <h2><%= t ".nearby users" %></h2>
46
47       <% if @nearby_users.empty? %>
48         <%= t ".no nearby users" %>
49       <% else %>
50         <nav class='secondary-actions mb-3'>
51           <ul class='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         </nav>
56         <div id="nearbyusers">
57           <%= render :partial => "contact", :collection => @nearby_users, :locals => { :type => "nearby mapper" } %>
58         </div>
59       <% end %>
60     </div>
61   <% end %>
62 </div>