no additional formats links if not needed
[librarian.git] / librarian / pyhtml.py
index 6aeada9..64ac47f 100644 (file)
@@ -196,8 +196,9 @@ class EduModule(Xmill):
             fmt_links = []
             for f in formats[1:]:
                 fmt_links.append(u'<a href="%s">%s</a>' % (make_url(f), f.upper()))
             fmt_links = []
             for f in formats[1:]:
                 fmt_links.append(u'<a href="%s">%s</a>' % (make_url(f), f.upper()))
+            more_links = u' (%s)' % u', '.join(fmt_links) if fmt_links else u''
 
 
-            return u"<a href='%s'>" % def_href, u'</a> (%s)' % u' '.join(fmt_links)
+            return u"<a href='%s'>" % def_href, u'</a>%s' % more_links
 
 
 class Exercise(EduModule):
 
 
 class Exercise(EduModule):
@@ -398,7 +399,7 @@ class Przyporzadkuj(Exercise):
         if self.options['subject']:
             self.piece_counter += 1
             if self.options['handles']:
         if self.options['subject']:
             self.piece_counter += 1
             if self.options['handles']:
-                return '<li><span data-solution="%s" data-no="%s" class="question-piece draggable handle">%s</span>' % (element.attrib['rozw'], self.piece_counter, self.piece_counter), '</li>'
+                return '<li><span data-solution="%s" data-no="%s" class="question-piece draggable handle add-li">%s</span>' % (element.attrib['rozw'], self.piece_counter, self.piece_counter), '</li>'
             else:
                 return '<li data-solution="%s" data-no="%s" class="question-piece draggable">' % (element.attrib['rozw'], self.piece_counter), '</li>'
 
             else:
                 return '<li data-solution="%s" data-no="%s" class="question-piece draggable">' % (element.attrib['rozw'], self.piece_counter), '</li>'