summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GroLUG/lib/GroLUG/C/Iscritto.pm8
-rw-r--r--GroLUG/lib/HTML/Widget/Constraint/ISODate.pm11
-rw-r--r--GroLUG/root/lib/site/header10
-rw-r--r--GroLUG/root/src/ttsite.css42
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 @@
<!-- BEGIN site/header -->
<h1 class="title">[% template.title or site.title %]</h1>
-<p>
+<ul class="nav">
[%- IF Catalyst.user_exists -%]
- <a href="[% Catalyst.uri_for('/logout') %]">logout</a>
+ <li><a href="[% Catalyst.uri_for('/logout') %]">logout</a></li>
[%- END %]
- <a href="[% Catalyst.uri_for('/iscritti') %]">elenco iscritti</a>
- <a href="[% Catalyst.uri_for('/cessati') %]">elenco iscritti cessati</a>
-</p>
+ <li><a href="[% Catalyst.uri_for('/iscritti') %]">elenco iscritti</a></li>
+ <li><a href="[% Catalyst.uri_for('/cessati') %]">elenco iscritti cessati</a></li>
+</ul>
<!-- END site/header -->
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