95 lines
3.1 KiB
Text
95 lines
3.1 KiB
Text
|
|
[%# TT conversion of manage/invitecodes.bml
|
||
|
|
# Invite code management system (user-facing).
|
||
|
|
#
|
||
|
|
# Authors:
|
||
|
|
# Jen Griffin <kareila@livejournal.com>
|
||
|
|
#
|
||
|
|
# Copyright (c) 2011 by Dreamwidth Studios, LLC.
|
||
|
|
#
|
||
|
|
# This program is free software; you may redistribute it and/or modify it
|
||
|
|
# under the same terms as Perl itself. For a copy of the license, please
|
||
|
|
# reference 'perldoc perlartistic' or 'perldoc perlgpl'.
|
||
|
|
#
|
||
|
|
%]
|
||
|
|
|
||
|
|
[%- sections.title='.title' | ml -%]
|
||
|
|
[%- CALL dw.active_resource_group( "foundation" ) -%]
|
||
|
|
|
||
|
|
[%- sections.head = BLOCK %]
|
||
|
|
<style type="text/css">
|
||
|
|
@media only screen and (max-width:40em) {
|
||
|
|
thead, th, tr:first-of-type {display: none;}
|
||
|
|
tbody, tr, td {display: block !important; width: 100%}
|
||
|
|
|
||
|
|
table {width: 100%}
|
||
|
|
|
||
|
|
td::before {
|
||
|
|
display: inline;
|
||
|
|
font-weight: bold;
|
||
|
|
}
|
||
|
|
|
||
|
|
td:nth-child(1)::before { content: "[% '.header.code' | ml %] "; }
|
||
|
|
td:nth-child(2)::before { content: "[% '.header.recipient' | ml %] "; }
|
||
|
|
td:nth-child(3)::before { content: "[% '.header.used' | ml %] "; }
|
||
|
|
td:nth-child(4)::before { content: "[% '.header.sent' | ml %] "; }
|
||
|
|
td:nth-child(5)::before { content: "[% '.header.email' | ml %] "; }
|
||
|
|
}
|
||
|
|
</style>
|
||
|
|
[%- END -%]
|
||
|
|
|
||
|
|
[%- IF print_req_form -%]
|
||
|
|
<h2>[% '.form.request.header' | ml %]</h2>
|
||
|
|
<p>[% '.form.request.intro' | ml %]</p>
|
||
|
|
<div><form method='POST'>
|
||
|
|
[% dw.form_auth;
|
||
|
|
reason_label = '.form.request.reason' | ml;
|
||
|
|
submit_label = '.form.request.submit2' | ml;
|
||
|
|
form.textbox( label = reason_label, name = 'reason', id = 'reason',
|
||
|
|
size = 75, maxlength = 255 );
|
||
|
|
form.submit( value = submit_label ) %]
|
||
|
|
</form></div>
|
||
|
|
[%- END -%]
|
||
|
|
|
||
|
|
[%- IF view_full;
|
||
|
|
viewing_label = '.label.viewing.full' | ml(aopts = "href='/invite'");
|
||
|
|
ELSE;
|
||
|
|
viewing_label = '.label.viewing.partial' | ml(aopts = "href='/invite?full=1'");
|
||
|
|
END -%]
|
||
|
|
<p>[% viewing_label %]</p>
|
||
|
|
|
||
|
|
[%- IF has_codes -%]
|
||
|
|
<p>[% '.label.send' | ml(aopts = "href='/manage/circle/invite'") %]</p>
|
||
|
|
<table class='table invitecodes' id='invitecodes'>
|
||
|
|
<thead><tr>
|
||
|
|
<th>[% '.header.code' | ml %]</th>
|
||
|
|
<th>[% '.header.recipient' | ml %]</th>
|
||
|
|
<th>[% '.header.used' | ml %]</th>
|
||
|
|
<th>[% '.header.sent' | ml %]</th>
|
||
|
|
<th>[% '.header.email' | ml %]</th>
|
||
|
|
</tr></thead>
|
||
|
|
|
||
|
|
[%- FOREACH code = invitecodes;
|
||
|
|
IF code.is_used; recuser = code.recipient; END -%]
|
||
|
|
<tr>
|
||
|
|
<td><tt>[% code.code %]</tt></td>
|
||
|
|
<td>
|
||
|
|
[%- IF code.is_used;
|
||
|
|
users.$recuser.ljuser_display;
|
||
|
|
ELSE;
|
||
|
|
link = create_link( code.code );
|
||
|
|
'.code.use' | ml(aopts = "href='$link'");
|
||
|
|
END -%]
|
||
|
|
</td><td>
|
||
|
|
[% IF code.is_used; time_to_http( users.$recuser.timecreate ); END %]
|
||
|
|
</td><td>
|
||
|
|
[% time_to_http( code.timesent ) %]
|
||
|
|
</td><td>[% code.email %]</td>
|
||
|
|
</tr>
|
||
|
|
[% END %]
|
||
|
|
</table>
|
||
|
|
|
||
|
|
[%- ELSE -%]
|
||
|
|
<p>[% IF view_full; '.noinvitecodes' | ml;
|
||
|
|
ELSE; '.noinvitecodes.partial' | ml; END %]</p>
|
||
|
|
[%- END -%]
|