Nathan Schneider 521c782c42 Initial commit
2025-03-23 21:44:39 -06:00

2.8 KiB

Dispute Protocol Builder

This is a prototype website, built in Hugo, to enable communities to develop customizable protocols for dispute resolution processes. It guides users through an accessible process that provides best practices while allowing for customization.

Project Structure

  • Static Site Generator: Hugo
  • Main Builder Interface: /themes/dispute-protocol-theme/layouts/_default/builder.html
  • JavaScript Files:
    • /static/js/builder.js: Main application logic
    • /static/js/data/modules.js: Predefined module options
    • /static/js/data/templates.js: Complete protocol templates
    • /static/js/data/template-mapper.js: Maps raw content to module references

Content Organization

  • Components: Building blocks of a protocol, defined in /data/components/*.yaml
  • Modules: Reusable text blocks for specific fields, defined in modules.js
  • Templates: Complete predefined protocols combining multiple modules

Data Model

The application maintains a hierarchical data model:

  • StagesComponentsFields
  • Each field can be populated with content from a Module

Core Features

  1. Black & white UI: Clean, accessible interface with vertical accordion sections
  2. Template selection: Users can start with a predefined protocol template
  3. Module selection: Users can choose from multiple pre-written modules for each field
  4. Customization: Direct text editing in fields
  5. Export options: Markdown, PDF, and JSON formats
  6. Import capability: Load previously saved protocols

Module System

Modules are the heart of the customization system:

  • Each module has: id, title, componentId, fieldId, and content
  • Modules are categorized by type (principles, participants, filing, etc.)
  • Custom modules are generated from templates via template-mapper.js
  • Module selector dropdowns display available options for each field

Recent Improvements

  1. Template mapping: Fixed custom module generation to create descriptive titles
  2. Module presentation: Removed category labels from dropdowns
  3. Module coverage: Added comprehensive modules for all components
  4. Name formatting: Enhanced logic to extract meaningful titles from content

Deployment

  • Deployable from a self-hosted GitLab server
  • Data is maintained in YAML files for components and stages
  • Module content is defined in JavaScript for easy client-side use

Key Files to Modify

  • /static/js/data/modules.js: Add, edit or remove module options
  • /static/js/data/template-mapper.js: Adjust how custom modules are generated
  • /static/js/data/templates.js: Define new protocol templates
  • /static/js/builder.js: Modify core interface functionality
  • /static/css/main.css: Adjust styling and responsive behavior