<commit_before># Alternate dispute resolution pathways tool

A resource discovery tool that asks the customer for their story and presents matching resources.
This tool is implemented as a pattern for content pages in the [Your rights, crime and the law][YRCL] franchise of Queensland Government.

## Background

At the most fundamental level the justice system is about resolving a dispute between two or more parties.

The justice system is traditionally viewed as complex, with a plethora of different ways individuals can engage the system to resolve their disputes. These options are not always clear for customers. This results in customers taking a pathway to resolution that could have otherwise been resolved in a less complex manner.

---

## Publishing a new service page

There are 2 pages: search form and results. You may use a single HTML file for both, or use separate files to alter the static content and metadata.

### A note on search engine optimisation (SEO)

There is no server-side support for rendering the search result content into the page for search engines. SEO relies entirely on the static content embedded in the page.

- SWE template
- dataset (hosted on Queensland Government's [open data portal][data])
- views: form, results, noresults, noscript.

### Dependencies

- [SWE template][SWE]: integration with Queensland Government online channel including:
  - [jQuery][jquery]: DOM helper library
  - [purl][purl]: URL helper library
  - web hosting on www.qld.gov.au
  - analytics
  - feedback
  - share
- [history.js][history.js]: a polyfill for managing browser state with support for old IE
- [handlebars][handlebars]: a light-weight template library for creating views with data
- [DataTables][datatables]: jquery plugin for sorting, filtering and pagination of tables
- source dataset (published on [data.qld.gov.au][data])
- custom script. The script for this tool is published on www under `/assets/law/dispute-pathways.js`

## Views

'Views' are the different states displayed in the UI.
Views are generated by mixing model data (viewmodel) with a template.
The template framework used by this tool is [handlebars][handlebars].
Templates must be embedded in the page as custom scripts.
Recommended: use [server-side includes (SSI)][SSI] on the www.qld.gov.au environment and manage templates as separate files.

### Helpers

In addition to standard handlebars functionality, the following helpers are implemented for this tool:

| Helper name  | Purpose                           | Usage                                                                              |
|--------------|-----------------------------------|------------------------------------------------------------------------------------|
| `vowelSound` | Render `a` or `an` as appropriate | `{{ vowelSound story.have 'an' 'a' }}` -> `a dispute` OR `an issue`                |
| `pluralize`  | Render plurals                    | `{{ pluralize results.totalMatches 'option' 'options' }}` -> `option` OR `options` |
| `select`     | Selects correct option            | Wrap around `<option>` elements within a `<select>` control                        |

### Form

The form view should be created with a handlebars template in order to correctly select the right values in the form.<commit_msg>add documentation on page structure<commit_after># Alternate dispute resolution pathways tool

A resource discovery tool that asks the customer for their story and presents matching resources.
This tool is implemented as a pattern for content pages in the [Your rights, crime and the law][YRCL] franchise of Queensland Government.

## Background

At the most fundamental level the justice system is about resolving a dispute between two or more parties.

The justice system is traditionally viewed as complex, with a plethora of different ways individuals can engage the system to resolve their disputes. These options are not always clear for customers. This results in customers taking a pathway to resolution that could have otherwise been resolved in a less complex manner.

---

## Publishing a new service page

There are 2 pages: search form and results.
You may use a single HTML file for both, or use separate files to alter the static content and metadata.

### A note on search engine optimisation (SEO)

There is no server-side support for rendering the search result content into the page for search engines. SEO relies entirely on the static content embedded in the page.

- SWE template
- dataset (hosted on Queensland Government's [open data portal][data])
- views: form, results, noresults, noscript.

### Dependencies

- [SWE template][SWE]: integration with Queensland Government online channel including:
  - [jQuery][jquery]: DOM helper library
  - [purl][purl]: URL helper library
  - web hosting on www.qld.gov.au
  - analytics
  - feedback
  - share
- [history.js][history.js]: a polyfill for managing browser state with support for old IE
- [handlebars][handlebars]: a light-weight template library for creating views with data
- [DataTables][datatables]: jquery plugin for sorting, filtering and pagination of tables
- source dataset (published on [data.qld.gov.au][data]) and specified in the metadata
- custom script. The script for this tool is published on www under `/assets/law/dispute-pathways.js`

## Page structure

1. follow the standard SWE template page structure
2. metadata: specify the dataset in the 'source', example:

   ```html
   <meta name="DCTERMS.source" scheme="DCTERMS.URI" content="https://staging.data.qld.gov.au/dataset/dispute-resolution-datasets/resource/56ac21ba-3de3-421a-ac40-297713e37e9d" />
   ```
3. embed custom styles: if any custom styles are required for the UI, embed them in a `<style>` tag
4. add a container for the main view:

   ```html
   <div id="dispute-pathways-view"></div>
   ```
5. add view templates (see below)
6. link to dependencies:

   ```html
   <script src="https://cdnjs.cloudflare.com/ajax/libs/history.js/1.8/bundled-uncompressed/html4+html5/jquery.history.js"></script>
   <script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/3.0.3/handlebars.min.js"></script>
   <script src="https://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.7/js/jquery.dataTables.min.js"></script>
   ```
7. link to the pathway tool script:

   ```html
   <script src="/assets/law/dispute-pathways.js"></script>
   ```

## Views

'Views' are the different states displayed in the UI.
Views are generated by mixing model data (viewmodel) with a template.
The template framework used by this tool is [handlebars][handlebars].
Templates must be embedded in the page as custom scripts.
Recommended: use [server-side includes (SSI)][SSI] on the www.qld.gov.au environment and manage templates as separate files.

### Helpers

In addition to standard handlebars functionality, the following helpers are implemented for this tool:

| Helper name  | Purpose                           | Usage                                                                              |
|--------------|-----------------------------------|------------------------------------------------------------------------------------|
| `vowelSound` | Render `a` or `an` as appropriate | `{{ vowelSound story.have 'an' 'a' }}` -> `a dispute` OR `an issue`                |
| `pluralize`  | Render plurals                    | `{{ pluralize results.totalMatches 'option' 'options' }}` -> `option` OR `options` |
| `select`     | Selects correct option            | Wrap around `<option>` elements within a `<select>` control                        |

### Form

The form view should be created with a handlebars template in order to correctly select the right values in the form.
{'fraction_non_alphanumeric': 0.11598705501618123, 'fraction_numerical': 0.005177993527508091, 'mean_word_length': 3.0072614107883817, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, 'https://': 4, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3238826', 'n_tokens_mistral': 1963, 'n_tokens_neox': 1882, 'n_words': 899}