CVSROOT: /cvs/cluster Module name: conga Changes by: [EMAIL PROTECTED] 2007-09-26 14:10:48
Modified files: luci/storage : form-macros mappings_provider Log message: More page template cleanup and bug fixes Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/form-macros.diff?cvsroot=cluster&r1=1.29&r2=1.30 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/mappings_provider.diff?cvsroot=cluster&r1=1.8&r2=1.9 --- conga/luci/storage/form-macros 2007/09/25 22:47:05 1.29 +++ conga/luci/storage/form-macros 2007/09/26 14:10:48 1.30 @@ -244,9 +244,9 @@ <h2 tal:content="python:mappers_data['pretty_type'] + 's'" /> <span tal:condition="not: mappers_data/mappers"> - No <span tal:replace="mappers_data/pretty_type"/>s exist on <span tal:replace="storagename" />. + No <span tal:replace="mappers_data/pretty_type" />s exist on <span tal:replace="storagename" />. <br/> - Use the link on the left to create new <span tal:replace="mappers_data/pretty_type"/>. + Use the link on the left to create new <span tal:replace="mappers_data/pretty_type" />. </span> <ul class="tree" tal:condition="mappers_data/mappers"> @@ -263,7 +263,7 @@ <ul class="tree"> <li class="closed"> <div metal:use-macro="here/form-macros/macros/li-collapse-handler" /> - <span tal:replace="mapper/pretty_type"/> Properties: + <span tal:replace="mapper/pretty_type" /> Properties: <ul class="tree"> <li> <span tal:define=" @@ -343,9 +343,9 @@ </div> <div metal:define-macro="display-hard-drives"> - <h2 tal:content="mappers_data/pretty_type"/> + <h2 tal:content="mappers_data/pretty_type" /> <tal:block tal:condition="not: mappers_data/mappers"> - No <span tal:replace="mappers_data/pretty_type"/>s exist on <span tal:replace="storagename" />. + No <span tal:replace="mappers_data/pretty_type" />s exist on <span tal:replace="storagename" />. <br/> Use the link on the left to create new <span tal:replace="mappers_data/pretty_type" />. </tal:block> @@ -481,33 +481,26 @@ style="position:absolute; visibility: hidden; border: medium double red; color: red; background-color: white; text-align: left; width: 350px; "> </span> - <div tal:attributes=" - id mapper/mapper_id; - class string:visible"> + <div class="visible" tal:attributes="id mapper/mapper_id"> <div metal:use-macro="here/form-macros/macros/display-mapper" /> </div> <tal:block tal:repeat="bd_data mapper/targets"> - <div tal:attributes=" - id bd_data/path; - class string:invisible"> + <div class="invisible" tal:attributes="id bd_data/path"> <div metal:use-macro="here/form-macros/macros/display-BD" /> </div> </tal:block> <tal:block tal:repeat="bd_data mapper/new_targets"> - <div tal:attributes=" - id bd_data/path; - class string:invisible"> + <div class="invisible" tal:attributes="id bd_data/path"> <div metal:use-macro="here/form-macros/macros/display-BD" /> </div> </tal:block> <tal:block tal:repeat="bd_data mapper/sources"> - <div tal:define="displaying_source python:True" - tal:attributes=" - id bd_data/path; - class string:invisible"> + <div class="invisible" + tal:define="displaying_source python:True" + tal:attributes="id bd_data/path"> <div metal:use-macro="here/form-macros/macros/display-BD" /> </div> @@ -548,9 +541,7 @@ <form method="get" tal:attributes="id mapper_template_form_id"> - <input type="hidden" name="pagetype" - tal:attributes="value string:commit_changes" /> - + <input type="hidden" name="pagetype" value="commit_changes" /> <input type="hidden" name="object_type" value="mapper_template" /> <input type="hidden" name="mapper_type" tal:attributes="value mapper/mapper_type" /> @@ -592,7 +583,7 @@ <tr class="props-form-header"> <th> <span tal:condition="python:mapper['min_sources'] == mapper['max_sources']"> - Select <span tal:replace="mapper/min_sources"/> <span tal:replace="mapper/pretty_source_name" /> + Select <span tal:replace="mapper/min_sources" /> <span tal:replace="mapper/pretty_source_name" /> </span> <span tal:condition="python:mapper['min_sources'] != mapper['max_sources']"> Select <span tal:replace="mapper/min_sources" /> to <span tal:replace="mapper/max_sources" /> <span tal:replace="mapper/pretty_sources_name" /> @@ -689,7 +680,7 @@ <input type="hidden" name="object_type" value="add_sources" /> <input type="hidden" name="mapper_type" - tal:attributes="value mapper/mapper_type"/> + tal:attributes="value mapper/mapper_type" /> <input type="hidden" name="mapper_id" tal:attributes="value mapper/mapper_id" /> @@ -724,10 +715,10 @@ <table class="props-inner-table"> <th colspan="2"> <span tal:condition="python:len(mapper['new_sources']) == 1"> - Select <span tal:replace="mapper/pretty_source_name"/> to add + Select <span tal:replace="mapper/pretty_source_name" /> to add </span> <span tal:condition="python:len(mapper['new_sources']) > 1"> - Select one or more <span tal:replace="mapper/pretty_sources_name"/> to add + Select one or more <span tal:replace="mapper/pretty_sources_name" /> to add </span> </th> <tr tal:repeat="bd mapper/new_sources"> @@ -943,393 +934,369 @@ <div metal:define-macro="display-BD"> <div metal:use-macro="here/form-macros/macros/forms-css" /> - <span tal:omit-tag="" - tal:define="mapper string:; - conts python:bd_data['contents']; - prefix prefix|bd_data/path; - prefix python:prefix + '_'; - bd_form_id python:prefix + 'bd_form'; - select_content_id python:prefix + 'select_content_id'; - apply_button_id python:prefix + 'apply_button_id'; - form_submit_button_id apply_button_id; - content_span_id python:prefix + 'content_span_id'"> - - <form method="get" tal:attributes="id bd_form_id"> - <input tal:attributes="type string:hidden; - name string:pagetype; - value string:commit_changes"/> - - <input tal:condition="not: bd_data/new" - tal:attributes="type string:hidden; - name string:object_type; - value string:bd"/> - - <input tal:condition="bd_data/new" - tal:attributes="type string:hidden; - name string:object_type; - value string:bd_template"/> - - <input tal:attributes="type string:hidden; - name string:mapper_id; - value bd_data/mapper_id"/> - - <input tal:attributes="type string:hidden; - name string:mapper_type; - value bd_data/mapper_type"/> - - <input tal:attributes="type string:hidden; - name string:bd_path; - value bd_data/path"/> - - <input tal:attributes="type string:hidden; - name string:storagename; - value storagename"/> - - <table class="props-form-table"> - <tr class="props-form-header"> - <th colspan="2" - tal:attributes="style python:here.add_commas('font-size: large', 'color: ' + bd_data['color'])"> - <table> - <tr> - <td style="min-width: 30px;"> - <img tal:condition="bd_data/icon" - tal:attributes="src bd_data/icon" - height="29px" - width="29px"/> - </td> - <td style="width: 100%;"> - <span tal:omit-tag="" - tal:condition="not: bd_data/new"> - <span tal:replace="bd_data/pretty_type"/> '<span tal:replace="bd_data/pretty_name"/>' - <span tal:replace="bd_data/path"/> - <span tal:omit-tag="" - tal:condition="displaying_source|nothing"> - <br/> - <a tal:define="tmp_URL context/storage/index_html/absolute_url; - URL python:tmp_URL + '?storagename=' + storagename + '&pagetype=62'" - tal:attributes="href python:URL + '&mapper_type=' + bd_data['mapper_type'] + '&mapper_id=' + bd_data['mapper_id'] + '&bd_path=' + bd_data['path']" - style="font-size: xx-small;" - tal:content="python: 'Go to ' + bd_data['pretty_mapper_type'] + ' view'"></a> - </span> - </span> - <span tal:omit-tag="" - tal:condition="bd_data/new"> - <span tal:omit-tag="" - tal:condition="bd_data/pretty_name"> - <span tal:replace="bd_data/pretty_name"/> - - - </span> - Creating <span tal:replace="bd_data/pretty_type"/> - </span> - </td> - <td style="min-width: 30px;"> - - </td> - </tr> - </table> - </th> - </tr> - <tr class="props-form-body"> - <td> - <span tal:omit-tag="" - tal:define="props bd_data/props_ordered"> - <table class="props-inner-table"> - <div metal:use-macro="here/form-macros/macros/display-props-tableless"/> - </table> - </span> - </td> - <td style="height: 100%;"> - <span tal:omit-tag="" - tal:condition="not: conts"> - - </span> - <table class="props-form-table" - style="height: 100%;" - tal:condition="conts"> - <tr class="props-form-header"> - <th tal:attributes="style python:'color: ' + conts[0]['color']"> - <table style="width: 100%;"> - <tr> - <th style="min-width: 30px;"> - <img tal:condition="python:conts[0]['icon']" - tal:attributes="src python:conts[0]['icon']" - height="29px" - width="29px"/> - </th> - <td style="width: 100%;"> - Content<span tal:condition="python:len(conts) == 1" - tal:replace="string::"/> - <select tal:define="funct python:'change_content(\'' + select_content_id + '\', \'' + content_span_id + '\')'" - tal:condition="python:len(conts) > 1" - tal:attributes="id select_content_id; - name string:content_id; - onchange funct"> - <span tal:omit-tag="" tal:repeat="cont conts"> - <option tal:attributes="value cont/id"/><span tal:replace="cont/name"/> - </span> - </select> - - <span tal:define="cont python:conts[0]" - tal:condition="python:len(conts) == 1"> - <input tal:attributes="id select_content_id; - type string:hidden; - name string:content_id; - value cont/id"/> - <span tal:replace="cont/name"/> - </span> - <span tal:omit-tag="" - tal:define="cont python:conts[0]" - tal:condition="not: displaying_source|nothing"> - <span tal:condition="cont/is_source"> - <br/> - <a tal:define="tmp_URL context/storage/index_html/absolute_url; - URL python:tmp_URL + '?storagename=' + storagename + '&pagetype=52'" - tal:attributes="href python:URL + '&mapper_type=' + cont['mapper_type'] + '&mapper_id=' + cont['mapper_id']" - style="font-size: xx-small;" - tal:content="python: 'Go to ' + cont['pretty_mapper_type']"></a> - </span> - </span> - </td> - <td style="min-width: 30px;"> - - </td> - </tr> - </table> - </th> - </tr> - <tr class="props-form-body"> - <td> - <span tal:attributes="id content_span_id"> - <span tal:define="cont python:conts[0]" - tal:attributes="class string:visible; - id cont/id"> - <div metal:use-macro="here/form-macros/macros/display-content"/> - </span> - <span tal:omit-tag="" - tal:repeat="cont python:conts[1:]"> - <span tal:attributes="class string:invisible; - id cont/id"> - <div metal:use-macro="here/form-macros/macros/display-content"/> - </span> - </span> - </span> - </td> - </tr> - <tr class="props-form-footer"> - <td> - - </td> - </tr> - </table> - </td> - </tr> - <tr class="props-form-footer"> - <td colspan="2"> - <table style="width: 100%;"> - <tr> - <td align="left" - tal:define="actions bd_data/actions"> - <span tal:omit-tag="" - tal:repeat="action actions"> - <span tal:omit-tag="" - tal:define="act_name action/name; - act_msg action/msg; - act_link action/link"> - <span tal:condition="act_link"> - <input tal:define="act_link python:act_link + '&storagename=' + storagename; - funct python:'window.location.assign(\'' + act_link + '\')'" - tal:attributes="type string:button; - name string:action_type; - value act_name; - onclick funct" - class="form_button"/> - </span> - <span tal:condition="not: act_link"> - <input tal:condition="act_msg" - tal:attributes="type string:submit; - name string:action_type; - value act_name; - onclick python:'return confirm(\'' + act_msg + '\')'" - class="form_button"/> - <input tal:condition="not: act_msg" - tal:attributes="type string:submit; - name string:action_type; - value act_name" - class="form_button"/> - </span> - </span> - </span> - </td> - <td align="right" - tal:define="validate_url context/validate_html/absolute_url"> - <span tal:omit-tag="" - tal:condition="not: bd_data/need_apply_button"> - - </span> - <span tal:omit-tag="" - tal:condition="bd_data/need_apply_button"> - <input tal:attributes="type string:button; - name string:action_type; - value string:Reset; - onclick python:'return reset_bd_form(this.form, \'' + select_content_id + '\', \'' + content_span_id + '\')'" - class="form_button"/> - <input tal:condition="bd_data/new" - tal:define="prompt_msg python:'Do you really want to create ' + bd_data['pretty_type'] + '?'" - tal:attributes="id apply_button_id; - type string:button; - name string:action_type; - value string:Create; - onclick python:'return validate_and_submit_form(\'' + validate_url + '\', \'' + bd_form_id + '\', \'' + apply_button_id + '\', \'' + prompt_msg + '\')'" - class="form_button"/> - <input tal:condition="not: bd_data/new" - tal:define="prompt_msg python:'Do you really want to apply changes to ' + bd_data['pretty_type'] + ' \\\'' + bd_data['pretty_name'] + '\\\'?'" - tal:attributes="id apply_button_id; - type string:button; - name string:action_type; - value string:Apply; - onclick python:'return validate_and_submit_form(\'' + validate_url + '\', \'' + bd_form_id + '\', \'' + apply_button_id + '\', \'' + prompt_msg + '\')'" - class="form_button"/> - </span> - </td> - </tr> - </table> - </td> - </tr> - </table> - </form> - </span> + <tal:block tal:define="mapper string:; + conts python:bd_data['contents']; + prefix prefix|bd_data/path; + prefix python:prefix + '_'; + bd_form_id python:prefix + 'bd_form'; + select_content_id python:prefix + 'select_content_id'; + apply_button_id python:prefix + 'apply_button_id'; + form_submit_button_id apply_button_id; + content_span_id python:prefix + 'content_span_id'"> + + <form method="get" tal:attributes="id bd_form_id"> + <input type="hidden" name="pagetype" value="commit_changes" /> + <input tal:condition="not: bd_data/new" + type="hidden" name="object_type" value="bd" /> + + <input tal:condition="bd_data/new" + type="hidden" name="object_type" value="bd_template" /> + + <input type="hidden" name="mapper_id" + tal:attributes=" value bd_data/mapper_id" /> + + <input type="hidden" name="mapper_type" + tal:attributes="value bd_data/mapper_type" /> + + <input type="hidden" name="bd_path" + tal:attributes="value bd_data/path" /> + + <input type="hidden" name="storagename" + tal:attributes="value storagename" /> + + <table class="props-form-table"> + <tr class="props-form-header"> + <th colspan="2" + tal:attributes="style python:here.add_commas('font-size: large', 'color: ' + bd_data['color'])"> + <table> + <tr> + <td style="min-width: 30px;"> + <img tal:condition="bd_data/icon" + tal:attributes="src bd_data/icon" + height="29px" + width="29px" /> + </td> + <td style="width: 100%;"> + <tal:block tal:condition="not: bd_data/new"> + <span tal:replace="bd_data/pretty_type" /> '<span tal:replace="bd_data/pretty_name" />' - <span tal:replace="bd_data/path" /> + <tal:block tal:condition="displaying_source|nothing"> + <br/> + <a tal:define=" + tmp_URL context/storage/index_html/absolute_url; + URL python:tmp_URL + '?storagename=' + storagename + '&pagetype=62'" + tal:attributes=" + href python:URL + '&mapper_type=' + bd_data['mapper_type'] + '&mapper_id=' + bd_data['mapper_id'] + '&bd_path=' + bd_data['path']" + style="font-size: xx-small;" + tal:content=" + python: 'Go to ' + bd_data['pretty_mapper_type'] + ' view'"> + </a> + </tal:block> + </tal:block> + + <tal:block tal:condition="bd_data/new"> + <tal:block tal:condition="bd_data/pretty_name"> + <span tal:replace="bd_data/pretty_name" /> + - + Creating <span tal:replace="bd_data/pretty_type" /> + </tal:block> + </tal:block> + </td> + <td style="min-width: 30px;"> </td> + </tr> + </table> + </th> + </tr> + <tr class="props-form-body"> + <td> + <tal:block tal:define="props bd_data/props_ordered"> + <table class="props-inner-table"> + <div metal:use-macro="here/form-macros/macros/display-props-tableless" /> + </table> + </tal:block> + </td> + <td style="height: 100%;"> + <tal:block tal:condition="not: conts"> + + </tal:block> + + <table tal:condition="conts" + class="props-form-table" style="height: 100%;"> + + <tr class="props-form-header"> + <th tal:attributes=" + style python:'color: ' + conts[0]['color']"> + <table style="width: 100%;"> + <tr> + <th style="min-width: 30px;"> + <img + tal:condition=" + python:conts[0]['icon']" + tal:attributes=" + src python:conts[0]['icon']" + height="29px" + width="29px" /> + </th> + <td style="width: 100%;"> + Content<span tal:condition="python:len(conts) == 1" tal:replace="string::" /> + + <select name="content_id" + tal:define="funct python:'change_content(\'' + select_content_id + '\', \'' + content_span_id + '\')'" + tal:condition="python:len(conts) > 1" + tal:attributes=" + id select_content_id; + onchange funct"> + <option tal:repeat="cont conts" + tal:attributes=" + value cont/id" + tal:content="cont/name" /> + </select> + + <span tal:define="cont python:conts[0]" tal:condition="python:len(conts) == 1"> + <input type="hidden" + name="content_id" + tal:attributes=" + id select_content_id; + value cont/id" /> + <span tal:replace="cont/name" /> + </span> + <tal:block tal:define="cont python:conts[0]" tal:condition="not: displaying_source|nothing"> + <span tal:condition="cont/is_source"> + <br/> + <a tal:define=" + tmp_URL context/storage/index_html/absolute_url; + URL python:tmp_URL + '?storagename=' + storagename + '&pagetype=52'" + tal:attributes=" + href python:URL + '&mapper_type=' + cont['mapper_type'] + '&mapper_id=' + cont['mapper_id']" + style="font-size: xx-small;" + tal:content="python: 'Go to ' + cont['pretty_mapper_type']" /> + </span> + </tal:block> + </td> + <td style="min-width: 30px;"> + + </td> + </tr> + </table> + </th> + </tr> + <tr class="props-form-body"> + <td> + <span tal:attributes="id content_span_id"> + <span class="visible" + tal:define="cont python:conts[0]" + tal:attributes="id cont/id"> + <div metal:use-macro="here/form-macros/macros/display-content" /> + </span> + <tal:block tal:repeat="cont python:conts[1:]"> + <span class="invisible" + tal:attributes="id cont/id"> + <div metal:use-macro="here/form-macros/macros/display-content" /> + </span> + </tal:block> + </span> + </td> + </tr> + <tr class="props-form-footer"> + <td> + + </td> + </tr> + </table> + </td> + </tr> + <tr class="props-form-footer"> + <td colspan="2"> + <table style="width: 100%;"> + <tr> + <td align="left" tal:define="actions bd_data/actions"> + <tal:block tal:repeat="action actions"> + <tal:block + tal:define=" + act_name action/name; + act_msg action/msg; + act_link action/link"> + <span tal:condition="act_link"> + <input class="form_button" + type="button" name="action_type" + tal:define=" + act_link python:act_link + '&storagename=' + storagename; + funct python:'window.location.assign(\'' + act_link + '\')'" + tal:attributes=" + value act_name; + onclick funct" /> + + </span> + <span tal:condition="not: act_link"> + <input tal:condition="act_msg" + type="submit" name="action_type" + class="form_button" + tal:attributes=" + value act_name; + onclick python:'return confirm(\'' + act_msg + '\')'" /> + <input tal:condition="not: act_msg" + type="submit" name="action_type" + class="form_button" + tal:attributes="value act_name" /> + </span> + </tal:block> + </tal:block> + </td> + <td align="right" + tal:define="validate_url context/validate_html/absolute_url"> + <tal:block tal:condition="not: bd_data/need_apply_button"> + + </tal:block> + <tal:block tal:condition="bd_data/need_apply_button"> + <input type="button" name="action_type" + value="Reset" class="form_button" + tal:attributes=" + onclick python:'return reset_bd_form(this.form, \'' + select_content_id + '\', \'' + content_span_id + '\')'" /> + + <input tal:condition="bd_data/new" + type="button" name="action_type" + value="Create" class="form_button" + tal:define="prompt_msg python:'Do you really want to create ' + bd_data['pretty_type'] + '?'" + tal:attributes=" + id apply_button_id; + onclick python:'return validate_and_submit_form(\'' + validate_url + '\', \'' + bd_form_id + '\', \'' + apply_button_id + '\', \'' + prompt_msg + '\')'" /> + + <input tal:condition="not: bd_data/new" + type="button" name="action_type" + value="Apply" class="form_button" + tal:define="prompt_msg python:'Do you really want to apply changes to ' + bd_data['pretty_type'] + ' \\\'' + bd_data['pretty_name'] + '\\\'?'" + tal:attributes=" + id apply_button_id; + onclick python:'return validate_and_submit_form(\'' + validate_url + '\', \'' + bd_form_id + '\', \'' + apply_button_id + '\', \'' + prompt_msg + '\')'" /> + </tal:block> + </td> + </tr> + </table> + </td> + </tr> + </table> + </form> + </tal:block> </div> <div metal:define-macro="display-mapper"> <div metal:use-macro="here/form-macros/macros/forms-css" /> - <form tal:define="prefix prefix|mapper/mapper_id; - prefix python:prefix + '_'; - mapper_form_id python:prefix + 'mapper_form_id'; - apply_button_id python:prefix + 'apply_button_id'; - form_submit_button_id apply_button_id" - tal:attributes="id mapper_form_id; - method string:get"> - - <input tal:attributes="type string:hidden; - name string:pagetype; - value string:commit_changes"/> - - <input tal:attributes="type string:hidden; - name string:object_type; - value string:mapper"/> - - <input tal:attributes="type string:hidden; - name string:mapper_id; - value mapper/mapper_id"/> - - <input tal:attributes="type string:hidden; - name string:mapper_type; - value mapper/mapper_type"/> - - <input tal:attributes="type string:hidden; - name string:storagename; - value storagename"/> - - <table class="props-form-table"> - <tr class="props-form-header"> - <th colspan="2" - tal:attributes="style python:here.add_commas('font-size: large', 'color: ' + mapper['color'])"> - <table> - <tr> - <td style="min-width: 30px;"> - <img tal:condition="mapper/icon" - tal:attributes="src mapper/icon" - height="29px" - width="29px"/> - </td> - <td style="width: 100%;"> - <span tal:replace="mapper/pretty_type"/> '<span tal:replace="mapper/pretty_name"/>' - </td> - <td style="min-width: 30px;"> - - </td> - </tr> - </table> - </th> - </tr> - <tr class="props-form-body"> - <td> - <table class="props-inner-table" - tal:define="props mapper/props_ordered"> - <div metal:use-macro="here/form-macros/macros/display-props-tableless"/> - </table> - </td> - <td style="height: 100%;"> - - </td> - </tr> - <tr class="props-form-footer"> - <td colspan="2"> - <table style="width: 100%;"> - <tr> - <td align="left"> - <span tal:omit-tag="" - tal:define="actions mapper/actions" - tal:repeat="action actions"> - <span tal:define="act_name action/name; - act_msg action/msg; - act_link action/link" - align="left"> - <span tal:condition="act_link"> - <input tal:define="act_link python:act_link + '&storagename=' + storagename; - funct python:'window.location.assign(\'' + act_link + '\')'" - tal:attributes="type string:button; - name string:action_type; - value act_name; - onclick funct" - class="form_button"/> - </span> - <span tal:condition="not: act_link"> - <input tal:condition="act_msg" - tal:attributes="type string:submit; - name string:action_type; - value act_name; - onclick python:'return confirm(\'' + act_msg + '\')'" - class="form_button"/> - <input tal:condition="not: act_msg" - tal:attributes="type string:submit; - name string:action_type; - value act_name" - class="form_button"/> - </span> - </span> - </span> - </td> - <td align="right"> - <span tal:omit-tag="" - tal:condition="not: mapper/need_apply_button"> - - </span> - <span tal:omit-tag="" - tal:condition="mapper/need_apply_button"> - <input type="button" - name="action_type" - value="Reset" - onclick="return reset_form(this.form)" - class="form_button"/> - - <input tal:define=" - prompt_msg python:'Do you really want to apply changes to ' + mapper['pretty_type'] + ' \\\'' + mapper['pretty_name'] + '\\\'?'; - validate_url context/validate_html/absolute_url" - tal:attributes="id apply_button_id; - type string:button; - name string:action_type; - value string:Apply; - onclick python:'return validate_and_submit_form(\'' + validate_url + '\', \'' + mapper_form_id + '\', \'' + apply_button_id + '\', \'' + prompt_msg + '\')'" - class="form_button"/> - </span> - </td> - </tr> - </table> - </td> - </tr> - </table> - </form> + <form method="get" + tal:define=" + prefix prefix|mapper/mapper_id; + prefix python:prefix + '_'; + mapper_form_id python:prefix + 'mapper_form_id'; + apply_button_id python:prefix + 'apply_button_id'; + form_submit_button_id apply_button_id" + tal:attributes="id mapper_form_id"> + + <input type="hidden" name="pagetype" value="commit_changes" /> + <input type="hidden" name="object_type" value="mapper" /> + + <input type="hidden" name="mapper_id" + tal:attributes="value mapper/mapper_id" /> + + <input type="hidden" name="mapper_type" + tal:attributes="value mapper/mapper_type" /> + + <input type="hidden" name="storagename" + tal:attributes="value storagename" /> + + <table class="props-form-table"> + <tr class="props-form-header"> + <th colspan="2" tal:attributes="style python:here.add_commas('font-size: large', 'color: ' + mapper['color'])"> + <table> + <tr> + <td style="min-width: 30px;"> + <img tal:condition="mapper/icon" + tal:attributes="src mapper/icon" + height="29px" + width="29px" /> + </td> + <td style="width: 100%;"> + <span tal:replace="mapper/pretty_type" /> '<span tal:replace="mapper/pretty_name" />' + </td> + <td style="min-width: 30px;"> + + </td> + </tr> + </table> + </th> + </tr> + <tr class="props-form-body"> + <td> + <table class="props-inner-table" + tal:define="props mapper/props_ordered"> + <div metal:use-macro="here/form-macros/macros/display-props-tableless" /> + </table> + </td> + <td style="height: 100%;"> + + </td> + </tr> + <tr class="props-form-footer"> + <td colspan="2"> + <table style="width: 100%;"> + <tr> + <td align="left"> + <tal:block tal:define="actions mapper/actions" + tal:repeat="action actions"> + <span align="left" + tal:define=" + act_name action/name; + act_msg action/msg; + act_link action/link"> + <span tal:condition="act_link"> + <input type="button" name="action_type" + tal:define=" + act_link python:act_link + '&storagename=' + storagename; + funct python:'window.location.assign(\'' + act_link + '\')'" + tal:attributes=" + value act_name; + onclick funct" + class="form_button" /> + </span> + <span tal:condition="not: act_link"> + <input tal:condition="act_msg" + type="submit" name="action_type" + tal:attributes=" + value act_name; + onclick python:'return confirm(\'' + act_msg + '\')'" + class="form_button" /> + <input tal:condition="not: act_msg" + type="submit" name="action_type" + class="form_button" + tal:attributes="value act_name" /> + </span> + </span> + </tal:block> + </td> + <td align="right"> + <tal:block tal:condition="not: mapper/need_apply_button"> + + </tal:block> + <tal:block tal:condition="mapper/need_apply_button"> + <input type="button" name="action_type" + value="Reset" + onclick="return reset_form(this.form)" + class="form_button" /> + + <input type="button" name="action_type" + value="Apply" class="form_button" + tal:define=" + prompt_msg python:'Do you really want to apply changes to ' + mapper['pretty_type'] + ' \\\'' + mapper['pretty_name'] + '\\\'?'; + validate_url context/validate_html/absolute_url" + tal:attributes=" + id apply_button_id; + onclick python:'return validate_and_submit_form(\'' + validate_url + '\', \'' + mapper_form_id + '\', \'' + apply_button_id + '\', \'' + prompt_msg + '\')'" /> + </tal:block> + </td> + </tr> + </table> + </td> + </tr> + </table> + </form> </div> </body> --- conga/luci/storage/mappings_provider 2007/09/25 18:55:13 1.8 +++ conga/luci/storage/mappings_provider 2007/09/26 14:10:48 1.9 @@ -44,134 +44,134 @@ </style> </head> -<span tal:omit-tag="" - tal:define="default_sel request/selected_path|nothing; - global default_selection_c python:''" - tal:condition="default_sel"> - <span tal:omit-tag="" - tal:define="global default_selection_c python:'select_subcyl(\'' + default_sel + '\', ' + mapp_info['js'] + ')'"/> -</span> - -<body tal:define="onload_c python:'properties_span_id = \'' + mapper['mapper_id'] + '_properties_span_id\''; - onload_c python:here.add_commas(onload_c, 'current_selection = \'' + mapp_info['mapper']['mapper_id'] + '\''); - onload_c python:here.add_commas(onload_c, 'display_props(' + mapp_info['js'] + ')'); - onload_c python:here.add_commas(onload_c, default_selection_c)" - tal:attributes="onload onload_c"> - - - - +<tal:block tal:condition="default_sel" + tal:define=" + default_sel request/selected_path|nothing; + global default_selection_c python:''"> + + <tal:block tal:define="global default_selection_c python:'select_subcyl(\'' + default_sel + '\', ' + mapp_info['js'] + ')'" /> +</tal:block> + +<body + tal:define=" + onload_c python:'properties_span_id = \'' + mapper['mapper_id'] + '_properties_span_id\''; + onload_c python:here.add_commas(onload_c, 'current_selection = \'' + mapp_info['mapper']['mapper_id'] + '\''); + onload_c python:here.add_commas(onload_c, 'display_props(' + mapp_info['js'] + ')'); + onload_c python:here.add_commas(onload_c, default_selection_c)" + tal:attributes="onload onload_c"> <div> - - - - - - - <!-- upper cylinder --> - <div tal:define="cyl mapp_info/upper_cyl; - X_offset python:X_offset + cyl['offset']" - tal:condition="cyl/cyls" - tal:attributes="style python:here.add_commas('position:absolute', here.add_commas('left: ' + str(X_offset), 'top: ' + str(Y_offset)))"> - - <!-- description --> - <div tal:define="style_1 python:here.add_commas('left: -1em', 'top: -1.5ex'); - style_2 python:here.add_commas(style_1, 'position: absolute'); - style_3 python:here.add_commas(style_2, 'width: ' + str(cyl_width))" - tal:attributes="style style_3"> - <div tal:define="style_1 python:here.add_commas('font-size: xx-small', 'text-align: left'); - style_2 python:here.add_commas(style_1, 'white-space: nowrap'); - style_3 python:here.add_commas(style_2, 'color: ' + cyl['color_css'])" - tal:attributes="style style_3"> - <span tal:replace="cyl/description"/>: - </div> - </div> - - <div tal:define="one_temp_assignment python:here.add_commas('position:absolute', here.add_commas('left: ' + str(curve_width), 'top: 0'))" - tal:attributes="onmousedown python:'cyl_click(event.clientX-' + str(curve_width) + '-' + str(X_offset) + ', event.clientY-' + str(Y_offset) + ', ' + cyl['js'] + ', ' + mapp_info['js'] + ')'; - onmousemove python:'cyl_over(document.getElementById(\'upper_msg_board\'), event.clientX-' + str(curve_width) + '-' + str(X_offset) + ', event.clientY-' + str(Y_offset) + ', ' + cyl['js'] + ', ' + mapp_info['js'] + ')'; - onmouseout python:'document.getElementById(\'upper_msg_board\').style.visibility = \'hidden\''; - style python:here.add_commas('cursor: pointer', one_temp_assignment); - id string:upper_cylinder"> - - <!-- base --> - <div metal:use-macro="here/mappings_macros/macros/draw-base-cyl"/> - - <!-- highlights --> - <span tal:omit-tag="" - tal:define="highs cyl/highs"> - <div metal:use-macro="here/mappings_macros/macros/draw-highlights"/> - </span> - - <div id="upper_msg_board" - style="position: absolute; border: 2px solid black; padding: 2px; background-color: lightyellow; visibility: hidden; z-index: 100; white-space: nowrap; font-size: small;"> - </div> - - </div> - </div> - - - <!-- lower cylinder --> - <div tal:define="cyl mapp_info/lower_cyl; - lower_Y_offset python:Y_offset + 80; - X_offset python:X_offset + cyl['offset']" - tal:condition="cyl/cyls" - tal:attributes="style python:here.add_commas('position:absolute', here.add_commas('left: ' + str(X_offset), 'top: ' + str(lower_Y_offset)))"> - - <!-- description --> - <div tal:define="style_1 python:here.add_commas('left: -1em', 'top: -1.5ex'); - style_2 python:here.add_commas(style_1, 'position: absolute'); - style_3 python:here.add_commas(style_2, 'width: ' + str(cyl_width))" - tal:attributes="style style_3"> - <div tal:define="style_1 python:here.add_commas('font-size: xx-small', 'text-align: left'); - style_2 python:here.add_commas(style_1, 'white-space: nowrap'); - style_3 python:here.add_commas(style_2, 'color: ' + cyl['color_css'])" - tal:attributes="style style_3"> - <span tal:replace="cyl/description"/>: - </div> - </div> - - <div tal:define="one_temp_assignment python:here.add_commas('position:absolute', here.add_commas('left: ' + str(curve_width), 'top: 0'))" - tal:attributes="onmousedown python:'cyl_click(event.clientX-' + str(curve_width) + '-' + str(X_offset) + ', event.clientY-' + str(lower_Y_offset) + ', ' + cyl['js'] + ', ' + mapp_info['js'] + ')'; - onmousemove python:'cyl_over(document.getElementById(\'lower_msg_board\'), event.clientX-' + str(curve_width) + '-' + str(X_offset) + ', event.clientY-' + str(lower_Y_offset) + ', ' + cyl['js'] + ', ' + mapp_info['js'] + ')'; - onmouseout python:'document.getElementById(\'lower_msg_board\').style.visibility = \'hidden\''; - style python:here.add_commas('cursor: pointer', one_temp_assignment); - id string:lower_cylinder"> - - <!-- base --> - <div metal:use-macro="here/mappings_macros/macros/draw-base-cyl"/> - - <!-- highlights --> - <span tal:omit-tag="" tal:define="highs cyl/highs"> - <div metal:use-macro="here/mappings_macros/macros/draw-highlights"/> - </span> - - <div id="lower_msg_board" - style="position: absolute; border: 2px solid black; padding: 2px; background-color: lightyellow; visibility: hidden; z-index: 100; white-space: nowrap; font-size: small;"> - </div> - - </div> - </div> - - - <!-- select me message --> - <div tal:define="cyl mapp_info/lower_cyl; - Y_offset python:Y_offset + 80 + 40 + 10; - X_offset python:X_offset; - style_1 python:here.add_commas('left: ' + str(X_offset), 'top: ' + str(Y_offset)); - style_2 python:here.add_commas('position: absolute', style_1); - style_3 python:here.add_commas(style_2, 'width: ' + str(cyl_width))" - tal:attributes="style style_3"> - <div style="font-size: x-small; text-align: center;"> - Click cylinders to view properties, unselect all to view <span tal:replace="mapper/pretty_type"/>'s properties - </div> - </div> - - + <!-- upper cylinder --> + <div tal:condition="cyl/cyls" + tal:define=" + cyl mapp_info/upper_cyl; + X_offset python:X_offset + cyl['offset']" + tal:attributes=" + style python:here.add_commas('position:absolute', here.add_commas('left: ' + str(X_offset), 'top: ' + str(Y_offset)))"> + + <!-- description --> + <div + tal:define=" + style_1 python:here.add_commas('left: -1em', 'top: -1.5ex'); + style_2 python:here.add_commas(style_1, 'position: absolute'); + style_3 python:here.add_commas(style_2, 'width: ' + str(cyl_width))" + tal:attributes="style style_3"> + <div + tal:define=" + style_1 python:here.add_commas('font-size: xx-small', 'text-align: left'); + style_2 python:here.add_commas(style_1, 'white-space: nowrap'); + style_3 python:here.add_commas(style_2, 'color: ' + cyl['color_css'])" + tal:attributes="style style_3"> + <span tal:replace="cyl/description" />: + </div> + </div> + + <div tal:define="one_temp_assignment python:here.add_commas('position:absolute', here.add_commas('left: ' + str(curve_width), 'top: 0'))" + tal:attributes=" + onmousedown python:'cyl_click(event.clientX-' + str(curve_width) + '-' + str(X_offset) + ', event.clientY-' + str(Y_offset) + ', ' + cyl['js'] + ', ' + mapp_info['js'] + ')'; + onmousemove python:'cyl_over(document.getElementById(\'upper_msg_board\'), event.clientX-' + str(curve_width) + '-' + str(X_offset) + ', event.clientY-' + str(Y_offset) + ', ' + cyl['js'] + ', ' + mapp_info['js'] + ')'; + onmouseout python:'document.getElementById(\'upper_msg_board\').style.visibility = \'hidden\''; + style python:here.add_commas('cursor: pointer', one_temp_assignment); + id string:upper_cylinder"> + + <!-- base --> + <div metal:use-macro="here/mappings_macros/macros/draw-base-cyl" /> + + <!-- highlights --> + <tal:block tal:define="highs cyl/highs"> + <div metal:use-macro="here/mappings_macros/macros/draw-highlights" /> + </tal:block> + + <div id="upper_msg_board" style="position: absolute; border: 2px solid black; padding: 2px; background-color: lightyellow; visibility: hidden; z-index: 100; white-space: nowrap; font-size: small;"> + </div> + </div> + </div> + + <!-- lower cylinder --> + <div tal:condition="cyl/cyls" + tal:define=" + cyl mapp_info/lower_cyl; + lower_Y_offset python:Y_offset + 80; + X_offset python:X_offset + cyl['offset']" + tal:attributes="style python:here.add_commas('position:absolute', here.add_commas('left: ' + str(X_offset), 'top: ' + str(lower_Y_offset)))"> + + <!-- description --> + <div + tal:define=" + style_1 python:here.add_commas('left: -1em', 'top: -1.5ex'); + style_2 python:here.add_commas(style_1, 'position: absolute'); + style_3 python:here.add_commas(style_2, 'width: ' + str(cyl_width))" + tal:attributes="style style_3"> + <div + tal:define=" + style_1 python:here.add_commas('font-size: xx-small', 'text-align: left'); + style_2 python:here.add_commas(style_1, 'white-space: nowrap'); + style_3 python:here.add_commas(style_2, 'color: ' + cyl['color_css'])" + tal:attributes="style style_3"> + <span tal:replace="cyl/description" />: + </div> + </div> + + <div + tal:define="one_temp_assignment python:here.add_commas('position:absolute', here.add_commas('left: ' + str(curve_width), 'top: 0'))" + tal:attributes=" + onmousedown python:'cyl_click(event.clientX-' + str(curve_width) + '-' + str(X_offset) + ', event.clientY-' + str(lower_Y_offset) + ', ' + cyl['js'] + ', ' + mapp_info['js'] + ')'; + onmousemove python:'cyl_over(document.getElementById(\'lower_msg_board\'), event.clientX-' + str(curve_width) + '-' + str(X_offset) + ', event.clientY-' + str(lower_Y_offset) + ', ' + cyl['js'] + ', ' + mapp_info['js'] + ')'; + onmouseout python:'document.getElementById(\'lower_msg_board\').style.visibility = \'hidden\''; + style python:here.add_commas('cursor: pointer', one_temp_assignment); + id string:lower_cylinder"> + + <!-- base --> + <div metal:use-macro="here/mappings_macros/macros/draw-base-cyl" /> + + <!-- highlights --> + <tal:block tal:define="highs cyl/highs"> + <div metal:use-macro="here/mappings_macros/macros/draw-highlights" /> + </tal:block> + + <div id="lower_msg_board" + style="position: absolute; border: 2px solid black; padding: 2px; background-color: lightyellow; visibility: hidden; z-index: 100; white-space: nowrap; font-size: small;"> + </div> + </div> + </div> + + + <!-- select me message --> + <div + tal:define=" + cyl mapp_info/lower_cyl; + Y_offset python:Y_offset + 80 + 40 + 10; + X_offset python:X_offset; + style_1 python:here.add_commas('left: ' + str(X_offset), 'top: ' + str(Y_offset)); + style_2 python:here.add_commas('position: absolute', style_1); + style_3 python:here.add_commas(style_2, 'width: ' + str(cyl_width))" + tal:attributes="style style_3"> + <div style="font-size: x-small; text-align: center;"> + Click cylinders to view properties, unselect all to view <span tal:replace="mapper/pretty_type"/>'s properties + </div> + </div> </div> - </body> </html>