From owner-svn-src-user@FreeBSD.ORG Wed Apr 16 21:11:36 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4132C152; Wed, 16 Apr 2014 21:11:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BFE011F1; Wed, 16 Apr 2014 21:11:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s3GLBaWP042081; Wed, 16 Apr 2014 21:11:36 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s3GLBVWS042052; Wed, 16 Apr 2014 21:11:31 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201404162111.s3GLBVWS042052@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 16 Apr 2014 21:11:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r264559 - in user/des/fbp: lib/FBP/View root root/lib root/poll root/question root/static t X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Apr 2014 21:11:36 -0000 Author: des Date: Wed Apr 16 21:11:31 2014 New Revision: 264559 URL: http://svnweb.freebsd.org/changeset/base/264559 Log: View. Added: user/des/fbp/lib/FBP/View/Web.pm (contents, props changed) user/des/fbp/root/blank.tt (contents, props changed) user/des/fbp/root/fof.tt (contents, props changed) user/des/fbp/root/help.tt (contents, props changed) user/des/fbp/root/index.tt (contents, props changed) user/des/fbp/root/lib/ user/des/fbp/root/lib/date (contents, props changed) user/des/fbp/root/lib/datetime (contents, props changed) user/des/fbp/root/lib/footer (contents, props changed) user/des/fbp/root/lib/header (contents, props changed) user/des/fbp/root/lib/help (contents, props changed) user/des/fbp/root/lib/html_bottom (contents, props changed) user/des/fbp/root/lib/html_top (contents, props changed) user/des/fbp/root/lib/loginout (contents, props changed) user/des/fbp/root/lib/main (contents, props changed) user/des/fbp/root/lib/navigation (contents, props changed) user/des/fbp/root/lib/time (contents, props changed) user/des/fbp/root/login.tt (contents, props changed) user/des/fbp/root/poll/ user/des/fbp/root/poll/done.tt (contents, props changed) user/des/fbp/root/poll/review.tt (contents, props changed) user/des/fbp/root/poll/see.tt (contents, props changed) user/des/fbp/root/poll/vote.tt (contents, props changed) user/des/fbp/root/polls.tt (contents, props changed) user/des/fbp/root/question/ user/des/fbp/root/static/fbp.css (contents, props changed) user/des/fbp/t/view_Web.t Modified: user/des/fbp/root/favicon.ico (contents, props changed) Added: user/des/fbp/lib/FBP/View/Web.pm ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/lib/FBP/View/Web.pm Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,39 @@ +use utf8; +package FBP::View::Web; +use Moose; +use namespace::autoclean; + +extends 'Catalyst::View::TT'; + +__PACKAGE__->config( + TEMPLATE_EXTENSION => '.tt', + ENCODING => 'utf-8', + render_die => 1, +); + +=head1 NAME + +FBP::View::Web - TT View for FBP + +=head1 DESCRIPTION + +TT View for FBP. + +=head1 SEE ALSO + +L + +=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$ Added: user/des/fbp/root/blank.tt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/blank.tt Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,12 @@ +[%# $FreeBSD$ %] +[% PROCESS lib/html_top %] +[% PROCESS lib/header %] +[% WRAPPER lib/main %] + +
+

This page intentionally left blank.

