@@ -63,10 +63,13 @@ def __repr__(self):
6363 def __str__ (self ):
6464 return "%s %s" % (self ._item .type_display , self ._item .name )
6565
66- def create_summary (self ):
66+ def create_summary (self , level = 0 ):
6767 """
6868 Creates summary of actions
6969
70+ :param level: Indentation level of this item lives within the tree.
71+ :type level: int
72+
7073 :returns: List of strings
7174 """
7275 if self .checked :
@@ -81,16 +84,23 @@ def create_summary(self):
8184 task_summaries .extend (child_item .create_summary ())
8285 else :
8386 # sub-items
84- items_summaries .extend (child_item .create_summary ())
87+ items_summaries .extend (child_item .create_summary (level + 1 ))
8588
8689 summary = []
8790
8891 if len (task_summaries ) > 0 :
8992
90- summary_str = "<b>%s</b><br>" % self .item .name
91- summary_str += "<br>" .join (
92- ["– %s" % task_summary for task_summary in task_summaries ]
93+ summary_str = "<ul><li>" * level
94+ summary_str += "<b>%s</b>" % self .item .name
95+ summary_str += '<ul style="list-style-type:circle;">'
96+ summary_str += "" .join (
97+ [
98+ "<li><i>%s</i></li>" % task_summary
99+ for task_summary in task_summaries
100+ ]
93101 )
102+ summary_str += "</ul>"
103+ summary_str += "</li></ul>" * level
94104 summary .append (summary_str )
95105
96106 summary .extend (items_summaries )
0 commit comments