diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2020-01-25 10:47:36 +0100 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2020-01-25 10:47:36 +0100 |
commit | ffb428e629b3f94c724f41e35c77ca024ba47149 (patch) | |
tree | ef3ac53805eb3a26cd30db9374fee152227a61fc /src/main/resources/templates | |
parent | ae402342fe5736d74cf86e21c642abbb0805ff83 (diff) |
Wiki: Add ContentTools to all wiki pages.
Change-Id: I30e3c59458b2754439c9edfd5029d260816dd9de
Diffstat (limited to 'src/main/resources/templates')
-rw-r--r-- | src/main/resources/templates/base.html | 2 | ||||
-rw-r--r-- | src/main/resources/templates/benki/wiki/wikiPage.html | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/src/main/resources/templates/base.html b/src/main/resources/templates/base.html index 8fefe31..408424d 100644 --- a/src/main/resources/templates/base.html +++ b/src/main/resources/templates/base.html @@ -7,6 +7,8 @@ <link rel="stylesheet" type="text/css" href="/common.css" /> <script type="module" src="/components.js"></script> + + {#insert head}{/} </head> <body> diff --git a/src/main/resources/templates/benki/wiki/wikiPage.html b/src/main/resources/templates/benki/wiki/wikiPage.html index 7caf94d..8ca34e7 100644 --- a/src/main/resources/templates/benki/wiki/wikiPage.html +++ b/src/main/resources/templates/benki/wiki/wikiPage.html @@ -1,7 +1,20 @@ {@eu.mulk.mulkcms2.benki.wiki.WikiPageRevision page} {#include base.html} + {#title}{page.title} — Benki Wiki{/title} + +{#head} +<link rel="stylesheet" type="text/css" href="/web_modules/ContentTools/build/content-tools.min.css" /> +<script type="module"> + import {ContentTools} from "/web_modules/ContentTools.js"; + window.addEventListener('DOMContentLoaded', function() { + let editor = ContentTools.EditorApp.get(); + editor.init('*[data-editable]', 'data-name'); + }); +</script> +{/head} + {#body} <article id="wiki-page"> <header> @@ -9,7 +22,9 @@ </header> <main> - {#with page}{content.raw}{/} + <div data-editable data-name="main-content"> + {#with page}{content.raw}{/} + </div> </main> <hr> @@ -19,4 +34,5 @@ </footer> </article> {/body} + {/include} |