Skip to content

Commit

Permalink
Not sure where classname commit went
Browse files Browse the repository at this point in the history
  • Loading branch information
plocket committed Jul 6, 2023
1 parent 66c482d commit 6458633
Show file tree
Hide file tree
Showing 15 changed files with 287 additions and 933 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ They are placed here
rather than in https://github.com/SuffolkLitLab/docassemble-AssemblyLine because we believe these small components can easily be used
by anyone, regardless of whether they use any other code from the Document Assembly Line project.

If you want to add a small function to this project, consider adding it to the existing misc.py to avoid creating too many module files.
If you want to add a small fuction to this project, consider adding it to the existing misc.py to avoid creating too many module files.

## Documentation

Expand All @@ -17,7 +17,7 @@ how to use these components in your own [Docassemble](https://github.com/jhpyle/

## Suffolk LIT Lab Document Assembly Line

<img src="https://user-images.githubusercontent.com/7645641/142245862-c2eb02ab-3090-4e97-9653-bb700bf4c54d.png" alt="drawing of people working together on a website UI" width="300" style="align: center;"/>
<img src="https://user-images.githubusercontent.com/7645641/142245862-c2eb02ab-3090-4e97-9653-bb700bf4c54d.png" alt="drawing" width="300" alt="work together" style="align: center;"/>

The Assembly Line Project is a collection of volunteers, students, and institutions who joined together
during the COVID-19 pandemic to help increase access to the court system. Our vision is mobile-friendly,
Expand All @@ -34,7 +34,7 @@ consistent, and attractive Docassemble interviews that help complete court forms
Read more on our [documentation page](https://suffolklitlab.org/docassemble-AssemblyLine-documentation/).


## Related repositories
# Related repositories

* https://github.com/SuffolkLitLab/docassemble-AssemblyLine
* https://github.com/SuffolkLitLab/docassemble-ALWeaver
Expand Down
1,004 changes: 122 additions & 882 deletions docassemble/ALToolbox/ThreePartsDate.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docassemble/ALToolbox/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.8.1'
__version__ = '0.7.1'
63 changes: 60 additions & 3 deletions docassemble/ALToolbox/data/questions/ThreePartsDate.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,61 @@
metadata:
title: ALToolbox - CustomDatatype "ThreePartsDate"
---
features:
css: al_three_parts_date.css
---
modules:
- .ThreePartsDate
---
mandatory: True
code: |
date_of_birth
end
---
question: |
Regular datatype vs ThreePartsDate datatype.
subquestion: |
This example shows you how to use the **ThreePartsDate** datatype.<br/><br/>
ThreePartsDate is good for dates such as a birth date where it's easier for a user to type than to use a long dropdown, or when a browser doesn't honor a datepicker.
The BirthDate datatype is like ThreePartsDate, but it adds
validation so that you cannot enter dates in the future.
fields:
- When is your high school graduation?: date_of_graduation
datatype: ThreePartsDate
required: False
- Birth date (today is valid): date_of_birth
datatype: BirthDate
default: ${ today(format='MM/dd/yyyy') }
required: True
- Show hidden date fields: show_fields
datatype: yesno
- Court date: court_date
datatype: ThreePartsDate
default: '2/1/2055'
required: True
show if: show_fields
- Date you lost your first tooth: tooth_date
datatype: BirthDate
required: False
show if: show_fields
---
#mandatory: true
event: end
question: |
Your dates
subquestion: |
% if date_of_birth:
You were born ${ date_of_birth }.
% endif
% if date_of_graduation:
Your graduation date is ${ date_of_graduation }
% endif
% if defined('court_date'):
Your court date is ${ court_date }
% endif
% if defined('tooth_date') and not tooth_date is None:
The date lost your first tooth was ${ tooth_date }
% endif
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,20 @@ subquestion: |
What is your favorite fruit? Everybody has a favorite fruit.
${ collapse_template(fruit_explanation, closed_icon="plus", open_icon="minus") }
Don't you have a favorite fruit?
${ collapse_template(favorite_explanation) }
You must have a favorite.
fields:
- Favorite fruit: favorite_fruit
css: |
<style>
#about_favorites a {
text-decoration-style: double;
}
</style>
---
mandatory: True
question: |
Expand Down
47 changes: 29 additions & 18 deletions docassemble/ALToolbox/data/questions/display_template_demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ subquestion: |
1. **copy** (default=False)
- It adds a copy button under the template for users to copy/share the template content.
- This feature applies the **copy_button_html()** function to template content. See [copy button demo](${interview_url(i=user_info().package + ":copy_button_demo.yml")}).
1. **class_name** (default=None)
- To style your template, include a class_name input in the call, and add your css rules either on the screen or to a .css file.
1. **classname** (default="bg-light")
- To style your template content, include a `classname` keyword argument when you call the function and add your css rules either on the screen or to a .css file.
You can mix and match these features. The following screens will show you how.
Expand All @@ -44,37 +44,42 @@ question: |
Scrollable examples
subquestion: |
##### Srollable only
${ display_template(my_template1) }<br>
${ display_template(my_template1) }
##### Style only
${ display_template(my_template2, scrollable=False, class_name="my_color")}
${ display_template(my_template2, scrollable=False, classname="my_color") }
##### Template with no subject
${ display_template(template_no_subject) }
---
id: collapse and scrollable examples
continue button field: collapse_n_scrollable_examples
question: |
Collase and scrollable examples
subquestion: |
##### Collapse only with a style
${ display_template(my_template1, scrollable=False, collapse=True, class_name="my_color") }
${ display_template(my_template1, scrollable=False, collapse=True, classname="my_color") }
##### Collapse and scrollable, without the copy button
${ display_template(my_template2, collapse=True) }
---
id: copy button examples
continue button field: copy_button_examples
event: copy_button_examples
question: |
Copy button examples
fields:
- html: <h5>Copy and scrollable</h5>
- note: |
${ display_template(my_template1, copy=True) }
- html: <h5>Copy and collapse but not scrollable</h5>
- note: |
_(Hover over the box to see the full template content. If this is annoying, keep the default value scrollable=True as shown in the very last example.)_<br><br>
${ display_template(my_template1, scrollable=False, collapse=True, copy=True) }
- html: <h5>Copy and collapse and scrollable</h5>
- note: |
${ display_template(my_template2, collapse=True, copy=True) }
subquestion: |
<h5>Copy and scrollable</h5>
${ display_template(my_template1, copy=True) }
<h5>Copy and collapse but not scrollable</h5>
_(Hover over the box to see the full template content. If this is annoying, keep the default value scrollable=True as shown in the very last example.)_
${ display_template(my_template1, scrollable=False, collapse=True, copy=True) }
<h5>Copy and collapse and scrollable</h5>
${ display_template(my_template2, collapse=True, copy=True) }
---
template: my_template1
subject: |
Expand All @@ -94,4 +99,10 @@ content: |
Est ad autem vitae, ius graeco delicata eu. Vim quod postea ad. Vero omnis iuvaret in ius. Eu noster volumus sed.
Qui eu dictas senserit. Ne affert doctus his. Eius dicta utinam ex pri, tota equidem vel at. Cu nec habemus definitiones, eos oratio impedit mediocrem ex, inermis necessitatibus duo et. Malis graeco dicunt ei mea. Ei idque cetero est.
Qui eu dictas senserit. Ne affert doctus his. Eius dicta utinam ex pri, tota equidem vel at. Cu nec habemus definitiones, eos oratio impedit mediocrem ex, inermis necessitatibus duo et. Malis graeco dicunt ei mea. Ei idque cetero est.
---
template: template_no_subject
content: |
Qui eu dictas senserit. Ne affert doctus his. Eius dicta utinam ex pri, tota equidem vel at. Cu nec habemus definitiones, eos oratio impedit mediocrem ex, inermis necessitatibus duo et. Malis graeco dicunt ei mea. Ei idque cetero est.
Est ad autem vitae, ius graeco delicata eu. Vim quod postea ad. Vero omnis iuvaret in ius. Eu noster volumus sed.
4 changes: 2 additions & 2 deletions docassemble/ALToolbox/data/questions/multiselect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ comment: |
script: |
<script type="text/javascript">
$(document).ready(function() {
$("#${ base64.b64encode("input_name".encode()) }").multiselect({enableCaseInsensitiveFiltering: true, inheritClass: true});
$("#${ base64.b64encode("input_name") }").multiselect({enableCaseInsensitiveFiltering: true, inheritClass: true});
});
</script>
Expand All @@ -28,4 +28,4 @@ comment: |
https://davidstutz.github.io/bootstrap-multiselect/
Forked as of 11/18/2021, with changes to make compatible with Bootstrap 5
Forked as of 11/18/2021, with changes to make compatible with Bootstrap 5

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions docassemble/ALToolbox/data/static/collapse_template.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.al_collapse_template {
padding-bottom: 1rem;
}

a span.pdcaretopen {
display: inline;
}
Expand Down
6 changes: 5 additions & 1 deletion docassemble/ALToolbox/data/static/display_template.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.al_display_template {
padding-bottom: 1rem;
}

.scrollable-panel{
height:200px;
max-height:200px;
overflow-y:scroll;
width:100%;
}
Expand Down
3 changes: 2 additions & 1 deletion docassemble/ALToolbox/data/static/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
background: lightcyan;
color: darkgreen;
}
h5 {

h5, .h5 {
color: brown;
}
Loading

0 comments on commit 6458633

Please sign in to comment.