Skip to content

Commit 07cca28

Browse files
author
Liam Hoflay
committed
Adding better formatting to publish dialog for summaries.
1 parent 7d666da commit 07cca28

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

python/tk_multi_publish2/dialog.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@ def _create_item_details(self, tree_item):
624624

625625
else:
626626
summary_text = "<p>The following items will be processed:</p>"
627+
summary_text += "<style>ul { margin-left:-20px; }</style>"
627628
summary_text += "".join(["<p>%s</p>" % line for line in summary])
628629

629630
self.ui.item_summary.setText(summary_text)

python/tk_multi_publish2/publish_tree_widget/tree_node_item.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __repr__(self):
6060
def __str__(self):
6161
return "%s %s" % (self._item.type_display, self._item.name)
6262

63-
def create_summary(self):
63+
def create_summary(self, level=0):
6464
"""
6565
Creates summary of actions
6666
@@ -70,22 +70,25 @@ def create_summary(self):
7070

7171
items_summaries = []
7272
task_summaries = []
73-
7473
for child_index in xrange(self.childCount()):
7574
child_item = self.child(child_index)
7675

7776
if isinstance(child_item, TreeNodeTask):
7877
task_summaries.extend(child_item.create_summary())
7978
else:
8079
# sub-items
81-
items_summaries.extend(child_item.create_summary())
80+
items_summaries.extend(child_item.create_summary(level + 1))
8281

8382
summary = []
8483

8584
if len(task_summaries) > 0:
85+
summary_str = "<ul><li>" * level
86+
summary_str += "<b>%s</b>" % self.item.name
87+
summary_str += "<ul style=\"list-style-type:circle;\">"
88+
summary_str += "".join(["<li><i>%s</i></li>" % task_summary for task_summary in task_summaries])
89+
summary_str += "</ul>"
90+
summary_str += "</li></ul>" * level
8691

87-
summary_str = "<b>%s</b><br>" % self.item.name
88-
summary_str += "<br>".join(["&ndash; %s" % task_summary for task_summary in task_summaries])
8992
summary.append(summary_str)
9093

9194
summary.extend(items_summaries)

0 commit comments

Comments
 (0)