@@ -73,10 +73,13 @@ def __repr__(self):
73
73
def __str__ (self ):
74
74
return "%s %s" % (self ._item .type_display , self ._item .name )
75
75
76
- def create_summary (self ):
76
+ def create_summary (self , level = 0 ):
77
77
"""
78
78
Creates summary of actions
79
79
80
+ :param level: Indentation level of this item lives within the tree.
81
+ :type level: int
82
+
80
83
:returns: List of strings
81
84
"""
82
85
if self .checked :
@@ -91,16 +94,23 @@ def create_summary(self):
91
94
task_summaries .extend (child_item .create_summary ())
92
95
else :
93
96
# sub-items
94
- items_summaries .extend (child_item .create_summary ())
97
+ items_summaries .extend (child_item .create_summary (level + 1 ))
95
98
96
99
summary = []
97
100
98
101
if len (task_summaries ) > 0 :
99
102
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
+ ]
103
111
)
112
+ summary_str += "</ul>"
113
+ summary_str += "</li></ul>" * level
104
114
summary .append (summary_str )
105
115
106
116
summary .extend (items_summaries )
0 commit comments