1
0
forked from ScoDoc/ScoDoc

Pour une poignée d'octets

This commit is contained in:
Emmanuel Viennet 2021-12-11 09:58:04 +01:00
parent 2cca1e9bbd
commit c2c1c5b5f2

View File

@ -334,7 +334,7 @@ class TF(object):
buttons_markup = "" buttons_markup = ""
if self.submitbutton: if self.submitbutton:
buttons_markup += ( buttons_markup += (
'<input type="submit" name="%s_submit" id="%s_submit" value="%s" %s/>' '<input type="submit" name="%s_submit" id="%s_submit" value="%s" %s>'
% ( % (
self.formid, self.formid,
self.formid, self.formid,
@ -344,7 +344,7 @@ class TF(object):
) )
if self.cancelbutton: if self.cancelbutton:
buttons_markup += ( buttons_markup += (
' <input type="submit" name="%s_cancel" id="%s_cancel" value="%s"/>' ' <input type="submit" name="%s_cancel" id="%s_cancel" value="%s">'
% (self.formid, self.formid, self.cancelbutton) % (self.formid, self.formid, self.cancelbutton)
) )
@ -364,7 +364,7 @@ class TF(object):
'<form action="%s" method="%s" id="%s" enctype="%s" name="%s" %s>' '<form action="%s" method="%s" id="%s" enctype="%s" name="%s" %s>'
% (self.form_url, self.method, self.formid, enctype, name, klass) % (self.form_url, self.method, self.formid, enctype, name, klass)
) )
R.append('<input type="hidden" name="%s_submitted" value="1"/>' % self.formid) R.append('<input type="hidden" name="%s_submitted" value="1">' % self.formid)
if self.top_buttons: if self.top_buttons:
R.append(buttons_markup + "<p></p>") R.append(buttons_markup + "<p></p>")
R.append('<table class="tf">') R.append('<table class="tf">')
@ -406,7 +406,7 @@ class TF(object):
else: else:
checked = "" checked = ""
lab.append( lab.append(
'<input type="checkbox" name="%s:list" value="%s" onclick="tf_enable_elem(this)" %s/>' '<input type="checkbox" name="%s:list" value="%s" onclick="tf_enable_elem(this)" %s>'
% ("tf-checked", field, checked) % ("tf-checked", field, checked)
) )
if title_bubble: if title_bubble:
@ -439,13 +439,13 @@ class TF(object):
add_no_enter_js = True add_no_enter_js = True
# lem.append('onchange="document.%s.%s.focus()"'%(name,nextitemname)) # lem.append('onchange="document.%s.%s.focus()"'%(name,nextitemname))
# lem.append('onblur="document.%s.%s.focus()"'%(name,nextitemname)) # lem.append('onblur="document.%s.%s.focus()"'%(name,nextitemname))
lem.append(('value="%(' + field + ')s" />') % values) lem.append(('value="%(' + field + ')s" >') % values)
elif input_type == "password": elif input_type == "password":
lem.append( lem.append(
'<input type="password" name="%s" id="%s" size="%d" %s' '<input type="password" name="%s" id="%s" size="%d" %s'
% (field, wid, size, attribs) % (field, wid, size, attribs)
) )
lem.append(('value="%(' + field + ')s" />') % values) lem.append(('value="%(' + field + ')s" >') % values)
elif input_type == "radio": elif input_type == "radio":
labels = descr.get("labels", descr["allowed_values"]) labels = descr.get("labels", descr["allowed_values"])
for i in range(len(labels)): for i in range(len(labels)):
@ -549,24 +549,24 @@ class TF(object):
if descr.get("type", "") == "list": if descr.get("type", "") == "list":
for v in values[field]: for v in values[field]:
lem.append( lem.append(
'<input type="hidden" name="%s:list" value="%s" %s />' '<input type="hidden" name="%s:list" value="%s" %s >'
% (field, v, attribs) % (field, v, attribs)
) )
else: else:
lem.append( lem.append(
'<input type="hidden" name="%s" id="%s" value="%s" %s />' '<input type="hidden" name="%s" id="%s" value="%s" %s >'
% (field, wid, values[field], attribs) % (field, wid, values[field], attribs)
) )
elif input_type == "separator": elif input_type == "separator":
pass pass
elif input_type == "file": elif input_type == "file":
lem.append( lem.append(
'<input type="file" name="%s" size="%s" value="%s" %s/>' '<input type="file" name="%s" size="%s" value="%s" %s>'
% (field, size, values[field], attribs) % (field, size, values[field], attribs)
) )
elif input_type == "date": # JavaScript widget for date input elif input_type == "date": # JavaScript widget for date input
lem.append( lem.append(
'<input type="text" name="%s" size="10" value="%s" class="datepicker"/>' '<input type="text" name="%s" size="10" value="%s" class="datepicker">'
% (field, values[field]) % (field, values[field])
) )
elif input_type == "text_suggest": elif input_type == "text_suggest":
@ -716,7 +716,7 @@ var {field}_as = new bsn.AutoSuggest('{field}', {field}_opts);
bool_val = 0 bool_val = 0
R.append(labels[bool_val]) R.append(labels[bool_val])
if bool_val: if bool_val:
R.append('<input type="hidden" name="%s" value="1"/>' % field) R.append('<input type="hidden" name="%s" value="1">' % field)
else: else:
labels = descr.get("labels", descr["allowed_values"]) labels = descr.get("labels", descr["allowed_values"])
for i in range(len(labels)): for i in range(len(labels)):