Improvements historization.

This commit is contained in:
Gaetan Delannay 2009-12-15 21:30:43 +01:00
parent d320a369c9
commit fff2b6a329
5 changed files with 49 additions and 85 deletions

View file

@ -163,7 +163,10 @@ class AbstractMixin:
modified values.''' modified values.'''
# Remove from previousData all values that were not changed # Remove from previousData all values that were not changed
for fieldName in previousData.keys(): for fieldName in previousData.keys():
if getattr(self, fieldName) == previousData[fieldName][0]: prev = previousData[fieldName][0]
curr = getattr(self, fieldName)
if (prev == curr) or ((prev == None) and (curr == '')) or \
((prev == '') and (curr == None)):
del previousData[fieldName] del previousData[fieldName]
if previousData: if previousData:
# Create the event to add in the history # Create the event to add in the history

View file

@ -79,7 +79,7 @@
</form> </form>
<h1 tal:content="python: tool.translate('import_title')"></h1><br/> <h1 tal:content="python: tool.translate('import_title')"></h1><br/>
<table cellpadding="0" cellspacing="0" class="vertical listing" width="100%"> <table cellpadding="0" cellspacing="0" class="listing nosort" width="100%">
<tr> <tr>
<th tal:repeat="columnHeader python: importElems[0]"> <th tal:repeat="columnHeader python: importElems[0]">
<img tal:condition="python: repeat['columnHeader'].number() == 1" <img tal:condition="python: repeat['columnHeader'].number() == 1"
@ -96,9 +96,11 @@
</tr> </tr>
<tal:row repeat="row python: importElems[1]"> <tal:row repeat="row python: importElems[1]">
<tr tal:define="alreadyImported python: tool.isAlreadyImported(contentType, row[0]); <tr tal:define="alreadyImported python: tool.isAlreadyImported(contentType, row[0]);
global allAreImported python: allAreImported and alreadyImported" global allAreImported python: allAreImported and alreadyImported;
odd repeat/row/odd"
tal:attributes="id python:test(alreadyImported, 'importedElem', 'notImportedElem'); tal:attributes="id python:test(alreadyImported, 'importedElem', 'notImportedElem');
style python:test(alreadyImported, 'display:none', 'display:table-row')"> style python:test(alreadyImported, 'display:none', 'display:table-row');
class python:test(odd, 'even', 'odd')">
<td tal:repeat="elem python: row[1:]" tal:content="elem"> <td tal:repeat="elem python: row[1:]" tal:content="elem">
</td> </td>
<td> <td>

View file

@ -316,8 +316,8 @@
Display the previous values of the fields whose value were modified in this change.</tal:comment> Display the previous values of the fields whose value were modified in this change.</tal:comment>
<table class="appyChanges" width="100%"> <table class="appyChanges" width="100%">
<tr> <tr>
<th tal:content="python: tool.translate('modified_field')"></th> <th align="left" width="30%" tal:content="python: tool.translate('modified_field')"></th>
<th tal:content="python: tool.translate('previous_value')"></th> <th align="left" width="70%" tal:content="python: tool.translate('previous_value')"></th>
</tr> </tr>
<tr tal:repeat="change event/changes/items"> <tr tal:repeat="change event/changes/items">
<td tal:content="python: tool.translate(change[1][1])"></td> <td tal:content="python: tool.translate(change[1][1])"></td>
@ -669,7 +669,7 @@
</tr></table> </tr></table>
<table tal:define="fieldDescrs python: tool.getResultColumns(objs[0], contentType)" <table tal:define="fieldDescrs python: tool.getResultColumns(objs[0], contentType)"
class="vertical listing" width="100%" cellpadding="0" cellspacing="0"> class="listing nosort" width="100%" cellpadding="0" cellspacing="0">
<tal:comment replace="nothing">Every item in fieldDescr is a FieldDescr instance, <tal:comment replace="nothing">Every item in fieldDescr is a FieldDescr instance,
excepted for workflow state (which is not a field): in this case it is simply the excepted for workflow state (which is not a field): in this case it is simply the
string "workflowState".</tal:comment> string "workflowState".</tal:comment>
@ -723,7 +723,9 @@
</tr> </tr>
<tal:comment replace="nothing">Results</tal:comment> <tal:comment replace="nothing">Results</tal:comment>
<tr tal:repeat="obj objs" id="query_row"> <tal:row repeat="obj objs">
<tr id="query_row" tal:define="odd repeat/obj/odd"
tal:attributes="class python:test(odd, 'even', 'odd')">
<tal:comment replace="nothing">Mandatory column "Title"/"Name"</tal:comment> <tal:comment replace="nothing">Mandatory column "Title"/"Name"</tal:comment>
<td id="field_title"><a <td id="field_title"><a
@ -777,6 +779,7 @@
</table> </table>
</td> </td>
</tr> </tr>
</tal:row>
</table> </table>
<tal:comment replace="nothing">Appy (bottom) navigation</tal:comment> <tal:comment replace="nothing">Appy (bottom) navigation</tal:comment>

View file

