Skip to content

Commit e804ffd

Browse files
momijizukamoriCocoa
andauthored
Convert /polls to TT (#3400)
Co-authored-by: Cocoa <momijizukamori@gmail.com>
1 parent 398ccab commit e804ffd

File tree

12 files changed

+1067
-1003
lines changed

12 files changed

+1067
-1003
lines changed

cgi-bin/DW/Controller/Poll.pm

Lines changed: 699 additions & 0 deletions
Large diffs are not rendered by default.

cgi-bin/DW/Template/Plugin/FormHTML.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,8 @@ sub _process_errors {
510510

511511
my @errors;
512512
@errors = $self->{errors}->get( $args->{name} ) if $self->{errors};
513+
push @errors, ( { "message" => $args->{error} } )
514+
if exists $args->{error} && length $args->{error};
513515

514516
$args->{class} .= " error" if @errors;
515517

cgi-bin/LJ/Web.pm

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ sub make_authas_select {
192192

193193
my $authas = $opts->{authas} || $u->user;
194194
my $button = $opts->{button} || $BML::ML{'web.authas.btn'};
195+
my $label = $opts->{label} || $BML::ML{'web.authas.select.label'};
195196

196197
my $foundation = $opts->{foundation} || 0;
197198

@@ -217,7 +218,7 @@ sub make_authas_select {
217218
else {
218219
$ret = $foundation
219220
? q{<div class='row collapse'><div class='columns small-3 medium-1'><label class='inline'>}
220-
. LJ::Lang::ml('web.authas.select.label')
221+
. $label
221222
. q{</label></div>}
222223
. q{<div class='columns small-9 medium-11'><div class='row'>}
223224
. q{<div class="columns small-8 medium-4">}
@@ -245,40 +246,6 @@ sub make_authas_select {
245246
return LJ::html_hidden( authas => $authas );
246247
}
247248

248-
# <LJFUNC>
249-
# name: LJ::make_postto_select
250-
# des: Given a u object and some options, determines which users the given user
251-
# can post to. If the list exists, returns a select list and a submit
252-
# button with labels. Otherwise returns a hidden element.
253-
# returns: string of HTML elements
254-
# args: u, opts?
255-
# des-opts: Optional. Valid keys are:
256-
# 'authas' - current user, gets selected in drop-down;
257-
# 'label' - label to go before form elements;
258-
# 'button' - button label for submit button;
259-
# </LJFUNC>
260-
sub make_postto_select {
261-
my ( $u, $opts ) = @_;
262-
263-
my $authas = $opts->{authas} || $u->user;
264-
my $label = $opts->{label} || $BML::ML{'web.postto.label'};
265-
my $button = $opts->{button} || $BML::ML{'web.postto.btn'};
266-
267-
my @list = ( $u, $u->posting_access_list );
268-
269-
# only do most of form if there are options to select from
270-
if ( @list > 1 ) {
271-
return "$label "
272-
. LJ::html_select( { name => 'authas', selected => $authas },
273-
map { $_->user, $_->user } @list )
274-
. " "
275-
. LJ::html_submit( undef, $button );
276-
}
277-
278-
# no communities to choose from, give the caller a hidden
279-
return LJ::html_hidden( authas => $authas );
280-
}
281-
282249
# <LJFUNC>
283250
# name: LJ::help_icon
284251
# des: Returns BML to show a help link/icon given a help topic, or nothing

0 commit comments

Comments
 (0)