From 707c715d1e336ee45bdcced031881ed603b9297a Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 9 Sep 2024 10:48:29 -0500 Subject: Display species details in populations views. --- uploader/static/css/styles.css | 9 +++++++++ uploader/templates/populations/create-population.html | 3 ++- uploader/templates/populations/list-populations.html | 3 ++- uploader/templates/populations/view-population.html | 4 ++-- .../templates/species/macro-display-species-card.html | 16 ++++++++++++++++ uploader/templates/species/view-species.html | 13 ------------- 6 files changed, 31 insertions(+), 17 deletions(-) create mode 100644 uploader/templates/species/macro-display-species-card.html diff --git a/uploader/static/css/styles.css b/uploader/static/css/styles.css index 7754213..834c563 100644 --- a/uploader/static/css/styles.css +++ b/uploader/static/css/styles.css @@ -104,3 +104,12 @@ dd { input[type="submit"] { text-transform: capitalize; } + +.card { + margin-top: 0.3em; + border-width: 1px; + border-style: solid; + border-radius: 0.3em; + border-color: #AAAAAA; + padding: 0.5em; +} diff --git a/uploader/templates/populations/create-population.html b/uploader/templates/populations/create-population.html index 12811fd..b57afba 100644 --- a/uploader/templates/populations/create-population.html +++ b/uploader/templates/populations/create-population.html @@ -1,6 +1,7 @@ {%extends "populations/base.html"%} {%from "flash_messages.html" import flash_all_messages%} {%from "species/macro-select-species.html" import select_species_form%} +{%from "species/macro-display-species-card.html" import display_species_card%} {%block title%}Create Population{%endblock%} @@ -219,5 +220,5 @@ {%endblock%} {%block sidebarcontents%} -
… maybe provide species details here, perhaps? …
+{{display_species_card(species)}} {%endblock%} diff --git a/uploader/templates/populations/list-populations.html b/uploader/templates/populations/list-populations.html index f0e3d50..c83c18c 100644 --- a/uploader/templates/populations/list-populations.html +++ b/uploader/templates/populations/list-populations.html @@ -1,6 +1,7 @@ {%extends "populations/base.html"%} {%from "flash_messages.html" import flash_all_messages%} {%from "species/macro-select-species.html" import select_species_form%} +{%from "species/macro-display-species-card.html" import display_species_card%} {%block title%}Populations{%endblock%} @@ -86,5 +87,5 @@ {%endblock%} {%block sidebarcontents%} -… maybe provide species details here, perhaps? … +{{display_species_card(species)}} {%endblock%} diff --git a/uploader/templates/populations/view-population.html b/uploader/templates/populations/view-population.html index 3ae76ab..52dadc4 100644 --- a/uploader/templates/populations/view-population.html +++ b/uploader/templates/populations/view-population.html @@ -1,6 +1,7 @@ {%extends "populations/base.html"%} {%from "flash_messages.html" import flash_all_messages%} {%from "species/macro-select-species.html" import select_species_form%} +{%from "species/macro-display-species-card.html" import display_species_card%} {%block title%}Populations{%endblock%} @@ -78,6 +79,5 @@ {%endblock%} {%block sidebarcontents%} -… maybe provide species details here, perhaps? …
-… maybe provide extra population details here, perhaps? …
+{{display_species_card(species)}} {%endblock%} diff --git a/uploader/templates/species/macro-display-species-card.html b/uploader/templates/species/macro-display-species-card.html new file mode 100644 index 0000000..857c0f0 --- /dev/null +++ b/uploader/templates/species/macro-display-species-card.html @@ -0,0 +1,16 @@ +{%macro display_species_card(species)%} +