]> git.openstreetmap.org Git - rails.git/blob - app/views/dashboards/show.html.erb
Replace CSS-driven borders with bootstrap borders
[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 border border-grey">
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-grey rounded", :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         <nav class='secondary-actions mb-3'>
36           <ul class='clearfix'>
37             <li><%= link_to t(".friends_changesets"), friend_changesets_path %></li>
38             <li><%= link_to t(".friends_diaries"), friends_diary_entries_path %></li>
39           </ul>
40         </nav>
41         <div id="friends-container">
42           <%= render :partial => "contact", :collection => friends, :locals => { :type => "friend" } %>
43         </div>
44       <% end %>
45
46       <hr>
47
48       <h3><%= t ".nearby users" %></h3>
49
50       <% if nearby.empty? %>
51         <%= t ".no nearby users" %>
52       <% else %>
53         <nav class='secondary-actions mb-3'>
54           <ul class='clearfix'>
55             <li><%= link_to t(".nearby_changesets"), nearby_changesets_path %></li>
56             <li><%= link_to t(".nearby_diaries"), nearby_diary_entries_path %></li>
57           </ul>
58         </nav>
59         <div id="nearbyusers">
60           <%= render :partial => "contact", :collection => nearby, :locals => { :type => "nearby mapper" } %>
61         </div>
62       <% end %>
63     </div>
64   <% end %>
65 </div>