Skip to content

Commit

Permalink
Merge remote branch 'upstream/yapc-dev' into yapc-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
netangel committed Dec 17, 2011
2 parents 5709aee + 2854eb5 commit 1c3f4cf
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 7 deletions.
15 changes: 11 additions & 4 deletions lib/Act/Handler/User/Purchase.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use Act::Template::HTML;
use Act::Util;

my $form = Act::Form->new(
optional => [qw(donation friend-of-perl future-friend-of-perl)],
optional => [qw(donation friend-of-perl future-friend-of-perl spouses-program)],
constraints => {
donation => 'numeric',
}
Expand All @@ -26,14 +26,15 @@ sub handler
return Act::Util::redirect(make_uri('register'))
unless $Request{user}->has_registered;

# shouldn't get here unless online payment is open
my $template = Act::Template::HTML->new();

# shouldn't get here unless online payment is open
unless ($Config->payment_type ne 'NONE' && $Config->payment_open) {
$Request{status} = 404;
$template->process('user/purchase_closed');
return;
}

$Request{r}->no_cache(1);
my $template = Act::Template::HTML->new();
my ($productlist, $products) = Act::Payment::get_prices;
my $fields;

Expand Down Expand Up @@ -114,6 +115,12 @@ sub handler
name => localize('Future Friend of Perl'),
};
}
if ($ok && $fields->{'spouses-program'}) {
push @items, {
amount => 100,
name => localize('Spouses Program'),
};
}
$ok = @items > 0 if $ok;
if ($ok) {
# always a use a newly created order
Expand Down
12 changes: 12 additions & 0 deletions po/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,9 @@ msgstr "Abrechnung"
msgid "Delayed payment"
msgstr "verbindlich anmelden"

msgid "Sorry, registration for this conference has been closed."
msgstr "Tut mir leid, die Anmeldung für diese Konferenz wurde geschlossen."

msgid "Login with Facebook"
msgstr "Bei Facebook Anmelden"

Expand Down Expand Up @@ -918,3 +921,12 @@ msgstr "Freund von Perl"

msgid "Future Friend of Perl"
msgstr "Zukünftiger Freund von Perl"

msgid "Conference Registration Closed"
msgstr "Konferenz Anmeldung Geschlossen"

msgid "You can no longer purchase a badge for this conference online. Instead, you may purchase a badge at the registration desk upon arrival."
msgstr "Sie dürfen nicht mehr ein Schild für diese Konferenz online kaufen. Sie müssen stattdessen ein Schild am Anmeldungstisch kaufen."

msgid "Spouses Program"
msgstr "Ehemann / Ehefrau Programm"
9 changes: 9 additions & 0 deletions po/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -1445,3 +1445,12 @@ msgstr "Friend of Perl"

msgid "Future Friend of Perl"
msgstr "Future Friend of Perl"

msgid "Conference Registration Closed"
msgstr "Conference Registration Closed"

msgid "You can no longer purchase a badge for this conference online. Instead, you may purchase a badge at the registration desk upon arrival."
msgstr "You can no longer purchase a badge for this conference online. Instead, you may purchase a badge at the registration desk upon arrival."

msgid "Spouses Program"
msgstr "Spouses Program"
11 changes: 9 additions & 2 deletions templates/core/user/purchase
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,21 @@ if (window.act) {

<tr>
<td align="right"><input type="checkbox" value="friend-of-perl" id="friend-of-perl" name="friend-of-perl" /></td>
<td><label for="friend-of-perl">{{Friend of Perl}}</label></td>
<td><label for="friend-of-perl"><a href="http://www.yapcna.org/sponsorship/levels-of-sponsorship#idGGisuanB0ZI6CVm3W914Gg">{{Friend of Perl}}</a></label></td>
<td align="right">250</td>
<td>Dollars</td>
</tr>

<tr>
<td align="right"><input type="checkbox" value="future-friend-of-perl" id="future-friend-of-perl" name="future-friend-of-perl" /></td>
<td><label for="future-friend-of-perl">{{Future Friend of Perl}}</label></td>
<td><label for="future-friend-of-perl"><a href="http://www.yapcna.org/sponsorship/levels-of-sponsorship#idDthsrvIAXVjW8wPd3Mt44w">{{Future Friend of Perl}}</a></label></td>
<td align="right">100</td>
<td>Dollars</td>
</tr>

<tr>
<td align="right"><input type="checkbox" value="spouses-program" id="spouses-program" name="spouses-program" /></td>
<td><label for="spouses-program">{{Spouses Program}}</label></td>
<td align="right">100</td>
<td>Dollars</td>
</tr>
Expand Down
3 changes: 2 additions & 1 deletion templates/ui
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@

<ul class="main-menu">
<li><h2><a href="[% make_uri('') %]">Home</a></h2> </li>
<li><h2><a href="[% make_uri('login') %]">Login / Register</a></h2> </li>
<li><h2><a href="[% make_uri('login') %]">{{Login}}</a></h2> </li>
<li><h2><a href="[% make_uri('register') %]">{{Register}}</a></h2> </li>

</ul>

Expand Down
9 changes: 9 additions & 0 deletions templates/user/purchase_closed
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[% WRAPPER ui title = loc('Conference Registration Closed') %]
<div align="center">

<h3>{{Conference Registration Closed}}</h3>

{{You can no longer purchase a badge for this conference online. Instead, you may purchase a badge at the registration desk upon arrival.}}

</div>
[% END %]

0 comments on commit 1c3f4cf

Please sign in to comment.