Refactor ride list and search suggestion templates for improved structure and styling; update view logic to support dynamic template rendering based on request type

This commit is contained in:
pacnpal
2025-02-11 15:24:14 -05:00
parent 59efc39143
commit f5c063b76f
8 changed files with 153 additions and 758 deletions

View File

@@ -261,6 +261,12 @@ class RideListView(ListView):
return queryset
def get_template_names(self):
"""Return appropriate template based on request type"""
if self.request.htmx:
return ["rides/partials/ride_list_results.html"]
return [self.template_name]
def get_context_data(self, **kwargs):
"""Add park and category choices to context"""
context = super().get_context_data(**kwargs)