diff options
| author | Frederick Muriuki Muriithi | 2025-12-29 11:02:16 -0600 |
|---|---|---|
| committer | Frederick Muriuki Muriithi | 2025-12-29 11:02:16 -0600 |
| commit | 8b2737c391834e8245c42e13b84c67ed2a0d942b (patch) | |
| tree | 2b90f293a67b1e0ef0100a249189e5470c46b83d | |
| parent | c9b3db62655eb31d2229aba988b86da666163329 (diff) | |
| download | gn-uploader-8b2737c391834e8245c42e13b84c67ed2a0d942b.tar.gz | |
Sequencing Platforms: Move feature to new UI templates.
| -rw-r--r-- | uploader/platforms/views.py | 6 | ||||
| -rw-r--r-- | uploader/templates/platforms/base.html | 22 | ||||
| -rw-r--r-- | uploader/templates/platforms/create-platform.html | 20 | ||||
| -rw-r--r-- | uploader/templates/platforms/list-platforms.html | 5 | ||||
| -rw-r--r-- | uploader/templates/platforms/sui-base.html | 17 | ||||
| -rw-r--r-- | uploader/templates/platforms/sui-create-platform.html | 116 | ||||
| -rw-r--r-- | uploader/templates/platforms/sui-list-platforms.html | 88 |
7 files changed, 21 insertions, 253 deletions
diff --git a/uploader/platforms/views.py b/uploader/platforms/views.py index 0092760..ba0f0ef 100644 --- a/uploader/platforms/views.py +++ b/uploader/platforms/views.py @@ -8,8 +8,6 @@ from flask import ( Blueprint, current_app as app) -from uploader.sui import sui_template - from uploader.flask_extensions import url_for from uploader.ui import make_template_renderer from uploader.authorisation import require_login @@ -62,7 +60,7 @@ def list_platforms(species_id: int): start_from = max(safe_int(request.args.get("start_from") or 0), 0) count = safe_int(request.args.get("count") or 20) return render_template( - sui_template("platforms/list-platforms.html"), + "platforms/list-platforms.html", species=species, platforms=enumerate_sequence( platforms_by_species(conn, @@ -89,7 +87,7 @@ def create_platform(species_id: int): if request.method == "GET": return render_template( - sui_template("platforms/create-platform.html"), + "platforms/create-platform.html", species=species, activelink="create-platform") diff --git a/uploader/templates/platforms/base.html b/uploader/templates/platforms/base.html index dac965f..d4f3686 100644 --- a/uploader/templates/platforms/base.html +++ b/uploader/templates/platforms/base.html @@ -1,13 +1,17 @@ {%extends "species/base.html"%} +{%from "species/macro-display-species-card.html" import display_sui_species_card%} -{%block lvl3_breadcrumbs%} -<li {%if activelink=="platforms"%} - class="breadcrumb-item active" - {%else%} - class="breadcrumb-item" - {%endif%}> - <a href="{{url_for('species.populations.platforms.index')}}"> - Sequencing Platforms</a> +{%block breadcrumbs%} +{{super()}} +<li class="breadcrumb-item"> + <a href="{{url_for('species.platforms.list_platforms', + species_id=species['SpeciesId'])}}"> + Platforms + </a> </li> -{%block lvl4_breadcrumbs%}{%endblock%} +{%endblock%} + + +{%block sidebarcontents%} +{{display_sui_species_card(species)}} {%endblock%} diff --git a/uploader/templates/platforms/create-platform.html b/uploader/templates/platforms/create-platform.html index 0866d5e..3a62472 100644 --- a/uploader/templates/platforms/create-platform.html +++ b/uploader/templates/platforms/create-platform.html @@ -1,19 +1,15 @@ {%extends "platforms/base.html"%} {%from "flash_messages.html" import flash_all_messages%} -{%from "species/macro-display-species-card.html" import display_species_card%} {%block title%}Platforms — Create Platforms{%endblock%} -{%block pagetitle%}Platforms — Create Platforms{%endblock%} - -{%block lvl3_breadcrumbs%} -<li {%if activelink=="create-platform"%} - class="breadcrumb-item active" - {%else%} - class="breadcrumb-item" - {%endif%}> +{%block breadcrumbs%} +{{super()}} +<li class="breadcrumb-item"> <a href="{{url_for('species.platforms.create_platform', - species_id=species.SpeciesId)}}">create platform</a> + species_id=species['SpeciesId'])}}"> + Create + </a> </li> {%endblock%} @@ -118,7 +114,3 @@ </form> </div> {%endblock%} - -{%block sidebarcontents%} -{{display_species_card(species)}} -{%endblock%} diff --git a/uploader/templates/platforms/list-platforms.html b/uploader/templates/platforms/list-platforms.html index a6bcfdc..db14745 100644 --- a/uploader/templates/platforms/list-platforms.html +++ b/uploader/templates/platforms/list-platforms.html @@ -1,6 +1,5 @@ {%extends "platforms/base.html"%} {%from "flash_messages.html" import flash_all_messages%} -{%from "species/macro-display-species-card.html" import display_species_card%} {%block title%}Platforms — List Platforms{%endblock%} @@ -87,7 +86,3 @@ {%endif%} </div> {%endblock%} - -{%block sidebarcontents%} -{{display_species_card(species)}} -{%endblock%} diff --git a/uploader/templates/platforms/sui-base.html b/uploader/templates/platforms/sui-base.html deleted file mode 100644 index 136b956..0000000 --- a/uploader/templates/platforms/sui-base.html +++ /dev/null @@ -1,17 +0,0 @@ -{%extends "species/sui-base.html"%} -{%from "species/macro-display-species-card.html" import display_sui_species_card%} - -{%block breadcrumbs%} -{{super()}} -<li class="breadcrumb-item"> - <a href="{{url_for('species.platforms.list_platforms', - species_id=species['SpeciesId'])}}"> - Platforms - </a> -</li> -{%endblock%} - - -{%block sidebarcontents%} -{{display_sui_species_card(species)}} -{%endblock%} diff --git a/uploader/templates/platforms/sui-create-platform.html b/uploader/templates/platforms/sui-create-platform.html deleted file mode 100644 index 25977a7..0000000 --- a/uploader/templates/platforms/sui-create-platform.html +++ /dev/null @@ -1,116 +0,0 @@ -{%extends "platforms/sui-base.html"%} -{%from "flash_messages.html" import flash_all_messages%} - -{%block title%}Platforms — Create Platforms{%endblock%} - -{%block breadcrumbs%} -{{super()}} -<li class="breadcrumb-item"> - <a href="{{url_for('species.platforms.create_platform', - species_id=species['SpeciesId'])}}"> - Create - </a> -</li> -{%endblock%} - -{%block contents%} -{{flash_all_messages()}} - -<div class="row"> - <h2>Create New Platform</h2> - - <p>You can create a new genetic sequencing platform below.</p> -</div> - -<div class="row"> - <form id="frm-create-platform" - method="POST" - action="{{url_for('species.platforms.create_platform', - species_id=species.SpeciesId)}}"> - - <div class="form-group"> - <label for="txt-geo-platform" class="form-label">GEO Platform</label> - <input type="text" - id="txt-geo-platform" - name="geo-platform" - required="required" - class="form-control" /> - <small class="form-text text-muted"> - <p>This is the platform's - <a href="https://www.ncbi.nlm.nih.gov/geo/browse/?view=platforms&tax={{species.TaxonomyId}}" - title="Platforms for '{{species.FullName}}' on NCBI"> - accession value on NCBI</a>. If you do not know the value, click the - link and search on NCBI for species '{{species.FullName}}'.</p></small> - </div> - - <div class="form-group"> - <label for="txt-platform-name" class="form-label">Platform Name</label> - <input type="text" - id="txt-platform-name" - name="platform-name" - required="required" - class="form-control" /> - <small class="form-text text-muted"> - <p>This is name of the genetic sequencing platform.</p></small> - </div> - - <div class="form-group"> - <label for="txt-platform-shortname" class="form-label"> - Platform Short Name</label> - <input type="text" - id="txt-platform-shortname" - name="platform-shortname" - required="required" - class="form-control" /> - <small class="form-text text-muted"> - <p>Use the following conventions for this field: - <ol> - <li>Start with a 4-letter vendor code, e.g. "Affy" for "Affymetrix", "Illu" for "Illumina", etc.</li> - <li>Append an underscore to the 4-letter vendor code</li> - <li>Use the name of the array given by the vendor, e.g. U74AV2, MOE430A, etc.</li> - </ol> - </p> - </small> - </div> - - <div class="form-group"> - <label for="txt-platform-title" class="form-label">Platform Title</label> - <input type="text" - id="txt-platform-title" - name="platform-title" - required="required" - class="form-control" /> - <small class="form-text text-muted"> - <p>The full platform title. Sometimes, this is the same as the Platform - Name above.</p></small> - </div> - - <div class="form-group"> - <label for="txt-go-tree-value" class="form-label">GO Tree Value</label> - <input type="text" - id="txt-go-tree-value" - name="go-tree-value" - class="form-control" /> - <small class="form-text text-muted"> - <p>This is a Chip identification value useful for analysis with the - <strong> - <a href="https://www.geneweaver.org/" - title="Go to the GeneWeaver site." - target="_blank">GeneWeaver</a></strong> - and - <strong> - <a href="https://www.webgestalt.org/" - title="Go to the WEB-based GEne SeT AnaLysis Toolkit site." - target="_blank">WebGestalt</a></strong> - tools.<br /> - This can be left blank for custom platforms.</p></small> - </div> - - <div class="form-group"> - <input type="submit" - value="create new platform" - class="btn btn-primary" /> - </div> - </form> -</div> -{%endblock%} diff --git a/uploader/templates/platforms/sui-list-platforms.html b/uploader/templates/platforms/sui-list-platforms.html deleted file mode 100644 index f4c17e8..0000000 --- a/uploader/templates/platforms/sui-list-platforms.html +++ /dev/null @@ -1,88 +0,0 @@ -{%extends "platforms/sui-base.html"%} -{%from "flash_messages.html" import flash_all_messages%} - -{%block title%}Platforms — List Platforms{%endblock%} - -{%block pagetitle%}Platforms — List Platforms{%endblock%} - - -{%block contents%} -{{flash_all_messages()}} - -<div class="row"> - <p>View the list of the genetic sequencing platforms that are currently - supported by GeneNetwork.</p> - <p>If you cannot find the platform you wish to use, you can add it by clicking - the "New Platform" button below.</p> - <p><a href="{{url_for('species.platforms.create_platform', - species_id=species.SpeciesId)}}" - title="Create a new genetic sequencing platform for species {{species.FullName}}" - class="btn btn-primary">Create Platform</a></p> -</div> - -<div class="row"> - <h2>Supported Platforms</h2> - {%if platforms is defined and platforms | length > 0%} - <p>There are {{total_platforms}} platforms supported by GeneNetwork</p> - - <div class="row"> - <div class="col-md-2" style="text-align: start;"> - {%if start_from > 0%} - <a href="{{url_for('species.platforms.list_platforms', - species_id=species.SpeciesId, - start_from=start_from-count, - count=count)}}"> - <span class="glyphicon glyphicon-backward"></span> - Previous - </a> - {%endif%} - </div> - <div class="col-md-8" style="text-align: center;"> - Displaying platforms {{start_from+1}} to {{start_from+count if start_from+count < total_platforms else total_platforms}} of - {{total_platforms}} - </div> - <div class="col-md-2" style="text-align: end;"> - {%if start_from + count < total_platforms%} - <a href="{{url_for('species.platforms.list_platforms', - species_id=species.SpeciesId, - start_from=start_from+count, - count=count)}}"> - Next - <span class="glyphicon glyphicon-forward"></span> - </a> - {%endif%} - </div> - </div> - - <table class="table"> - <thead> - <tr> - <th></th> - <th>Platform Name</th> - <th><a href="https://www.ncbi.nlm.nih.gov/geo/browse/?view=platforms&tax={{species.TaxonomyId}}" - title="Gene Expression Omnibus: Platforms section" - target="_blank">GEO Platform</a></th> - <th>Title</th> - </tr> - </thead> - - <tbody> - {%for platform in platforms%} - <tr> - <td>{{platform.sequence_number}}</td> - <td>{{platform.GeneChipName}}</td> - <td><a href="https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc={{platform.GeoPlatform}}" - title="View platform on the Gene Expression Omnibus" - target="_blank">{{platform.GeoPlatform}}</a></td> - <td>{{platform.Title}}</td> - </tr> - {%endfor%} - </tbody> - </table> - {%else%} - <p class="text-warning"> - <span class="glyphicon glyphicon-exclamation-sign"></span> - There are no platforms supported at this time!</p> - {%endif%} -</div> -{%endblock%} |
