Skip to content

Commit

Permalink
Limited aliquot protocol to actual aliquot
Browse files Browse the repository at this point in the history
  • Loading branch information
KeironO committed Jan 19, 2021
1 parent d230ddf commit 47e57c6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
15 changes: 2 additions & 13 deletions services/web/app/sample/routes/aliquot.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,16 @@ def aliquot(uuid: str):
protocol_response = requests.get(
url_for("api.protocol_query", _external=True),
headers=get_internal_api_header(),
json={"is_locked": False},
json={"is_locked": False, "type": "ALD"},
)

if protocol_response.status_code != 200:
abort(400)

user_response = requests.get(
url_for("api.auth_home", _external=True),
headers=get_internal_api_header(),
json={},
)

if user_response.status_code != 200:
abort(400)

processing_templates = protocol_response.json()["content"]
users = user_response.json()["content"]

form = SampleAliquotingForm(processing_templates)

return render_template("sample/aliquot/create.html", form=form)
return render_template("sample/aliquot/create.html", form=form, aliquot_proc_count=len(processing_templates))


@sample.route("query", methods=["POST"])
Expand Down
19 changes: 17 additions & 2 deletions services/web/app/templates/sample/aliquot/create.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h1>

<div id="duplicate_barcode" class="alert alert-danger" style="display:none;">
<b>ALERT:</b> It looks like you've accidentally entered duplicate barcodes. You must correct this
before you can sbmit.
before you can submit.
</div>

<div id="quantityalert" class="alert alert-danger text-center" style="display:none;">
Expand All @@ -37,6 +37,8 @@ <h1>
<b>ERROR <span id="error_code"></span>:</b> Error submitting aliquot (<span id="error_message"></span>)
</div>

{% if aliquot_proc_count > 0 %}

<div class="row">

<div class="col-9">
Expand Down Expand Up @@ -114,7 +116,20 @@ <h2 style="margin-bottom: 1em;">
</table>

<button id="submit" class="btn btn-primary float-right">Submit</button>

{% else %}
<div class="jumbotron">
<div class="container">
<h1>😔</h1>
<h2>No Suitable Aliquot Protocol Found</h2>
<p>There doesn't seem to be any aliquot protocols available.</p>
<a href="{{ url_for('protocol.new') }}">
<div class="btn btn-outline-dark">
New Protocol
</div>
</a>
</div>
</div>
{% endif %}
</div>

<!-- Modal -->
Expand Down

0 comments on commit 47e57c6

Please sign in to comment.