forked from metacpan/metacpan-web
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwrapper.html
284 lines (276 loc) · 12.2 KB
/
wrapper.html
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
<%- menu = [{
title = "Home",
path = ["/", "/search"],
image = "/static/icons/metacpan-icon.png",
},
{
title = "Recent",
path = ["/recent"],
icon = "history",
},
{
title = "About",
path = ["/about"],
class = 'hidden-xs',
icon = "info",
},
{
title = "FAQ",
path = ["/about/faq"],
class = 'hidden-xs',
icon = "question",
},
{
title = "GitHub Issues",
path = ["https://github.com/metacpan/metacpan-web/issues"],
class = 'hidden-xs',
icon = "github-alt",
},
{
title = "News",
path = ["/news"],
class = 'hidden-xs',
icon = "newspaper-o",
},
{
title = "Lab",
path = ["/lab"],
class = 'hidden-xs',
icon = "rocket",
},
{
title = "API",
path = ["https://fastapi.metacpan.org"],
class = 'hidden-xs',
icon = "database",
},
] -%>
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title><% IF title; title; ELSE; 'Search the CPAN'; END %> - metacpan.org</title>
<%- IF rss %>
<link rel="alternate" type="application/rss+xml" title="RSS" href="/feed/<% rss %>" />
<%- END %>
<%- FOREACH css IN req.env.item('psgix.assets').grep(/\.css$/) %>
<link href="<% css %>" rel="stylesheet" type="text/css">
<%- END %>
<link rel="search" href="/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN">
<%- IF canonical %>
<link rel="canonical" href="https://metacpan.org<% canonical %>" />
<%- END %>
<%- IF meta_description %>
<meta name="description" content="<% meta_description %>" />
<%- END %>
<link rel="shortcut icon" href="/static/icons/favicon.ico">
<link rel="apple-touch-icon" sizes="152x152" href="/static/icons/apple-touch-icon.png">
<%- FOREACH js IN req.env.item('psgix.assets').grep(/\.js$/) %>
<script src="<% js %>" type="text/javascript"></script>
<%- END %>
<%- FOREACH less IN req.env.item('psgix.assets').grep(/\.less$/) %>
<link rel="stylesheet/less" type="text/css" href="/static/less/style.less">
<%- need_less = 1 %>
<%- END %>
<%- IF need_less %>
<script src="/static/js/less.min.js" type="text/javascript"></script>
<%- END %>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-27829474-1', {
siteSpeedSampleRate : 100
});
ga('send', 'pageview');
ga(function() {
var cookies=['__utma', '__utmb', '__utmc', '__utmv', '__utmz', '_gat'];
for (var i = cookies.length; i--; ) {
var cookie = cookies[i]+"=; expires="+(new Date(0)).toGMTString()+"; path=/";
document.cookie = cookie;
document.cookie = cookie + '; domain=.'+document.domain;
}
});
</script>
<% IF stats_page %>
<%# Just for the stats page %>
<script src="/static/stats/d3.v3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/stats/epoch.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="/static/stats/epoch.min.css">
<% END %>
<% IF twitter_card_inc %>
<% INCLUDE $twitter_card_inc %>
<% END %>
</head>
<body>
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<ul class="nav navbar-nav">
<%- UNLESS req.uri.path == "/" %>
<li class="visible-xs">
<a href="#" data-toggle="slidepanel" data-target=".slidepanel">
<i class="fa fa-bars fa-2x icon-slidepanel"></i>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
</li>
<% END %>
<%- FOREACH item IN menu;
active = item.path.grep(->{ this == req.uri.path} ).size;
IF active; %>
<li class="active">
<%- ELSE %>
<li class="<% item.class %>">
<%- END %>
<a href="<% item.path.0 %>">
<%- IF item.icon %><i class="fa fa-<% item.icon %>"></i><% END -%>
<%- IF item.image %><img src="<% item.image %>" /><% END -%>
<% item.title -%>
</a>
</li>
<%- END %>
</ul>
<ul class="nav navbar-nav navbar-right">
<form action="<% c.uri_for("/account/logout") %>" method="POST" id="metacpan-logout"></form>
<li class="dropdown logged_in" style="display: none;">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Account
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="/account/identities">Identities</a></li>
<li><a href="/account/profile">Profile</a></li>
<li><a href="/account/favorite/list">Favorites</a></li>
<li>
<a href="#" onclick="$('#metacpan-logout').submit(); return false">Logout</a>
</li>
</ul>
</li>
<li class="dropdown logged_out" style="display: none;">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
Sign in
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<%- FOREACH identity IN ['Facebook', 'GitHub', 'Twitter', 'Google'] %>
<li>
<a href="<% oauth_prefix %>&choice=<% identity.lower %>" onclick="return logInPAUSE(this)">
<i class="fa fa-<% identity.lower %> fa-fw"></i>
<% identity %>
</a>
</li>
<%- END %>
<li>
<a href="/login/openid">
<i class="fa fa-openid fa-fw"></i>
OpenID
</a>
</li>
</ul>
</li>
</ul>
</div>
</nav>
<div class="container-fluid">
<% IF site_alert_message %>
<div class="row">
<div class="site-alert-message alert alert-danger" role="alert">
<% site_alert_message %>
</div>
</div>
<% END %>
<% IF req.uri.path != '/' %>
<div class="row hidden-phone">
<div class="head-small-logo col-md-3">
<a href="/" class="small-logo"></a>
</div>
<div class="col-md-9">
<form action="<% IF req.uri.path == '/mirrors'; req.uri.path; ELSE; '/search'; END %>" class="search-form form-horizontal">
<div class="form-group">
<div class="input-group">
<input type="text" name="q" size="41" id="search-input" class="form-control" value="<% req.param('q').join(' ') or req.parameters.lucky %>">
<span class="input-group-btn">
<button class="btn search-btn" type="submit">Search<% IF req.uri.path == '/mirrors' %> Mirrors<% END %></button>
</span>
</div>
</div>
<div class="form-group search-type">
<label class="radio-inline">
<input type="radio" name="search_type" value="modules"
<%- IF !(req.param('search_type') eq 'authors' || req.uri.path.search('^/author/')) %> checked <% END %>
>
Modules
</label>
<label class="radio-inline">
<input type="radio" name="search_type" value="authors"
<%- IF (req.param('search_type') eq 'authors' || req.uri.path.search('^/author/')) %> checked <% END %>
>
Authors
</label>
</div>
<%- IF total.defined %>
<div class="smaller">
<%- IF page > 1 %>Page <% page %> of <% END; IF total == 999; 'more than '; END; total | format_number %>
<% "result".pluralize(total) %> (<% took / 1000 %> seconds)
</div>
<% END %>
</form>
</div>
</div>
<% END %>
<div class="row">
<div class="main-content col-md-12">
<% content | none %>
</div>
</div>
<div class="row footer">
<div class="hidden-xs hidden-sm col-md-2"> </div>
<div class="col-xs-2 col-sm-1 col-md-1" style="text-align: center">
<a href="https://fastapi.metacpan.org">API</a>
</div>
<div class="col-xs-5 col-sm-3 col-md-2" style="text-align: center">
<a href="/about">About MetaCPAN</a>
</div>
<div class="hidden-xs col-sm-2 col-md-2" style="text-align: center">
<a href="/mirrors">CPAN Mirrors</a>
</div>
<div class="hidden-xs col-sm-3 col-md-2" style="text-align: center">
<a href="https://github.com/metacpan/metacpan-web">Fork metacpan.org</a>
</div>
<div class="hidden-xs col-sm-1 col-md-1" style="text-align: center">
<a href="https://www.perl.org/">Perl.org</a>
</div>
</div>
<div class="row" style="padding:15px">
<div class="hidden-xs col-md-4 text-right" style="padding:25px">
<span class="hidden-phone" style="color: #999">Hosting generously provided by:</span>
</div>
<div class="col-xs-9 col-md-4" style="padding:25px">
<a href="http://www.bytemark.co.uk/r/metacpan.org/" target="_blank">
<img width="210" src="/static/images/sponsors/bytemark_logo.png">
</a>
</div>
<div class="col-xs-9 col-md-4" style="padding:15px">
<a target="_blank" href="https://www.liquidweb.com/">
<img width="170" src="/static/images/sponsors/liquidweb_color.png">
</a>
</div>
</div>
</div>
<div class="modal fade" tabindex="-1" role="dialog" id="keyboard-shortcuts">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Keyboard Shortcuts</h4>
</div>
<div class="modal-body row">
<% INCLUDE inc/keyboard_shortcuts.html %>
</div>
<div class="modal-footer"></div>
</div>
</div>
</div>
</body>
</html>