forked from metacpan/metacpan-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauthor.tx
168 lines (168 loc) · 7.18 KB
/
author.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
%% cascade base {
%% title => $title || $author.name ~ ' (' ~ $author.pauseid ~ ')',
%% rss => $rss || '/author/' ~ $author.pauseid ~ '/activity.rss',
%% rss_title => $rss_title || 'Recent CPAN Activity of ' ~ $author.pauseid ~ ' - MetaCPAN',
%% twitter_card_inc => $twitter_card_inc || 'inc/twitter/author.tx',
%% }
%% override left_nav_content -> {
<li class="hidden-phone">[% include inc::author_pic %]</li>
<li class="nav-header">Email</li>
<li>
%% my $email = [].merge($author.email).0;
<a href="mailto:[% $email %]" class="ellipsis" title="[% $email %]">[% $email %]</a>
</li>
%% if $author.website.size() {
<li class="nav-header">Website</li>
%% for $author.website -> $website {
<li>
<a rel="me noopener nofollow" href="[% $website %]" title="[% $website %]" target="_blank">[% $website.decode_punycode() %]</a>
</li>
%% } }
%% if $author.profile.size() {
<li class="nav-header">Profiles</li>
<div class="user-profiles">
%% for $author.profile.sort(-> $a, $b { $a.name cmp $b.name }) -> $profile {
%% my $known = $profiles[$profile.name];
%% if $known {
<a rel="me noopener nofollow" href="[% $known.url_format.sprintf($profile.id) %]" target="_blank" title="[% $known.name %] - [% $profile.id %]">
<img src="[% $known.icon %]" width="16" height="16" alt="[% $known.name %]">
</a>
%% }
%% }
</div>
%% }
%% if $author.country || $author.city || $author.region {
<li class="nav-header">Location</li>
%% if $author.country {
<img src="/static/images/flag/[% $author.country | lc %].png" alt="[% $author_country_name %]" title="[% $author_country_name %]" width=16 height=11>
%% }
[% $author.city %][% if $author.city && $author.region { %], [% } %][% $author.region %]
%% }
%% if $author.blog.size() {
<li class="nav-header">Blog</li>
%% for $author.blog -> $blog {
<li>
%% if $blog.feed {
<a rel="noopener nofollow" href="[% $blog.feed %]" target="_blank">
<img src="/static/images/profile/feed.png" width=16 height=16 style="float: right">
</a>
%% }
<a rel="noopener nofollow" href="[% $blog.url %]" title="[% $blog.url %]" target="_blank" class="ellipsis" style="width: 140px">
[% $blog.url.replace(rx("^https?://"), '') %]
</a>
</li>
%% }
%% }
%% for $author.donation -> $donate { if $donate.id {
%% if $donate.name == 'paypal' {
<li class="author-donate">
<center>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="[% $donate.id %]">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Donation to CPAN Author [% $author.pauseid %] via MetaCPAN">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_SM.gif:NonHostedGuest">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" style="width: auto">
</form>
</center>
</li>
%% }
%% else if $donate.name == 'wishlist' {
<li class="author-donate">
<a rel="me noopener nofollow" href="[% $donate.id %]" target="_blank">Wishlist</a>
</li>
%% }
%% } }
<li class="nav-header">Activity</li>
<li>
%% include inc::activity {
%% url => '/author/' ~ $author.pauseid ~ '/activity.svg',
%% }
</li>
%% if $latest.date {
<li class="nav-header">Latest Release</li>
<li>
<div>
<a href="[% if $latest.status == 'latest' { '/dist/' ~ $latest.distribution } else { '/release/' ~ $latest.author ~ '/' ~ $latest.name } %]" class="ellipsis" title="[% $latest.name %]">
[% $latest.name %]
</a>
</div>
</li>
<li>
<div>
<span class="relatize">[% datetime($latest.date).to_http %]</span>
</div>
</li>
%% }
<li>
<div>
<a href="/author/[% $author.pauseid %]/releases">All releases by this author</a>
</div>
</li>
<li class="nav-header">Tools</li>
<li>
Search distributions:<br>
</li>
<li class="toolbar-search-form">
<form action="/search">
<input type="hidden" name="q" value="author:[% $author.pauseid %]">
<input type="text" name="q" class="form-control tool-bar-form">
<input type="submit" style="display: none">
</form>
</li>
<li>
<a href="[% $author.links.cpantesters_reports %]">CPANTesters Reports</a>
<a href="[% $author.links.cpantesters_matrix %]" title="Matrix">
<i class="icon-grid"></i>
</a>
</li>
<li>
<a href="[% $author.links.cpants %]">CPANTS</a>
</li>
<li>
<a href="[% $author.links.metacpan_explorer %]">MetaCPAN Explorer</a>
</li>
<li>
<a href="[% $author.links.cpan_directory %]">CPAN directory</a> ([% $author.release_count.cpan + $author.release_count.latest %])
</li>
<li>
<a href="/author/[% $author.pauseid %]/permissions">Module permissions</a>
</li>
<li>
<a href="[% $author.links.backpan_directory %]" title="See all releases ever done by [% $author.pauseid %], not just those currently on CPAN.">BackPAN directory</a> ([% $author.release_count['backpan-only'] %])
</li>
%% }
%% override content -> {
<div class="content">
<div id="metacpan_feed_subscription" class="page-header">
<p>[% if $releases.0 { $releases.size() } else { 'No' } %] distributions uploaded by <span class="author-name">[% $author.name %]</span> ([% $author.pauseid %])</p>
<a href="/author/[% $author.pauseid %]/activity.rss"><i class="fa fa-rss fa-2x black"></i></a>
</div>
<div class="visible-xs inline-author-pic">[% include inc::author_pic %]</div>
%% if $releases.0 {
%% include inc::release_table { header => 1, tablesorter => 1, table_id => 'metacpan_author_releases' }
%% }
%% else {
<div class="message">
<strong>Releases</strong>
<p>No releases from <a href="/author/[% $author.pauseid %]">[% $author.pauseid %]</a> could be found
%% if $author.release_count["backpan-only"] {
<br/><a href="/author/[% $author.pauseid %]">[% $author.pauseid %]</a> has <a href="[% $author.links.backpan_directory %]">[% $author.release_count["backpan-only"] %] distributions on BackPAN</a> that were previously on CPAN.
%% }
</p>
</div>
%% }
%% if $faves.0 {
%% include inc::favorite_table { favorites => $faves, author => 1, tablesorter => 1 }
%% }
%% else {
<div class="message">
<strong>Favorites</strong>
<p>No favorite distributions from <a href="/author/[% $author.pauseid %]">[% $author.pauseid %]</a> could be found</p>
</div>
%% }
</div>
%% }