SuffolkLITLab / docassemble-AssemblyLine

Quickly go from a paper court form to a runnable, guided, step-by-step web application powered by Docassemble. Swap out branding and pre-built questions to meet your needs.
https://suffolklitlab.org/docassemble-AssemblyLine-documentation/
MIT License
43 stars 5 forks source link

Help someone have a field continue into multiple boxes and integrate with the `ALAddendumField.safe_value()` method #99

Open nonprofittechy opened 3 years ago

nonprofittechy commented 3 years ago

Sometimes there are two boxes on one form to handle overflow, but there's still a chance that you will need a real addendum.

Like:

Why do you need this motion?
+-------------------------------+
|                               |    
|                               |    
|                               |    
|                               |    
|                               |    
|                               |    
+-------------------------------+

Why do you need this motion (continued)
+-------------------------------+
|                               |    
|                               |    
|                               |    
+-------------------------------+

It would be nice to have a function that let you show an arbitrary number of lines of a text box, like:

safe_value(field, starting_at, additional_lines, line_length=80)

It would handle removing double newlines, etc. like the current DAAddendumField.safe_value() function. It could be line oriented instead of character oriented since it only has to handle text fields.

plocket commented 3 years ago

Might we consider a function that let you just specify multiple PDF fields for one variable and have the function or ALDocument method handle using the appropriate fields? [(Or calculating the characters for those fields.)]

nonprofittechy commented 3 years ago

Maybe a function signature would help. I'm not sure what you are envisioning.

plocket commented 3 years ago

Maybe I'm not clear on the purpose of this issue. I'm imagining a method for a ALDocument PDF that handles the issue automatically. I think we already calculate the dimensions of a pdf field, right? A possible example use for adding such a field: some_doc.add_overflow_field( 'var_with_full_text', ['pdf_field_1', 'pdf_field_2'], allow_addendum=True ). You might be able to later retrieve the info with something like some_doc.get_text( 'pdf_field_2' ) or some such.

nonprofittechy commented 3 years ago

I believe the need here is a bit simpler: splitting up the addendum/overflow text into multiple places. It's one text field that has two or more continuations; while safe_value() is currently set up to allow for just one continuation.