From 3f032c6930fa180cabd3d6c34c82f2add498274c Mon Sep 17 00:00:00 2001 From: Per Stark Date: Wed, 30 Apr 2025 14:16:46 +0200 Subject: [PATCH] fix: further fixes re content viewing and editing --- .../templates/content/content_list.html | 4 +-- .../content/edit_text_content_modal.html | 26 +++++++++++-------- .../templates/content/read_content_modal.html | 2 -- html-router/templates/modal_base.html | 2 +- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/html-router/templates/content/content_list.html b/html-router/templates/content/content_list.html index bf68a01..658473b 100644 --- a/html-router/templates/content/content_list.html +++ b/html-router/templates/content/content_list.html @@ -5,8 +5,8 @@

- {% if text_content.url %} - {{text_content.url}} + {% if text_content.url_info %} + {{text_content.url_info.title}} {% elif text_content.file_info %} {{text_content.file_info.file_name}} {% else %} diff --git a/html-router/templates/content/edit_text_content_modal.html b/html-router/templates/content/edit_text_content_modal.html index b16fa68..61738a7 100644 --- a/html-router/templates/content/edit_text_content_modal.html +++ b/html-router/templates/content/edit_text_content_modal.html @@ -1,31 +1,35 @@ {% extends "modal_base.html" %} +{% block modal_class %} +flex flex-col min-h-[95%] w-11/12 max-w-[90ch] max-h-[95%] +{% endblock %} + {% block form_attributes %} hx-patch="/content/{{text_content.id}}" hx-target="#main_section" hx-swap="outerHTML" +class="flex flex-col flex-1 h-full" {% endblock %} {% block modal_content %} -

Edit Content

+

Edit Content

- -
- -
-
+
+
+
{% endblock %} diff --git a/html-router/templates/content/read_content_modal.html b/html-router/templates/content/read_content_modal.html index 399955b..13cc54f 100644 --- a/html-router/templates/content/read_content_modal.html +++ b/html-router/templates/content/read_content_modal.html @@ -18,12 +18,10 @@ breaks: true, gfm: true, headerIds: false, mangle: false, smartLists: true, smartypants: true, xhtml: false }); - console.log('initialized'); } function renderStaticMarkdown() { document.querySelectorAll('.markdown-content').forEach(el => { - console.log('hello'); const raw = el.getAttribute('data-content') || ''; el.innerHTML = marked.parse(raw); }); diff --git a/html-router/templates/modal_base.html b/html-router/templates/modal_base.html index a34b914..9c89445 100644 --- a/html-router/templates/modal_base.html +++ b/html-router/templates/modal_base.html @@ -1,7 +1,7 @@