{% include "core/basic_elements/label.html" %} {% if structure is None %}
{% if allow_database_input %}
Option 1: Load from Database
{% htmx_selectbox name=database_table_name options=database_table_options placeholder="Choose table..." show_label=False %}
{% htmx_text_input name=database_id_name placeholder="Enter ID... (ex: mp-123)" show_label=False %}
{% htmx_button method_name="load_structure" label="Load" icon="download" theme="secondary" small=True show_label=False input_name=name %}
or
{% htmx_text_input name=url_name placeholder="Paste link to structure (ex: https://simmate.org/data/MatprojStructure/1234/)" show_label=False %}
{% htmx_button method_name="load_structure" label="Load" icon="download" theme="secondary" small=True show_label=False input_name=name %}
{% endif %} {% if allow_file_input %}
{% if allow_database_input %}Option 2:{% endif %} Load from File (CIF or POSCAR)
{% htmx_file_upload name=file_name show_label=False defer=False %}
{% endif %}
{% elif structure == False %} {% alert theme="danger" message="Failed to load the Structure. This typically happens due to invalid file formats or an incorrect ID." %}
Refresh the page to restart the form
{% else %}
{% draw_structure structure div_id=viewer_id dynamic=True %}
{% htmx_button method_name="unset_structure" label="Reset" show_label=False theme="secondary" icon="trash" small=True input_name=name %}
{% endif %}