-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathshow.html.erb
103 lines (84 loc) · 3.41 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
</div>
<% if params[:raw] == 'true' %>
<link href="/lib/woofmark/dist/woofmark.min.css" rel="stylesheet">
<link href="/lib/horsey/dist/horsey.min.css" rel="stylesheet">
<link href="/lib/bootstrap-tokenfield/dist/css/tokenfield-typeahead.min.css" rel="stylesheet">
<link href="/lib/bootstrap-tokenfield/dist/css/bootstrap-tokenfield.min.css" rel="stylesheet">
<link href="/lib/publiclab-editor/dist/PublicLab.Editor.css" rel="stylesheet">
<script src="/lib/publiclab-editor/dist/PublicLab.Editor.js"></script>
<% end %>
<% @presentation = @node.has_tag('style:presentation') %>
<% if @presentation && @node.main_image%>
<div id="main-image-presentation" style="margin-bottom:8px;">
<a href="<%= @node.main_image.path(:original) %>">
<img style="width:100%;" class="img-rounded" src="<%= @node.main_image.path(:original) %>" />
</a>
</div>
<% end %>
<div class="row">
<div class="col-md-9">
<%= render :partial => "wiki/header" %>
<div class="tab-content">
<% if @node.has_power_tag('tabbed') %>
<% if @node.power_tags('tabbed').include?("notes") %>
<div class="tab-pane" id="tab-notes">
<%= render :partial => "notes/notes" %>
<p><a href="/tag/<%= @node.slug_from_path %>"><%= raw t('wiki.show.more_research', :tag => @node.slug_from_path) %> »</a></p>
<br />
</div>
<% end %>
<% if @node.power_tags('tabbed').include?("wikis") %>
<div class="tab-pane" id="tab-wikis">
<%= render :partial => "wiki/wikis" %>
</div>
<% end %>
<% end %>
<% if @node.has_power_tag('notes') %>
<% tagname = @node.power_tag('notes') %>
<% @nodes = Tag.find_popular_notes(tagname,20,4) %>
<% if @nodes.length > 0 %>
<%= render :partial => "notes/tagged_notes", :locals => {:nodes => @nodes} %>
<p><a href="/tag/<%= tagname %>">More "<%= tagname %>" research »</a></p>
<%= raw t('wiki.show.more_tag_research', :tag => tagname) %>
<hr />
<% end %>
<% end %>
<div class="tab-pane active" id="tab-overview">
<% if controller.action_name == 'comments' %>
<%= render :partial => "notes/comments", :locals => {:nodes => @nodes} %>
<% else %>
<div <% unless @node.has_tag('style:wide') %>style="max-width:800px;"<% end %> id="content" class="pl-content wiki">
<% if @node.has_tag('format:raw') %>
<%= raw @revision.render_body_raw %>
<% else %>
<%= raw auto_link(insert_extras(@revision.render_body), sanitize: false) %>
<% end %>
</div>
<% if params[:raw] == 'true' %>
<div style="display:none;" id="content-raw-markdown" class="pl-content wiki"><%= raw insert_extras(@revision.body_raw) %></div>
<% end %>
<% end %>
</div>
</div>
<hr />
<div class="hidden-print">
<%= render :partial => "home/social" %>
</div>
</div>
<% if @node.has_tag('sidebar:none') %>
<%= render :partial => "sidebar/none" %>
<% else %>
<% if (@wikis.nil? && @notes.nil?) || @node.has_tag('sidebar:featured') %>
<%= render :partial => "sidebar/featured" %>
<% else %>
<%= render :partial => "sidebar/related" %>
<% end %>
<% end %>
<script>
(function(){
<% if @fancy %>
$('#content img').addClass('img-rounded');
<% end %>
setupWiki(<%= @node.id %>, "<%= @node.title %>", <%= params[:raw] == 'true' %>, <%= current_user.nil? != true %>);
})()
</script>