def gen_prs_content_pages(self, project_gid=None):
for task_id in self.kb.my_tasks.keys():
content_slide_layout = self.prs.slide_layouts[1]
slide = self.prs.slides.add_slide(content_slide_layout)
title = slide.shapes[0]
title.text = f"{self.kb.my_tasks[task_id]['name']} - {self.kb.my_tasks[task_id]['assignee']['name']}"
body_shape = slide.placeholders[1]
tf = body_shape.text_frame
start_on = self.kb.my_tasks[task_id]['start_on'].strftime("%Y-%m-%d")
due_on = self.kb.my_tasks[task_id]['due_on'].strftime("%Y-%m-%d")
is_completed = self.kb.my_tasks[task_id]['completed']
tf.text = f"任務名稱:{self.kb.my_tasks[task_id]['name']}\n"
tf.text += f"指派給: {self.kb.my_tasks[task_id]['assignee']['name']}\n"
tf.text += f"預定時間:{start_on} ~ {due_on}\n"
if is_completed:
tf.text += f"狀態:{self.kb.my_tasks[task_id]['completed_at'].strftime('%Y-%m-%d')} 完成"
elif self.kb.my_tasks[task_id]['start_on'] > date.today():
tf.text += f"狀態: 尚未開始"
else:
tf.text += f"狀態: 進行中..."