A great deal of information needs to be communicated to volunteers via the instructions in particular. Volunteers take in a lot of new information in their initial training's and often need notes on shifts to help remind them of all the nuances. Readable, organized notes go a long way to ensuring a shift is completed in the full context of what's needed. Currently Rootable notes are lengthy and have no formatting. Volunteers can miss information or don't bother reading it. Our current notes are not readable: they are just plain text with newlines.
Sites have "admin notes" and "instructions". Volunteers see the instructions, and org admins see both. These are now able to be saved as rich text via Trix.
Converting old notes
Trix saves data via action text as HTML in the database. Each rich text field on a model is stored as an ActionText::RichText record. To convert existing notes, I took a very simple approach of replacing newlines with <br> tags. It's not perfect, but it should give reasonable output from the existing text.
This also converts notes when converting from the old site.
Trix customization
Trix is kind of annoying to customize, but I wanted the formatting to stay simple. I hid some toolbar buttons like adding a codeblock or indentations, and made the heading h3 instead of h1 since semantically it fits in better with the page.
A great deal of information needs to be communicated to volunteers via the instructions in particular. Volunteers take in a lot of new information in their initial training's and often need notes on shifts to help remind them of all the nuances. Readable, organized notes go a long way to ensuring a shift is completed in the full context of what's needed. Currently Rootable notes are lengthy and have no formatting. Volunteers can miss information or don't bother reading it. Our current notes are not readable: they are just plain text with newlines.
Sites have "admin notes" and "instructions". Volunteers see the instructions, and org admins see both. These are now able to be saved as rich text via [Trix](https://trix-editor.org/).
## Converting old notes
Trix saves data via action text as HTML in the database. Each rich text field on a model is stored as an `ActionText::RichText` record. To convert existing notes, I took a very simple approach of replacing newlines with `<br>` tags. It's not perfect, but it should give reasonable output from the existing text.
This also converts notes when converting from the old site.
## Trix customization
Trix is kind of annoying to customize, but I wanted the formatting to stay simple. I hid some toolbar buttons like adding a codeblock or indentations, and made the heading h3 instead of h1 since semantically it fits in better with the page.