small fixes

This commit is contained in:
teldra 2022-04-04 01:13:42 +02:00
parent 2b23e50893
commit ba6ee3f80b
11 changed files with 39 additions and 410 deletions

View File

@ -7,7 +7,6 @@ covid: "3g"
contact: "schnbuuel@schnabel"
price: "3€"
draft: false
tags: []
---
Lorem ipsum occaecat culpa exercitation et deserunt laborum nisi ut in ex laborum pariatur ea officia commodo sit incididunt aliquip excepteur.
Exercitation velit eiusmod dolore dolor ea proident laboris culpa fugiat culpa anim cillum commodo ut amet cupidatat eu consectetur ut cillum occaecat sed incididunt in voluptate in amet amet incididunt consequat ex magna
@ -19,4 +18,6 @@ mollit consectetur dolore dolore labore mollit in magna deserunt quis laboris ci
Sed ad.
Officia eu do consectetur reprehenderit esse aliquip sed adipisicing consectetur adipisicing aliqua in ut eu id dolor labore occaecat id dolore laboris laborum sint dolore nulla consequat duis duis adipisicing elit enim aute laboris.
Officia eu do consectetur reprehenderit esse aliquip sed adipisicing consectetur adipisicing aliqua in ut eu id dolor labore occaecat id dolore laboris laborum sint dolore nulla consequat duis duis adipisicing elit enim aute laboris.
Lorem ipsum in cillum ut consectetur sit velit sint dolore elit cillum exercitation reprehenderit nulla aliquip in est in laborum magna eiusmod velit minim ut officia est non culpa cupidatat aute excepteur dolore enim et ut do id mollit culpa officia anim et consequat ex nisi officia fugiat nostrud excepteur duis in labore velit sint consectetur et dolor proident est magna ut deserunt labore cillum ullamco laborum sunt consequat eiusmod magna aliquip eu ut id magna quis voluptate esse in ut velit sunt dolore ut voluptate ullamco aliquip sed reprehenderit ut dolore duis enim laboris officia nulla in officia culpa laborum adipisicing minim proident consectetur sunt sunt duis ut labore consequat aliqua esse in nulla sint esse consectetur sit proident id dolore veniam dolore ea et consectetur pariatur et sit dolor ut pariatur esse occaecat ut reprehenderit esse officia sint eu dolor quis nisi aliqua aliquip in in ut non officia cupidatat aute in magna ut minim ut ut est aute magna esse ad irure eiusmod tempor anim tempor labore pariatur amet anim sit ullamco est do minim anim exercitation.

View File

@ -51,3 +51,12 @@ other = "erweitern"
[featured]
other = "Featured"
[when]
other = "Wann"
[price]
other = "Preis"
[registeremail]
other = "Registrierung"

View File

@ -37,3 +37,19 @@
</div>
{{ end }}
{{ end }}
{{ define "sidebar" }}
{{- if .Params.tags -}}
<h3>{{ T "tags" }}</h3>
<div class="tags-list" style="display: flex; flex-direction: column;">
{{- with .Params.tags -}}
{{- if ge (len .) 1 -}}
{{- range . -}}
<a href="{{ $.Site.BaseURL }}tags/{{ . | urlize }}/">#{{ . }}</a>
{{ end -}}
{{- end -}}
{{- end -}}
</div>
{{ end }}
{{ end }}

View File

@ -1,15 +0,0 @@
{{ $s := .Site.Params }}
{{- $paginator := slice -}}
{{- $paginator = .Paginate (where site.RegularPages.ByDate.Reverse ".Params.when" "ne" nil) -}}
{{ if eq $paginator.PageNumber 1 }}
{{ if ne .Content "" }}
<article>
{{ .Content }}
</article>
{{ end }}
{{ end }}
{{- range first 5 $paginator.Pages -}}
{{ partial "structure/list_article.html" . }}
{{- end }}
{{ partial "structure/paginator" "paginator" $paginator }}

View File

