From d34d77b26311cf6b57e1e4c8edf4f90e29bdfcfb Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 15 Feb 2006 13:04:25 +0000 Subject: * ritocchi ai CSS * corretta la validazione delle date git-svn-id: svn://luxion/repos/IscrittiGroLUG/trunk@195 fcb26f47-9200-0410-b104-b98ab5b095f3 --- GroLUG/lib/GroLUG/C/Iscritto.pm | 8 +++--- GroLUG/lib/HTML/Widget/Constraint/ISODate.pm | 11 ++++++-- GroLUG/root/lib/site/header | 10 +++---- GroLUG/root/src/ttsite.css | 42 ++++++++++++++++++++++++---- 4 files changed, 55 insertions(+), 16 deletions(-) diff --git a/GroLUG/lib/GroLUG/C/Iscritto.pm b/GroLUG/lib/GroLUG/C/Iscritto.pm index b2a9609..b47dfce 100644 --- a/GroLUG/lib/GroLUG/C/Iscritto.pm +++ b/GroLUG/lib/GroLUG/C/Iscritto.pm @@ -132,9 +132,9 @@ sub widget_for_pag { my $widget=$c->widget('pagamento'); $widget->method('post'); - $widget->element('Textfield','data_pagamento')->label('Data del pagamento')->value($self->strdate($pagamento->data_pagamento)); - $widget->element('Textfield','data_iscrizione')->label('Data di iscrizione')->value($self->strdate($pagamento->data_iscrizione)); - $widget->element('Textfield','data_scadenza')->label('Data di scadenza')->value($self->strdate($pagamento->data_scadenza)); + $widget->element('Textfield','data_pagamento')->label('Data del pagamento')->value($c->strdate($pagamento->data_pagamento)); + $widget->element('Textfield','data_iscrizione')->label('Data di iscrizione')->value($c->strdate($pagamento->data_iscrizione)); + $widget->element('Textfield','data_scadenza')->label('Data di scadenza')->value($c->strdate($pagamento->data_scadenza)); $widget->element('Textfield','prezzo')->label('Importo pagato')->value($pagamento->prezzo); $widget->element('Hidden','iscr_id')->value($iscr_id || (defined $pag ? $pagamento->iscritto->id : '')); @@ -142,7 +142,7 @@ sub widget_for_pag { $widget->filter('TrimEdges','data_scadenza','data_pagamento','data_iscrizione','prezzo'); - $widget->constraint('All','data_scadenza','data_pagamento','data_iscrizione','prezzo')->messagge('Campo obbligatorio'); + $widget->constraint('All','data_scadenza','data_pagamento','data_iscrizione','prezzo')->message('Campo obbligatorio'); $widget->constraint('ISODate','data_scadenza','data_pagamento','data_iscrizione')->message('Data non valida'); $widget->constraint('EuroAmount','prezzo')->message('Prezzo non valido'); diff --git a/GroLUG/lib/HTML/Widget/Constraint/ISODate.pm b/GroLUG/lib/HTML/Widget/Constraint/ISODate.pm index f5680d2..9712d3b 100644 --- a/GroLUG/lib/HTML/Widget/Constraint/ISODate.pm +++ b/GroLUG/lib/HTML/Widget/Constraint/ISODate.pm @@ -10,9 +10,16 @@ my $format=DateTime::Format::Strptime->new(pattern=>'%F'); sub validate { my ($self,$value)=@_; - my $val=$format->parse_datetime($value); + my $ret=eval { + my $val=$format->parse_datetime($value); + return unless defined($val); - return defined($val); + my $round_tripped=$val->strftime('%F'); + + return ($value eq $round_tripped); + }; + return if $@; + return $ret; } 1; diff --git a/GroLUG/root/lib/site/header b/GroLUG/root/lib/site/header index 2c89e2f..df860d0 100644 --- a/GroLUG/root/lib/site/header +++ b/GroLUG/root/lib/site/header @@ -1,10 +1,10 @@

[% template.title or site.title %]

-

+

diff --git a/GroLUG/root/src/ttsite.css b/GroLUG/root/src/ttsite.css index e946a43..865a431 100644 --- a/GroLUG/root/src/ttsite.css +++ b/GroLUG/root/src/ttsite.css @@ -8,38 +8,70 @@ body { color: [% site.col.text %]; margin: 0px; padding: 0px; - height: 100%; } #header { background-color: [% site.col.head %]; border-bottom: 1px solid [% site.col.line %]; + position: fixed; top: 0; left: 0; + width: 100%; +} +#header ul { + list-style: none; + float: right; + margin-right: 1em; +} +#header ul li { + display: inline; +} +#header ul li a { + text-decoration: none; + color: black; + padding: 2px; + border: 1px dotted black; +} +#header ul li a:hover { + color: white; + background-color: black; } #footer { background-color: [% site.col.head %]; text-align: center; border-top: 1px solid [% site.col.line %]; - position: absolute; - bottom: 0; - left: 0px; + position: fixed; bottom: 0; left: 0; width: 100%; padding: 4px; } #content { padding: 10px; + padding-top: 5em; + padding-bottom: 2em; } h1.title { padding: 4px; margin: 0px; + float: left; } .message { color: [% site.col.message %]; } -.error { +.error, +.fields_with_errors, +.labels_with_errors, +.error_messages { color: [% site.col.error %]; } + +form label { + display: block; +} + +form label * { + vertical-align: top; + margin-left: 0.5em; +} \ No newline at end of file -- cgit v1.2.3