feat: follow up events aesthetics
Browse files- app/dead.py +1 -2
- app/followup_events.py +4 -2
- app/main.py +7 -4
- app/theme.py +3 -3
- app/wounded.py +1 -2
app/dead.py
CHANGED
|
@@ -6,12 +6,11 @@ from followup_events import create_followup_section
|
|
| 6 |
def show_section_dead(visible):
|
| 7 |
with gr.Column(visible=visible, elem_id="dead") as section_dead:
|
| 8 |
gr.Markdown("# Dead Animal")
|
| 9 |
-
gr.Markdown("## Please describe the cause of death")
|
| 10 |
|
| 11 |
image_row, button_collision, button_deliberate_destruction, button_indirect_destruction, button_natural_cause = create_top_section(visible)
|
| 12 |
dropdown_row, dropdown, dropdown_level2, openfield_level2, dropdown_extra_level2 = create_dropdown(visible)
|
| 13 |
|
| 14 |
-
gr.Markdown("## Follow-up Events")
|
| 15 |
create_followup_section()
|
| 16 |
|
| 17 |
return section_dead, button_collision, button_deliberate_destruction, button_indirect_destruction, button_natural_cause, dropdown, dropdown_level2, openfield_level2, dropdown_extra_level2
|
|
|
|
| 6 |
def show_section_dead(visible):
|
| 7 |
with gr.Column(visible=visible, elem_id="dead") as section_dead:
|
| 8 |
gr.Markdown("# Dead Animal")
|
| 9 |
+
gr.Markdown("## Please describe the cause of death", label="description")
|
| 10 |
|
| 11 |
image_row, button_collision, button_deliberate_destruction, button_indirect_destruction, button_natural_cause = create_top_section(visible)
|
| 12 |
dropdown_row, dropdown, dropdown_level2, openfield_level2, dropdown_extra_level2 = create_dropdown(visible)
|
| 13 |
|
|
|
|
| 14 |
create_followup_section()
|
| 15 |
|
| 16 |
return section_dead, button_collision, button_deliberate_destruction, button_indirect_destruction, button_natural_cause, dropdown, dropdown_level2, openfield_level2, dropdown_extra_level2
|
app/followup_events.py
CHANGED
|
@@ -4,13 +4,15 @@ from config_utils import get_custom_config_dropdowns
|
|
| 4 |
def create_followup_section():
|
| 5 |
followup_config = get_custom_config_dropdowns("/assets/dropdowns/followup_config.json")
|
| 6 |
followup_config = followup_config["Event follow-up"]
|
|
|
|
|
|
|
| 7 |
with gr.Row():
|
| 8 |
for key, val in followup_config.items():
|
| 9 |
followup_label = key
|
| 10 |
if "Options" in val.keys():
|
| 11 |
-
gr.Dropdown(choices=val["Options"], label=followup_label, visible=True)
|
| 12 |
with gr.Row():
|
| 13 |
for key, val in followup_config.items():
|
| 14 |
followup_label = key
|
| 15 |
if "Open" in val.keys():
|
| 16 |
-
gr.Textbox(label=followup_label, visible=True)
|
|
|
|
| 4 |
def create_followup_section():
|
| 5 |
followup_config = get_custom_config_dropdowns("/assets/dropdowns/followup_config.json")
|
| 6 |
followup_config = followup_config["Event follow-up"]
|
| 7 |
+
gr.Markdown("## Follow-Up Events", label="Title")
|
| 8 |
+
gr.Markdown("Please tell us what you did with the animal.", label="description")
|
| 9 |
with gr.Row():
|
| 10 |
for key, val in followup_config.items():
|
| 11 |
followup_label = key
|
| 12 |
if "Options" in val.keys():
|
| 13 |
+
gr.Dropdown(choices=val["Options"], label=followup_label, visible=True, elem_id="followup")
|
| 14 |
with gr.Row():
|
| 15 |
for key, val in followup_config.items():
|
| 16 |
followup_label = key
|
| 17 |
if "Open" in val.keys():
|
| 18 |
+
gr.Textbox(label=followup_label, visible=True, elem_id="followup")
|
app/main.py
CHANGED
|
@@ -6,6 +6,7 @@ from dropdowns import *
|
|
| 6 |
from maps import get_location
|
| 7 |
from style import *
|
| 8 |
from theme import theme, css
|
|
|
|
| 9 |
|
| 10 |
with gr.Blocks(theme=theme, css=css) as demo:
|
| 11 |
# ---------------------------------------------------------
|
|
@@ -40,6 +41,8 @@ with gr.Blocks(theme=theme, css=css) as demo:
|
|
| 40 |
|
| 41 |
# ---------------------------------------------------------
|
| 42 |
# Dead and Wounded Buttons
|
|
|
|
|
|
|
| 43 |
with gr.Row() as block_form:
|
| 44 |
with gr.Column(scale=1):
|
| 45 |
butt_wounded = gr.Button("Wounded", elem_id="wounded")
|
|
@@ -95,13 +98,13 @@ with gr.Blocks(theme=theme, css=css) as demo:
|
|
| 95 |
|
| 96 |
dropdown_wounded.select(on_select, None, [dropdown_level2_wounded, openfield_level2_wounded, dropdown_extra_level2_wounded])
|
| 97 |
|
| 98 |
-
# ---------------------------------------------------------
|
| 99 |
-
#Follow up Events
|
| 100 |
-
|
| 101 |
# ---------------------------------------------------------
|
| 102 |
#Submit Button
|
| 103 |
with gr.Column(scale=1):
|
| 104 |
-
subbutt = gr.Button("SUBMIT YOUR OBSERVATION TO ORNITHO",
|
|
|
|
|
|
|
|
|
|
| 105 |
output_message = gr.Markdown("Thank you, you are a champion of biodiversity conservation !")
|
| 106 |
|
| 107 |
|
|
|
|
| 6 |
from maps import get_location
|
| 7 |
from style import *
|
| 8 |
from theme import theme, css
|
| 9 |
+
from followup_events import create_followup_section
|
| 10 |
|
| 11 |
with gr.Blocks(theme=theme, css=css) as demo:
|
| 12 |
# ---------------------------------------------------------
|
|
|
|
| 41 |
|
| 42 |
# ---------------------------------------------------------
|
| 43 |
# Dead and Wounded Buttons
|
| 44 |
+
gr.Markdown("## The State of the Animal", label="Title")
|
| 45 |
+
gr.Markdown("Please tell us if the animal was wounded or dead.", label="description")
|
| 46 |
with gr.Row() as block_form:
|
| 47 |
with gr.Column(scale=1):
|
| 48 |
butt_wounded = gr.Button("Wounded", elem_id="wounded")
|
|
|
|
| 98 |
|
| 99 |
dropdown_wounded.select(on_select, None, [dropdown_level2_wounded, openfield_level2_wounded, dropdown_extra_level2_wounded])
|
| 100 |
|
|
|
|
|
|
|
|
|
|
| 101 |
# ---------------------------------------------------------
|
| 102 |
#Submit Button
|
| 103 |
with gr.Column(scale=1):
|
| 104 |
+
subbutt = gr.Button("SUBMIT YOUR OBSERVATION TO ORNITHO",
|
| 105 |
+
elem_id="submit",
|
| 106 |
+
icon="https://cdn.iconscout.com/icon/free/png-256/free-send-2451554-2082560.png",
|
| 107 |
+
scale=1)
|
| 108 |
output_message = gr.Markdown("Thank you, you are a champion of biodiversity conservation !")
|
| 109 |
|
| 110 |
|
app/theme.py
CHANGED
|
@@ -7,11 +7,11 @@ css = """
|
|
| 7 |
#wounded {background-color: #5e0724}
|
| 8 |
#buttons-conditions {background-color: #b3b3b3}
|
| 9 |
#dropdown-conditions {background-color: #b3b3b3}
|
| 10 |
-
#
|
|
|
|
| 11 |
"""
|
| 12 |
-
#wound old: #2d5543
|
| 13 |
-
#submit:#13422f
|
| 14 |
|
|
|
|
| 15 |
|
| 16 |
theme = gr.themes.Soft(primary_hue="teal", secondary_hue="teal", neutral_hue="emerald",
|
| 17 |
font=[gr.themes.GoogleFont("Inconsolata"), "Arial", "sans-serif"])
|
|
|
|
| 7 |
#wounded {background-color: #5e0724}
|
| 8 |
#buttons-conditions {background-color: #b3b3b3}
|
| 9 |
#dropdown-conditions {background-color: #b3b3b3}
|
| 10 |
+
#followup {background-color: #38241c}
|
| 11 |
+
#submit {background-color: #abb2bf}
|
| 12 |
"""
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
#followup 2nd option: #13422f
|
| 15 |
|
| 16 |
theme = gr.themes.Soft(primary_hue="teal", secondary_hue="teal", neutral_hue="emerald",
|
| 17 |
font=[gr.themes.GoogleFont("Inconsolata"), "Arial", "sans-serif"])
|
app/wounded.py
CHANGED
|
@@ -5,12 +5,11 @@ from followup_events import create_followup_section
|
|
| 5 |
def show_section_wounded(visible):
|
| 6 |
with gr.Column(visible=visible, elem_id="wounded") as wounded_section:
|
| 7 |
gr.Markdown("# Wounded Animal")
|
| 8 |
-
gr.Markdown("#
|
| 9 |
|
| 10 |
image_row, button_collision, button_deliberate_destruction, button_indirect_destruction, button_natural_cause = create_top_section(visible)
|
| 11 |
dropdown_row, dropdown, dropdown_level2, openfield_level2, dropdown_extra_level2 = create_dropdown(visible)
|
| 12 |
|
| 13 |
-
gr.Markdown("## Follow-up Events")
|
| 14 |
create_followup_section()
|
| 15 |
|
| 16 |
# Change variables and names
|
|
|
|
| 5 |
def show_section_wounded(visible):
|
| 6 |
with gr.Column(visible=visible, elem_id="wounded") as wounded_section:
|
| 7 |
gr.Markdown("# Wounded Animal")
|
| 8 |
+
gr.Markdown("# Please describe the wound's cause.", label="description")
|
| 9 |
|
| 10 |
image_row, button_collision, button_deliberate_destruction, button_indirect_destruction, button_natural_cause = create_top_section(visible)
|
| 11 |
dropdown_row, dropdown, dropdown_level2, openfield_level2, dropdown_extra_level2 = create_dropdown(visible)
|
| 12 |
|
|
|
|
| 13 |
create_followup_section()
|
| 14 |
|
| 15 |
# Change variables and names
|