Files
thrillwiki_django_no_react/memory-bank/features/version-control/template_integration.md

2.3 KiB

Version Control UI Template Integration

Templates Requiring VCS Integration

Park System

  • 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:

<!-- 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:

{% 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
<!-- In base.html -->
<script src="{% static 'js/version-control.js' %}"></script>
  1. Add version control UI to detail views
  • Include the version control UI component
  • Add branch switching functionality
  • Display version history
  1. Add version indicators to list views
  • Show current branch
  • Indicate if changes are pending
  • Show version status
  1. Update view classes
  • Ensure models inherit from HistoricalModel
  • Add version control context
  • Handle branch switching
  1. 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