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>
|
<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">
|
<ul class="main-content">
|
||||||
{% if the_div %}
|
{% if the_div %}
|
||||||
<li class="grid_4">
|
<li class="grid_4">
|
||||||
@@ -28,6 +28,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% 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 %}
|
{% if analyses %}
|
||||||
{% for analysis in analyses %}
|
{% for analysis in analyses %}
|
||||||
<li class="grid_4 divlines" id="analysis_{{ analysis.id }}">
|
<li class="grid_4 divlines" id="analysis_{{ analysis.id }}">
|
||||||
@@ -84,14 +96,11 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<li class="grid_4">
|
<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>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</form>
|
||||||
</ul>
|
</ul>
|
||||||
{% csrf_token %}
|
|
||||||
<input name='instroke_compare' type="submit" value="Compare Selected">
|
|
||||||
</form>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<li class="grid_4">
|
<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>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -1974,12 +1974,26 @@ class SavedAnalysisView(UserPassesTestMixin, View):
|
|||||||
self.searchform = SearchForm()
|
self.searchform = SearchForm()
|
||||||
if query:
|
if query:
|
||||||
query_list = query.split()
|
query_list = query.split()
|
||||||
self.analyses = self.analyses.filter(
|
if self.analysis_class == InStrokeAnalysis:
|
||||||
reduce(operator.and_,
|
self.analyses = self.analyses.filter(
|
||||||
(Q(name__icontains=q) for q in query_list)) |
|
reduce(operator.and_,
|
||||||
reduce(operator.and_,
|
(Q(name__icontains=q) for q in query_list)) |
|
||||||
(Q(notes__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})
|
self.searchform = SearchForm(initial={'q': query})
|
||||||
date_initial = {}
|
date_initial = {}
|
||||||
if startdate:
|
if startdate:
|
||||||
@@ -2023,6 +2037,8 @@ class SavedAnalysisView(UserPassesTestMixin, View):
|
|||||||
'the_script': self.script,
|
'the_script': self.script,
|
||||||
'the_div': self.div,
|
'the_div': self.div,
|
||||||
'selected': self.selected,
|
'selected': self.selected,
|
||||||
|
'searchform': self.searchform,
|
||||||
|
'dateform': self.dateform,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user