2025-03-23 21:44:39 -06:00
# 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
2025-05-07 21:30:06 -06:00
- `/static/js/templates/*.js` : Individual protocol template definitions
- `/static/js/templates/index.js` : Central registry of all templates
2025-03-23 21:44:39 -06:00
## Content Organization
- **Components**: Building blocks of a protocol, defined in `/data/components/*.yaml`
2025-05-07 21:30:06 -06:00
- **Templates**: Complete predefined protocols with content for all fields, defined in `/static/js/templates/*.js`
2025-03-23 21:44:39 -06:00
## Data Model
The application maintains a hierarchical data model:
- **Stages** → **Components ** → **Fields **
2025-05-07 21:30:06 -06:00
- Each field is populated with content directly from templates
2025-03-23 21:44:39 -06:00
## Core Features
1. **Black & white UI ** : Clean, accessible interface with vertical accordion sections
2. **Template selection ** : Users can start with a predefined protocol template
2025-05-07 21:30:06 -06:00
3. **Customization ** : Direct text editing in fields
4. **Export options ** : Markdown, PDF, and JSON formats
5. **Import capability ** : Load previously saved protocols
6. **Preview mode ** : Toggle to see how the final protocol will appear
2025-03-23 21:44:39 -06:00
2025-05-07 21:30:06 -06:00
## Template System
2025-03-23 21:44:39 -06:00
2025-05-07 21:30:06 -06:00
Templates provide complete content for dispute resolution protocols:
- Each template has: `id` , `title` , `description` , and content data
- Templates define content for all stages and components
- Templates are loaded dynamically using ES Modules
- The template selector provides one-click application of complete protocols
2025-03-23 21:44:39 -06:00
## Recent Improvements
2025-05-07 21:30:06 -06:00
1. **Simplified template system ** : Consolidated template loading to a single source of truth
2. **ES Module architecture ** : Implemented modern JavaScript module pattern
3. **Enhanced debugging ** : Added detailed logging for template application
4. **Component titles ** : Simplified all component titles to be more direct and consistent
5. **Preview mode ** : Improved rendering of protocol content with Markdown support
2025-03-23 21:44:39 -06:00
## Deployment
- Deployable from a self-hosted GitLab server
- Data is maintained in YAML files for components and stages
2025-05-07 21:30:06 -06:00
- Template content is defined in JavaScript files for easy client-side use
2025-03-23 21:44:39 -06:00
## Key Files to Modify
2025-05-07 21:30:06 -06:00
- `/static/js/templates/*.js` : Add, edit or remove protocol templates
- `/static/js/templates/index.js` : Register new templates in the central registry
2025-03-23 21:44:39 -06:00
- `/static/js/builder.js` : Modify core interface functionality
- `/static/css/main.css` : Adjust styling and responsive behavior
2025-05-07 21:30:06 -06:00
- `/data/components/*.yaml` : Edit component titles and structure