appy.gen: bugfixes in Ref fields, IE CSS and master/slave relationships.

This commit is contained in:
Gaetan Delannay 2011-10-04 20:12:58 +02:00
parent e821307b4c
commit 4b44f8d565
11 changed files with 98 additions and 87 deletions

View file

@ -10,10 +10,12 @@ p { margin: 0;}
acronym {cursor: help;}
input[type=image] { border: 0; background: none; }
input[type=checkbox] { border: 0; background: none; cursor: pointer;}
input[type=radio] { border: 0; background: none; cursor: pointer;}
input[type=button] { border: 1px solid #cccccc; background-color: #f8f8f8;
cursor: pointer;}
cursor: pointer;}
input[type=submit] { border: 1px solid #cccccc; background-color: #f8f8f8;
cursor: pointer; }
input[type=password] { border: 1px solid #cccccc; background-color: #f8f8f8;}
input[type=text] { border: 1px solid #cccccc; background-color: #f8f8f8;
font-family: Lucida,Helvetica,Arial,sans-serif;
margin-bottom: 1px}
@ -48,8 +50,8 @@ img {border: 0;}
.phase { border-style: dashed; border-width: thin; padding: 0 0.6em 0 1em; }
.content { padding: 14px 3px 9px 15px;}
.grey { display: none; position: absolute; left: 0px; top: 0px;
width:100%; height:100%; background:grey; opacity:0.5;
-moz-opacity:0.5; -khtml-opacity:0.5; filter:alpha(Opacity=50);}
background:grey; opacity:0.5; -moz-opacity:0.5; -khtml-opacity:0.5;
filter:alpha(Opacity=50);}
.popup { display: none; position: absolute; top: 30%; left: 35%;
width: 350px; z-index : 100; background: white; padding: 8px;
border: 1px solid grey; }

View file

