From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] conga/luci cluster/form-chooser cluster/form-m ...
Date: 25 Sep 2007 22:47:07 -0000 [thread overview]
Message-ID: <20070925224707.12118.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2007-09-25 22:47:05
Modified files:
luci/cluster : form-chooser form-macros resource-form-macros
luci/homebase : form-chooser form-macros luci_homebase.css
luci/plone-custom: sys_svc.css
luci/storage : cylinder_select.js form-macros
storage_probing.js storage_utils.js
storage_validation.js validate_html
Log message:
More cleanup and fix some javascript bugs
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-chooser.diff?cvsroot=cluster&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.213&r2=1.214
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&r1=1.42&r2=1.43
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/form-chooser.diff?cvsroot=cluster&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/form-macros.diff?cvsroot=cluster&r1=1.61&r2=1.62
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/homebase/luci_homebase.css.diff?cvsroot=cluster&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/plone-custom/sys_svc.css.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/cylinder_select.js.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/form-macros.diff?cvsroot=cluster&r1=1.28&r2=1.29
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/storage_probing.js.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/storage_utils.js.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/storage_validation.js.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/storage/validate_html.diff?cvsroot=cluster&r1=1.6&r2=1.7
--- conga/luci/cluster/form-chooser 2007/08/08 21:00:06 1.19
+++ conga/luci/cluster/form-chooser 2007/09/25 22:47:05 1.20
@@ -1,3 +1,12 @@
+<tal:comment tal:replace="nothing">
+** Copyright (C) 2006-2007 Red Hat, Inc.
+**
+** This program is free software; you can redistribute
+** it and/or modify it under the terms of version 2 of the
+** GNU General Public License as published by the
+** Free Software Foundation.
+</tal:comment>
+
<html>
<head>
<title tal:content="string:"></title>
--- conga/luci/cluster/form-macros 2007/09/25 03:51:02 1.213
+++ conga/luci/cluster/form-macros 2007/09/25 22:47:05 1.214
@@ -1,3 +1,12 @@
+<tal:comment tal:replace="nothing">
+** Copyright (C) 2006-2007 Red Hat, Inc.
+**
+** This program is free software; you can redistribute
+** it and/or modify it under the terms of version 2 of the
+** GNU General Public License as published by the
+** Free Software Foundation.
+</tal:comment>
+
<html>
<head>
--- conga/luci/cluster/resource-form-macros 2007/09/25 03:51:02 1.42
+++ conga/luci/cluster/resource-form-macros 2007/09/25 22:47:05 1.43
@@ -1,3 +1,12 @@
+<tal:comment tal:replace="nothing">
+** Copyright (C) 2006-2007 Red Hat, Inc.
+**
+** This program is free software; you can redistribute
+** it and/or modify it under the terms of version 2 of the
+** GNU General Public License as published by the
+** Free Software Foundation.
+</tal:comment>
+
<html>
<head>
<title tal:content="template/title">The title</title>
--- conga/luci/homebase/form-chooser 2006/11/01 23:04:17 1.11
+++ conga/luci/homebase/form-chooser 2007/09/25 22:47:05 1.12
@@ -1,3 +1,12 @@
+<tal:comment tal:replace="nothing">
+** Copyright (C) 2006-2007 Red Hat, Inc.
+**
+** This program is free software; you can redistribute
+** it and/or modify it under the terms of version 2 of the
+** GNU General Public License as published by the
+** Free Software Foundation.
+</tal:comment>
+
<html>
<head>
--- conga/luci/homebase/form-macros 2007/09/25 03:51:21 1.61
+++ conga/luci/homebase/form-macros 2007/09/25 22:47:05 1.62
@@ -1,3 +1,12 @@
+<tal:comment tal:replace="nothing">
+** Copyright (C) 2006-2007 Red Hat, Inc.
+**
+** This program is free software; you can redistribute
+** it and/or modify it under the terms of version 2 of the
+** GNU General Public License as published by the
+** Free Software Foundation.
+</tal:comment>
+
<html>
<head>
--- conga/luci/homebase/luci_homebase.css 2007/09/25 03:51:21 1.43
+++ conga/luci/homebase/luci_homebase.css 2007/09/25 22:47:05 1.44
@@ -1,3 +1,12 @@
+/*
+** Copyright (C) 2006-2007 Red Hat, Inc.
+**
+** This program is free software; you can redistribute
+** it and/or modify it under the terms of version 2 of the
+** GNU General Public License as published by the
+** Free Software Foundation.
+*/
+
input[type=text], input[type=password] {
padding: .2em ! important;
font-family: "Bitstream Vera Sans Mono", "DejaVu Sans Mono", monospace;
--- conga/luci/plone-custom/sys_svc.css 2007/06/28 16:02:50 1.1
+++ conga/luci/plone-custom/sys_svc.css 2007/09/25 22:47:05 1.2
@@ -1,3 +1,12 @@
+/*
+** Copyright (C) 2007 Red Hat, Inc.
+**
+** This program is free software; you can redistribute
+** it and/or modify it under the terms of version 2 of the
+** GNU General Public License as published by the
+** Free Software Foundation.
+*/
+
input[type=image] {
border: 0;
background: transparent;
--- conga/luci/storage/cylinder_select.js 2007/09/25 18:55:13 1.3
+++ conga/luci/storage/cylinder_select.js 2007/09/25 22:47:05 1.4
@@ -58,12 +58,12 @@
}
}
- parent = top.document.getElementById(properties_span_id);
+ var parent_elem = top.document.getElementById(properties_span_id);
- for (var i = 0 ; i < parent.childNodes.length ; i++) {
- var item = parent.childNodes[i];
+ for (var i = 0 ; i < parent_elem.childNodes.length ; i++) {
+ var item = parent_elem.childNodes[i];
var item_type = item.nodeName.toLowerCase();
- if (item_type == 'span' || item.type == 'div') {
+ if (item_type == 'span' || item_type == 'div') {
if (item.id == current_selection) {
item.className = 'visible';
} else if (item.className == 'visible') {
@@ -86,7 +86,7 @@
var id = elem[0];
var beg = elem[1][0];
var end = elem[1][1];
- if (x > beg && x < end) {
+ if (x >= beg && x <= end) {
select_subcyl(id, h_data);
}
}
--- conga/luci/storage/form-macros 2007/09/25 18:55:13 1.28
+++ conga/luci/storage/form-macros 2007/09/25 22:47:05 1.29
@@ -21,17 +21,18 @@
<div metal:define-macro="commit-changes">
<script type="text/javascript" src="storage_utils.js"></script>
- <span tal:omit-tag=""
- tal:define="batch_id python:here.apply_storage_changes(ricci, storage_report, request);
- check_URL context/storage/check-batch/absolute_url;
- check_url python:check_URL + '?storagename=' + storagename + '&batch_id=' + batch_id">
+ <tal:block tal:define="
+ batch_id python:here.apply_storage_changes(ricci, storage_report, request);
+ check_URL context/storage/check-batch/absolute_url;
+ check_url python:check_URL + '?storagename=' + storagename + '&batch_id=' + batch_id">
<div metal:use-macro="here/form-macros/macros/display-committing-changes" />
+
<form id="urls_form">
<input type="hidden" name="check_url"
tal:attributes="value check_url" />
</form>
- </span>
+ </tal:block>
</div>
<div metal:define-macro="display-committing-changes">
@@ -378,9 +379,9 @@
</div>
<div metal:define-macro="view-mapper-form">
- <div metal:use-macro="here/form-macros/macros/content-scripts"/>
- <div metal:use-macro="here/form-macros/macros/form-scripts"/>
- <div metal:use-macro="here/form-macros/macros/single-visible-span"/>
+ <div metal:use-macro="here/form-macros/macros/content-scripts" />
+ <div metal:use-macro="here/form-macros/macros/form-scripts" />
+ <div metal:use-macro="here/form-macros/macros/single-visible-span" />
<tal:block tal:define="
mapper python:here.get_mapper_data(storage_report, request['mapper_id']);
@@ -401,7 +402,7 @@
<input type="checkbox" id="graphics_checkbox_id"
tal:attributes="
checked mapper/graphical_view"
- onchange="var s = (this.checked)?'graphical_view':'textual_view'; singleVisibleSpan('mappings_view', s);" />
+ onchange="var s = (this.checked) ? 'graphical_view' : 'textual_view'; singleVisibleSpan('mappings_view', s);" />
Graphical View <small>(Uncheck if volumes are too small to select)</small>
<span id="mappings_view"
tal:define="
@@ -412,8 +413,9 @@
tal:define="global bd_path request/bd_path|nothing">
<tal:block tal:condition="not: bd_path">
- <tal:block tal:define="global bd_path python:''"/>
+ <tal:block tal:define="global bd_path python:''" />
</tal:block>
+
<iframe style="border: none;"
tal:attributes="
src python:'mappings_provider?storagename=' + storagename + '&mapper_id=' + mapper['mapper_id'] + '&selected_path=' + bd_path;
@@ -545,138 +547,119 @@
<div metal:use-macro="here/form-macros/macros/form-scripts" />
<form method="get" tal:attributes="id mapper_template_form_id">
- <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_template"/>
- <input tal:attributes="type string:hidden;
- name string:mapper_type;
- value mapper/mapper_type"/>
-
- <input tal:attributes="type string:hidden;
- name string:mapper_id;
- value python:''"/>
+ <input type="hidden" name="pagetype"
+ tal:attributes="value string:commit_changes" />
- <input tal:attributes="type string:hidden;
- name string:storagename;
- value storagename"/>
+ <input type="hidden" name="object_type" value="mapper_template" />
+ <input type="hidden" name="mapper_type"
+ tal:attributes="value mapper/mapper_type" />
+ <input type="hidden" name="mapper_id" value="" />
+
+ <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%;">
+ Creating New <span tal:replace="mapper/pretty_type" />
+ </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">
- <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%;">
- Creating New <span tal:replace="mapper/pretty_type"/>
- </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%;">
- <table class="props-form-table"
- style="height: 100%;">
- <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"/>
- </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"/>
- </span>
- </th>
- </tr>
- <tr class="props-form-body">
- <td>
- <table class="props-inner-table">
- <span tal:omit-tag=""
- tal:define="bds mapper/new_sources"
- tal:repeat="bd bds">
- <tr>
- <td>
- <input tal:attributes="type string:checkbox;
- name python:'source_bd_' + bd['path']"/>
- </td>
- <td tal:define="bytes bd/props/size/value;
- dummy python:here.bytes_to_value_units(bytes);
- size python:dummy[0];
- units python:dummy[1]">
- <span tal:replace="bd/path"/> (<span tal:replace="size"/> <span tal:replace="units"/> - <span tal:replace="bd/pretty_type"/>)
- </td>
- </tr>
- </span>
- <tr>
- <td colspan="2"
- style="height: 100%;">
-
- </td>
- </tr>
- </table>
- </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">
-
- </td>
- <td align="right">
- <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 create new ' + mapper['pretty_type'] + '?';
- validate_url context/validate_html/absolute_url"
- tal:attributes="id create_mapper_button_id;
- type string:button;
- name string:action_type;
- value string:Create;
- onclick python:'return validate_and_submit_form(\'' + validate_url + '\', \'' + mapper_template_form_id + '\', \'' + create_mapper_button_id + '\', \'' + prompt_msg + '\')'"
- class="form_button"/>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </form>
+ <div metal:use-macro="here/form-macros/macros/display-props-tableless" />
+ </table>
+ </td>
+ <td style="height: 100%;">
+ <table class="props-form-table" style="height: 100%;">
+ <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" />
+ </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" />
+ </span>
+ </th>
+ </tr>
+ <tr class="props-form-body">
+ <td>
+ <table class="props-inner-table">
+ <tr tal:repeat="bd mapper/new_sources">
+ <td>
+ <input type="checkbox"
+ tal:attributes="name python:'source_bd_' + bd['path']" />
+ </td>
+ <td tal:define="
+ bytes bd/props/size/value;
+ dummy python:here.bytes_to_value_units(bytes);
+ size python:dummy[0];
+ units python:dummy[1]">
+ <span tal:replace="bd/path" /> (<span tal:replace="size" /> <span tal:replace="units" /> - <span tal:replace="bd/pretty_type" />)
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" style="height: 100%;">
+
+ </td>
+ </tr>
+ </table>
+ </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">
+
+ </td>
+ <td align="right">
+ <input type="button" name="action_type" value="Reset"
+ onclick="return reset_form(this.form)"
+ class="form_button" />
+
+ <input type="button" name="action_type"
+ value="Create" class="form_button"
+ tal:define="
+ prompt_msg python:'Do you really want to create new ' + mapper['pretty_type'] + '?';
+ validate_url context/validate_html/absolute_url"
+ tal:attributes="
+ id create_mapper_button_id;
+ onclick python:'return validate_and_submit_form(\'' + validate_url + '\', \'' + mapper_template_form_id + '\', \'' + create_mapper_button_id + '\', \'' + prompt_msg + '\')'" />
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </form>
</div>
-
-
-
-
<div metal:define-macro="add-sources-form" tal:define="
mapper python:here.get_mapper_data(storage_report, request['mapper_id']);
prefix python:'add_sources_to_' + mapper['mapper_id'] + '_';
@@ -688,249 +671,241 @@
<div metal:use-macro="here/form-macros/macros/forms-css" />
<div metal:use-macro="here/form-macros/macros/form-scripts" />
- <span tal:omit-tag=""
- tal:condition="not: mapper/new_sources">
- There are no available <span tal:replace="mapper/pretty_sources_name"/> to be added to <span tal:replace="mapper/pretty_type"/> '<span tal:replace="mapper/pretty_name"/>'.
- <br/>
- <br/>
- <a tal:define="go_to_mapper_url python:'./?pagetype=52&mapper_type=' + mapper['mapper_type'] + '&mapper_id=' + mapper['mapper_id'] + '&storagename=' + storagename"
- tal:attributes="href go_to_mapper_url">
- Go Back to <span tal:replace="mapper/pretty_type"/>
- </a>
- </span>
- <form tal:condition="mapper/new_sources"
- tal:attributes="id add_sources_form_id;
- method string:get">
-
- <input tal:attributes="type string:hidden;
- name string:pagetype;
- value string:commit_changes"/>
+ <tal:block tal:condition="not: mapper/new_sources">
+ There are no available <span tal:replace="mapper/pretty_sources_name" /> to be added to <span tal:replace="mapper/pretty_type" /> '<span tal:replace="mapper/pretty_name" />'.
+ <br/>
+ <br/>
+ <a tal:define="
+ go_to_mapper_url python:'./?pagetype=52&mapper_type=' + mapper['mapper_type'] + '&mapper_id=' + mapper['mapper_id'] + '&storagename=' + storagename"
+ tal:attributes="href go_to_mapper_url">
+ Go Back to <span tal:replace="mapper/pretty_type" />
+ </a>
+ </tal:block>
- <input tal:attributes="type string:hidden;
- name string:object_type;
- value string:add_sources"/>
+ <form method="get" tal:condition="mapper/new_sources"
+ tal:attributes="id add_sources_form_id">
- <input tal:attributes="type string:hidden;
- name string:mapper_type;
- value mapper/mapper_type"/>
+ <input type="hidden" name="pagetype" value="commit_changes" />
+ <input type="hidden" name="object_type" value="add_sources" />
- <input tal:attributes="type string:hidden;
- name string:mapper_id;
- value mapper/mapper_id"/>
+ <input type="hidden" name="mapper_type"
+ tal:attributes="value mapper/mapper_type"/>
- <input tal:attributes="type string:hidden;
- name string:storagename;
- value storagename"/>
+ <input type="hidden" name="mapper_id"
+ tal:attributes="value mapper/mapper_id" />
+
+ <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"
+ height="29px" width="29px"
+ tal:attributes="src mapper/icon" />
+ </td>
+ <td style="width: 100%;">
+ Adding new <span tal:replace="mapper/pretty_sources_name" /> to <span tal:replace="mapper/pretty_type" /> '<span tal:replace="mapper/pretty_name" />'
+ </td>
+ <td style="min-width: 30px;">
+
+ </td>
+ </tr>
+ </table>
+ </th>
+ </tr>
- <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%;">
- Adding new <span tal:replace="mapper/pretty_sources_name"/> to <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 style="height: 100%;">
- <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
- </span>
- <span tal:condition="python:len(mapper['new_sources']) > 1">
- Select one or more <span tal:replace="mapper/pretty_sources_name"/> to add
- </span>
- </th>
- <span tal:omit-tag=""
- tal:define="bds mapper/new_sources"
- tal:repeat="bd bds">
- <tr>
- <td>
- <input tal:attributes="type string:checkbox;
- name python:'source_bd_' + bd['path']"/>
- </td>
- <td tal:define="bytes bd/props/size/value;
- dummy python:here.bytes_to_value_units(bytes);
- size python:dummy[0];
- units python:dummy[1]">
- <span tal:replace="bd/path"/> (<span tal:replace="size"/> <span tal:replace="units"/> - <span tal:replace="bd/pretty_type"/>)
- </td>
- </tr>
- </span>
- <tr>
- <td colspan="2"
- style="height: 100%;">
-
- </td>
- </tr>
- </table>
- </td>
- <td>
-
- </td>
- </tr>
- <tr class="props-form-footer">
- <td colspan="2">
- <table style="width: 100%;">
- <tr>
- <td align="left">
-
- </td>
- <td align="right">
- <input tal:define="go_to_mapper_url python:'./?pagetype=52&mapper_type=' + mapper['mapper_type'] + '&mapper_id=' + mapper['mapper_id'] + '&storagename=' + storagename"
- tal:attributes="type string:button;
- name string:cancel_button;
- value string:Cancel;
- onclick python:'window.location.assign(\'' + go_to_mapper_url + '\')'"
- class="form_button"/>
- <input tal:define="prompt_msg python:'Do you really want to add selected ' + mapper['pretty_sources_name'] + ' to \\\'' + mapper['pretty_name'] + '\\\'?';
- validate_url context/validate_html/absolute_url"
- tal:attributes="id add_sources_button_id;
- type string:button;
- name string:action_type;
- value string:Add;
- onclick python:'return validate_and_submit_form(\'' + validate_url + '\', \'' + add_sources_form_id + '\', \'' + add_sources_button_id + '\', \'' + prompt_msg + '\')'"
- class="form_button"/>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </form>
+ <tr class="props-form-body">
+ <td style="height: 100%;">
+ <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
+ </span>
+ <span tal:condition="python:len(mapper['new_sources']) > 1">
+ Select one or more <span tal:replace="mapper/pretty_sources_name"/> to add
+ </span>
+ </th>
+ <tr tal:repeat="bd mapper/new_sources">
+ <td>
+ <input type="checkbox"
+ tal:attributes="name python:'source_bd_' + bd['path']" />
+ </td>
+ <td tal:define="
+ bytes bd/props/size/value;
+ dummy python:here.bytes_to_value_units(bytes);
+ size python:dummy[0];
+ units python:dummy[1]">
+
+ <span tal:replace="bd/path" /> (<span tal:replace="size" /> <span tal:replace="units" /> - <span tal:replace="bd/pretty_type" />)
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" style="height: 100%;">
+
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td>
+
+ </td>
+ </tr>
+ <tr class="props-form-footer">
+ <td colspan="2">
+ <table style="width: 100%;">
+ <tr>
+ <td align="left">
+
+ </td>
+ <td align="right">
+ <input type="button" name="cancel_button"
+ value="Cancel" class="form_button"
+ tal:define="
+ go_to_mapper_url python:'./?pagetype=52&mapper_type=' + mapper['mapper_type'] + '&mapper_id=' + mapper['mapper_id'] + '&storagename=' + storagename"
+ tal:attributes="
+ onclick python:'window.location.assign(\'' + go_to_mapper_url + '\')'" />
+
+ <input type="button" name="action_type"
+ value="Add" class="form_button"
+ tal:define="
+ prompt_msg python:'Do you really want to add selected ' + mapper['pretty_sources_name'] + ' to \\\'' + mapper['pretty_name'] + '\\\'?';
+ validate_url context/validate_html/absolute_url"
+ tal:attributes="
+ id add_sources_button_id;
+ onclick python:'return validate_and_submit_form(\'' + validate_url + '\', \'' + add_sources_form_id + '\', \'' + add_sources_button_id + '\', \'' + prompt_msg + '\')'" />
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </form>
</div>
<div tal:omit-tag="" metal:define-macro="display-props-tableless">
- <span tal:omit-tag=""
- tal:repeat="prop props">
- <tr tal:define="p prop/name;
- prop_pr_name prop/pretty_name"
- tal:condition="not: prop/hidden">
- <td tal:content="prop_pr_name"/>
- <td tal:define="prop_type prop/type;
- prop_units prop/units">
- <table>
- <tr>
- <td>
- <span tal:condition="python:prop_type == 'label'">
- <span tal:omit-tag=""
- tal:condition="prop/replacements|nothing">
- <input tal:attributes="type string:hidden;
- name p;
- value prop/value"/>
- <select tal:define="repls prop/replacements;
- select_id python:prefix + '_select_replace_block_' + p"
- tal:attributes="id select_id;
- onfocus python:'replace_properties_block__old_select_value = this.value';
- onchange python:'replace_properties_block(\'' + properties_span_id + '\', \'' + select_id + '\')'">
- <span tal:omit-tag=""
- tal:repeat="repl_name repls/repl_names">
- <option tal:attributes="value python:repls[repl_name]['path']"/><span tal:replace="repl_name"/>
- </span>
- </select>
- </span>
- <span tal:omit-tag=""
- tal:condition="not: prop/replacements|nothing">
- <span tal:condition="python: prop_units == 'bytes'">
- <span tal:define="dummy python: here.bytes_to_value_units(prop['value']);
- value python: str(dummy[0]) + ' ' + str(dummy[1])"
- tal:replace="value"/>
- </span>
- <span tal:condition="python: prop_units != 'bytes'"
- tal:replace="prop/value"/>
- </span>
- </span>
-
-
-
- <input tal:condition="python:prop_type == 'text'"
- tal:attributes="name p;
- type string:text;
- value prop/value;
- onkeypress python:'return validate_text_keypress(this, event, 2, \'' + prop['validation']['illegal_chars'] + '\', ' + str(prop['validation']['max_length']) + ')';
- onchange python:'validate_text(this, 2, \'' + prop['validation']['illegal_chars'] + '\', \'' + prop['validation']['reserved_words'] + '\', ' + str(prop['validation']['min_length']) + ', ' + str(prop['validation']['max_length']) + ', \'' + form_submit_button_id + '\')'"/>
-
-
+ <tal:block tal:repeat="prop props">
+ <tr tal:condition="not: prop/hidden"
+ tal:define="
+ p prop/name;
+ prop_pr_name prop/pretty_name">
+ <td tal:content="prop_pr_name" />
+ <td tal:define="
+ prop_type prop/type;
+ prop_units prop/units">
+ <table>
+ <tr>
+ <td>
+ <span tal:condition="python:prop_type == 'label'">
+ <tal:block tal:condition="prop/replacements|nothing">
+ <input type="hidden"
+ tal:attributes="
+ name p;
+ value prop/value" />
+ <select
+ tal:define="
+ repls prop/replacements;
+ select_id python:prefix + '_select_replace_block_' + p"
+ tal:attributes="
+ id select_id;
+ onfocus python:'replace_properties_block__old_select_value = this.value';
+ onchange python:'replace_properties_block(\'' + properties_span_id + '\', \'' + select_id + '\')'">
+ <tal:block tal:repeat="repl_name repls/repl_names">
+ <option tal:attributes="
+ value python:repls[repl_name]['path']" />
+ <span tal:replace="repl_name" />
+ </tal:block>
+ </select>
+ </tal:block>
+
+ <tal:block tal:condition="not: prop/replacements|nothing">
+ <span tal:condition="python: prop_units == 'bytes'">
+ <span tal:define="
+ dummy python: here.bytes_to_value_units(prop['value']);
+ value python: str(dummy[0]) + ' ' + str(dummy[1])"
+ tal:replace="value" />
+ </span>
+ <span tal:condition="python: prop_units != 'bytes'"
+ tal:replace="prop/value" />
+ </tal:block>
+ </span>
- <span tal:omit-tag=""
- tal:condition="python:prop_type == 'int' and prop_units != 'bytes'">
- <input tal:attributes="name p;
- type string:text;
- size string:15;
- value prop/value;
- onchange python:'validate_int(this, 2, ' + str(prop['validation']['min']) + ', ' + str(prop['validation']['max']) + ', ' + str(prop['validation']['step']) + ', \'' + prop_units + '\', \'' + form_submit_button_id + '\')'"
- onkeypress="return validate_int_keypress(this, event, 2)"/>
- (<span tal:replace="prop/validation/min"/> - <span tal:replace="prop/validation/max"/>)
- <span tal:replace="prop_units"/>
- </span>
- <span tal:omit-tag=""
- tal:condition="python:prop_type == 'int' and prop_units == 'bytes'">
- <span tal:define="bytes prop/value;
- dummy python:here.bytes_to_value_prefunits(bytes);
- value python:dummy[0];
- units python:dummy[1];
- minim python:here.convert_bytes(prop['validation']['min'], units);
- maxim python:here.convert_bytes(prop['validation']['max'], units);
- step python:here.convert_bytes(prop['validation']['step'], units)">
- <input tal:attributes="name p;
- type string:text;
- size string:15;
- value value;
- onchange python:'validate_float(this, 2, ' + str(minim) + ', ' + str(maxim) + ', ' + str(step) + ', \'' + units + '\', \'' + form_submit_button_id + '\')'"
- onkeypress="return validate_float_keypress(this, event, 2)"/>
- (<span tal:replace="minim"/> - <span tal:replace="maxim"/>)
- <span tal:replace="units"/>
- </span>
- </span>
+ <input type="text"
+ tal:condition="python:prop_type == 'text'"
+ tal:attributes="
+ name p;
+ value prop/value;
+ onkeypress python:'return validate_text_keypress(this, event, 2, \'' + prop['validation']['illegal_chars'] + '\', ' + str(prop['validation']['max_length']) + ')';
+ onchange python:'validate_text(this, 2, \'' + prop['validation']['illegal_chars'] + '\', \'' + prop['validation']['reserved_words'] + '\', ' + str(prop['validation']['min_length']) + ', ' + str(prop['validation']['max_length']) + ', \'' + form_submit_button_id + '\')'" />
+
+ <tal:block tal:condition="python:prop_type == 'int' and prop_units != 'bytes'">
+ <input type="text" size="15"
+ tal:attributes="
+ name p;
+ value prop/value;
+ onchange python:'validate_int(this, 2, ' + str(prop['validation']['min']) + ', ' + str(prop['validation']['max']) + ', ' + str(prop['validation']['step']) + ', \'' + prop_units + '\', \'' + form_submit_button_id + '\')'"
+ onkeypress="return validate_int_keypress(this, event, 2)" />
+ (<span tal:replace="prop/validation/min" /> - <span tal:replace="prop/validation/max" />) <span tal:replace="prop_units" />
+ </tal:block>
+ <tal:block tal:condition="python:prop_type == 'int' and prop_units == 'bytes'">
+ <span tal:define="
+ bytes prop/value;
+ dummy python:here.bytes_to_value_prefunits(bytes);
+ value python:dummy[0];
+ units python:dummy[1];
+ minim python:here.convert_bytes(prop['validation']['min'], units);
+ maxim python:here.convert_bytes(prop['validation']['max'], units);
+ step python:here.convert_bytes(prop['validation']['step'], units)">
+ <input type="string" size="15"
+ tal:attributes="
+ name p;
+ value value;
+ onchange python:'validate_float(this, 2, ' + str(minim) + ', ' + str(maxim) + ', ' + str(step) + ', \'' + units + '\', \'' + form_submit_button_id + '\')'"
+ onkeypress="return validate_float_keypress(this, event, 2)" />
+ (<span tal:replace="minim" /> - <span tal:replace="maxim" />) <span tal:replace="units" />
+ </span>
+ </tal:block>
- <span tal:condition="python:prop_type == 'select'">
- <select tal:define="prop_options prop/value"
- tal:attributes="name p">
- <span tal:omit-tag=""
- tal:condition="python: prop_units != 'bytes'"
- tal:repeat="prop_opt prop_options">
- <option tal:attributes="value prop_opt"/><span tal:replace="prop_opt"/>
- </span>
- <span tal:omit-tag=""
- tal:condition="python: prop_units == 'bytes'"
- tal:repeat="prop_opt prop_options">
- <option tal:attributes="value prop_opt"/><span tal:define="dummy python: here.bytes_to_value_units(prop_opt);
- value python: str(dummy[0]) + ' ' + str(dummy[1])"
- tal:replace="value"/>
- </span>
- </select>
- </span>
- </td>
- <td>
- <span tal:condition="python: prop_units != 'bytes'"
- tal:replace="prop_units"/>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </span>
- <tr>
- <td colspan="2" style="height: 100%;">
-
- </td>
- </tr>
+ <tal:block tal:condition="python:prop_type == 'select'">
+ <select tal:define="prop_options prop/value" tal:attributes="name p">
+ <tal:block
+ tal:condition="python: prop_units != 'bytes'"
+ tal:repeat="prop_opt prop_options">
+ <option tal:attributes="value prop_opt" />
+ <span tal:replace="prop_opt" />
+ </tal:block>
+ <tal:block
+ tal:condition="python: prop_units == 'bytes'"
+ tal:repeat="prop_opt prop_options">
+ <option tal:attributes="value prop_opt" />
+ <span
+ tal:define="
+ dummy python: here.bytes_to_value_units(prop_opt);
+ value python: str(dummy[0]) + ' ' + str(dummy[1])"
+ tal:replace="value" />
+ </tal:block>
+ </select>
+ </tal:block>
+ </td>
+ <td>
+ <span tal:condition="python: prop_units != 'bytes'" tal:replace="prop_units" />
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </tal:block>
+ <tr>
+ <td colspan="2" style="height: 100%;">
+
+ </td>
+ </tr>
</div>
<div tal:omit-tag="" metal:define-macro="display-props">
@@ -968,7 +943,7 @@
<div metal:define-macro="display-BD">
<div metal:use-macro="here/form-macros/macros/forms-css" />
- <span tal:omit-tag=""
+ <span tal:omit-tag=""
tal:define="mapper string:;
conts python:bd_data['contents'];
prefix prefix|bd_data/path;
@@ -978,9 +953,8 @@
apply_button_id python:prefix + 'apply_button_id';
form_submit_button_id apply_button_id;
content_span_id python:prefix + 'content_span_id'">
- <form tal:attributes="id bd_form_id;
- method string:get">
+ <form method="get" tal:attributes="id bd_form_id">
<input tal:attributes="type string:hidden;
name string:pagetype;
value string:commit_changes"/>
@@ -1089,11 +1063,11 @@
tal:attributes="id select_content_id;
name string:content_id;
onchange funct">
- <span tal:omit-tag=""
- tal:repeat="cont conts">
+ <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;
@@ -1338,8 +1312,10 @@
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"
+
+ <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;
--- conga/luci/storage/storage_probing.js 2007/09/25 16:49:36 1.1
+++ conga/luci/storage/storage_probing.js 2007/09/25 22:47:05 1.2
@@ -9,7 +9,9 @@
function strip_left(txt) {
for (var i = 0 ; i < txt.length ; i++) {
- if (txt[i] == " " || txt[i] == "\n") {
+ if (txt[i] == ' ' || txt[i] == '\n' ||
+ txt[i] == '\r' || txt[i] == '\t')
+ {
continue;
}
return txt.substr(i);
--- conga/luci/storage/storage_utils.js 2007/09/25 16:49:36 1.1
+++ conga/luci/storage/storage_utils.js 2007/09/25 22:47:05 1.2
@@ -9,7 +9,9 @@
function strip_left(txt) {
for (var i = 0 ; i < txt.length ; i++) {
- if (txt[i] == " " || txt[i] == "\n") {
+ if (txt[i] == ' ' || txt[i] == '\n' ||
+ txt[i] == '\r' || txt[i] == '\t')
+ {
continue;
}
return txt.substr(i);
--- conga/luci/storage/storage_validation.js 2007/09/25 16:49:36 1.1
+++ conga/luci/storage/storage_validation.js 2007/09/25 22:47:05 1.2
@@ -305,7 +305,9 @@
function strip_left(txt) {
for (var i = 0 ; i < txt.length ; i++) {
- if (txt[i] == " " || txt[i] == "\n") {
+ if (txt[i] == ' ' || txt[i] == '\n' ||
+ txt[i] == '\r' || txt[i] == '\t')
+ {
continue;
}
return txt.substr(i);
@@ -346,7 +348,7 @@
}
}
- alert(err_msg);
+ alert(err_msg || 'An unknown error occurred');
}
} else {
alert("Error retrieving data from server");
--- conga/luci/storage/validate_html 2007/09/25 18:55:13 1.6
+++ conga/luci/storage/validate_html 2007/09/25 22:47:05 1.7
@@ -31,7 +31,7 @@
<tal:block tal:condition="access_to_host_allowed">
<span tal:condition="python:action_type == 'Validate'"
- tal:content="python:here.validate(storage_report, request)" />
+ tal:replace="python:here.validate(storage_report, request)" />
<tal:block tal:condition="python:action_type != 'Validate'">
This form is to be used for validation only
next reply other threads:[~2007-09-25 22:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-25 22:47 rmccabe [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-03-12 4:25 [Cluster-devel] conga/luci cluster/form-chooser cluster/form-m rmccabe
2007-03-12 4:24 rmccabe
2007-03-12 4:22 rmccabe
2007-02-23 22:07 rmccabe
2006-12-21 21:26 kupcevic
2006-12-07 17:54 rmccabe
2006-12-06 18:38 rmccabe
2006-11-10 19:44 rmccabe
2006-10-09 17:12 rmccabe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070925224707.12118.qmail@sourceware.org \
--to=rmccabe@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.