{% extends "base.html" %}
{% block content %}
{#
Helper macros to access data:
- get(key): Gets value from method_json or method_details, returns empty string if "No response" or "NA"
- val(value, default): Returns value or default, filtering out "No response" and "NA"
- format_date(iso): Converts ISO timestamp to readable format
#}
{% macro val(v, default='—') %}{{ default if (not v or v == 'NA' or 'no response' in v.lower()) else v }}{% endmacro %}
{% macro get(key, default='—') %}{{ val(method_json.get(key) or method_details.get(key) or '', default) }}{% endmacro %}
{% macro format_date(iso) %}{% if iso and iso != '—' %}{% set parts = iso[:10].split('-') %}{% set months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] %}{{ parts[2] | int }} {{ months[parts[1] | int - 1] }} {{ parts[0] }}{% else %}—{% endif %}{% endmacro %}
{# Page header #}
{% set title = get('method', '') or get('method_name_content', '') or get('service', 'Method') %}
{% set description = get('method_description_content', '') or get('method_description', '') or get('description', '—') %}
{% set ontology_iri_nav = (method_json.get('ontology_term_content') or method_details.get('ontology_term_content') or '') %}
{% if ontology_iri_nav and ontology_iri_nav.startswith('http') %}
{# Extract key details - using val() for fields needing special handling #}
{% set catalog_url = val(method_json.get('catalog_webpage_url') or method_details.get('catalog_webpage_url') or '', '') %}
{% set sop_url = val(method_json.get('sop') or method_details.get('sop') or '', '') %}
{% set type_iri = val(method_json.get('type_content') or method_details.get('type_content') or '', '') %}
{% if sop_url %}Download SOP{% else %}—{% endif %}
Type
{%- if type_iri and type_iri.startswith('http') -%}
{{ type_iri }}
{%- else -%}
{{ type_iri or '—' }}
{%- endif -%}
Citation
{{ get('citation_content') or get('citation') }}
Last updated
{{ format_date(get('timestamp', '')) }}
Safety Assessment Workflow
{% set stage = get('vhp4safety_workflow_stage_content', '') or get('vhp4safety_workflow_stage', '—') %}
{% set substage = get('workflow_substage_content', '') %}
{{ stage or '—' }}
{% if substage %}{{ substage }}{% endif %}
Regulatory question
{% set reg_text = get('relevant_vhp4safety_regulatory_question(s)_content', '') or get('regulatory_question', '—') %}
{{ reg_text }}
{% if method_details.screenshot or method_json.get('screenshot') %}
{% endif %}
{% if method_json.get('instance') and method_json.instance.get('url') %}
Run the method
{% elif method_details.get('instance') and method_details.instance.get('url') %}
Run the method
{% elif method_json.get('catalog_webpage_url') or method_details.get('catalog_webpage_url') %}
Method webpage
{% else %}
{% endif %}
{% set md = method_json.get('meta_data') or method_details.get('meta_data') or '' %}
{% if md %}
{% endif %}
Provider
{{ get('data_producer_content') }}
{% if (method_json.get('ELIXIR') and method_json.ELIXIR.get('tess')) or (method_details.get('ELIXIR') and method_details.ELIXIR.get('tess')) %}
Taxila.nl
ELIXIR TeSS
{% else %}
At this moment no documentation is (known to be) registered in Taxila.nl or
ELIXIR TeSS.
{% endif %}
{% set provider_name = (method_json.get('provider', {}).get('name') or method_details.get('provider', {}).get('name') or '') %}
{% set contact = (method_json.get('provider', {}).get('contact') or method_details.get('provider', {}).get('contact') or {}) %}
{% if contact %}
{% if contact.get('name') %}
{% endif %}
{% if (method_json.get('ELIXIR') and method_json.ELIXIR.get('biomethods')) or (method_details.get('ELIXIR') and method_details.ELIXIR.get('biomethods')) %}
{% set ontology_iri = (method_json.get('ontology_term_content') or method_details.get('ontology_term_content') or '') %}
{% if ontology_iri and ontology_iri.startswith('http') %}
{% set ontology_iri_script = (method_json.get('ontology_term_content') or method_details.get('ontology_term_content') or '') %}
{% if ontology_iri_script and ontology_iri_script.startswith('http') %}
{% endif %}
{% endblock %}