diff --git a/atlas/templates/atlas/case_display_block.html b/atlas/templates/atlas/case_display_block.html index 1f286136..9f9247bb 100755 --- a/atlas/templates/atlas/case_display_block.html +++ b/atlas/templates/atlas/case_display_block.html @@ -97,10 +97,10 @@

Case:
- {{ case.title }} + {% url 'atlas:case_inline_field' case.pk 'title' as title_url %} + {% with endpoint_default=title_url|add:"?show_label=0" endpoint_edit=title_url|add:"?edit=1&show_label=0" %} + {% include 'atlas/partials/case_inline_field.html' with show_label=0 editing=False field_label="Title" can_edit=can_edit endpoint_url_default=endpoint_default endpoint_url_edit=endpoint_edit container_id='case-inline-title' field_kind='text' value=case.title display_value=case.title field_name='title' error_message='' %} + {% endwith %} {% if can_edit %} {% endif %} -
- {{ case.get_diagnostic_certainty_display }} -
+ {% url 'atlas:case_inline_field' case.pk 'diagnostic_certainty' as diag_url %} + {% with endpoint_default=diag_url|add:"?show_label=0" endpoint_edit=diag_url|add:"?edit=1&show_label=0" %} + {% include 'atlas/partials/case_inline_field.html' with show_label=0 editing=False field_label="Diagnostic certainty" can_edit=can_edit endpoint_url_default=endpoint_default endpoint_url_edit=endpoint_edit container_id='case-inline-diagnostic_certainty' field_kind='select' value=case.get_diagnostic_certainty_display display_value=case.get_diagnostic_certainty_display field_name='diagnostic_certainty' error_message='' %} + {% endwith %}
{# Normal toggle HTMX block #}
@@ -263,10 +261,10 @@
Description: -
{{ case.description }}
+ {% url 'atlas:case_inline_field' case.pk 'description' as desc_url %} + {% with endpoint_default=desc_url|add:"?show_label=0" endpoint_edit=desc_url|add:"?edit=1&show_label=0" %} + {% include 'atlas/partials/case_inline_field.html' with show_label=0 editing=False field_label="Description" can_edit=can_edit endpoint_url_default=endpoint_default endpoint_url_edit=endpoint_edit container_id='case-inline-description' field_kind='textarea' value=case.description display_value=case.description field_name='description' error_message='' %} + {% endwith %}
{% if can_edit %}
-
+
{% if collection %}
{% csrf_token %}
+ View {% else %} View {% endif %} diff --git a/atlas/templates/atlas/partials/case_search_results.html b/atlas/templates/atlas/partials/case_search_results.html index 9d4e5355..6d79be6a 100644 --- a/atlas/templates/atlas/partials/case_search_results.html +++ b/atlas/templates/atlas/partials/case_search_results.html @@ -48,18 +48,36 @@ {% for case in recent_cases %}
-
{{ case.title }}
-
{% if case.description %}{{ case.description|truncatechars:100 }}{% endif %}
+
+
{{ case.title }}
+ {{ case.created_date|date:"Y-m-d" }} +
+
+ {% if case.author.all %}By {{ case.author.all|join:", " }}{% endif %} + {% for cond in case.condition.all %} + {% if cond.name %}{{ cond.name }}{% endif %} + {% endfor %} + {% for pres in case.presentation.all %} + {% if pres.name %}{{ pres.name }}{% endif %} + {% endfor %} + {% for ss in case.subspecialty.all %} + {% if ss.name %}{{ ss.name }}{% endif %} + {% endfor %} +
+

{% if case.description %}{{ case.description|truncatechars:100 }}{% endif %}

+
+
+ {% if collection %} +
+ {% csrf_token %} + + +
+ View + {% else %} + View + {% endif %}
- {% if collection %} -
- {% csrf_token %} - - -
- {% else %} - View - {% endif %}
{% endfor %}
diff --git a/atlas/templates/atlas/partials/case_search_widget.html b/atlas/templates/atlas/partials/case_search_widget.html index de60bf0a..30a1d8ee 100644 --- a/atlas/templates/atlas/partials/case_search_widget.html +++ b/atlas/templates/atlas/partials/case_search_widget.html @@ -1,19 +1,19 @@
{% with input_id=input_id|default:'case-search-input' target_id=target_id|default:'case-search-results' %} - - + + -
+
{# Render initial results (search + recent) on initial GET; HTMX searches will replace this div with partial results #} - {% include 'atlas/partials/case_search_results.html' with cases=cases recent_cases=recent_cases collection=collection %} -
+ {% include 'atlas/partials/case_search_results.html' with cases=cases recent_cases=recent_cases collection=collection %} +
{% endwith %}
@@ -26,7 +26,7 @@ input.addEventListener('input', function(){ if (timer) clearTimeout(timer); timer = setTimeout(function(){ - try { + try { var q = encodeURIComponent(input.value || ''); var url = "{% url 'atlas:case_search' %}?q=" + q + ({% if collection %} "&collection={{ collection.pk }}" {% else %} '' {% endif %}); var target = '#{{ target_id|default:"case-search-results" }}';