forked from metacpan/metacpan-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase.tx
277 lines (270 loc) · 12.6 KB
/
base.tx
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
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
<title>[% $title || 'Search the CPAN' %] - metacpan.org</title>
%% if $rss {
<link rel="alternate" type="application/rss+xml" title="[% $rss_title || 'RSS'; %]" href="[% $rss %]" />
%% }
%% for $assets.grep(rx('\.css$')) -> $css {
<link href="[% $css %]" rel="stylesheet" type="text/css">
%% }
<link rel="search" href="/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN">
%% if $canonical {
<link rel="canonical" href="https://metacpan.org[% $canonical %]" />
%% }
%% if $meta_description {
<meta name="description" content="[% $meta_description %]" />
%% }
<link rel="shortcut icon" href="/static/icons/favicon.ico">
<link rel="apple-touch-icon" sizes="152x152" href="/static/icons/apple-touch-icon.png">
%% for $assets.grep(rx('\.js$')) -> $js {
<script src="[% $js %]" type="text/javascript" defer></script>
%% }
%% for $assets.grep(rx('\.less$')) -> $less {
<link rel="stylesheet/less" type="text/css" href="[% $less %]">
%% }
<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');
(function(skey, ga_id){
ga('create', ga_id, {
siteSpeedSampleRate : 100,
storage : 'none',
clientId : localStorage.getItem(skey)
});
ga(function(tracker) {
localStorage.setItem(skey, tracker.get('clientId'));
});
ga('send', 'pageview');
})('ga:clientId', 'UA-27829474-1');
</script>
%% if $twitter_card_inc {
%% include $twitter_card_inc
%% }
</head>
<body>
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<ul class="nav navbar-nav">
%% if ! $current['/'] {
<li class="visible-xs">
<a href="#" data-toggle="slidepanel" data-target=".slidepanel">
<i class="fa fa-bars icon-slidepanel"></i>
</a>
</li>
%% }
[%-
my $menu = [
{
title => "Home",
path => ["/", "/search"],
image => "/static/icons/metacpan-icon.png",
alt => "MetaCPAN icon",
},
{
title => "grep::cpan",
path => ["https://grep.metacpan.org/"],
icon => "fa fa-search",
},
{
title => "Recent",
path => ["/recent"],
icon => "fa fa-history",
},
{
title => "About",
path => ["/about"],
class => 'hidden-xs',
icon => "fa fa-info",
},
{
title => "FAQ",
path => ["/about/faq"],
class => 'hidden-xs',
icon => "fa fa-question",
},
{
title => "GitHub Issues",
path => ["https://github.com/metacpan/metacpan-web/issues"],
class => 'hidden-xs',
icon => "fab fa-github-alt",
},
{
title => "News",
path => ["/news"],
class => 'hidden-xs',
icon => "fa fa-newspaper",
},
{
title => "Tools",
path => ["/tools"],
class => 'hidden-xs',
icon => "fa fa-wrench",
},
{
title => "API",
path => ["https://fastapi.metacpan.org/"],
class => 'hidden-xs',
icon => "fa fa-database",
},
];
-%]
%% for $menu -> $item {
%% my $active = $item.path.map(-> $p { $current[$p] ? 'active' : '' }).join('');
<li class="[% $active || $item.class %]">
<a href="[% $item.path.0 %]">
[%- if $item.icon { %]<i class="[% $item.icon %]"></i>[% } %]
[%- if $item.image { %]<img src="[% $item.image %]" [%- if $item.alt { %] alt="[% $item.alt %]"[% } %]/>[% } -%]
[% $item.title -%]
</a>
</li>
%% }
</ul>
<ul class="nav navbar-nav navbar-right">
<form action="/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">
%% for ['GitHub', 'Twitter', 'Google'] -> $identity {
<li>
<a href="/login/[% $identity.lc() %]">
<i class="fab fa-[% $identity.lc() %] fa-fw"></i>
[% $identity %]
</a>
</li>
%% }
</ul>
</li>
</ul>
</div>
</nav>
<div class="container-fluid [% $page_class %]">
%% if $site_alert_message {
<div class="row">
<div class="site-alert-message alert alert-danger" role="alert">
[% $site_alert_message %]
</div>
</div>
%% }
%% block full_content -> {
%% block search_bar -> {
<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="/search" class="search-form form-horizontal">
<div class="form-group">
<div class="input-group">
<input type="text" name="q" size="41" id="metacpan_search-input" class="form-control" value="[% $search_query %]">
<span class="input-group-btn">
<button class="btn search-btn" type="submit">Search</button>
<button class="btn search-btn help-btn">?</button>
</span>
</div>
</div>
</form>
</div>
</div>
%% }
<div class="row">
<div class="main-content col-md-12">
%% block breadcrumbs -> { }
%% block left_nav -> {
<ul class="nav-list slidepanel [% block left_nav_classes -> { } %]">
<li class="visible-xs">
%% include mobile::toolbar_search_form
</li>
%% block left_nav_content -> {}
</ul>
%% }
%% block content -> { }
</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-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: 50px 15px 30px">
<div class="col-xs-9 col-md-3" style="padding:25px">
<a href="https://www.bytemark.co.uk/r/metacpan.org/" target="_blank" rel="noopener">
<img width="170" src="/static/images/sponsors/bytemark_logo.png" alt="Bytemark logo">
</a>
</div>
<div class="col-xs-9 col-md-3" style="padding:15px">
<a target="_blank" href="https://www.liquidweb.com/" rel="noopener">
<img width="170" src="/static/images/sponsors/liquidweb_color.png" alt="liquidweb logo">
</a>
</div>
<div class="col-xs-9 col-md-3" style="padding:15px">
<a target="_blank" href="https://www.yellowbot.com/" rel="noopener">
<img width="170" src="/static/images/sponsors/yellowbot-small.png" alt="YellowBot logo">
</a>
</div>
<div class="col-xs-9 col-md-3" style="padding:15px">
<a href="https://www.fastly.com/" target="_blank" rel="noopener">
<img src="/static/images/sponsors/fastly_logo.png" width=110 height=51 alt="Fastly logo">
</a>
</div>
</div>
%% if !$suppress_stickeryou {
<div class="row">
<div class="col-xs-18 col-xs-offset-3 col-md-6" style="padding-bottom: 20px">
As a valued partner and proud supporter of MetaCPAN, StickerYou
is happy to offer a 10% discount on all Custom Stickers,
Business Labels, Roll Labels, Vinyl Lettering or Custom Decals.
<a href="http://StickerYou.com" target="_blank"
rel="noopener">StickerYou.com</a> is your one-stop shop to make
your business stick. Use code <strong>METACPAN10</strong> at
checkout to apply your discount.
</div>
</div>
%% }
</div>
<div class="modal fade" tabindex="-1" role="dialog" id="metacpan_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
</div>
<div class="modal-footer"></div>
</div>
</div>
</div>
</body>
</html>