-
Notifications
You must be signed in to change notification settings - Fork 1
/
show.html.erb
52 lines (46 loc) · 1.39 KB
/
show.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<% provide(:title, @user.uid) %>
<div class="row">
<aside class="col-md-4">
<section class="user_info">
<h1>
<% if @user.image.url.nil? %>
<%= gravatar_for @user %>
<% else %>
<%= image_tag @user.image.thumb.url, :class => "ui circular image" %>
<% end %>
<%= @user.nickname %>
</h1>
<% if user_signed_in? && @user.id == current_user.id %>
<%= link_to t('users.show.edit_user'), edit_user_path(@user) %>
<% end %>
<%= render 'shared/user_info' %>
</section>
<section class="post_form">
<% if user_signed_in? %>
<%= render 'shared/post_form' %>
<% end %>
</section>
</aside>
</div>
<%# if @user %>
<div class="col-md-8">
<% if @user.posts.any? %>
<h3><%= @user.nickname %>'s Posts (<%= @user.posts.count %>)</h3>
<ol class="posts">
<%= render @posts %>
</ol>
<%= will_paginate @posts %>
<% end %>
</div>
<div style='width: 800px;'>
<div id="map" style='width: 800px; height: 400px;'></div>
</div>
<script type="text/javascript">
handler = Gmaps.build('Google');
handler.buildMap({ provider: {}, internal: {id: 'map'}}, function(){
markers = handler.addMarkers(<%=raw @hash.to_json %>);
handler.bounds.extendWith(markers);
handler.fitMapToBounds();
});
</script>
<%# end %>