Proper assets template
This commit is contained in:
parent
16a7d81535
commit
184b062135
@ -9,8 +9,12 @@ const topSection = window.location.pathname.split('/')[1]
|
||||
if (topSection) document.body.classList.add(topSection)
|
||||
|
||||
// Differentiate users and authors
|
||||
if ('pages' === topSection)
|
||||
if ('pages' === topSection) {
|
||||
document.body.classList.add('author')
|
||||
} else {
|
||||
// Check if access is authorized to root page
|
||||
fetch('/').then(() => document.body.classList.add('author'))
|
||||
}
|
||||
|
||||
// Setup a "property" attribute, to send to the backend for insertion/update/deletion
|
||||
document.querySelectorAll('body > header h1, main article header h1')
|
||||
|
27
themes/acoeur/layouts/_default/assets.html
Normal file
27
themes/acoeur/layouts/_default/assets.html
Normal file
@ -0,0 +1,27 @@
|
||||
{{ define "main" }}
|
||||
<article class="pa3 pa4-ns nested-copy-line-height">
|
||||
<aside id="actions" class="w-30-l mt4-l fr tc">
|
||||
<button class="br-pill pa3 pointer"><label for="file">{{ T (print .Section ".create") }}</label></button>
|
||||
<input id="file" multiple name="file" type="file"/>
|
||||
</aside>
|
||||
|
||||
{{ with .Content }}
|
||||
<section id="content"
|
||||
class="cf ph3 ph5-l pv3 pv4-l f4 tc-l center measure-wide lh-copy {{ $.Param "text_color" | default "mid-gray" }}">
|
||||
{{- . -}}
|
||||
</section>
|
||||
{{ end }}
|
||||
|
||||
<section class="flex-ns flex-wrap justify-around">
|
||||
{{ range .Resources }}
|
||||
<div class="relative w-100 w-30-l mb4 bg-white">
|
||||
<img src="{{ .RelPermalink }}" title="{{.}}" alt="{{.}}" />
|
||||
{{ . }}
|
||||
<button class="delete_image br-pill pa3 pointer" data-target="{{.RelPermalink}}">
|
||||
{{ T (print $.Section ".delete") }}
|
||||
</button>
|
||||
</div>
|
||||
{{ end }}
|
||||
</section>
|
||||
</article>
|
||||
{{ end }}
|
@ -1,12 +1,9 @@
|
||||
{{ define "main" }}
|
||||
<article class="pa3 pa4-ns nested-copy-line-height">
|
||||
<aside id="actions" class="w-30-l mt4-l fr tc">
|
||||
{{ if eq .Section "assets" }}
|
||||
<button class="br-pill pa3 pointer"><label for="file">{{ T (print .Section ".create") }}</label></button>
|
||||
<input id="file" multiple name="file" type="file"/>
|
||||
{{ else if .Parent.IsHome }}
|
||||
{{ if .Parent.IsHome }}
|
||||
<button id="create" class="br-pill pa3 pointer">{{ T (print .Section ".create") }}</button>
|
||||
{{ else }}
|
||||
{{ else if .Parent.Parent.IsHome }}
|
||||
<button id="delete" class="br-pill pa3 pointer">{{ T (print .Section ".delete") }}</button>
|
||||
{{ end }}
|
||||
</aside>
|
||||
@ -33,19 +30,8 @@
|
||||
{{ .Render "summary-with-image" }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{- template "_internal/pagination.html" . -}}
|
||||
|
||||
{{ if .Parent.IsHome }}
|
||||
{{ range .Resources }}
|
||||
<div class="relative w-100 w-30-l mb4 bg-white">
|
||||
<img src="{{ .RelPermalink }}" title="{{.}}" alt="{{.}}" />
|
||||
{{ . }}
|
||||
<button class="delete_image br-pill pa3 pointer" data-target="{{.RelPermalink}}">
|
||||
{{ T (print $.Section ".delete") }}
|
||||
</button>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{- template "_internal/pagination.html" . -}}
|
||||
{{ end }}
|
||||
</section>
|
||||
</article>
|
||||
|
Loading…
Reference in New Issue
Block a user