From e7471348f9839fec053b6ccbf3c6c8a2b06fe8aa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Fri, 30 Aug 2013 16:58:03 +0200 Subject: [PATCH] Don't show activity counter if it's not adjacent to another activity --- librarian/pyhtml.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/librarian/pyhtml.py b/librarian/pyhtml.py index 096e1f6..7816a40 100644 --- a/librarian/pyhtml.py +++ b/librarian/pyhtml.py @@ -28,6 +28,7 @@ class EduModule(Xmill): def __init__(self, options=None): super(EduModule, self).__init__(options) self.activity_counter = 0 + self.activity_last = None self.exercise_counter = 0 # text filters @@ -113,10 +114,17 @@ class EduModule(Xmill): counter = self.activity_counter + if element.getnext().tag == 'aktywnosc' or self.activity_last.getnext() == element: + counter_html = """%(counter)d.""" % locals() + else: + counter_html = '' + + self.activity_last = element + return u"""
- %(counter)d. + %(counter_html)s %(opis)s""" % locals(), \ u"""%(wskazowki)s
-- 2.20.1