|
3 | 3 | <% end %>
|
4 | 4 |
|
5 | 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 } %> |
| 6 | + <div class="col-md order-md-last"> |
| 7 | + <% if !current_user.home_location? %> |
| 8 | + <div id="map" class="content_map border border-secondary-subtle"> |
| 9 | + <p class="m-3"><%= t(".no_home_location_html", :edit_profile_link => link_to(t(".edit_your_profile"), edit_profile_path)) %></p> |
| 10 | + </div> |
| 11 | + <% else %> |
| 12 | + <% content_for :head do %> |
| 13 | + <%= javascript_include_tag "user" %> |
23 | 14 | <% end %>
|
| 15 | + <% user_data = { |
| 16 | + :lon => current_user.home_lon, |
| 17 | + :lat => current_user.home_lat, |
| 18 | + :icon => image_path("marker-red.png"), |
| 19 | + :description => render(:partial => "popup", :object => current_user, :locals => { :type => "your location" }) |
| 20 | + } %> |
| 21 | + <%= tag.div "", :id => "map", :class => "content_map border border-secondary-subtle rounded z-0", :data => { :user => user_data } %> |
| 22 | + <% end %> |
| 23 | + </div> |
24 | 24 |
|
25 |
| - <% followings = @user.followings %> |
26 |
| - <% nearby = @user.nearby - followings %> |
27 |
| - </div> |
| 25 | + <div class="col-md"> |
| 26 | + <h2><%= t ".followings" %></h2> |
28 | 27 |
|
29 |
| - <div class="col-md"> |
30 |
| - <h2><%= t ".followings" %></h2> |
| 28 | + <% if @followings.empty? %> |
| 29 | + <%= t ".no followings" %> |
| 30 | + <% else %> |
| 31 | + <nav class='secondary-actions mb-3'> |
| 32 | + <ul class='clearfix'> |
| 33 | + <li><%= link_to t(".followed_changesets"), friend_changesets_path %></li> |
| 34 | + <li><%= link_to t(".followed_diaries"), friends_diary_entries_path %></li> |
| 35 | + </ul> |
| 36 | + </nav> |
| 37 | + <div> |
| 38 | + <%= render :partial => "contact", :collection => @followings, :locals => { :type => "following" } %> |
| 39 | + </div> |
| 40 | + <% end %> |
31 | 41 |
|
32 |
| - <% if followings.empty? %> |
33 |
| - <%= t ".no followings" %> |
34 |
| - <% else %> |
35 |
| - <nav class='secondary-actions mb-3'> |
36 |
| - <ul class='clearfix'> |
37 |
| - <li><%= link_to t(".followed_changesets"), friend_changesets_path %></li> |
38 |
| - <li><%= link_to t(".followed_diaries"), friends_diary_entries_path %></li> |
39 |
| - </ul> |
40 |
| - </nav> |
41 |
| - <div> |
42 |
| - <%= render :partial => "contact", :collection => followings, :locals => { :type => "following" } %> |
43 |
| - </div> |
44 |
| - <% end %> |
45 |
| - |
46 |
| - <hr> |
| 42 | + <hr> |
47 | 43 |
|
48 |
| - <h2><%= t ".nearby users" %></h2> |
| 44 | + <h2><%= t ".nearby users" %></h2> |
49 | 45 |
|
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 %> |
| 46 | + <% if @nearby_users.empty? %> |
| 47 | + <%= t ".no nearby users" %> |
| 48 | + <% else %> |
| 49 | + <nav class='secondary-actions mb-3'> |
| 50 | + <ul class='clearfix'> |
| 51 | + <li><%= link_to t(".nearby_changesets"), nearby_changesets_path %></li> |
| 52 | + <li><%= link_to t(".nearby_diaries"), nearby_diary_entries_path %></li> |
| 53 | + </ul> |
| 54 | + </nav> |
| 55 | + <div id="nearbyusers"> |
| 56 | + <%= render :partial => "contact", :collection => @nearby_users, :locals => { :type => "nearby mapper" } %> |
| 57 | + </div> |
| 58 | + <% end %> |
| 59 | + </div> |
65 | 60 | </div>
|
0 commit comments