From e9e3b1efc33b35280464ba2f40d96fdd6560e3c1 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 14 Feb 2024 10:56:08 +0300 Subject: Extract upload progress indication code * Extract the UI elements and code for indicating upload progress into separate, reusable "modules". * Fix bugs arising from changes. --- qc_app/templates/index.html | 50 +++++++++++----------- .../rqtl2/upload-rqtl2-bundle-step-01.html | 28 +++++++++++- qc_app/templates/upload_progress_indicator.html | 16 +++++++ 3 files changed, 66 insertions(+), 28 deletions(-) create mode 100644 qc_app/templates/upload_progress_indicator.html (limited to 'qc_app/templates') diff --git a/qc_app/templates/index.html b/qc_app/templates/index.html index b9638d2..588133a 100644 --- a/qc_app/templates/index.html +++ b/qc_app/templates/index.html @@ -1,5 +1,6 @@ {%extends "base.html"%} -{%from "flash_messages.html" import flash_all_messages%} +{%from "flash_messages.html" import flash_messages%} +{%from "upload_progress_indicator.html" import upload_progress_indicator%} {%block title%}Data Upload{%endblock%} @@ -54,17 +55,11 @@
+ method="POST" + enctype="multipart/form-data" + id="frm-upload-expression-data"> upload expression data - {%with messages = get_flashed_messages(with_categories=True) %} - {%if messages %} -
- {%for category, message in messages %} - {{message}} - {%endfor%} -
- {%endif%} - {%endwith%} + {{flash_messages("error-expr-data")}}
@@ -108,20 +103,7 @@
- +{{upload_progress_indicator()}}

samples/cases

@@ -155,6 +137,22 @@ {%block javascript%} {%endblock%} diff --git a/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html b/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html index 64fcdcd..eaa68a9 100644 --- a/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html +++ b/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html @@ -1,11 +1,14 @@ {%extends "base.html"%} {%from "flash_messages.html" import flash_all_messages%} +{%from "upload_progress_indicator.html" import upload_progress_indicator%} {%block title%}Upload R/qtl2 Bundle{%endblock%} {%block contents%}

Upload R/qtl2 Bundle

+{{upload_progress_indicator()}} +
R/qtl2 bundle - R/qtl2 bundle +

Provide a valid R/qtl2 zip file here. In @@ -42,3 +45,24 @@

{%endblock%} + +{%block javascript%} + + +{%endblock%} diff --git a/qc_app/templates/upload_progress_indicator.html b/qc_app/templates/upload_progress_indicator.html new file mode 100644 index 0000000..9855c2d --- /dev/null +++ b/qc_app/templates/upload_progress_indicator.html @@ -0,0 +1,16 @@ +{%macro upload_progress_indicator()%} + +{%endmacro%} -- cgit v1.2.3