diff --git a/src/main/kotlin/wanijo/wanijo2/http/controller/ShowController.kt b/src/main/kotlin/wanijo/wanijo2/http/controller/ShowController.kt index a6d50db..12b9cda 100644 --- a/src/main/kotlin/wanijo/wanijo2/http/controller/ShowController.kt +++ b/src/main/kotlin/wanijo/wanijo2/http/controller/ShowController.kt @@ -18,6 +18,9 @@ class ShowController( val tagDao: TagDao ) { + val markdownParser: Parser = Parser.builder().build() + val htmlRenderer: HtmlRenderer = HtmlRenderer.builder().build() + @GetMapping("/document/{id}") fun show( model: Model, @@ -26,11 +29,9 @@ class ShowController( val document = docDao.findById(id) ?: throw DocumentNotFound() model["document"] = document - - val descHtml = Parser.builder().build().parse(document.description).let { - HtmlRenderer.builder().build().render(it) + model["descHtml"] = markdownParser.parse(document.description).let { + htmlRenderer.render(it) } - model["descHtml"] = descHtml val documentTags = tagDao.ofDocument(id) model["documentTags"] = documentTags.sortedBy { it.name.lowercase() } diff --git a/src/main/resources/static/stylesheet.css b/src/main/resources/static/stylesheet.css index 88d98c3..8fe2e26 100644 --- a/src/main/resources/static/stylesheet.css +++ b/src/main/resources/static/stylesheet.css @@ -74,7 +74,10 @@ main { .tag-block { border: 1px solid var(--light-grey); border-left: .5rem solid AccentColor; - padding: .2rem .2rem .2rem .5rem; + + [type=submit] { + padding: .5rem; + } } fieldset { @@ -132,6 +135,25 @@ form { } } +form.vert { + display: grid; + grid-template-columns: 100%; + grid-auto-flow: row; + row-gap: 1rem; + + label { + grid-column: 1; + } + + input, textarea, select, button, .form__widget { + grid-column: 1; + } + + textarea { + min-height: 20rem; + } +} + .form-link { display: inline; diff --git a/src/main/resources/templates/new.html b/src/main/resources/templates/new.html index 6c58ebe..724920f 100644 --- a/src/main/resources/templates/new.html +++ b/src/main/resources/templates/new.html @@ -8,7 +8,7 @@
-
+ @@ -24,7 +24,7 @@ - + +
@@ -87,7 +87,7 @@
- +