small fixes
This commit is contained in:
parent
69ea83853b
commit
e2157a0a6b
|
@ -15,6 +15,11 @@ forms:
|
|||
name: "Titel"
|
||||
required: true
|
||||
placeholder: "Untitled Band \"Rocken in Häusern\"-Tour"
|
||||
- title: summary
|
||||
input_type: text
|
||||
name: "Beschreibung/Summary"
|
||||
placeholder: "Wir feiern die 300jährige Tour und können das mit ca 30 Worten umreissen."
|
||||
|
||||
- title: headline
|
||||
input_type: buttons
|
||||
name: "Überschrift"
|
||||
|
@ -43,13 +48,14 @@ forms:
|
|||
input_type: buttons
|
||||
name: "More"
|
||||
target: "content"
|
||||
|
||||
- title: content
|
||||
input_type: textarea
|
||||
name: "Inhalt"
|
||||
required: true
|
||||
placeholder: "Einfach losschreiben. Der erste Absatz wird die Zusammenfassung in Artikelübersichten. Denke an die Formatierungshilfe hinter dem Link oben."
|
||||
- title: categories
|
||||
input_type: mc
|
||||
input_type: rb
|
||||
name: "Kategorie"
|
||||
expanded: true
|
||||
new: "Neue Kategorie"
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
---
|
||||
title: "Katzengejammer"
|
||||
date: "2022-04-04T23:16:00+02:00"
|
||||
summary: "sdadasdasdasd"
|
||||
when: "Montag, 04.04.2022, 23.23 Uhr"
|
||||
categories: ["Pressemitteilung"]
|
||||
events: ["Konzert"]
|
||||
price: "free"
|
||||
foundations: ["rote_hilfe"]
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
fieldset {
|
||||
display: flex; flex-wrap: wrap; flex-direction: row; padding: 0; border: none; margin: 0 0 .3rem .5rem;
|
||||
}
|
||||
|
||||
.w100 {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.column {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
#result {
|
||||
white-space: pre; display: none; background: var(--background-body);
|
||||
padding: 1rem 0 1rem 1rem;
|
||||
margin-top: 1rem;
|
||||
-webkit-user-select: all;
|
||||
user-select: all;
|
||||
}
|
|
@ -1,9 +1,3 @@
|
|||
{{ define "css" }}
|
||||
<link rel="stylesheet" href="/css/visibleIf.css" type="text/css" />
|
||||
{{ end }}
|
||||
|
||||
|
||||
<article>
|
||||
<div>
|
||||
{{ .context.Content }}
|
||||
</div>
|
||||
|
@ -12,6 +6,5 @@
|
|||
{{ partial "layout/generator/form" (dict "context" .context "form" 0) }}
|
||||
{{ end }}
|
||||
|
||||
</article>
|
||||
<script defer src="{{ "/js/visibleIf.js" | urlize | relURL }}"></script>
|
||||
<script defer src="{{ "/js/generator.js" | urlize | relURL }}"></script>
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
|
||||
{{ else if eq .input_type "mc" }}
|
||||
{{ $in0 := .title }}
|
||||
|
||||
{{- $finale := slice -}}
|
||||
{{ $pages := where site.RegularPages "Type" "in" site.Params.searchSections }}
|
||||
{{ if eq .title "tags" }}
|
||||
|
@ -75,15 +74,11 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
{{- $finale = $finale | uniq -}}
|
||||
|
||||
<div class="margin_top_1rem column {{ if .group }} visibleIf" data-visibleif-rule="{{ .group }}group == 'true'{{ end }}">
|
||||
<div class="w100 {{ if .group }}margin_left_1rem{{ end }}">
|
||||
{{ .name }}
|
||||
{{ if ne .expanded true }}{{ partial "layout/generator/expand" (dict "name" (printf "%scat" $in0)) }}{{ end }}{{- if .required -}}{{- " *" -}}{{- end -}}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="checkbox {{ if ne .expanded true }}visibleIf margin_left_1rem stretch" data-visibleif-rule="{{ $in0 }}cat == 'true'{{end}}">
|
||||
<div class="column margin_left_1rem">
|
||||
<fieldset id="{{ $in0 }}" name="{{ $in0 }}" class="fieldset">
|
||||
|
@ -97,8 +92,51 @@
|
|||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ else if eq .input_type "rb" }}
|
||||
{{ $in0 := .title }}
|
||||
{{- $finale := slice -}}
|
||||
{{ $pages := where site.RegularPages "Type" "in" site.Params.searchSections }}
|
||||
{{ if eq .title "tags" }}
|
||||
{{ range $pages }}
|
||||
{{- with .Params.tags -}}
|
||||
{{- $finale = $finale | append . -}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ else if eq .title "foundations" }}
|
||||
{{ range resources.Match "/images/foundations/*" }}
|
||||
{{ $n := path.Base (strings.TrimSuffix (path.Ext .Name) .Name) }}
|
||||
{{- $finale = $finale | append $n -}}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ range $pages }}
|
||||
{{ range .Param $in0 }}
|
||||
{{- $finale = $finale | append . -}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- $finale = $finale | uniq -}}
|
||||
<div class="margin_top_1rem column {{ if .group }} visibleIf" data-visibleif-rule="{{ .group }}group == 'true'{{ end }}">
|
||||
<div class="w100 {{ if .group }}margin_left_1rem{{ end }}">
|
||||
{{ .name }}
|
||||
{{ if ne .expanded true }}{{ partial "layout/generator/expand" (dict "name" (printf "%scat" $in0)) }}{{ end }}{{- if .required -}}{{- " *" -}}{{- end -}}
|
||||
</div>
|
||||
<div class="checkbox {{ if ne .expanded true }}visibleIf margin_left_1rem stretch" data-visibleif-rule="{{ $in0 }}cat == 'true'{{end}}">
|
||||
<div class="column margin_left_1rem">
|
||||
<fieldset id="{{ $in0 }}" name="{{ $in0 }}" class="fieldset">
|
||||
<input type="button" value="Clear" onclick="Clear({{ $in0 }});">
|
||||
{{ range sort $finale }}
|
||||
<label><input type="radio" name="{{ $in0 }}" id="{{ $in0 }}{{ . }}" value="{{ . }}" />{{ . }}</label>
|
||||
{{ end }}
|
||||
</fieldset>
|
||||
{{ if .new }}
|
||||
<label for="new{{- .title -}}">{{ .new }} <span class="font_size_smaller">({{- $divide -}}{{- if .help -}}, {{ .help }}{{ end }})</span></label>
|
||||
<input class="w100" type="text" name="new{{- .title -}}" id="new{{- .title -}}" value="" {{ if .placeholder }}placeholder="{{ .placeholder }}"{{ end }} />
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{{ else }}
|
||||
|
|
|
@ -11,8 +11,10 @@
|
|||
{{ $main := resources.Get "scss/main.scss" | resources.ToCSS }}
|
||||
{{ $pagination := resources.Get "scss/pagination.scss" | resources.ToCSS }}
|
||||
{{ $footer := resources.Get "scss/footer.scss" | resources.ToCSS }}
|
||||
{{ $allcss := slice $water $font $container $header $banner $main $pagination $footer | resources.Concat "/css/vendor.css" | minify | fingerprint "sha512" }}
|
||||
{{ $generator := resources.Get "scss/generator.scss" | resources.ToCSS }}
|
||||
{{ $allcss := slice $water $font $container $header $banner $main $pagination $footer $generator | resources.Concat "/css/vendor.css" | minify | fingerprint "sha512" }}
|
||||
<link rel="stylesheet" href="{{ $allcss.RelPermalink }}" integrity="{{ $allcss.Data.Integrity }}">
|
||||
<link rel="stylesheet" href="/css/visibleIf.css" type="text/css" />
|
||||
|
||||
{{ $title := print .Site.Title " | " .Title }}
|
||||
{{ if .IsHome }}{{ $title = .Site.Title }}{{ end }}
|
||||
|
|
|
@ -2,7 +2,7 @@ function check_checkboxes(name) {
|
|||
const checkboxes = document.querySelectorAll(`input[name="${name}"]:checked`);
|
||||
let values = [];
|
||||
checkboxes.forEach((checkbox) => {
|
||||
values.push("\"" + checkbox.value + "\"");
|
||||
values.push("\"" + checkbox.value + "\"");
|
||||
});
|
||||
if (values) {
|
||||
return values;
|
||||
|
@ -11,6 +11,18 @@ function check_checkboxes(name) {
|
|||
}
|
||||
}
|
||||
|
||||
function Clear(name)
|
||||
{
|
||||
clearRadioGroup(name);
|
||||
}
|
||||
|
||||
function clearRadioGroup(name)
|
||||
{
|
||||
var ele = document.getElementsByName(name);
|
||||
for(var i=0;i<ele.length;i++)
|
||||
ele[i].checked = false;
|
||||
}
|
||||
|
||||
function typeInTextarea(newText, el = document.getElementById('content')) {
|
||||
const [start, end] = [el.selectionStart, el.selectionEnd];
|
||||
el.setRangeText(newText, start, end);
|
||||
|
@ -79,6 +91,7 @@ function showInput(e) {
|
|||
|
||||
var form = document.querySelector('form[id="myform"]');
|
||||
var title = form.elements['title'].value;
|
||||
var summary = form.elements['summary'].value;
|
||||
var content = form.elements['content'].value;
|
||||
var when = form.elements['when'].value;
|
||||
var covid = form.elements['covid'].value;
|
||||
|
@ -116,17 +129,19 @@ function showInput(e) {
|
|||
if (tags != '' && newtags != '""') {
|
||||
var ntags = tags + "," + newtags;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (newcategories != '""') {
|
||||
var ncategories = newcategories;
|
||||
var ncategories = newcategories;
|
||||
}
|
||||
|
||||
if (categories != '') {
|
||||
var ncategories = categories;
|
||||
if (categories != '' ) {
|
||||
var ncategories = categories;
|
||||
}
|
||||
|
||||
if (categories != '' && newcategories != '""') {
|
||||
var ncategories = categories + "," + newcategories;
|
||||
var ncategories = categories + "," + newcategories;
|
||||
}
|
||||
|
||||
|
||||
|
@ -175,6 +190,10 @@ function showInput(e) {
|
|||
} else {
|
||||
display.innerHTML += "date: " + datestring + "<br>";
|
||||
}
|
||||
if (summary) {
|
||||
display.innerHTML += "summary: \"" + summary + "\"<br>";
|
||||
}
|
||||
|
||||
if (featured != '') {
|
||||
display.innerHTML += "featured: true<br>";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue