forked from publiclab/plots2
/
_tab_content.html.erb
61 lines (54 loc) · 2.01 KB
/
_tab_content.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
<div class="tab-content" style="clear:both;">
<!-- separate these in partials-->
<!-- use controller to determine which partial to render -->
<% if @node_type == "note" %>
<div class="tab-pane active" id="notes">
<% if @notes.nil? || @notes.length == 0 %>
<p><%= raw translation('tag.show.no_results_found', tag: params[:id]) %>:</p>
<p><a href="/search/<%= params[:id] %>">Search for "<%= params[:id] %>"</a></p>
<% else %>
<%= render partial: "notes/notes", locals: { tagname: params[:id] } %>
<% end %>
</div>
<% end %>
<% if @node_type == "questions" %>
<div class="tab-pane active" id="questions">
<div class="tab-pane" id="questions-tab">
<div class="btn-group text-center">
<a href="#asked-tab" class="btn btn-outline-secondary active" data-toggle="tab">Asked</a>
<a href="#answered-tab" class="btn btn-outline-secondary" data-toggle="tab">Answered</a>
</div>
<div class="tab-content">
<div class="tab-pane active" id="asked-tab">
<%= render partial: "questions/new_question" %>
</div>
<div class="tab-pane" id="answered-tab">
<% if @answered_questions %>
<%= render partial: "users/answered" %>
<% end %>
</div>
</div>
</div>
</div>
<% end %>
<% if @node_type == "wiki" %>
<div class="tab-pane active" id="wikis">
<%= render partial: "wiki/wikis" %>
</div>
<% end %>
<% if @node_type == "maps" %>
<div class="tab-pane active" id="wikis">
<% if @nodes.empty? %>
<p><%= raw translation('tag.show.no_map_results_found', :tag => params[:id]) %>. You can view other maps <a href="/maps">here</a>.</p>
<% else %>
<%= render partial: "map/maps" %>
<% end %>
</div>
<% end %>
<% if @node_type == "contributors" %>
<div class="tab-pane active" id="contributors">
<%= render partial: "tag/contributors" %>
</div>
<% end %>
<br />
</div>