-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathshow.html.erb
125 lines (115 loc) · 3.73 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<script src="/assets/wikis.js" type="text/javascript"></script>
<div class="container tag-header">
<%= render partial: 'tag/show/header' %>
<div class= "card tag-card">
<div class="card-body">
<div class="pull-right"><%= render :partial => "tag/show/user_controls" %></div>
<h1 style="margin-top:6px;"><%= @title %></h1>
<% if @wildcard %>
<% if @node_type == "questions"%>
<p><i>Showing <b>questions</b></i></p>
<% elsif @node_type == "note" && params[:id].match("activity:") %>
<p><i>Showing <b>activities</b></i></p>
<% elsif @node_type == "note" && params[:id].match("replication:") %>
<p><i>Showing <b>completed activities</b></i></p>
<% end %>
<p><i>This is a wildcard (*) tag search. Please enter a tag without wildcards to display lead wiki pages.</i></p>
<% end %>
<% if @wiki %>
<p class = "wiki-sub"><%= @wiki.latest.body.split('\n').first %></p>
<% end %>
<div class="tag-buttons">
<div class="btn-group" role="group">
<% if current_user && current_user.following(params[:id]) %>
<a rel="tooltip" title="<%= translation('sidebar._post_button.share_your_work') %>" data-placement="bottom" href="/post?tags=<%= @title %>" class="btn btn-primary requireLogin">New post <i class="fa fa-plus fa-white"></i></a>
<% else %>
<a class="btn btn-primary requireLogin" target="_blank" href="/subscribe/tag/<%= params[:id] %>"> Follow</a>
<% if @related_tags %>
<a><%= render partial: 'tag/dropdown_subscribe', locals: { tags: @related_tags, buttonStyle: "btn-primary"} %></a>
<% end %>
<% end %>
</div>
<% if @wiki %>
<a><%= link_to("Learn more »".html_safe, "/wiki/#{params[:id]}", :class=> "btn btn-outline-secondary")%></a>
<% else %>
<a class="btn btn-outline-secondary" href="/wiki/new?title=<%= params[:id] %>">Add a description <span class="fa fa-plus"></span></a>
<% end %>
</div>
</div>
</div>
</div>
<% cache("tag-show-#{request.fullpath}", expires_in: 5.minutes, skip_digest: true) do %>
<div class="container">
<div class="box">
<div class="row">
<div class="col-md-12">
<%= render partial: 'tag/show/contributors' %>
<%= render partial: 'tag/show/sort' %>
<%= render partial: 'tag/show/nav_tabs' %>
<%= render partial: 'tag/show/tab_content' %>
<div>
<script type="text/javascript">
$('#questions .btn-group .btn').click(function(){
$(this).addClass('active').siblings().removeClass('active');
});
</script>
</div>
</div>
</div>
</div>
</div>
<% end %>
<%= stylesheet_link_tag "dashboard" %>
<style>
.node-types .nav-link {
color: #495057;
}
.tag-card {
position: absolute;
top: 100px;
left: 5%;
z-index: 1;
width: 40%;
padding: 10px 10px !important;
}
@media screen and (max-width: 998px) {
.tag-card {
width: 60%;
}
}
@media screen and (max-width: 480px) {
.tag-card {
top: 90px;
width: 90%;
}
}
.tag-header {
height: 355px;
}
.wiki-sub{
overflow: hidden;
color: #666;
height: 70px;
}
.tag-buttons .btn {
margin-top: 10px;
}
.contributor-info,
.contributor-info a i,
.contributor-info a:link i,
.contributor-info a:active i,
.contributor-info a:visited i {
color: #aaa;
}
.contributor-info a,
.contributor-info a:link,
.contributor-info a:active,
.contributor-info a:visited {
color: currentColor;
text-decoration: underline;
}
.contributor-info a:hover,
.contributor-info a:hover i {
color: #666;
}
</style>