Index: user/des/fbce/lib/FBCE/Schema/Result/Statement.pm =================================================================== --- user/des/fbce/lib/FBCE/Schema/Result/Statement.pm (revision 266501) +++ user/des/fbce/lib/FBCE/Schema/Result/Statement.pm (revision 266502) @@ -1,138 +1,129 @@ use utf8; package FBCE::Schema::Result::Statement; # Created by DBIx::Class::Schema::Loader # DO NOT MODIFY THE FIRST PART OF THIS FILE =head1 NAME FBCE::Schema::Result::Statement =cut use strict; use warnings; use base 'DBIx::Class::Core'; =head1 COMPONENTS LOADED =over 4 =item * L =back =cut __PACKAGE__->load_components("InflateColumn::DateTime"); =head1 TABLE: C =cut __PACKAGE__->table("statements"); =head1 ACCESSORS =head2 id data_type: 'integer' is_auto_increment: 1 is_nullable: 0 sequence: 'statements_id_seq' =head2 person data_type: 'integer' is_foreign_key: 1 is_nullable: 0 =head2 short data_type: 'varchar' is_nullable: 0 size: 64 =head2 long data_type: 'text' is_nullable: 0 =cut __PACKAGE__->add_columns( "id", { data_type => "integer", is_auto_increment => 1, is_nullable => 0, sequence => "statements_id_seq", }, "person", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, "short", { data_type => "varchar", is_nullable => 0, size => 64 }, "long", { data_type => "text", is_nullable => 0 }, ); =head1 PRIMARY KEY =over 4 =item * L =back =cut __PACKAGE__->set_primary_key("id"); =head1 UNIQUE CONSTRAINTS =head2 C =over 4 =item * L =back =cut __PACKAGE__->add_unique_constraint("statements_person_key", ["person"]); =head1 RELATIONS =head2 person Type: belongs_to Related object: L =cut __PACKAGE__->belongs_to( "person", "FBCE::Schema::Result::Person", { id => "person" }, { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" }, ); # Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-03-10 19:05:50 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8wDb6dHYSG6Eoe9bdNnm8Q -use Text::WikiFormat; - -sub long_html($) { - my ($self) = @_; - - return Text::WikiFormat::format($self->long, {}, { - implicit_links => 0, extended => 1, absolute_links => 1 }); -} - 1; # $FreeBSD$ Index: user/des/fbce/lib/FBCE/View/HTML.pm =================================================================== --- user/des/fbce/lib/FBCE/View/HTML.pm (revision 266501) +++ user/des/fbce/lib/FBCE/View/HTML.pm (revision 266502) @@ -1,39 +1,39 @@ +use utf8; package FBCE::View::HTML; +use Moose; +use namespace::autoclean; -use strict; -use warnings; +extends 'Catalyst::View::TT'; -use base 'Catalyst::View::TT'; - __PACKAGE__->config( TEMPLATE_EXTENSION => '.tt', ENCODING => 'utf-8', render_die => 1, ); =head1 NAME FBCE::View::HTML - TT View for FBCE =head1 DESCRIPTION TT View for FBCE. =head1 SEE ALSO L =head1 AUTHOR -Dag-Erling Smørgrav +Dag-Erling Smørgrav =head1 LICENSE This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself. =cut 1; # $FreeBSD$ Index: user/des/fbce/lib/Template/Plugin/WikiFormat.pm =================================================================== --- user/des/fbce/lib/Template/Plugin/WikiFormat.pm (nonexistent) +++ user/des/fbce/lib/Template/Plugin/WikiFormat.pm (revision 266502) @@ -0,0 +1,75 @@ +use utf8; +package Template::Plugin::WikiFormat; + +=head1 NAME + +Template::Plugin::WikiFormat + +=cut + +use strict; +use warnings; +use base 'Template::Plugin::Filter'; +use Text::WikiFormat; + +=head1 DESCRIPTION + +L filter plugin for L + +=cut + +our $TAGS = { + blocks => { + code => qr/^: /, + }, +}; + +our $OPTIONS = { + absolute_links => 1, + implicit_links => 0, + extended => 1, +}; + +=head1 METHODS + +=head2 init + +The initialization function. + +=cut + +sub init($) { + my ($self) = @_; + + my $name = $self->{_CONFIG}->{name} || 'wiki'; + $self->{_DYNAMIC} = 1; + $self->install_filter($name); + return $self; +} + +=head2 filter + +The filter function. + +=cut + +sub filter($$) { + my ($self, $raw) = @_; + + return Text::WikiFormat::format($raw, $TAGS, $OPTIONS); +} + +=head1 AUTHOR + +Dag-Erling Smørgrav + +=head1 LICENSE + +This library is free software. You can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut + +1; + +# $FreeBSD$ Property changes on: user/des/fbce/lib/Template/Plugin/WikiFormat.pm ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: user/des/fbce/root/run/index.tt =================================================================== --- user/des/fbce/root/run/index.tt (revision 266501) +++ user/des/fbce/root/run/index.tt (revision 266502) @@ -1,27 +1,28 @@ +[% USE WikiFormat %] [% PROCESS lib/html_top %] [% PROCESS lib/header %] [% WRAPPER lib/main %] [% PROCESS run/when %] [% IF !user.active %]

You are not qualified to run in the election. If you believe this is incorrect, please contact the election administrator.

[% ELSIF user.statement.defined %]

You have registered as a candidate in the [% title %]. You have provided the following statement:

-

[% user.statement.short | html %]

+

[% user.statement.short | wiki %]

- [% user.statement.long_html %] + [% user.statement.long | wiki %]
[% IF nominating == 0 %]

You can edit your statement or withdraw your candidacy.

[% END %] [% ELSIF nominating == 0 %]

You can register your candidacy in the election.

[% END %] [% END %] [% PROCESS lib/footer %] [% PROCESS lib/html_bottom %] Index: user/des/fbce/root/run/register.tt =================================================================== --- user/des/fbce/root/run/register.tt (revision 266501) +++ user/des/fbce/root/run/register.tt (revision 266502) @@ -1,31 +1,31 @@ [% PROCESS lib/html_top %] [% PROCESS lib/header %] [% WRAPPER lib/main %] [% PROCESS run/when %] [% IF !user.active %]

You are not qualified to run in the election. If you believe this is incorrect, please contact the election administrator.

[% ELSIF nominating == 0 %]

To register as a candidate in the election, enter the following information:

  • A short slogan which will appear next to your name on the list of candidates and at the top of your candidate page;
  • A longer statement about your background, why you are running and what you intend to do if elected.

If you have a Gravatar, it will appear next to your statement.

Slogan

-

Statement (WikiFormat)

+

Statement (WikiFormat)

[% END %] [% END %] [% PROCESS lib/footer %] [% PROCESS lib/html_bottom %] Index: user/des/fbce/root/see/candidate.tt =================================================================== --- user/des/fbce/root/see/candidate.tt (revision 266501) +++ user/des/fbce/root/see/candidate.tt (revision 266502) @@ -1,19 +1,20 @@ +[% USE WikiFormat %] [% PROCESS lib/html_top %] [% PROCESS lib/header %] [% WRAPPER lib/main %]

[% candidate.name | html %] ([% candidate.login %])

[% IF candidate.incumbent %]

(incumbent)

[% END %]
-

[% candidate.statement.short | html %]

+

[% candidate.statement.short | wiki %]

- [% candidate.statement.long_html %] + [% candidate.statement.long | wiki %]
[% END %] [% PROCESS lib/footer %] [% PROCESS lib/html_bottom %]