@ -248,7 +248,11 @@ function getSlaves(master) {
// Gets all the slaves of master.
allSlaves = document.getElementsByName('slave');
res = [];
slavePrefix = 'slave_' + master.attributes['name'].value + '_';
masterName = master.attributes['name'].value;
if (master.type == 'checkbox') {
masterName = masterName.substr(0, masterName.length-8);
}
slavePrefix = 'slave_' + masterName + '_';
for (var i=0; i < slaves.length; i++){
cssClasses = slaves[i].className.split(' ');
for (var j=0; j < cssClasses.length; j++) {
@ -381,13 +385,15 @@ function openPopup(popupId, msg) {
// Open the popup
var popup = document.getElementById(popupId);
// Put it at the right place on the screen
var scrollTop = window.pageYOffset || document.documentElement.scrollTop || 0;
var scrollTop = document.body.scrollTop || window.pageYOffset || 0;
popup.style.top = (scrollTop + 150) + 'px';
popup.style.display = "block";
// Show the greyed zone
var greyed = document.getElementById('grey');
greyed.style.top = scrollTop + 'px';
greyed.style.display = "block";
greyed.style.height = document.body.clientHeight;
greyed.style.width = document.body.clientWidth;
}
function closePopup(popupId) {

View file

@ -75,7 +75,7 @@
</form>
<h1 tal:content="python: tool.translate('import_title')"></h1><br/>
<table cellpadding="0" cellspacing="0" class="listing nosort" width="100%">
<table class="list" width="100%">
<tr>
<th tal:repeat="columnHeader python: importElems[0]">
<img tal:condition="python: repeat['columnHeader'].number() == 1"
@ -107,7 +107,7 @@
<span tal:condition="alreadyImported" tal:replace="python: tool.translate('import_already')"/>
</td>
<td align="center">
<input type="checkbox" checked="checked" class="noborder" id="cbElem" name="cbElem"
<input type="checkbox" checked="checked" id="cbElem" name="cbElem"
tal:attributes="value python: row[0]" tal:condition="not: alreadyImported"/>
</td>
</tr>

View file

@ -7,11 +7,10 @@
<tal:comment replace="nothing">Edit macro for an Boolean.</tal:comment>
<metal:edit define-macro="edit">
<input type="checkbox"
tal:attributes="name python: name + '_visible';
id name;
tal:attributes="name python: name + '_visible'; id name;
checked python:contextObj.checkboxChecked(name, rawValue);
onClick python:'toggleCheckbox(\'%s\', \'%s_hidden\');;updateSlaves(this)' % (name, name);
class python: 'noborder %s' % masterCss"/>
class masterCss"/>
<input tal:attributes="name name;
id string:${name}_hidden;
value python: test(contextObj.checkboxChecked(name, rawValue), 'True', 'False')"
@ -28,15 +27,15 @@
tal:define="typedWidget python:'%s*bool' % widgetName">
<label tal:attributes="for widgetName" tal:content="python: tool.translate(widget['labelId'])"></label><br>&nbsp;&nbsp;
<tal:yes define="valueId python:'%s_yes' % name">
<input type="radio" class="noborder" value="True" tal:attributes="name typedWidget; id valueId"/>
<input type="radio" value="True" tal:attributes="name typedWidget; id valueId"/>
<label tal:attributes="for valueId" i18n:translate="yes" i18n:domain="plone"></label>
</tal:yes>
<tal:no define="valueId python:'%s_no' % name">
<input type="radio" class="noborder" value="False" tal:attributes="name typedWidget; id valueId"/>
<input type="radio" value="False" tal:attributes="name typedWidget; id valueId"/>
<label tal:attributes="for valueId" i18n:translate="no" i18n:domain="plone"></label>
</tal:no>
<tal:whatever define="valueId python:'%s_whatever' % name">
<input type="radio" class="noborder" value="" tal:attributes="name typedWidget; id valueId" checked="checked"/>
<input type="radio" value="" tal:attributes="name typedWidget; id valueId" checked="checked"/>
<label tal:attributes="for valueId" tal:content="python: tool.translate('whatever')"></label>
</tal:whatever><br/>
</metal:search>

View file

@ -81,7 +81,7 @@
<metal:search define-macro="search"
tal:define="years python:range(widget['startYear'], widget['endYear']+1)">
<label tal:content="python: tool.translate(widget['labelId'])"></label>
<table cellpadding="0" cellspacing="0">
<table>
<tal:comment replace="nothing">From</tal:comment>
<tr tal:define="yearFromName python: '%s*date' % widgetName;
monthFromName python: '%s_from_month' % name;

View file

@ -23,7 +23,7 @@
</tal:showFile>
<tal:editButtons condition="python: value and value.size">
<tal:comment replace="nothing">Keep the file untouched.</tal:comment>
<input class="noborder" type="radio" value="nochange"
<input type="radio" value="nochange"
tal:attributes="checked python:test(value.size!=0, 'checked', None);
name string:${name}_delete;
id string:${name}_nochange;
@ -33,7 +33,7 @@
<br/>
<tal:comment replace="nothing">Delete the file.</tal:comment>
<tal:delete condition="not: widget/required">
<input class="noborder" type="radio" value="delete"
<input type="radio" value="delete"
tal:attributes="name string:${name}_delete;
id string:${name}_delete;
onclick string:document.getElementById('${name}_file').disabled=true;"/>
@ -42,7 +42,7 @@
<br/>
</tal:delete>
<tal:comment replace="nothing">Replace with a new file.</tal:comment>
<input class="noborder" type="radio" value=""
<input type="radio" value=""
tal:attributes="checked python:test(value.size==0, 'checked', None);
name string:${name}_delete;
id string:${name}_upload;

View file

@ -101,7 +101,7 @@
id slaveId; name slaveId">
<tal:comment replace="nothing">First row: the tabs.</tal:comment>
<tr valign="middle"><td style="border-bottom: 1px solid #ff8040">
<table cellpadding="0" cellspacing="0" style="position:relative; bottom:-1px;">
<table style="position:relative; bottom:-1px;">
<tr valign="middle">
<tal:tab repeat="widgetRow widget/widgets">
<tal:id define="tabId python:'tab_%s_%d_%d' % (widget['name'], repeat['widgetRow'].number(), len(widget['widgets']))">

View file

@ -90,9 +90,9 @@
orName python: '%s_or' % operName;
andName python: '%s_and' % operName;"
condition="python: widget['multiplicity'][1]!=1">
<input type="radio" class="noborder" tal:attributes="name operName; id orName" checked="checked" value="or"/>
<input type="radio" tal:attributes="name operName; id orName" checked="checked" value="or"/>
<label tal:attributes="for orName" tal:content="python: tool.translate('search_or')"></label>
<input type="radio" class="noborder" tal:attributes="name operName; id andName" value="and"/>
<input type="radio" tal:attributes="name operName; id andName" value="and"/>
<label tal:attributes="for andName" tal:content="python: tool.translate('search_and')"></label><br/>
</tal:operator>
<tal:comment replace="nothing">The list of values</tal:comment>