Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

Commit

Permalink
Record the contestant's IDs as well
Browse files Browse the repository at this point in the history
  • Loading branch information
rafl committed Mar 10, 2012
1 parent eab503f commit a274c24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/MetaCPAN/Contest/Vote/Types.pm
Expand Up @@ -4,7 +4,7 @@ use MooseX::Types -declare => ['Ballot', 'EmptyString'];
use MooseX::Types::Moose 'Str', 'ArrayRef';
use MooseX::Types::URI 'Uri';
use MooseX::Types::Structured 'Dict';
use MooseX::Types::Common::Numeric 'PositiveInt';
use MooseX::Types::Common::Numeric 'PositiveInt', 'PositiveOrZeroInt';

subtype EmptyString, as Str, where { length $_ == 0 };

Expand All @@ -14,6 +14,7 @@ subtype Ballot, as ArrayRef[
# coerce first
score => PositiveInt|EmptyString,
title => Str,
id => PositiveOrZeroInt,
],
];

Expand Down
1 change: 1 addition & 0 deletions root/templates/entries/index.html
Expand Up @@ -118,6 +118,7 @@ <h2>Cast your vote!</h2>
<div class="vote-entry">
<input type="hidden" name="votes.<% id %>.title" value="<% entry.title %>" />
<input type="hidden" name="votes.<% id %>.name" value="<% entry.link %>" />
<input type="hidden" name="votes.<% id %>.id" value="<% id %>" />
<input type="text" class="vote" id="votes.<% id %>.score" name="votes.<% id %>.score" value="" />
<label for="votes.<% id %>.score"><% entry.title %></label>
</div>
Expand Down

0 comments on commit a274c24

Please sign in to comment.