+
+ +[% END %] +[% PROCESS lib/footer %] +[% PROCESS lib/html_bottom %] Modified: user/des/fbp/root/favicon.ico ============================================================================== Binary file (source and/or target). No diff available. Added: user/des/fbp/root/fof.tt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/fof.tt Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,14 @@ +[%# $FreeBSD$ %] +[% PROCESS lib/html_top %] +[% PROCESS lib/header %] +[% WRAPPER lib/main %] + +
+

This is not the page you are looking for.

+

You may go about your business.

+

Move along, move along.

+
+ +[% END %] +[% PROCESS lib/footer %] +[% PROCESS lib/html_bottom %] Added: user/des/fbp/root/help.tt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/help.tt Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,12 @@ +[%# $FreeBSD$ %] +[% PROCESS lib/html_top %] +[% PROCESS lib/header %] +[% WRAPPER lib/main %] + + +

Help

+[% PROCESS lib/help %] + +[% END %] +[% PROCESS lib/footer %] +[% PROCESS lib/html_bottom %] Added: user/des/fbp/root/index.tt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/index.tt Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,19 @@ +[%# $FreeBSD$ %] +[% PROCESS lib/html_top %] +[% PROCESS lib/header %] +[% WRAPPER lib/main %] + +

This site hosts polls for the FreeBSD Project.

+[% IF c.user %] +[% IF polls.size() > 0 %] +

Please proceed to the polls.

+[% ELSE %] +

There are no active polls at the moment.

+[% END %] +[% ELSE %] +

You must log in to see or answer polls.

+[% END %] + +[% END %] +[% PROCESS lib/footer %] +[% PROCESS lib/html_bottom %] Added: user/des/fbp/root/lib/date ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/lib/date Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,2 @@ +[%# $FreeBSD$ %] +[%- dt.day_name %], [% dt.day %] [% dt.month_name %] [% dt.year -%] Added: user/des/fbp/root/lib/datetime ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/lib/datetime Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,2 @@ +[%# $FreeBSD$ %] +[%- PROCESS lib/date%] at [% PROCESS lib/time -%] Added: user/des/fbp/root/lib/footer ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/lib/footer Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,2 @@ +[%# $FreeBSD$ %] + Added: user/des/fbp/root/lib/header ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/lib/header Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,5 @@ +
+

[% title | html %]

+[% PROCESS lib/navigation %] +[% PROCESS lib/loginout %] +
Added: user/des/fbp/root/lib/help ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/lib/help Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,40 @@ +

What is this?

+ +

This is a website for FreeBSD polls and elections.

+ +

Who has access?

+ +

Anyone with a valid commit bit in at least one of FreeBSD's repositories (src, doc, ports) can log in with their FreeBSD user name. However, only active committers, i.e. those who have made at least one commit in the twelve months preceding the opening of the poll are qualified to vote. Inactive committers can only observe.

+ +[% IF c.user %] + [% IF c.user.active %] +

You are registered as an active committer, and are qualified to vote.

+ [% ELSE %] +

You are not registered as an active committer, and are therefore not qualified to vote. If you believe this is incorrect, please contact the election administrator.

+ [% END %] +[% ELSE %] +

When you are logged in, your status (active or inactive) will be visible next to your name in the top right corner.

+[% END %] + +

How do I log in?

+ +[% IF c.user %] +

You're already logged in, you big dummy.

+[% ELSE %] +

Click the Log in link below the navigation bar (or the one right here). Log in with your FreeBSD user name and the password that was left in your home directory on the FreeBSD cluster.

+[% IF polls.count > 0 %] +

If you have a valid FreeBSD commit bit but you haven't received a password, please contact the election administrator.

+[% END %] +[% END %] + +

How do I vote?

+ +[% IF !c.user %] +

You must be logged in to vote.

+[% ELSIF !c.user.active %] +

You are not registered as an active committer, and are therefore not qualified to vote. If you believe this is incorrect, please contact the election administrator.

+[% ELSIF polls.count == 0 %] +

There are currently no active polls.

+[% ELSE %] +

Click the Active Polls link in the navigation bar (or the one right here) to view the list of active polls. Select the poll in which you wish to vote and hit the “Let me vote” button. Answer all the questions, then hit the “I'm done” button. You can come back and change your vote at any time until the poll closes.

+[% END %] Added: user/des/fbp/root/lib/html_bottom ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/lib/html_bottom Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,3 @@ +[%# $FreeBSD$ %] + + Added: user/des/fbp/root/lib/html_top ============================================================================== Binary file. No diff available. Added: user/des/fbp/root/lib/loginout ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/lib/loginout Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,9 @@ +[%# $FreeBSD$ %] +
+
[% PROCESS lib/datetime dt=c.now %]
+ [% IF c.user %] + Logged in as [% c.user.realname | html %] ([% IF c.user.active %]active[% ELSE %]inactive[% END %]) – Log out + [% ELSE %] + Log in + [% END %] +
Added: user/des/fbp/root/lib/main ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/lib/main Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,4 @@ +[%# $FreeBSD$ %] +
+[% content %] +
Added: user/des/fbp/root/lib/navigation ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/lib/navigation Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,12 @@ +[%# $FreeBSD$ %] + Added: user/des/fbp/root/lib/time ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/lib/time Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,2 @@ +[%# $FreeBSD$ %] +[%- dt.hms %] UTC[% -%] Added: user/des/fbp/root/login.tt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/login.tt Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,22 @@ +[%# $FreeBSD$ %] +[% PROCESS lib/html_top %] + +
+
+ [% title | html %] + +
+ + +
+
+ + +
+
+ +
+
+
+ +[% PROCESS lib/html_bottom %] Added: user/des/fbp/root/poll/done.tt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/poll/done.tt Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,12 @@ +[%# $FreeBSD$ %] +[% PROCESS lib/html_top %] +[% PROCESS lib/header title='Thank you for voting' %] +[% WRAPPER lib/main %] + +

Thank you for voting in this poll.

+ +

Return to the front page

+ +[% END %] +[% PROCESS lib/footer %] +[% PROCESS lib/html_bottom %] Added: user/des/fbp/root/poll/review.tt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/poll/review.tt Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,39 @@ +[%# $FreeBSD$ %] +[% USE WikiFormat %] +[% PROCESS lib/html_top %] +[% PROCESS lib/header %] +[% WRAPPER lib/main %] + +[% IF error %] +
+

[% error | html %]

+
+[% ELSE %] +
+

You have submitted valid answers to all questions in the poll.

+ [% FOREACH question IN poll.questions %] + [% qid = question.id %] +
+ [% question.short | wiki %] +
+ [% IF question.max_options == 1 %] +

You answered: [% answers.$qid.0.label | html %]

+ [% ELSE %] +

You answered:

+
    + [% FOREACH option IN answers.$qid %] +
  • [% option.label %]
  • + [% END %] +
+ [% END %] + [% END %] +
+ + +
+
+[% END %] + +[% END %] +[% PROCESS lib/footer %] +[% PROCESS lib/html_bottom %] Added: user/des/fbp/root/poll/see.tt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/poll/see.tt Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,27 @@ +[%# $FreeBSD$ %] +[% USE WikiFormat %] +[% PROCESS lib/html_top %] +[% PROCESS lib/header %] +[% WRAPPER lib/main %] + +
+
+[% poll.synopsis | wiki %] +
+
+[% poll.long | wiki %] +
+ +
+ +[% END %] +[% PROCESS lib/footer %] +[% PROCESS lib/html_bottom %] Added: user/des/fbp/root/poll/vote.tt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/poll/vote.tt Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,41 @@ +[% USE WikiFormat %] +[% PROCESS lib/html_top %] +[% PROCESS lib/header %] +[% WRAPPER lib/main %] + +[% IF error %] +
+

[% error | html %]

+
+[% END %] +
+
+ +
+[% question.short | wiki %] +
+
+[% question.long | wiki %] +
+
+[% IF question.max_options == 1 %] +[% itype = 'radio' %] +[% ELSE %] +[% itype = 'checkbox' %] +[% END %] +[% FOREACH option = question.options %] +[% oid = option.id %] +
+[% option.label | html %] +
+[% END %] + + + +
+
+
+ +[% END %] +[% PROCESS lib/footer %] +[% PROCESS lib/html_bottom %] Added: user/des/fbp/root/polls.tt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/polls.tt Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,20 @@ +[%# $FreeBSD$ %] +[% USE WikiFormat %] +[% PROCESS lib/html_top %] +[% PROCESS lib/header %] +[% WRAPPER lib/main %] + +[% IF polls.count == 0 %] +

There are no active polls at present.

+[% ELSE %] +
+[% WHILE (poll = polls.next) %] +
[% poll.title | html%]
+
[% poll.synopsis | wiki %]
+[% END %] +
+[% END %] + +[% END %] +[% PROCESS lib/footer %] +[% PROCESS lib/html_bottom %] Added: user/des/fbp/root/static/fbp.css ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/root/static/fbp.css Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,187 @@ +/* + * $FreeBSD$ + */ + +/* + * Body + */ +body { + font-family: sans-serif; + background-color: #fff; + margin: 5% auto 5% auto; + min-width: 400px; + width: 80%; + max-width: 800px; +} + +/* + * General formatting + */ +a { + text-decoration: none; + color: #900; +} + +a:hover, a:focus { + background-color: #fee; +} + +th { + text-align: left; +} + +/* + * Title + */ +.title { + display: block; + padding: 6pt; + font-size: 200%; + font-weight: bold; +} + +/* + * Navigation bar + */ +.navigation { + display: block; + margin: 0; + padding: 2pt; + border-top: thin solid black; + border-bottom: thin solid black; + text-align: center; + background-color: #fc6; + color: #900; +} + +.navigation ul { + margin: 0; + padding: 0; +} + +.navigation li { + display: inline; + padding: 0; + margin: 0; +} + +.navigation a { + padding: 2pt 2em 2pt 2em; + margin: 0; + // font-size: 120%; + text-transform: uppercase; + font-weight: bold; + color: #900; +} + +.navigation a:hover, .navigation a:focus { + background-color: #900; + color: #fc6; +} + +/* + * Date / time, name and login / logout link + */ +.loginout { + display: block; + margin: 0; + padding: 3pt; + text-align: right; + font-size: 75%; + font-style: italic; +} + +.datetime { + float: left; +} + +/* + * Content + */ +.main { + display: block; + padding: 6pt; + min-height: 400px; + overflow: auto; +} + +.info { + color: green; + font-weight: bold; +} + +.error { + color: red; + font-weight: bold; +} + +/* + * Footer + */ +.footer { + padding: 3pt 0 3pt 0; + border-top: thin solid black; + border-bottom: thin solid black; + background-color: #fc6; + text-align: center; + font-size: 75%; + font-style: italic; +} + +/* + * Error message + */ +.errorbox { + display: block; + margin: 20% auto 0 auto; + font-size: large; + text-align: center; + vertical-align: middle; +} + +/* + * Login page + */ +.loginform { + display: block; + width: 50%; + margin: 25% auto 0 auto; +} + +.loginform fieldset { + padding: 12pt; + border: thin solid #900; +} + +.loginform legend { + padding: 0.5ex; + font-size: large; + font-weight: bold; + color: #900; + // background-color: #fc6; +} + +.loginform div { + padding: 6pt; + white-space: nowrap; + text-align: right; +} + +/* + * Poll + */ +.poll .synopsis { + font-size: large; +} + +.poll .long { + margin-left: 2ex; +} + +/* + * Voting + */ +.vote .votebox { + width: 2ex; + text-align: center; +} Added: user/des/fbp/t/view_Web.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/des/fbp/t/view_Web.t Wed Apr 16 21:11:31 2014 (r264559) @@ -0,0 +1,8 @@ +use strict; +use warnings; +use Test::More; + + +BEGIN { use_ok 'FBP::View::Web' } + +done_testing();