-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6017cf8
commit 35ec541
Showing
2 changed files
with
225 additions
and
27 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
docassemble/AssemblyLine/data/questions/demo_search_sessions.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
include: | ||
- assembly_line.yml | ||
--- | ||
mandatory: True | ||
code: | | ||
search_keyword | ||
if not matching_results: | ||
no_matches | ||
show_results | ||
show_selected_interview | ||
--- | ||
id: search_keyword | ||
question: | | ||
What would you like to search for? | ||
subquestion: | | ||
Searching is not case sensitive. | ||
fields: | ||
- Keyword: search_keyword | ||
--- | ||
code: | | ||
matching_results = find_saved_interview(search_keyword, user_id="all") | ||
--- | ||
event: no_matches | ||
question: | | ||
We didn't find any matches | ||
subquestion: | | ||
Check your spelling and try again. | ||
--- | ||
continue button field: show_results | ||
question: | | ||
We found ${ len(matching_results) } results that match your keyword | ||
subquestion: | | ||
% for result in matching_results: | ||
* ${ nice_interview_subtitle(result, exclude_identical=False)} | ||
${ result["modtime"]} | ||
% endfor | ||
Raw results: | ||
<div class="overflow-scroll" style="height: 200px;"> | ||
${ matching_results } | ||
</div> | ||
fields: | ||
- Which session do you want to load: interview_to_load | ||
datatype: integer | ||
code: | | ||
[{idx: f"<b>{nice_interview_subtitle(answer, exclude_identical=False)}</b>" + f' ({answer.get("modtime", DAEmpty()).strftime("%B %d, %Y")})'} for idx, answer in enumerate(matching_results)] | ||
--- | ||
event: show_selected_interview | ||
id: show the selected interview | ||
question: | | ||
Here is some information from the session you chose | ||
subquestion: | | ||
Filename: ${ matching_results[interview_to_load]["filename"] } [BR] | ||
Session ID: ${ matching_results[interview_to_load]["key"] } | ||
<div class="overflow-scroll" style="height: 200px;"> | ||
<pre>${ get_filtered_session_variables_string(filename=matching_results[interview_to_load]["filename"], session_id=matching_results[interview_to_load]["key"]) }</pre> | ||
</div |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters