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>
<html>
{{- partial "head.html" . -}}
{{ block "css" . -}}{{- end }}
<body>
<div class="container">
<header>

View File

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

View File

@ -12,37 +12,40 @@
{{- $categories := $categories | uniq -}}
{{- $tags := $tags | uniq -}}
<label for="categories">{{ i18n "categories" }}</label>
<fieldset style="display: flex; flex-direction: column; max-width: 58.5rem;" id="categories" name="categories">
{{ range sort $categories }}
{{ $n := . | i18n }}
{{ if not $n }}
{{ $n = . }}
<div style="display:flex; flex-direction: row;"> Kategorien <input type="checkbox" name="opencat" value="true" /> aufklappen</div>
<div style="flex-direction: column;" class="visibleIf" data-visibleif-rule="opencat == 'true'">
<fieldset style="max-width: 58.5rem;" id="categories" name="categories">
{{ range sort $categories }}
{{ $n := . | i18n }}
{{ if not $n }}
{{ $n = . }}
{{ end }}
<div style="display: flex; flex-direction: row;">
<input type="checkbox" name="category" id="{{ . }}-cat" value="{{ . }}"><label style="width: 20rem;" for="{{ . }}-cat">{{ strings.FirstUpper $n }}</label>
</div>
{{ end }}
<div style="display: flex; flex-direction: row;">
<input type="checkbox" name="category" id="{{ . }}-cat" value="{{ . }}"><label style="width: 20rem;" for="{{ . }}-cat">{{ strings.FirstUpper $n }}</label>
</div>
{{ end }}
</fieldset>
<label style="width: 12vw;" for="newcat">{{ i18n "new" }}</label>
<input style="max-width: 58.5rem;" type="text" class="f" name="newcat" id="newcat" placeholder="" />
</fieldset>
<label style="width: 12vw;" for="newcat">{{ i18n "new" }}</label>
<input style="max-width: 58.5rem;" type="text" class="f" name="newcat" id="newcat" placeholder="" />
</div>
<label for="tags">{{ i18n "tags" }}</label>
<fieldset style="display: flex; flex-direction: column; max-width: 58.5rem;" id="tags" name="tags">
{{ range sort $tags }}
{{ $n := . | i18n }}
{{ if not $n }}
{{ $n = . }}
<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">
{{ range sort $tags }}
{{ $n := . | i18n }}
{{ if not $n }}
{{ $n = . }}
{{ end }}
<div style="display: flex; flex-direction: row;">
<input type="checkbox" name="tags" id="{{ . }}-tag" value="{{ . }}"><label style="width: 20rem;" for="{{ . }}-tag">{{ strings.FirstUpper $n }}</label>
</div>
{{ end }}
<div style="display: flex; flex-direction: row;">
<input type="checkbox" name="tags" id="{{ . }}-tag" value="{{ . }}"><label style="width: 20rem;" for="{{ . }}-tag">{{ strings.FirstUpper $n }}</label>
</div>
{{ end }}
</fieldset>
</fieldset>
<label style="width: 12vw;" for="newtag">{{ i18n "new" }}</label>
<input style="max-width: 58.5rem;" type="text" class="f" name="newtag" id="newtag" placeholder="" />
<label style="width: 12vw;" for="newtag">{{ i18n "new" }}</label>
<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;
}