Skip to content

Commit

Permalink
Removed the back buttom from the first run page.
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerAK committed Nov 27, 2023
1 parent b960176 commit 0eab1d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions ui/runs/templates/runs/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ <h3>{{ display_name }}</h3>
<form action="{% url 'runs:next' run_name %}" method="post" id="runs_next">
{% csrf_token %}
<div class="form-group">
<a href="{% url 'runs:back' run_name %}" class="btn btn-grey mr-auto"
{% if not show_back %}
disabled {% endif %}>Back</a>
{% if show_back %}
<a href="{% url 'runs:back' run_name %}" class="btn btn-grey mr-auto">Back</a>
{% endif %}
<button class="btn btn-red" {% if not show_next %} disabled {% endif %}>Next
</button>
</div>
Expand Down
7 changes: 3 additions & 4 deletions ui/runs/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def detail(request, run_name):
run = active_runs[run_name]
section, step, method = run.current_run_location()
allow_next = run.calculated_method is not None or (run.step == "plot" and run.plots)

end_of_run = not step

current_plots = []
Expand Down Expand Up @@ -131,7 +132,7 @@ def detail(request, run_name):
name_field=make_name_field(allow_next, "runs_next", run, end_of_run),
current_plots=current_plots,
show_next=allow_next,
show_back=bool(run.history.steps),
show_back= bool(run.history.steps),
show_plot_button=run.result_df is not None,
sidebar=make_sidebar(request, run, run_name),
end_of_run=end_of_run,
Expand Down Expand Up @@ -441,9 +442,7 @@ def back(request, run_name):
:rtype: HttpResponse
"""
run = active_runs[run_name]
if run.step_index == 0:
messages.warning(request, "You are already at the beginning of the run.")
else:
if run.step_index > 0:
run.back_step()
return HttpResponseRedirect(reverse("runs:detail", args=(run_name,)))

Expand Down

0 comments on commit 0eab1d8

Please sign in to comment.