@ -1,118 +0,0 @@
{{ $s := .Site.Params }}
{{- $paginator := slice -}}
{{- $posts := where .Site.RegularPages "Type" "in" $s.mainSections }}
{{- $paginator = .Paginate (where $posts "Params.featured" true) -}}
{{ if eq $paginator.PageNumber 1 }}
{{ if ne .Content "" }}
<article>
{{ .Content }}
</article>
{{ end }}
{{ end }}
{{- range first 5 $paginator.Pages -}}
{{ partial "structure/list_article.html" . }}
{{- end }}
<div id="pagination">
<!-- Number of links either side of the current page. -->
{{ $adjacent_links := 2 }}
<!-- $max_links = ($adjacent_links * 2) + 1 -->
{{ $max_links := (add (mul $adjacent_links 2) 1) }}
<!-- $lower_limit = $adjacent_links + 1 -->
{{ $lower_limit := (add $adjacent_links 1) }}
<!-- $upper_limit = $paginator.TotalPages - $adjacent_links -->
{{ $upper_limit := (sub $paginator.TotalPages $adjacent_links) }}
<!-- If there's more than one page. -->
{{ if gt $paginator.TotalPages 1 }}
<!-- First page. -->
{{ if ne $paginator.PageNumber 1 }}
<a class="pagination__link pagination__link--first" href="{{ $paginator.First.URL }}">
««
</a>
{{ end }}
<!-- Previous page. -->
{{ if $paginator.HasPrev }}
<a href="{{ $paginator.Prev.URL }}" class="pagination__link pagination__link--previous">
«
</a>
{{ end }}
<!-- Page numbers. -->
{{ range $paginator.Pagers }}
{{ $.Scratch.Set "page_number_flag" false }}
<!-- Advanced page numbers. -->
{{ if gt $paginator.TotalPages $max_links }}
<!-- Lower limit pages. -->
<!-- If the user is on a page which is in the lower limit. -->
{{ if le $paginator.PageNumber $lower_limit }}
<!-- If the current loop page is less than max_links. -->
{{ if le .PageNumber $max_links }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
<!-- Upper limit pages. -->
<!-- If the user is on a page which is in the upper limit. -->
{{ else if ge $paginator.PageNumber $upper_limit }}
<!-- If the current loop page is greater than total pages minus $max_links -->
{{ if gt .PageNumber (sub $paginator.TotalPages $max_links) }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
<!-- Middle pages. -->
{{ else }}
{{ if and ( ge .PageNumber (sub $paginator.PageNumber $adjacent_links) ) ( le .PageNumber (add $paginator.PageNumber $adjacent_links) ) }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
{{ end }}
<!-- Simple page numbers. -->
{{ else }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
<!-- Output page numbers. -->
{{ if eq ($.Scratch.Get "page_number_flag") true }}
<a href="{{ .URL }}" class="pagination__link">
{{ .PageNumber }}
</a>
{{ end }}
{{ end }}
<!-- Next page. -->
{{ if $paginator.HasNext }}
<a href="{{ $paginator.Next.URL }}" class="pagination__link pagination__link--next">
»
</a>
{{ end }}
<!-- Last page. -->
{{ if ne $paginator.PageNumber $paginator.TotalPages }}
<a class="pagination__link pagination__link--last" href="{{ $paginator.Last.URL }}">
»»
</a>
{{ end }}
{{ end }}
</div>

View File

@ -1,117 +0,0 @@
{{ $s := .Site.Params }}
{{- $paginator := slice -}}
{{- $paginator = .Paginate (where (where .Site.RegularPages.ByDate.Reverse "Permalink" "!=" .Permalink) "Type" "in" .Site.Params.mainSections) }}
{{ if eq $paginator.PageNumber 1 }}
{{ if ne .Content "" }}
<article>
{{ .Content }}
</article>
{{ end }}
{{ end }}
{{- range first 5 $paginator.Pages -}}
{{ partial "structure/list_article.html" . }}
{{- end }}
<div id="pagination">
<!-- Number of links either side of the current page. -->
{{ $adjacent_links := 2 }}
<!-- $max_links = ($adjacent_links * 2) + 1 -->
{{ $max_links := (add (mul $adjacent_links 2) 1) }}
<!-- $lower_limit = $adjacent_links + 1 -->
{{ $lower_limit := (add $adjacent_links 1) }}
<!-- $upper_limit = $paginator.TotalPages - $adjacent_links -->
{{ $upper_limit := (sub $paginator.TotalPages $adjacent_links) }}
<!-- If there's more than one page. -->
{{ if gt $paginator.TotalPages 1 }}
<!-- First page. -->
{{ if ne $paginator.PageNumber 1 }}
<a class="pagination__link pagination__link--first" href="{{ $paginator.First.URL }}">
««
</a>
{{ end }}
<!-- Previous page. -->
{{ if $paginator.HasPrev }}
<a href="{{ $paginator.Prev.URL }}" class="pagination__link pagination__link--previous">
«
</a>
{{ end }}
<!-- Page numbers. -->
{{ range $paginator.Pagers }}
{{ $.Scratch.Set "page_number_flag" false }}
<!-- Advanced page numbers. -->
{{ if gt $paginator.TotalPages $max_links }}
<!-- Lower limit pages. -->
<!-- If the user is on a page which is in the lower limit. -->
{{ if le $paginator.PageNumber $lower_limit }}
<!-- If the current loop page is less than max_links. -->
{{ if le .PageNumber $max_links }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
<!-- Upper limit pages. -->
<!-- If the user is on a page which is in the upper limit. -->
{{ else if ge $paginator.PageNumber $upper_limit }}
<!-- If the current loop page is greater than total pages minus $max_links -->
{{ if gt .PageNumber (sub $paginator.TotalPages $max_links) }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
<!-- Middle pages. -->
{{ else }}
{{ if and ( ge .PageNumber (sub $paginator.PageNumber $adjacent_links) ) ( le .PageNumber (add $paginator.PageNumber $adjacent_links) ) }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
{{ end }}
<!-- Simple page numbers. -->
{{ else }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
<!-- Output page numbers. -->
{{ if eq ($.Scratch.Get "page_number_flag") true }}
<a href="{{ .URL }}" class="pagination__link">
{{ .PageNumber }}
</a>
{{ end }}
{{ end }}
<!-- Next page. -->
{{ if $paginator.HasNext }}
<a href="{{ $paginator.Next.URL }}" class="pagination__link pagination__link--next">
»
</a>
{{ end }}
<!-- Last page. -->
{{ if ne $paginator.PageNumber $paginator.TotalPages }}
<a class="pagination__link pagination__link--last" href="{{ $paginator.Last.URL }}">
»»
</a>
{{ end }}
{{ end }}
</div>

View File

@ -1,117 +0,0 @@
{{ $s := .Site.Params }}
{{- $paginator := slice -}}
{{- $paginator = .Paginate (where .Site.RegularPages "Params.recurrent" true) -}}
{{ if eq $paginator.PageNumber 1 }}
{{ if ne .Content "" }}
<article>
{{ .Content }}
</article>
{{ end }}
{{ end }}
{{- range first 5 $paginator.Pages -}}
{{ partial "structure/list_article.html" . }}
{{- end }}
<div id="pagination">
<!-- Number of links either side of the current page. -->
{{ $adjacent_links := 2 }}
<!-- $max_links = ($adjacent_links * 2) + 1 -->
{{ $max_links := (add (mul $adjacent_links 2) 1) }}
<!-- $lower_limit = $adjacent_links + 1 -->
{{ $lower_limit := (add $adjacent_links 1) }}
<!-- $upper_limit = $paginator.TotalPages - $adjacent_links -->
{{ $upper_limit := (sub $paginator.TotalPages $adjacent_links) }}
<!-- If there's more than one page. -->
{{ if gt $paginator.TotalPages 1 }}
<!-- First page. -->
{{ if ne $paginator.PageNumber 1 }}
<a class="pagination__link pagination__link--first" href="{{ $paginator.First.URL }}">
««
</a>
{{ end }}
<!-- Previous page. -->
{{ if $paginator.HasPrev }}
<a href="{{ $paginator.Prev.URL }}" class="pagination__link pagination__link--previous">
«
</a>
{{ end }}
<!-- Page numbers. -->
{{ range $paginator.Pagers }}
{{ $.Scratch.Set "page_number_flag" false }}
<!-- Advanced page numbers. -->
{{ if gt $paginator.TotalPages $max_links }}
<!-- Lower limit pages. -->
<!-- If the user is on a page which is in the lower limit. -->
{{ if le $paginator.PageNumber $lower_limit }}
<!-- If the current loop page is less than max_links. -->
{{ if le .PageNumber $max_links }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
<!-- Upper limit pages. -->
<!-- If the user is on a page which is in the upper limit. -->
{{ else if ge $paginator.PageNumber $upper_limit }}
<!-- If the current loop page is greater than total pages minus $max_links -->
{{ if gt .PageNumber (sub $paginator.TotalPages $max_links) }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
<!-- Middle pages. -->
{{ else }}
{{ if and ( ge .PageNumber (sub $paginator.PageNumber $adjacent_links) ) ( le .PageNumber (add $paginator.PageNumber $adjacent_links) ) }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
{{ end }}
<!-- Simple page numbers. -->
{{ else }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
<!-- Output page numbers. -->
{{ if eq ($.Scratch.Get "page_number_flag") true }}
<a href="{{ .URL }}" class="pagination__link">
{{ .PageNumber }}
</a>
{{ end }}
{{ end }}
<!-- Next page. -->
{{ if $paginator.HasNext }}
<a href="{{ $paginator.Next.URL }}" class="pagination__link pagination__link--next">
»
</a>
{{ end }}
<!-- Last page. -->
{{ if ne $paginator.PageNumber $paginator.TotalPages }}
<a class="pagination__link pagination__link--last" href="{{ $paginator.Last.URL }}">
»»
</a>
{{ end }}
{{ end }}
</div>

View File

@ -36,13 +36,13 @@
{{ partial "orga/generator/partials/truefalse" (dict "name" "featured" "expanded" "true") }}
{{ partial "orga/generator/partials/truefalse" (dict "name" "about" "expanded" "true") }}
{{ partial "orga/generator/partials/categories_and_tags.html" (dict "name" "tags" "new" "true") }}
{{ partial "orga/generator/partials/input_line" (dict "name" "covid" "mandatory" "false" "eg" "3G") }}
<!-- {{ partial "orga/generator/partials/input_line" (dict "name" "covid" "mandatory" "false" "eg" "3G") }} -->
</div>
{{ partial "orga/generator/submit" }}
</form>
<div id='display' class="result" style="white-space: pre; background: green;"></div>
<div id='display' class="result" style="white-space: pre; background: var(--background-body); padding: 1rem;"></div>
</article>
<script defer language="javascript" type="text/javascript" src="{{ "/js/visibleIf.js" | urlize | relURL }}"></script>

View File

@ -25,19 +25,6 @@
</div>
</div>
</div>
</article>
{{ define "sidebar" }}
<h3>{{ T "tags" }}</h3>
<div class="tags-list" style="display: flex; flex-direction: column;">
{{- with .Params.tags -}}
{{- if ge (len .) 1 -}}
{{- range . -}}
<a href="{{ $.Site.BaseURL }}tags/{{ . | urlize }}/">#{{ . }}</a>
{{ end -}}
{{- end -}}
{{- end -}}
</div>
{{ end }}

View File

@ -1,22 +0,0 @@
<div id="article_footer" style="margin-top: 0; margin-bottom: 0; background: green; padding: 0;">
{{ if .IsTranslated }}
<div style="flex-grow: 0; flex-direction: column; margin-right: 1rem;">
<b>{{ "Translations" }}</b>
{{ range .Translations }}
<li style="list-style: none; text-decoration: none; font-size: x-small; color: var(--text-muted);">
<a href="{{ .Permalink }}" class="underline">{{ T .Lang }}</a>
</li>
{{ end }}
</div>
{{ end }}
<div style="flex-grow: 1; flex-direction: column;">
<b>Verfasst am</b><br>
{{ .Date | time.Format ":date_full" }}
</div>
{{ if ne .Date .Lastmod }}
<div style="flex-grow: 1; flex-direction: column;">
<b>zuletzt geändert</b><br>
{{ .Lastmod | time.Format ":date_full" }}
</div>
{{ end }}
</div>

View File

@ -36,7 +36,7 @@ function showInput(e) {
var title = form.elements['newtitle'].value;
var content = form.elements['content'].value;
var when = form.elements['newwhen'].value;
var covid = form.elements['newcovid'].value;
// var covid = form.elements['newcovid'].value;
var price = form.elements['newprice'].value;
var registeremail = form.elements['newregisteremail'].value;
var events = check_checkboxes('events');
@ -46,6 +46,7 @@ function showInput(e) {
var tags = check_checkboxes('tags');
if (form.elements['newtags']) { var newtags = testor(form.elements['newtags'].value.split(',')); }
var featured = check_checkboxes('featured');
var about = check_checkboxes('about');
if (newtags != '""') {
@ -93,6 +94,10 @@ function showInput(e) {
display.innerHTML += "featured: true<br>";
}
if (about != '') {
display.innerHTML += "about: true<br>";
}
if (when) {
display.innerHTML += "when: \"" + when + "\"<br>";
}
@ -108,9 +113,9 @@ function showInput(e) {
if (ntags) {
display.innerHTML += "tags: \[" + ntags + "]<br>";
}
if (covid) {
display.innerHTML += "covid: \"" + covid + "\"<br>";
}
// if (covid) {
// display.innerHTML += "covid: \"" + covid + "\"<br>";
// }
if (price) {
display.innerHTML += "price: \"" + price + "\"<br>";
}