Commit db8202ccfcea23f811ce59e2d3a518e3100a9100

Authored by Cédric RICARD
1 parent 94683f0a

Adding 'text_input_ro'

Removing 'label' tag when empty on check-boxes
Showing 1 changed file with 9 additions and 2 deletions   Show diff stats
calexium_lib/web/CXM_making_a_web_site.anubis
@@ -880,6 +880,7 @@ public type HTML_In_Form: @@ -880,6 +880,7 @@ public type HTML_In_Form:
880 private_download (String abs_path, String name, String extra_ext, 880 private_download (String abs_path, String name, String extra_ext,
881 Maybe((String,List((String,String)))) action), 881 Maybe((String,List((String,String)))) action),
882 text_input (String label_text, String label, String name, String init, Int32 width), 882 text_input (String label_text, String label, String name, String init, Int32 width),
  883 + text_input_ro (String label_text, String label, String name, String init, Int32 width),
883 password_input (String label_text, String label, String name, Int32 width), 884 password_input (String label_text, String label, String name, Int32 width),
884 text_area (List(TextAreaOption), String name, String init, Int32 width, Int32 height), 885 text_area (List(TextAreaOption), String name, String init, Int32 width, Int32 height),
885 file_upload (String name, Int32 width), 886 file_upload (String name, Int32 width),
@@ -3082,7 +3083,8 @@ define List(Cell_Option) @@ -3082,7 +3083,8 @@ define List(Cell_Option)
3082 if member(l,left) then l else 3083 if member(l,left) then l else
3083 if member(l,h_center) then l else 3084 if member(l,h_center) then l else
3084 if member(l,right) then l else 3085 if member(l,right) then l else
3085 - [left . l]. 3086 + //[left . l]. CR: why ? there is no default because we can use CSS
  3087 + l.
3086 3088
3087 3089
3088 Formating cells in a row. 3090 Formating cells in a row.
@@ -3501,6 +3503,10 @@ define Printable_tree @@ -3501,6 +3503,10 @@ define Printable_tree
3501 [ "<label for=\"",label,"\">",label_text,"</label>", 3503 [ "<label for=\"",label,"\">",label_text,"</label>",
3502 "<input type=text name=o",name," id=",label," size=",w," value=\"",i,"\">"], 3504 "<input type=text name=o",name," id=",label," size=",w," value=\"",i,"\">"],
3503 //["&nbsp; <input type=text name=o",n," size=",w," value=\"",i,"\">"], 3505 //["&nbsp; <input type=text name=o",n," size=",w," value=\"",i,"\">"],
  3506 + text_input_ro(label_text, label, name,i,w) then
  3507 + [ "<label for=\"",label,"\">",label_text,"</label>",
  3508 + "<input readonly=\"readonly\" type=text name=o",name," id=",label," size=",w," value=\"",i,"\">"],
  3509 + //["&nbsp; <input type=text name=o",n," size=",w," value=\"",i,"\">"],
3504 password_input(label_text, label, name,w) then 3510 password_input(label_text, label, name,w) then
3505 [ "<label for=\"",label,"\">",label_text,"</label>", 3511 [ "<label for=\"",label,"\">",label_text,"</label>",
3506 "<input type=password name=p",name," id=",label," size=",w,">"], 3512 "<input type=password name=p",name," id=",label," size=",w,">"],
@@ -3522,7 +3528,7 @@ define Printable_tree @@ -3522,7 +3528,7 @@ define Printable_tree
3522 [ "<label for=\"",label,"\">",label_text,"</label>", 3528 [ "<label for=\"",label,"\">",label_text,"</label>",
3523 "<input type=radio name=o",n," id=",label," value=\"",v,"\"",(if c then " checked" else ""),">"], 3529 "<input type=radio name=o",n," id=",label," value=\"",v,"\"",(if c then " checked" else ""),">"],
3524 check_box(label_text, label,n,c) then 3530 check_box(label_text, label,n,c) then
3525 - [ "<label for=\"",label,"\">",label_text,"</label>", 3531 + [ if length(label_text) > 0 then "<label for=\""+label+"\">"+label_text+"</label>" else "",
3526 "<input type=checkbox name=o",n," id=\"",label,"\""+(if c then " checked " else ""),">"] 3532 "<input type=checkbox name=o",n," id=\"",label,"\""+(if c then " checked " else ""),">"]
3527 div(options, e) then 3533 div(options, e) then
3528 format(cinfo,sn,ic_v,any_div(options, e),format_element,is_https), 3534 format(cinfo,sn,ic_v,any_div(options, e),format_element,is_https),
@@ -3582,6 +3588,7 @@ define Bool @@ -3582,6 +3588,7 @@ define Bool
3582 foreign_link(o,u,n) then false, 3588 foreign_link(o,u,n) then false,
3583 private_download(p,n,e,a) then false, 3589 private_download(p,n,e,a) then false,
3584 text_input(lt,l,n,i,w) then false, 3590 text_input(lt,l,n,i,w) then false,
  3591 + text_input_ro(lt,l,n,i,w) then false,
3585 password_input(lt,l,n,w) then false, 3592 password_input(lt,l,n,w) then false,
3586 text_area(o,n,i,w,h) then false, 3593 text_area(o,n,i,w,h) then false,
3587 file_upload(n,w) then true, 3594 file_upload(n,w) then true,