From 878ab666be73ffa07c28685593700dd8e53daecd Mon Sep 17 00:00:00 2001 From: Antonio de la Rosa Date: Mon, 31 Jul 2017 02:59:35 +0200 Subject: [PATCH] Fix in pokerform --- .../citoplasma/templates/forms/dateform.phtml | 14 +++++++------- paramecio/cromosoma/extrafields/datefield.py | 3 +++ paramecio/cromosoma/extraforms/dateform.py | 11 ++++++----- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/paramecio/citoplasma/templates/forms/dateform.phtml b/paramecio/citoplasma/templates/forms/dateform.phtml index 2dfc4a1..c8d746d 100644 --- a/paramecio/citoplasma/templates/forms/dateform.phtml +++ b/paramecio/citoplasma/templates/forms/dateform.phtml @@ -1,12 +1,12 @@ ${add_js_home_local('jquery.min.js', 'admin')} - - - + + + %if yes_time==True: - - - + + + % endif @@ -17,4 +17,4 @@ ${add_js_home_local('jquery.min.js', 'admin')} }); - \ No newline at end of file + diff --git a/paramecio/cromosoma/extrafields/datefield.py b/paramecio/cromosoma/extrafields/datefield.py index da52ec1..79a4619 100644 --- a/paramecio/cromosoma/extrafields/datefield.py +++ b/paramecio/cromosoma/extrafields/datefield.py @@ -1,5 +1,6 @@ from paramecio.cromosoma.corefields import PhangoField from paramecio.citoplasma import datetime +from paramecio.cromosoma.extraforms.dateform import DateForm class DateField(PhangoField): @@ -7,6 +8,8 @@ class DateField(PhangoField): super().__init__(name, size, required) + self.name_form=DateForm + self.utc=True def check(self, value): diff --git a/paramecio/cromosoma/extraforms/dateform.py b/paramecio/cromosoma/extraforms/dateform.py index 07109db..c3d0fda 100644 --- a/paramecio/cromosoma/extraforms/dateform.py +++ b/paramecio/cromosoma/extraforms/dateform.py @@ -11,6 +11,7 @@ class DateForm(BaseForm): super().__init__(name, value) self.yes_time=False + self.t=standard_t def form(self): @@ -23,15 +24,15 @@ class DateForm(BaseForm): time=format_timedata(self.default_value) - if time==True: + if time: y=int(time[0]) m=int(time[1]) d=int(time[2]) h=int(time[3]) - min=int(time[4]) + min_time=int(time[4]) s=int(time[5]) - - return standard_t.load_template('forms/dateform.phtml', yes_time=self.yes_time, form=self.name, y=y, m=m, d=d, h=h, min=min, s=s) + + return self.t.load_template('forms/dateform.phtml', yes_time=self.yes_time, form=self.name, y=y, m=m, d=d, h=h, min=min_time, s=s) #def - \ No newline at end of file +