diff --git a/browser/action_macros.pt b/browser/action_macros.pt
index ab185c0..38492dc 100644
--- a/browser/action_macros.pt
+++ b/browser/action_macros.pt
@@ -8,7 +8,8 @@
+ title action/description;"
+ i18n:attributes="title">
+ alt action/description"
+ i18n:attributes="alt" />
Action Title
diff --git a/browser/controller.py b/browser/controller.py
index c44c408..3fcd482 100644
--- a/browser/controller.py
+++ b/browser/controller.py
@@ -83,7 +83,7 @@ class Macros(dict):
def __init__(self, controller):
self.controller = controller
- self.identifiers = set()
+ self.identifiers = {}
def register(self, slot, identifier=None, template=None, name=None,
priority=50, **kw):
@@ -91,21 +91,28 @@ class Macros(dict):
# make sure a certain resource is only registered once
if identifier in self.identifiers:
return
- self.identifiers.add(identifier)
+ #self.identifiers.add(identifier)
+ self.identifiers[identifier] = True
if template is None:
template = self.standardTemplate
if name is None:
name = slot
- macro = Macro(template, name, priority, **kw)
+ macro = Macro(template, name, priority, identifier=identifier, **kw)
entry = self.setdefault(slot, [])
entry.append(macro)
+ def hide(self, identifier):
+ self.identifiers[identifier] = False
+
def __getitem__(self, key):
- return list(sorted(self.get(key, []), key=lambda x: x.priority))
+ return [m for m in sorted(self.get(key, []), key=lambda x: x.priority)
+ if self.identifiers.get(m.identifier, True)]
class Macro(object):
+ identifier = ''
+
def __init__(self, template, name, priority, **kw):
self.template = template
self.name = name
diff --git a/browser/icons/ledgrey.png b/browser/icons/ledgrey.png
new file mode 100644
index 0000000..53369b0
Binary files /dev/null and b/browser/icons/ledgrey.png differ
diff --git a/organize/party.py b/organize/party.py
index 508aa7b..cb0cb96 100644
--- a/organize/party.py
+++ b/organize/party.py
@@ -48,10 +48,11 @@ class Person(object):
def age(self):
return self.ageAt(date.today())
- def ageAt(self, date):
- if not self.birthDate:
+ def ageAt(self, dt):
+ bd = self.birthDate
+ if not bd:
return None
- return int((date - self.birthDate).days/365.25)
+ return int((dt - date(bd.year, bd.month, bd.day)).days/365.25)
class Address(object):
diff --git a/stateful/publishing.py b/stateful/publishing.py
index 41a9d90..5b376e3 100644
--- a/stateful/publishing.py
+++ b/stateful/publishing.py
@@ -35,9 +35,9 @@ def simplePublishing():
return StatesDefinition('simple_publishing',
State('private', 'private', ('show', 'archive', 'remove'), color='red'),
State('draft', 'draft', ('publish', 'hide', 'archive', 'remove'),
- color='yellow'),
+ color='blue'),
State('published', 'published', ('retract', 'archive'), color='green'),
- State('archived', 'archived', ('show', 'remove'), color='lightblue'),
+ State('archived', 'archived', ('show', 'remove'), color='grey'),
State('removed', 'removed', ('show',), icon='cancel.png'),
Transition('show', 'show', 'draft'),
Transition('hide', 'hide', 'private'),