@ -178,7 +178,7 @@
</table> </table>
<tal:comment replace="nothing">Show forward reference(s)</tal:comment> <tal:comment replace="nothing">Show forward reference(s)</tal:comment>
<table tal:attributes="class python:test(innerRef, '', 'vertical listing'); <table tal:attributes="class python:test(innerRef, '', 'listing nosort');
width python:test(innerRef, '100%', test(appyType['wide'], '100%', ''))" width python:test(innerRef, '100%', test(appyType['wide'], '100%', ''))"
align="right" tal:condition="python: not isBack and objs" cellpadding="0" cellspacing="0"> align="right" tal:condition="python: not isBack and objs" cellpadding="0" cellspacing="0">
<tr tal:condition="appyType/showHeaders"> <tr tal:condition="appyType/showHeaders">
@ -195,7 +195,9 @@
</th> </th>
<th tal:content="python: tool.translate('ref_actions')"></th> <th tal:content="python: tool.translate('ref_actions')"></th>
</tr> </tr>
<tr tal:repeat="obj objs" valign="top"> <tal:row repeat="obj objs">
<tr valign="top" tal:define="odd repeat/obj/odd"
tal:attributes="class python:test(odd, 'even', 'odd')">
<tal:comment replace="nothing">Object title, shown here if not specified somewhere <tal:comment replace="nothing">Object title, shown here if not specified somewhere
else in appyType.shownInfo.</tal:comment> else in appyType.shownInfo.</tal:comment>
<td tal:condition="python: 'title' not in appyType['shownInfo']"><metal:showObjectTitle <td tal:condition="python: 'title' not in appyType['shownInfo']"><metal:showObjectTitle
@ -233,6 +235,7 @@
<metal:showObjectActions use-macro="here/skyn/ref/macros/objectActions" /> <metal:showObjectActions use-macro="here/skyn/ref/macros/objectActions" />
</td> </td>
</tr> </tr>
</tal:row>
</table> </table>
</td></tr> </td></tr>

View file

@ -2,58 +2,31 @@
/* <dtml-with base_properties> (do not remove this :) */ /* <dtml-with base_properties> (do not remove this :) */
/* <dtml-call "REQUEST.set('portal_url', portal_url())"> (not this either :) */ /* <dtml-call "REQUEST.set('portal_url', portal_url())"> (not this either :) */
#portal-breadcrumbs { #portal-breadcrumbs { display: none; }
display: none; #importedElem { color: grey; font-style: italic; }
.appyList { line-height: 1.1em; margin: 0 0 0.5em 1.2em; padding: 0; }
.appyBullet { margin: 0; }
.appyPod { float:right; }
.appyNav { padding: 0.4em 0 0.4em 0; }
.appyFocus { color: #900101; }
.appyTabs { margin-bottom: 1em; }
.appyTabs li a { border-bottom:1px solid transparent; font-size: 90%; }
.appyTabs li a:visited { color: #578308; }
.appyTitle { padding-top: 0.5em; font-size: 110%; }
.appyLabel { font-weight: bold; padding-right: 0.4em; }
.appyRefEdit { line-height: 1.5em; }
.appyWorkflow {
text-align: center;
background-color: &dtml-globalBackgroundColor;;
} }
.appyList { .appyPlusImg {
line-height: 1.1em; vertical-align: top;
margin: 0 0 0.5em 1.2em; position: relative;
padding: 0; left: -1.4em;
} top: -0.55em;
.appyBullet {
margin: 0;
}
.appyPod {
float:right;
}
.appyNav {
padding: 0.4em 0 0.4em 0;
}
.appyFocus {
color: #900101;
}
#importedElem {
color: grey;
font-style: italic;
}
.appyTabs {
margin-bottom: 1em;
}
.appyTabs li a {
border-bottom:1px solid transparent;
font-size: 90%;
}
.appyTabs li a:visited {
color: #578308;
}
.appyTitle {
padding-top: 0.5em;
font-size: 110%;
}
.appyLabel {
font-weight: bold;
padding-right: 0.4em;
} }
.appyPhase { .appyPhase {
@ -97,7 +70,7 @@
font-size: 105%; font-size: 105%;
} }
/* stepxx classes are used for displaying status of a phase or state. */ /* Following classes are used for displaying status of a phase or state. */
.stepDone { .stepDone {
background-color: #cde2a7; background-color: #cde2a7;
background-image: url(&dtml-portal_url;/skyn/done.png); background-image: url(&dtml-portal_url;/skyn/done.png);
@ -122,17 +95,6 @@
background-color: #ffffff; background-color: #ffffff;
} }
.appyPlusImg {
vertical-align: top;
position: relative;
left: -1.4em;
top: -0.55em;
}
.appyRefEdit {
line-height: 1.5em;
}
.appyCommonInfo { .appyCommonInfo {
border-color: #ffa500; border-color: #ffa500;
background-color: &dtml-evenRowBackgroundColor;; background-color: &dtml-evenRowBackgroundColor;;
@ -141,24 +103,15 @@
margin-bottom: 0.5em; margin-bottom: 0.5em;
} }
.appyWorkflow {
text-align: center;
background-color: &dtml-globalBackgroundColor;;
}
dl.expandedInlineCollapsible dt.collapsibleHeader, dl.expandedBlockCollapsible dt.collapsibleHeader {
background:#dee7ec url(treeExpanded.gif) no-repeat scroll 6px 50%;
border-width 1px;
border-color: #8cacbb;
border-style: solid;
border-width: thin;
}
/* With fields layout in columns, standard error frame is too large */ /* With fields layout in columns, standard error frame is too large */
.error { .error {
padding: 0.4em; padding: 0.4em;
} }
.odd {
background-color: white;
}
/* Table styles */ /* Table styles */
.no-style-table { .no-style-table {
border: 0 !important; border: 0 !important;