small fixes

This commit is contained in:
teldra 2022-03-27 21:17:25 +02:00
parent 65399f07e7
commit fff332a2d2
4 changed files with 61 additions and 29 deletions

View File

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
{{- partial "head.html" . -}} {{- partial "head.html" . -}}
{{ block "css" . -}}{{- end }}
<body> <body>
<div class="container"> <div class="container">
<header> <header>

View File

@ -1,3 +1,7 @@
{{ define "css" }}
<link rel="stylesheet" href="/css/visibleIf.css" type="text/css" />
{{ end }}
<h1>Artikelgenerator</h1> <h1>Artikelgenerator</h1>
<p> <p>
@ -19,9 +23,9 @@
<form id="myform" style="min-width: 55rem; max-width: 100vw; display: flex; flex-grow: 1; flex-direction: column;"> <form id="myform" style="min-width: 55rem; max-width: 100vw; display: flex; flex-grow: 1; flex-direction: column;">
{{ partial "tools/title" }} {{ partial "tools/title" }}
{{ partial "tools/content" }} {{ partial "tools/content" }}
{{ partial "tools/featured" }}
{{ partial "tools/event" }} {{ partial "tools/event" }}
{{ partial "tools/categories" }} {{ partial "tools/categories" }}
{{ partial "tools/featured" }}
{{ partial "tools/submit" }} {{ partial "tools/submit" }}
</form> </form>

View File

@ -12,9 +12,9 @@
{{- $categories := $categories | uniq -}} {{- $categories := $categories | uniq -}}
{{- $tags := $tags | uniq -}} {{- $tags := $tags | uniq -}}
<div style="display:flex; flex-direction: row;"> Kategorien <input type="checkbox" name="opencat" value="true" /> aufklappen</div>
<label for="categories">{{ i18n "categories" }}</label> <div style="flex-direction: column;" class="visibleIf" data-visibleif-rule="opencat == 'true'">
<fieldset style="display: flex; flex-direction: column; max-width: 58.5rem;" id="categories" name="categories"> <fieldset style="max-width: 58.5rem;" id="categories" name="categories">
{{ range sort $categories }} {{ range sort $categories }}
{{ $n := . | i18n }} {{ $n := . | i18n }}
{{ if not $n }} {{ if not $n }}
@ -25,13 +25,15 @@
</div> </div>
{{ end }} {{ end }}
</fieldset> </fieldset>
<label style="width: 12vw;" for="newcat">{{ i18n "new" }}</label> <label style="width: 12vw;" for="newcat">{{ i18n "new" }}</label>
<input style="max-width: 58.5rem;" type="text" class="f" name="newcat" id="newcat" placeholder="" /> <input style="max-width: 58.5rem;" type="text" class="f" name="newcat" id="newcat" placeholder="" />
</div>
<label for="tags">{{ i18n "tags" }}</label>
<div style="display:flex; flex-direction: row;"> Tags <input type="checkbox" name="opentag" value="true" /> aufklappen</div>
<div style="flex-direction: column;" class="visibleIf" data-visibleif-rule="opentag == 'true'">
<fieldset style="display: flex; flex-direction: column; max-width: 58.5rem;" id="tags" name="tags"> <fieldset style="display: flex; flex-direction: column; max-width: 58.5rem;" id="tags" name="tags">
{{ range sort $tags }} {{ range sort $tags }}
{{ $n := . | i18n }} {{ $n := . | i18n }}
@ -46,3 +48,4 @@
<label style="width: 12vw;" for="newtag">{{ i18n "new" }}</label> <label style="width: 12vw;" for="newtag">{{ i18n "new" }}</label>
<input style="max-width: 58.5rem;" type="text" class="f" name="newtag" id="newtag" placeholder="" /> <input style="max-width: 58.5rem;" type="text" class="f" name="newtag" id="newtag" placeholder="" />
</div>

View File

@ -0,0 +1,24 @@
.visibleIf, .visibleif {
display: none;
}
.visibleIf-visible, .visibleif-visible {
display: flex;
flex: 0 1 auto;
}
span.visibleIf-visible, span.visibleif-visible {
display: flex-inline;
}
tr.visibleIf-visible, tr.visibleif-visible {
display: flex;
display: table-row;
}
.visibleIf-rule, .mandatoryIf-rule, .visibleif-rule, .mandatoryif-rule {
display: none;
}