Commit 8cf7421c authored by berumuron's avatar berumuron
Browse files

tec: Allow to limit private events in Project.events

parent 4484e496
......@@ -169,8 +169,11 @@ class Project:
self.responsible = responsible
self.description = description
def events(self):
return Event.items(project_id=self.id)
def events(self, with_private=False):
if with_private:
return Event.items(project_id=self.id)
else:
return Event.items(project_id=self.id, is_private=False)
@classmethod
def items(cls, **kwargs):
......
......@@ -50,7 +50,7 @@
</div>
<ul class="events">
{% for event in project.events() if g.current_user or not event.is_private %}
{% for event in project.events(with_private=g.current_user) %}
<li class="event {{ 'event-private' if event.is_private }} {{ 'folder folder-folded' if event.description }}">
<span class="event-date">
{{ event.date.strftime('%d %b') }}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment