Skip to content

Commit

Permalink
comparison put inside the template
Browse files Browse the repository at this point in the history
  • Loading branch information
hrifanov authored and prihoda committed Jan 5, 2023
1 parent bd683cb commit 9ba777b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
{{ icon('chevron-left') }} Results
</a>
</div>
{% if has_next_page or has_prev_page %}
{% if result_index > 1 or result_index < len_results %}
<div class="col-sm-2">
{% if has_prev_page %}
{% if result_index > 1 %}
<a class="btn btn-light" href="{{ url_for('biophi_humanization.humanize_detail_get', task_id=task_id, index=result_index-1) }}"> {{ icon('caret-left-fill') }} </a>
{% else %}
<a class="btn btn-light" style="visibility:hidden"> {{ icon('caret-left-fill') }} </a>
{% endif %}
{{result_index}}/{{len_results}}
{% if has_next_page %}
{% if result_index < len_results %}
<a class="btn btn-light" href="{{ url_for('biophi_humanization.humanize_detail_get', task_id=task_id, index=result_index+1) }}"> {{ icon('caret-right-fill') }} </a>
{% else %}
<a class="btn btn-light" style="visibility:hidden"> {{ icon('caret-right-fill') }} </a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
{{ icon('chevron-left') }} Results
</a>
</div>
{% if has_next_page or has_prev_page %}
{% if result_index > 1 or result_index < len_results %}
<div class="col-sm-2">
{% if has_prev_page %}
{% if result_index > 1 %}
<a class="btn btn-light" href="{{ url_for('biophi_humanization.humanness_report_detail_get', task_id=task_id, result_index=result_index-1) }}"> {{ icon('caret-left-fill') }} </a>
{% else %}
<a class="btn btn-light" style="visibility:hidden"> {{ icon('caret-left-fill') }} </a>
{% endif %}
{{result_index}}/{{len_results}}
{% if has_next_page %}
{% if result_index < len_results %}
<a class="btn btn-light" href="{{ url_for('biophi_humanization.humanness_report_detail_get', task_id=task_id, result_index=result_index+1) }}"> {{ icon('caret-right-fill') }} </a>
{% else %}
<a class="btn btn-light" style="visibility:hidden"> {{ icon('caret-right-fill') }} </a>
Expand Down
18 changes: 7 additions & 11 deletions biophi/humanization/web/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,14 @@ def humanize_detail_get(task_id, index):
result: HumanizeAntibodyTaskResult = scheduler.get_result(task_id, index)

len_results = scheduler.get_results_len(task_id)

has_prev_page = int(index) > 1
has_next_page = int(index) < len_results

return render_template('humanization/humanize_detail.html',
task_id=task_id, result_task_id=result_task_id, result=result, result_index=int(index), len_results=len_results, has_prev_page=has_prev_page, has_next_page=has_next_page)
task_id=task_id,
result_task_id=result_task_id,
result=result,
result_index=int(index),
len_results=len_results
)


@biophi_humanization.route('/humanize/report/<task_id>/humanized.fa', methods=['GET'])
Expand Down Expand Up @@ -397,17 +399,11 @@ def humanness_report_detail_get(task_id, result_index):
result: HumannessTaskResult = scheduler.get_result(task_id, result_index)
len_results = scheduler.get_results_len(task_id)

has_prev_page = int(result_index) > 1
has_next_page = int(result_index) < len_results


return render_template('humanization/humanness_report_detail.html',
task_id=task_id,
result_index=result_index,
result_index=int(result_index),
result=result,
len_results=len_results,
has_prev_page=has_prev_page,
has_next_page=has_next_page,
)


Expand Down

0 comments on commit 9ba777b

Please sign in to comment.