nog mooier fitleren
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
|
||||
<h1>Force Curve Analysis for {{ rower.user.first_name }} {{ rower.user.last_name }}</h1>
|
||||
|
||||
<form enctype="multipart/form-data" method="post">
|
||||
|
||||
<ul class="main-content">
|
||||
{% if the_div %}
|
||||
<li class="grid_4">
|
||||
@@ -28,6 +28,18 @@
|
||||
</div>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="grid_4">
|
||||
<form method="get">
|
||||
{{ searchform.as_table }}
|
||||
{{ dateform.as_table }}
|
||||
<input name='filter' type='submit' value="Filter">
|
||||
</form>
|
||||
</li>
|
||||
<li class="grid_4">
|
||||
<form enctype="multipart/form-data" method="post">
|
||||
{% csrf_token %}
|
||||
<input name='instroke_compare' type="submit" value="Compare Selected">
|
||||
</li>
|
||||
{% if analyses %}
|
||||
{% for analysis in analyses %}
|
||||
<li class="grid_4 divlines" id="analysis_{{ analysis.id }}">
|
||||
@@ -84,14 +96,11 @@
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<li class="grid_4">
|
||||
<p>You have not saved any analyses for {{ rower.user.first_name }}</p>
|
||||
<p>No analyses found for {{ rower.user.first_name }}</p>
|
||||
</li>
|
||||
{% endif %}
|
||||
</form>
|
||||
</ul>
|
||||
{% csrf_token %}
|
||||
<input name='instroke_compare' type="submit" value="Compare Selected">
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<li class="grid_4">
|
||||
<p>You have not saved any analyses for {{ rower.user.first_name }}</p>
|
||||
<p>No analyses found for {{ rower.user.first_name }}</p>
|
||||
</li>
|
||||
{% endif %}
|
||||
</form>
|
||||
|
||||
@@ -1974,12 +1974,26 @@ class SavedAnalysisView(UserPassesTestMixin, View):
|
||||
self.searchform = SearchForm()
|
||||
if query:
|
||||
query_list = query.split()
|
||||
self.analyses = self.analyses.filter(
|
||||
reduce(operator.and_,
|
||||
(Q(name__icontains=q) for q in query_list)) |
|
||||
reduce(operator.and_,
|
||||
(Q(notes__icontains=q) for q in query_list))
|
||||
)
|
||||
if self.analysis_class == InStrokeAnalysis:
|
||||
self.analyses = self.analyses.filter(
|
||||
reduce(operator.and_,
|
||||
(Q(name__icontains=q) for q in query_list)) |
|
||||
reduce(operator.and_,
|
||||
(Q(notes__icontains=q) for q in query_list)) |
|
||||
reduce(operator.and_,
|
||||
(Q(metric__icontains=q) for q in query_list)) |
|
||||
reduce(operator.and_,
|
||||
(Q(workout__name__icontains=q) for q in query_list))
|
||||
)
|
||||
else:
|
||||
self.analyses = self.analyses.filter(
|
||||
reduce(operator.and_,
|
||||
(Q(name__icontains=q) for q in query_list)) |
|
||||
reduce(operator.and_,
|
||||
(Q(notes__icontains=q) for q in query_list)) |
|
||||
reduce(operator.and_,
|
||||
(Q(workout__name__icontains=q) for q in query_list))
|
||||
)
|
||||
self.searchform = SearchForm(initial={'q': query})
|
||||
date_initial = {}
|
||||
if startdate:
|
||||
@@ -2023,6 +2037,8 @@ class SavedAnalysisView(UserPassesTestMixin, View):
|
||||
'the_script': self.script,
|
||||
'the_div': self.div,
|
||||
'selected': self.selected,
|
||||
'searchform': self.searchform,
|
||||
'dateform': self.dateform,
|
||||
})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user