Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/vjeantet/hugo-theme-docport.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvjeantet <valere.jeantet@gmail.com>2020-09-23 23:39:42 +0300
committervjeantet <valere.jeantet@gmail.com>2020-09-23 23:39:42 +0300
commitd1f32ddaf9f51b037f8221460cfba10bdcd2e141 (patch)
tree03e27aedc0caedccb2b679d49fb4d5ab92da5fd4 /layouts/partials
parentee1a0501f9841ea3719dbde8dd542f25982cc826 (diff)
add checklist kind of pages
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/_checklist-footer.html8
-rw-r--r--layouts/partials/_checklist-header.html16
-rw-r--r--layouts/partials/_mdinclude.html18
-rw-r--r--layouts/partials/body-article-content.html16
-rw-r--r--layouts/partials/body-article-sidepage.html5
-rw-r--r--layouts/partials/body-footer.html2
-rw-r--r--layouts/partials/body-header.html2
-rw-r--r--layouts/partials/body-sidebar.html4
-rw-r--r--layouts/partials/html-head.html11
9 files changed, 69 insertions, 13 deletions
diff --git a/layouts/partials/_checklist-footer.html b/layouts/partials/_checklist-footer.html
new file mode 100644
index 0000000..009e6fc
--- /dev/null
+++ b/layouts/partials/_checklist-footer.html
@@ -0,0 +1,8 @@
+{{if .Params.checklist}}
+ </form>
+ <div class="checklist-footer">
+ <button type="button"
+ onclick="downloadFile('6d2ab01b-fad4-4e70-83a8-b910ca848fec');"
+ class="btn btn-success"><i class="fas fa-download"></i>&nbsp;{{T "checklist-download-answers"}}</button>
+ </div>
+{{end}}
diff --git a/layouts/partials/_checklist-header.html b/layouts/partials/_checklist-header.html
new file mode 100644
index 0000000..4426680
--- /dev/null
+++ b/layouts/partials/_checklist-header.html
@@ -0,0 +1,16 @@
+{{if .Params.checklist}}
+ {{ $formID := .File.UniqueID }}
+ <link rel="stylesheet" href='{{ (resources.Get "sass/checklist.scss" | resources.ExecuteAsTemplate "css/checklist.main.scss" . | toCSS).Permalink }}'>
+ <form name="{{$formID}}" id="6d2ab01b-fad4-4e70-83a8-b910ca848fec" ref="{{with $.Params.Ref}}{{.}}{{else}}{{printf "%s-%s" $.CurrentSection.Title $formID}}{{end}}">
+ <script src='{{"js/checklist.js" | relURL}}'></script>
+ <script type="text/javascript">
+ $( document ).ready(function() {
+ listenFormChange('6d2ab01b-fad4-4e70-83a8-b910ca848fec')
+ });
+ </script>
+
+ <div class="form-group checklist-header">
+ <label class="sr-only" for="inputFile">File Upload</label>
+ <input type="file" class="form-control-file text-primary font-weight-bold" id="inputFile" accept="application/json" onchange="onChooseFile(event,fillForm('6d2ab01b-fad4-4e70-83a8-b910ca848fec'))" data-title="{{T "checklist-load-answers"}}">
+ </div>
+{{end}} \ No newline at end of file
diff --git a/layouts/partials/_mdinclude.html b/layouts/partials/_mdinclude.html
index 820a5e3..812b8c9 100644
--- a/layouts/partials/_mdinclude.html
+++ b/layouts/partials/_mdinclude.html
@@ -1,9 +1,12 @@
-{{- template "extrapage" dict "name" .name "page" .context "tip" .tip -}}
-{{- define "extrapage" -}}
- {{ $header := print .name "." .page.Lang }}
- {{ range where .page.Site.Pages "File.BaseFileName" $header }}
+{{- template "pageBlock" dict "name" .name "page" .context -}}
+{{- template "siteBlock" dict "name" .name "page" .context "tip" .tip -}}
+
+{{- define "siteBlock" -}}
+ {{ $path := printf "_layout/%s/_index.%s.md" .name .page.Lang}}
+ {{ range where .page.Site.Pages "File.BaseFileName" $path }}
{{ .Content }}
{{else}}
+ {{ $path = printf "_layout/%s/_index.md" .name }}
{{ if .page.Site.GetPage "page" (print .name ".md") }}
{{(.page.Site.GetPage "page" (print .name ".md")).Content}}
{{else}}
@@ -11,3 +14,10 @@
{{end}}
{{end}}
{{- end -}}
+
+{{- define "pageBlock" -}}
+{{ $path := printf "%s__%s.md" .page.Dir .name}}
+ {{ with .page.Site.GetPage $path }}
+ {{ .Content }}
+ {{end}}
+{{- end -}}
diff --git a/layouts/partials/body-article-content.html b/layouts/partials/body-article-content.html
index 0eedee2..f4d9698 100644
--- a/layouts/partials/body-article-content.html
+++ b/layouts/partials/body-article-content.html
@@ -20,6 +20,7 @@
{{ $isSubPage := .Params.subpage }}
{{ $subpages := (where (where (where .Sections.ByWeight "Params.subpage" true) "Params.hidden" "ne" true ) "Kind" "section")}}
{{ $pages := (where (where .CurrentSection.Pages.ByWeight "Kind" "page") "Params.hidden" "ne" true ) }}
+
{{if $isSubPage }}
<h1>{{.Parent.Title}}<span>{{$pagetitle}}</span></h1>
@@ -40,7 +41,7 @@
{{ if gt (len $elements) 0}}
<nav class="subpages">
{{- range $elements}}
- {{- if not .Params.hidden }}
+ {{- if and (not .Params.hidden) ( not (hasPrefix .File.BaseFileName "__")) }}
{{$pagetitle := .Title}}
{{if eq $pagetitle ""}}{{$pagetitle = .File.BaseFileName}}{{end}}
<li {{if eq . $cPage}}class="active"{{- end}}>
@@ -65,9 +66,16 @@
{{end}}
<!-- / JUMP TO SECTION -->
+
+
+
+
+
<div class="content">
{{- with .Content -}}
- {{ . | replaceRE "(<h[1-9]) id=\"([^\"]+)\"(.+)(</h[1-9]+>)" `${1}${3}${4}<a class="anchor" id="${2}"></a>` | safeHTML }}
+ {{ partial "_checklist-header.html" $ }}
+ {{ . | replaceRE "(<h[1-9]) id=\"([^\"]+)\"(.+)(</h[1-9]+>)" `${1} ref="${2}" ${3}${4}<a class="anchor" id="${2}"></a>` | safeHTML }}
+ {{ partial "_checklist-footer.html" $ }}
{{- else -}}
{{with index .Pages 0}}
<meta http-equiv = "refresh" content = "0; url = {{.RelPermalink}}"/>
@@ -78,6 +86,10 @@
</div>
+
+
+
+
{{if not (in .Params.hide "nextpage")}}
<div class="chevrons">
{{ partial "_next-prev-page.html" .CurrentSection }}
diff --git a/layouts/partials/body-article-sidepage.html b/layouts/partials/body-article-sidepage.html
index 4d8a8c5..0a4417b 100644
--- a/layouts/partials/body-article-sidepage.html
+++ b/layouts/partials/body-article-sidepage.html
@@ -1,6 +1,5 @@
-{{- partial "_mdinclude.html" (dict "name" "_layout/article-sidebar-before/_index" "context" .) -}}
+{{- partial "_mdinclude.html" (dict "name" "article-sidebar-before" "context" .) -}}
<div class="TableOfContents">
-
<label><i class="fas fa-align-right"></i>&nbsp;&nbsp;{{T "table-of-contents"}}</label>
<nav>
<ul >
@@ -9,7 +8,7 @@
</nav>
{{ .TableOfContents }}
</div>
-{{- partial "_mdinclude.html" (dict "name" "_layout/article-sidebar-after/_index" "context" .) -}}
+{{- partial "_mdinclude.html" (dict "name" "article-sidebar-after" "context" .) -}}
<div class="Actions">
diff --git a/layouts/partials/body-footer.html b/layouts/partials/body-footer.html
index 157e877..96eef5b 100644
--- a/layouts/partials/body-footer.html
+++ b/layouts/partials/body-footer.html
@@ -1,4 +1,4 @@
-{{- partial "_mdinclude.html" (dict "name" "_layout/footer/_index" "context" . "tip" (T "create-footer-md") ) -}}
+{{- partial "_mdinclude.html" (dict "name" "footer" "context" . "tip" (T "create-footer-md") ) -}}
diff --git a/layouts/partials/body-header.html b/layouts/partials/body-header.html
index 1b32e30..56a1af1 100644
--- a/layouts/partials/body-header.html
+++ b/layouts/partials/body-header.html
@@ -7,7 +7,7 @@
<div>
{{- $defaultheader := printf "<a class='baselink' href='%s'>%s</a>" .Site.BaseURL .Site.Title -}}
- {{- partial "_mdinclude.html" (dict "name" "_layout/header/_index" "context" . "tip" $defaultheader ) -}}
+ {{- partial "_mdinclude.html" (dict "name" "header" "context" . "tip" $defaultheader ) -}}
</div>
{{- with .Site.Menus.shortcuts}}
diff --git a/layouts/partials/body-sidebar.html b/layouts/partials/body-sidebar.html
index 217d8fb..bcfd4ac 100644
--- a/layouts/partials/body-sidebar.html
+++ b/layouts/partials/body-sidebar.html
@@ -18,7 +18,7 @@
{{- end}}
-{{- partial "_mdinclude.html" (dict "name" "_layout/sidebar-before/_index" "context" .) -}}
+{{- partial "_mdinclude.html" (dict "name" "sidebar-before" "context" .) -}}
<div id="close_menu">
<a href="javascript:void(0);" style="font-size:15px;" onclick="$('article > aside').toggleClass('responsive')">
@@ -30,4 +30,4 @@
{{- partial "_menu.html" . }}
</ul>
-{{- partial "_mdinclude.html" (dict "name" "_layout/sidebar-after/_index" "context" .) -}} \ No newline at end of file
+{{- partial "_mdinclude.html" (dict "name" "sidebar-after" "context" .) -}} \ No newline at end of file
diff --git a/layouts/partials/html-head.html b/layouts/partials/html-head.html
index ff23396..436ed4c 100644
--- a/layouts/partials/html-head.html
+++ b/layouts/partials/html-head.html
@@ -20,6 +20,17 @@
<link href='{{"vendor/bootstrap/bootstrap-4.5.2-dist/css/bootstrap.min.css" | relURL}}' rel="stylesheet">
+
+
+<link rel="stylesheet" type="text/css" href='{{ (resources.Get "sass/shortcodes/notice.scss" | toCSS).Permalink }}'>
+<link rel="stylesheet" type="text/css" href='{{ (resources.Get "sass/shortcodes/tabs.scss" | toCSS).Permalink }}'>
+<link rel="stylesheet" type="text/css" href='{{ (resources.Get "sass/shortcodes/panel.scss" | toCSS).Permalink }}'>
+<link rel="stylesheet" type="text/css" href='{{ (resources.Get "sass/shortcodes/columns.scss" | toCSS).Permalink }}'>
+<link rel="stylesheet" type="text/css" href='{{ (resources.Get "sass/shortcodes/children.scss" | toCSS).Permalink }}'>
+<link rel="stylesheet" type="text/css" href='{{ (resources.Get "sass/shortcodes/attachments.scss" | toCSS).Permalink }}'>
+<link rel="stylesheet" type="text/css" href='{{ (resources.Get "sass/shortcodes/alert.scss" | toCSS).Permalink }}'>
+
+
<link rel="stylesheet" href='{{"/css/docport.css" | relURL}}'>