Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion biosimdb_interface/form/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

form_bp = Blueprint("form", __name__)

from . import extract, webform # noqa: E402, F401
from . import extract, home, webform # noqa: E402, F401
34 changes: 34 additions & 0 deletions biosimdb_interface/form/home.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env python
"""
Home page for biosimdb-interface
"""

from flask import (
current_app,
render_template,
url_for,
)

from . import form_bp


@form_bp.route("/", methods=["GET"])
def home():
"""Landing page with BioSimDB overview and quick links."""
return render_template(
"main/home.html",
links={
"deposit": url_for("form.webform"),
"biosimdb": f"{current_app.config.get('BASE_URL', '').rstrip('/')}/communities/biosimdb",
"docs": "https://biosimdb-interface.readthedocs.io/",
"github": "https://github.com/CCPBioSim/biosimdb-interface",
"extract": "https://biosim-extractor.readthedocs.io/en/latest/",
"schema": "https://biosim-schema.readthedocs.io/en/latest/",
"aiida_gromacs": "https://aiida-gromacs.readthedocs.io/en/latest/",
"roadmap": "https://example.com/",
"zulip": "https://example.com/",
"policy": "https://data-collections.psdi.ac.uk/communities/biosimdb/curation-policy",
"instructions": "https://biosimdb-interface.readthedocs.io/en/latest/biosimdb_intro.html",
"tutorials": "https://biosimdb-interface.readthedocs.io/en/latest/biosimdb_intro.html",
},
)
46 changes: 30 additions & 16 deletions biosimdb_interface/schema/webform.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,31 @@ def get_simulation_metadata():
# ``simulation_metadata`` is loaded fresh on first access via get_simulation_metadata().
WEBFORM_SCHEMA = {
"data": {
"title": "BioSim Data Extraction & Submission Form",
"title": "BioSim Deposition",
"description": "This form automatically extracts useful data that describes a molecular dynamics simulation. Whenever you share your data, include this metadata with the simulation files to make your data more findable, accessible, interoperable and reuseable (FAIR).",
"guidance": {
"label": "Please Note:",
"options": [
"To extract simulation metadata, please upload a topology and corresponding trajectory file/s. Optionally, upload an aiida archive file containing the simulation provenance, to extract further information about the simulation protocol.",
"Multiple trajectory files can be uploaded with a single associated topology file, both file types are required.",
'Various simulation file formats are accepted and read using <a href="https://www.mdanalysis.org/" target="_blank" class="text-reset"> MDAnalysis</a>, please ensure your files are compatible.',
'This form uses the <a href="https://biosim-schema.readthedocs.io/" target="_blank" class="text-reset"> biosim-schema</a> to define and group biosim metadata. Missing terms or units? Please considering raising an <a href="https://github.com/CCPBioSim/biosim-schema/issues" target="_blank" class="text-reset"> issue</a> or contributing to the schema.',
'Automatically add metadata associated with each entry using the "Extract metadata" button. Please fill in any missing metadata fields manually where applicable, click on each field name for further information about data field requirements.',
"Two options are available for your extracted simulation metadata: <ol> <li> Download the simulation metadata as a json file and share alongside simulation files. </li> <li> Submit your simulation files and metadata in one step to BioSimDB, you will be directed to a login page and asked to authorize this application. Please continue and complete the data submission process in BioSimDB. </li> </ol>",
],
},
"guidance": [
{
"label": "Instructions:",
"options": [
"To extract simulation metadata, please upload a topology and corresponding trajectory file/s.",
# Optionally, upload an aiida archive file containing the simulation provenance, to extract further information about the simulation protocol.",
"Multiple trajectory files can be uploaded with a single associated topology file, both file types are required.",
'Various simulation file formats are accepted and read using <a href="https://www.mdanalysis.org/" target="_blank" class="text-reset"> MDAnalysis</a>, please ensure your files are compatible.',
'This form uses the <a href="https://biosim-schema.readthedocs.io/" target="_blank" class="text-reset"> biosim-schema</a> to define and group biosim metadata. Missing terms or units? Please consider raising an <a href="https://github.com/CCPBioSim/biosim-schema/issues" target="_blank" class="text-reset"> issue</a> or contributing to the schema.',
'Automatically add metadata associated with each entry using the "Extract metadata" button.',
"Please fill in any missing metadata fields manually where applicable, click on each field name for further information about data field requirements.",
"Two options are available for your extracted simulation metadata: <ol> <li> Download the simulation metadata as a json file and share alongside simulation files. </li> <li> Submit your simulation files and metadata in one step to BioSimDB, you will be directed to a login page and asked to authorize this application. Please continue and complete the data submission process in BioSimDB. </li> </ol>",
"Clear all fields when uploading new files, as manually filled in fields are preserved unless cleared.",
],
},
{
"label": "Any Problems?",
"options": [
"This deposition form is in active development, with new features being added, there may be a few bugs &#128030; that have crept in!",
'If you experience any errors or warnings when using this form, please report them <a href="https://github.com/CCPBioSim/biosimdb-interface/issues" target="_blank" class="text-reset"> here</a>.',
],
},
],
"repeatable": True,
"max": 1,
"files": {
Expand All @@ -72,10 +84,12 @@ def get_simulation_metadata():
"multiple": True,
"required": True,
},
"aiida": {
"label": "Upload AiiDA archive file",
"multiple": False,
},
# Future option to include aiida archive files
# for extraction.
# "aiida": {
# "label": "Upload AiiDA archive file",
# "multiple": False,
# },
},
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions biosimdb_interface/static/js/form/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,14 @@ function renumberInstances(container) {
const newIndex = index + 1;

// Update header text
const header = instance.querySelector('h6');
header.textContent = header.textContent.replace(/\d+/, newIndex);
const header = instance.querySelector('.biosimdb-subsection-title');
const numberEl = instance.querySelector('.instance-number');

if (numberEl) {
numberEl.textContent = newIndex;
} else if (header) {
header.textContent = header.textContent.replace(/\d+$/, newIndex);
}

// Update input names
instance.querySelectorAll('input, select, textarea').forEach(input => {
Expand Down
Loading
Loading