Allow to define the text color and background color in calendar view

issue5953
review33461002
This commit is contained in:
Sergi Almacellas Abellana committed 2016-10-28 17:55:09 +02:00
1 parent ea605d2e9c
commit 226caf249b
5 files changed
+22 -1

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
* Allow to define the text color and background color in calendar view
* Allow to override cache implementation
* Add button rule
* Allow to specify translatable languages in trytond-admin
+6
View File
@@ -771,6 +771,12 @@ Each calendar view must start with this tag.
* ``mode``: An optional name for the view that will be used first.
Available views are: `week` and `month`. The default value is `month`.
* ``color``: An optional field name that contains the text color for the
event. The default value is `black`.
* ``background_color``: An optional field name that contains the background
color for the event. The default value is `lightblue`.
field
^^^^^
+4
View File
@@ -8,6 +8,10 @@ attlist.calendar &=
attlist.calendar &=
attribute mode { "week"
| "month" }?
attlist.calendar &=
[ a:defaultValue = "black" ] attribute color { text }?
attlist.calendar &=
[ a:defaultValue = "lightblue" ] attribute background_color { text }?
field = element field { attlist.field, empty }
attlist.field &= attribute name { text }
data = element data { attlist.data, xpath* }
+10
View File
@@ -26,6 +26,16 @@
</attribute>
</optional>
</define>
<define name="attlist.calendar" combine="interleave">
<optional>
<attribute name="color" a:defaultValue="black"/>
</optional>
</define>
<define name="attlist.calendar" combine="interleave">
<optional>
<attribute name="background_color" a:defaultValue="lightblue"/>
</optional>
</define>
<define name="field">
<element name="field">
<ref name="attlist.field"/>
+1 -1
View File
@@ -587,7 +587,7 @@ class ModelView(Model):
fields_attrs.setdefault(element.get('sequence'), {})
if element.tag == 'calendar':
for attr in ('dtstart', 'dtend'):
for attr in ['dtstart', 'dtend', 'color', 'background_color']:
if element.get(attr):
fields_attrs.setdefault(element.get(attr), {})