Skip to content

Commit

Permalink
Merge pull request #1220 from CPAN-API/talina/plusser
Browse files Browse the repository at this point in the history
Displaying plussers on a separate page.
  • Loading branch information
oalders committed Jun 30, 2014
2 parents ba7a6c5 + f31e3c8 commit 3ff6c4c
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 7 deletions.
9 changes: 9 additions & 0 deletions lib/MetaCPAN/Web/Controller/Release.pm
Expand Up @@ -23,7 +23,16 @@ sub by_distribution : Chained('root') PathPart('') Args(1) {
my $model = $c->stash->{model};
$c->stash->{data} = $model->find($distribution);
$c->forward('view');
}

sub index : Chained('/') PathPart('release') CaptureArgs(1) {
my ( $self, $c, $dist ) = @_;
$c->stash( $c->model('API::Favorite')->find_plussers($dist) );
}

sub plusser_display : Chained('index') PathPart('plussers') Args(0) {
my ( $self, $c ) = @_;
$c->stash( { template => 'plussers.html' } );
}

sub by_author_and_release : Chained('root') PathPart('') Args(2) {
Expand Down
3 changes: 2 additions & 1 deletion lib/MetaCPAN/Web/Model/API/Favorite.pm
Expand Up @@ -140,7 +140,8 @@ sub find_plussers {
return (
{
plusser_authors => \@plusser_details,
plusser_others => $total_nonauthors
plusser_others => $total_nonauthors,
plusser_data => $distribution
}
);

Expand Down
2 changes: 1 addition & 1 deletion root/inc/author-pic.html
Expand Up @@ -14,7 +14,7 @@
<!-- Display counts of plussers-->
<p>
<% IF plusser_authors.size %>
<% plusser_authors.size %> PAUSE user(s)</b><br>
<a href="/release/<% plusser_data %>/plussers"><% plusser_authors.size %> PAUSE user(s)</a><br>
<% END %>
<% IF plusser_others %>
<% plusser_others %> non-PAUSE user(s).
Expand Down
27 changes: 27 additions & 0 deletions root/plussers.html
@@ -0,0 +1,27 @@
<title>Plussers - <% plusser_data %></title>
<% title ='Plussers - ' _ plusser_data %>


<ul class="nav nav-list slidepanel">
<li class="visible-phone search">
<form action="<% IF req.uri.path == '/mirrors'; req.uri.path; ELSE; '/search'; END %>">
<input type="search" placeholder="Search" name="q"><input type="submit" class="hidden">
</form>
</li>
<li class="nav-header"></li>
</ul>

<div class="pull-right hidden-phone">
</div>
<div class="plusser-title">
<h4> PAUSE users who ++ed <a href="/release/<% plusser_data %>"><% plusser_data %></a></h4>
<!-- For plussers -->
<div class ="plussers_disp">
<% FOREACH plusser IN plusser_authors%>

<a href="/author/<% plusser.id %>"><img src="<% plusser.pic.gravatar_fixup(70) || '/static/icons/user.png' %>" title="<% plusser.id %>" alt="<% plusser.id %>" width ="75" height ="75"><% plusser.id %></a>

<% END %>
</div>
</div>

34 changes: 34 additions & 0 deletions root/static/less/plusser.less
@@ -0,0 +1,34 @@
body {
margin: 0;
padding: 0;
}
.plusser-title {
text-align: center;
}
.plussers_disp {
font-size: 0;
width: 1000px;
margin: 0 auto;
margin-bottom: 100px;
-moz-column-count: 5;
-webkit-column-count: 5;
-o-column-count: 5;
-ms-column-count: 5;
column-count: 5;
a {
margin: 30px;
border: 4px solid transparent;
display: inline-block;
-webkit-border-radius: 12px;
border-radius: 12px;
font-size: 12pt;
}
img {
-webkit-border-radius: 9px;
border-radius: 9px;
display: block;
margin: 0 auto;
height: 75px;
width: 75px;
}
}
11 changes: 6 additions & 5 deletions root/static/less/style.less
@@ -1,13 +1,14 @@
@import "bootstrap/bootstrap.less";
@import "account.less";
@import "author.less";
@import "breadcrumbs.less";
@import "bootstrap/bootstrap.less";
@import "log.less";
@import "plusser.less";
@import "pod.less";
@import "release.less";
@import "search.less";
@import "table.less";
@import "author.less";
@import "toplists.less";
@import "pod.less";
@import "release.less";
@import "log.less";

@iconSpritePath: "/static/icons/glyphicons-halflings.png";
@iconWhiteSpritePath: "/static/icons/glyphicons-halflings-white.png";
Expand Down

0 comments on commit 3ff6c4c

Please sign in to comment.