don't show priority and activity if corresponding data tables do not exist; translations
This commit is contained in:
parent
c824c0bdb5
commit
a565d750e3
6 changed files with 43 additions and 16 deletions
|
@ -913,7 +913,7 @@ relates ISO country codes with the full name of the country.
|
||||||
>>> sorted(adapted(concepts['countries']).data.items())
|
>>> sorted(adapted(concepts['countries']).data.items())
|
||||||
[('at', ['Austria']), ('de', ['Germany'])]
|
[('at', ['Austria']), ('de', ['Germany'])]
|
||||||
|
|
||||||
>>> countries.dataAsRecords
|
>>> countries.dataAsRecords()
|
||||||
[{'value': 'Austria', 'key': 'at'}, {'value': 'Germany', 'key': 'de'}]
|
[{'value': 'Austria', 'key': 'at'}, {'value': 'Germany', 'key': 'de'}]
|
||||||
|
|
||||||
>>> countries.getRowsByValue('value', 'Germany')
|
>>> countries.getRowsByValue('value', 'Germany')
|
||||||
|
|
Binary file not shown.
|
@ -3,7 +3,7 @@ msgstr ""
|
||||||
|
|
||||||
"Project-Id-Version: 0.13.1\n"
|
"Project-Id-Version: 0.13.1\n"
|
||||||
"POT-Creation-Date: 2007-05-22 12:00 CET\n"
|
"POT-Creation-Date: 2007-05-22 12:00 CET\n"
|
||||||
"PO-Revision-Date: 2015-03-13 12:00 CET\n"
|
"PO-Revision-Date: 2015-03-17 12:00 CET\n"
|
||||||
"Last-Translator: Helmut Merz <helmutm@cy55.de>\n"
|
"Last-Translator: Helmut Merz <helmutm@cy55.de>\n"
|
||||||
"Language-Team: loops developers <helmutm@cy55.de>\n"
|
"Language-Team: loops developers <helmutm@cy55.de>\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
|
@ -1009,6 +1009,21 @@ msgstr "Kalender"
|
||||||
msgid "Work Items"
|
msgid "Work Items"
|
||||||
msgstr "Aktivitäten"
|
msgstr "Aktivitäten"
|
||||||
|
|
||||||
|
msgid "Work Item Type"
|
||||||
|
msgstr "Art der Aktivität"
|
||||||
|
|
||||||
|
msgid "Unit of Work"
|
||||||
|
msgstr "Standard-Aktivität"
|
||||||
|
|
||||||
|
msgid "Scheduled Event"
|
||||||
|
msgstr "Termin"
|
||||||
|
|
||||||
|
msgid "Deadline"
|
||||||
|
msgstr "Deadline"
|
||||||
|
|
||||||
|
msgid "Check-up"
|
||||||
|
msgstr "Überprüfung"
|
||||||
|
|
||||||
msgid "Work Items for $title"
|
msgid "Work Items for $title"
|
||||||
msgstr "Aktivitäten für $title"
|
msgstr "Aktivitäten für $title"
|
||||||
|
|
||||||
|
@ -1039,6 +1054,12 @@ msgstr "Dauer/Aufwand"
|
||||||
msgid "Duration / Effort (hh:mm)"
|
msgid "Duration / Effort (hh:mm)"
|
||||||
msgstr "Dauer / Aufwand (hh:mm)"
|
msgstr "Dauer / Aufwand (hh:mm)"
|
||||||
|
|
||||||
|
msgid "Priority"
|
||||||
|
msgstr "Priorität"
|
||||||
|
|
||||||
|
msgid "Activity"
|
||||||
|
msgstr "Tätigkeit"
|
||||||
|
|
||||||
msgid "Action"
|
msgid "Action"
|
||||||
msgstr "Aktion"
|
msgstr "Aktion"
|
||||||
|
|
||||||
|
|
|
@ -549,13 +549,19 @@ class CreateWorkItemForm(ObjectForm, BaseTrackView):
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def priorities(self):
|
def priorities(self):
|
||||||
|
if 'priority' in self.workItemType.fields:
|
||||||
prio = self.conceptManager.get('organize.work.priorities')
|
prio = self.conceptManager.get('organize.work.priorities')
|
||||||
return prio and adapted(prio).dataAsRecords or []
|
if prio:
|
||||||
|
return adapted(prio).dataAsRecords()
|
||||||
|
return []
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def activities(self):
|
def activities(self):
|
||||||
|
if 'activity' in self.workItemType.fields:
|
||||||
act = self.conceptManager.get('organize.work.activities')
|
act = self.conceptManager.get('organize.work.activities')
|
||||||
return act and adapted(act).dataAsRecords or []
|
if act:
|
||||||
|
return adapted(act).dataAsRecords()
|
||||||
|
return []
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def duration(self):
|
def duration(self):
|
||||||
|
|
|
@ -163,29 +163,30 @@
|
||||||
tal:attributes="value view/deadlineTime" />
|
tal:attributes="value view/deadlineTime" />
|
||||||
</div>
|
</div>
|
||||||
<div id="priority-activity"
|
<div id="priority-activity"
|
||||||
tal:condition="python:'priority' in workItemType.fields or
|
tal:define="priorities view/priorities;
|
||||||
'activity' in workItemType.fields">
|
activities view/activities"
|
||||||
|
tal:condition="python:priorities or activities">
|
||||||
<table style="width: auto">
|
<table style="width: auto">
|
||||||
<tr>
|
<tr>
|
||||||
<td tal:condition="python:'priority' in workItemType.fields">
|
<td tal:condition="priorities">
|
||||||
<label i18n:translate="" for="priority">Priority</label></td>
|
<label i18n:translate="" for="priority">Priority</label></td>
|
||||||
<td tal:condition="python:'activity' in workItemType.fields">
|
<td tal:condition="activities">
|
||||||
<label i18n:translate="" for="activity">Activity</label></td>
|
<label i18n:translate="" for="activity">Activity</label></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td tal:condition="python:'priority' in workItemType.fields">
|
<td tal:condition="priorities">
|
||||||
<select name="priority" id="priority"
|
<select name="priority" id="priority"
|
||||||
tal:define="value view/track/data/priority|nothing">
|
tal:define="value view/track/data/priority|nothing">
|
||||||
<option tal:repeat="prio view/priorities"
|
<option tal:repeat="prio priorities"
|
||||||
tal:attributes="value prio/name;
|
tal:attributes="value prio/name;
|
||||||
selected python:prio['name'] == value"
|
selected python:prio['name'] == value"
|
||||||
tal:content="prio/title" />
|
tal:content="prio/title" />
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
<td tal:condition="python:'activity' in workItemType.fields">
|
<td tal:condition="activities">
|
||||||
<select name="activity" id="activity"
|
<select name="activity" id="activity"
|
||||||
tal:define="value view/track/data/activity|nothing">
|
tal:define="value view/track/data/activity|nothing">
|
||||||
<option tal:repeat="act view/activities"
|
<option tal:repeat="act activities"
|
||||||
tal:attributes="value act/name;
|
tal:attributes="value act/name;
|
||||||
selected python:act['name'] == value"
|
selected python:act['name'] == value"
|
||||||
tal:content="act/title" />
|
tal:content="act/title" />
|
||||||
|
|
3
table.py
3
table.py
|
@ -93,7 +93,6 @@ class DataTable(AdapterBase):
|
||||||
self.context._data = OOBTree(data)
|
self.context._data = OOBTree(data)
|
||||||
data = property(getData, setData)
|
data = property(getData, setData)
|
||||||
|
|
||||||
@property
|
|
||||||
def dataAsRecords(self):
|
def dataAsRecords(self):
|
||||||
result = []
|
result = []
|
||||||
for k, v in sorted(self.data.items()):
|
for k, v in sorted(self.data.items()):
|
||||||
|
@ -107,7 +106,7 @@ class DataTable(AdapterBase):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def getRowsByValue(self, column, value):
|
def getRowsByValue(self, column, value):
|
||||||
return [r for r in self.dataAsRecords if r[column] == value]
|
return [r for r in self.dataAsRecords() if r[column] == value]
|
||||||
|
|
||||||
|
|
||||||
TypeInterfaceSourceList.typeInterfaces += (IDataTable,)
|
TypeInterfaceSourceList.typeInterfaces += (IDataTable,)
|
||||||
|
|
Loading…
Add table
Reference in a new issue