Add version control context processor and integrate map functionality with dedicated JavaScript

This commit is contained in:
pacnpal
2025-02-06 20:06:10 -05:00
parent f3d28817a5
commit ecf94bf84e
16 changed files with 1671 additions and 89 deletions

View File

@@ -0,0 +1,86 @@
# Version Control UI Template Integration
## Templates Requiring VCS Integration
### Park System
- [x] parks/templates/parks/park_detail.html - Completed
- [ ] parks/templates/parks/park_list.html - Add version status indicators
- [ ] parks/templates/parks/park_area_detail.html - Add version control UI
### Rides System
- [ ] rides/templates/rides/ride_detail.html - Add version control UI
- [ ] rides/templates/rides/ride_list.html - Add version status indicators
### Reviews System
- [ ] reviews/templates/reviews/review_detail.html - Add version control UI
- [ ] reviews/templates/reviews/review_list.html - Add version status indicators
### Company System
- [ ] companies/templates/companies/company_detail.html - Add version control UI
- [ ] companies/templates/companies/company_list.html - Add version status indicators
## Integration Guidelines
### Detail Templates
For detail templates, add the version control UI below the main title:
```html
<!-- Title Section -->
<h1>{{ object.name }}</h1>
<!-- Version Control UI -->
{% include "history_tracking/includes/version_control_ui.html" %}
<!-- Rest of the content -->
```
### List Templates
For list templates, add version indicators in the list items:
```html
{% for item in object_list %}
<div class="item">
<h2>{{ item.name }}</h2>
{% if version_control.vcs_enabled %}
<div class="version-info text-sm text-gray-600">
Branch: {{ item.get_version_info.current_branch.name }}
</div>
{% endif %}
</div>
{% endfor %}
```
## Integration Steps
1. Update base template to include necessary JavaScript
```html
<!-- In base.html -->
<script src="{% static 'js/version-control.js' %}"></script>
```
2. Add version control UI to detail views
- Include the version control UI component
- Add branch switching functionality
- Display version history
3. Add version indicators to list views
- Show current branch
- Indicate if changes are pending
- Show version status
4. Update view classes
- Ensure models inherit from HistoricalModel
- Add version control context
- Handle branch switching
5. Test integration
- Verify UI appears correctly
- Test branch switching
- Verify history tracking
- Test merge functionality
## Next Steps
1. Create park area detail template with version control
2. Update ride detail template
3. Add version control to review system
4. Integrate with company templates