From ffaf881707dfb1636d9286a670bd7431b44fff30 Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Mon, 20 Sep 2021 18:43:55 -0700 Subject: [PATCH] Replace divs with semantic elements --- amanuensis/resources/editor.css | 4 +-- amanuensis/resources/page.css | 36 +++++++++---------- amanuensis/server/page.jinja | 16 ++++----- amanuensis/server/page_2col.jinja | 4 +-- .../server/session/session.editor.jinja | 10 +++--- 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/amanuensis/resources/editor.css b/amanuensis/resources/editor.css index fb0e52b..2ccbbaa 100644 --- a/amanuensis/resources/editor.css +++ b/amanuensis/resources/editor.css @@ -17,7 +17,7 @@ div#editor-left { display: flex; align-items: stretch; } -div#editor-left div.contentblock { +div#editor-left section { display: flex; flex-direction: column; margin: 10px 5px 10px 10px; @@ -48,7 +48,7 @@ textarea#editor-content { div#editor-right { overflow-y: scroll; } -div#editor-right div.contentblock { +div#editor-right section { margin: 10px 5px 10px 10px; } span.message-warning { diff --git a/amanuensis/resources/page.css b/amanuensis/resources/page.css index bffd77b..8e68a98 100644 --- a/amanuensis/resources/page.css +++ b/amanuensis/resources/page.css @@ -8,14 +8,14 @@ body { line-height: 1.4; font-size: 16px; } -div#wrapper { +main { max-width: 800px; position: absolute; left: 0; right: 0; margin: 0 auto; } -div#header { +header { padding: 5px; margin: 5px; background-color: #ffffff; @@ -24,7 +24,7 @@ div#header { overflow: auto; position: relative; } -div#header p, div#header h2 { +header p, header h2 { margin: 5px; } div#login-status { @@ -33,7 +33,7 @@ div#login-status { top: 10px; right: 10px; } -div#sidebar { +nav { width: 200px; float:left; margin:5px; @@ -46,7 +46,7 @@ div#sidebar { img#logo { max-width: 200px; } -div#sidebar table { +nav table { width: 100%; border-collapse: collapse; } @@ -63,32 +63,32 @@ table a { border-radius: 5px; text-decoration: none; } -div#sidebar table a { +nav table a { justify-content: center; } table a:hover { background-color: var(--button-hover); } -div#sidebar table a.current-page { +nav table a.current-page { background-color: var(--button-current); } -div#sidebar table a.current-page:hover { +nav table a.current-page:hover { background-color: var(--button-current); } -div#sidebar table td { +nav table td { padding: 0px; margin: 3px 0; border-bottom: 8px solid transparent; } -div#content { +article { margin: 5px; } -div.content-2col { +article.content-2col { position: absolute; right: 0px; left: 226px; max-width: 564px; } -div.contentblock { +section { background-color: #ffffff; box-shadow: 2px 2px 10px #888888; margin-bottom: 5px; @@ -216,26 +216,26 @@ details.setting-help { width: 4em; } @media only screen and (max-width: 816px) { - div#wrapper { + main { padding: 5px; } - div#header { + header { max-width: 554px; margin: 0 auto; } - div#sidebar { + nav { max-width: 548px; width: inherit; float: inherit; margin: 10px auto; } - div#content{ + article{ margin: 10px auto; } - div.content-1col { + article.content-1col { max-width: 564px; } - div.content-2col { + article.content-2col { max-width: 564px; position: static; right: inherit; diff --git a/amanuensis/server/page.jinja b/amanuensis/server/page.jinja index 5b45466..df4832e 100644 --- a/amanuensis/server/page.jinja +++ b/amanuensis/server/page.jinja @@ -8,8 +8,8 @@ -
- + {% block sidebar %}{% endblock %} -
+
{% if not template_content_blocks %}{% set template_content_blocks = [] %}{% endif %} {% if not content_blocks %}{% set content_blocks = [] %}{% endif %} - {% for content_block in template_content_blocks + content_blocks %}
- {{ content_block|safe }}
+ {% for content_block in template_content_blocks + content_blocks -%} +
{{ content_block|safe }}
{% endfor %} -
- + + diff --git a/amanuensis/server/page_2col.jinja b/amanuensis/server/page_2col.jinja index dac4d32..6bce71e 100644 --- a/amanuensis/server/page_2col.jinja +++ b/amanuensis/server/page_2col.jinja @@ -1,12 +1,12 @@ {% extends "page.jinja" %} {% block sidebar %} - + {% endblock %} {% block content_class %}content-2col{% endblock %} \ No newline at end of file diff --git a/amanuensis/server/session/session.editor.jinja b/amanuensis/server/session/session.editor.jinja index 0e10d5a..031deb9 100644 --- a/amanuensis/server/session/session.editor.jinja +++ b/amanuensis/server/session/session.editor.jinja @@ -34,7 +34,7 @@
-
+
{# Thin header bar #}
{# Header always includes backlink to lexicon #} @@ -103,16 +103,16 @@ {# #}{{ article.contents }}{# #} {% endif %} -
+
-
+

This editor requires Javascript to function.

-
+

 

-
+