Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
64 lines (63 sloc) 1.74 KB
metadata:
title: Interviews
documentation: "https://docassemble.org/docs/config.html#session list interview"
example start: 1
example end: 6
---
initial: True
code: |
if not user_logged_in():
response(url=url_of('login'))
---
reconsider: True
code: |
current_info = user_info()
list_of_interviews = list()
next_id = None
while True:
(items, next_id) = interview_list(next_id=next_id)
for info in items:
if info['filename'] != current_info.filename:
list_of_interviews.append(info)
if not next_id:
break
if len(list_of_interviews) > 0:
list_of_interviews += [dict()]
---
table: session_table
rows: |
list_of_interviews
columns:
- Title: |
'<a href="' + interview_url(i=row_item['filename'], session=row_item['session']) + '">' + row_item['title'] + '</a>' if 'title' in row_item else ''
- Started: |
row_item['modtime'] if 'modtime' in row_item else ''
- Delete: |
action_button_html(url_action('delete', filename=row_item['filename'], session=row_item['session']), color='warning', label='Delete') if 'title' in row_item else action_button_html(url_action('delete_all'), color='danger', label='Delete All')
---
prevent going back: True
mandatory: True
question: |
Resume an interview
subquestion: |
% if len(list_of_interviews) > 0:
Click the interview title
to resume an interview
you already started.
${ session_table }
% else:
You do not have any sessions.
% endif
---
event: delete
code: |
if interview_list(
action='delete',
filename=action_argument('filename'),
session=action_argument('session')):
log("Deleted interview", "success")
---
event: delete_all
code: |
interview_list(action='delete_all')
log("Deleted interviews", "success")