@@ -73,10 +73,13 @@ def __repr__(self):
7373 def __str__ (self ):
7474 return "%s %s" % (self ._item .type_display , self ._item .name )
7575
76- def create_summary (self ):
76+ def create_summary (self , level = 0 ):
7777 """
7878 Creates summary of actions
7979
80+ :param level: Indentation level of this item lives within the tree.
81+ :type level: int
82+
8083 :returns: List of strings
8184 """
8285 if self .checked :
@@ -91,16 +94,23 @@ def create_summary(self):
9194 task_summaries .extend (child_item .create_summary ())
9295 else :
9396 # sub-items
94- items_summaries .extend (child_item .create_summary ())
97+ items_summaries .extend (child_item .create_summary (level + 1 ))
9598
9699 summary = []
97100
98101 if len (task_summaries ) > 0 :
99102
100- summary_str = "<b>%s</b><br>" % self .item .name
101- summary_str += "<br>" .join (
102- ["– %s" % task_summary for task_summary in task_summaries ]
103+ summary_str = "<ul><li>" * level
104+ summary_str += "<b>%s</b>" % self .item .name
105+ summary_str += '<ul style="list-style-type:circle;">'
106+ summary_str += "" .join (
107+ [
108+ "<li><i>%s</i></li>" % task_summary
109+ for task_summary in task_summaries
110+ ]
103111 )
112+ summary_str += "</ul>"
113+ summary_str += "</li></ul>" * level
104114 summary .append (summary_str )
105115
106116 summary .extend (items_summaries )
0 commit comments