aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/docs/src/templates/partials/consent.html
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2023-12-15 10:08:56 +0800
committerGitHub <noreply@github.com>2023-12-15 10:08:56 +0800
commitd697a1774ad8571e9314e3bd85aa141170587d19 (patch)
treecd3c3d84e3288db1f8e574a0b4dfb85e2e40f764 /docs/src/templates/partials/consent.html
parent4943d5eff52a75caaccda6a1d84183032f06be26 (diff)
parent4dafb0f0a81255193f2a44df5d203239325e2236 (diff)
downloadinfini-d697a1774ad8571e9314e3bd85aa141170587d19.tar.gz
infini-d697a1774ad8571e9314e3bd85aa141170587d19.zip
Merge branch 'master' into master
Diffstat (limited to 'docs/src/templates/partials/consent.html')
-rw-r--r--docs/src/templates/partials/consent.html66
1 files changed, 66 insertions, 0 deletions
diff --git a/docs/src/templates/partials/consent.html b/docs/src/templates/partials/consent.html
new file mode 100644
index 00000000..4ac5cb77
--- /dev/null
+++ b/docs/src/templates/partials/consent.html
@@ -0,0 +1,66 @@
+{#-
+ This file was automatically generated - do not edit
+-#}
+{% set cookies = config.extra.consent.cookies | d({}) %}
+{% if config.extra.analytics %}
+ {% if "analytics" not in cookies %}
+ {% set _ = cookies.update({ "analytics": "Google Analytics" }) %}
+ {% endif %}
+{% endif %}
+{% if config.repo_url and "github.com" in config.repo_url %}
+ {% if "github" not in cookies %}
+ {% set _ = cookies.update({ "github": "GitHub" }) %}
+ {% endif %}
+{% endif %}
+{% set actions = config.extra.consent.actions %}
+{% if not actions %}
+ {% set actions = ["accept", "manage"] %}
+{% endif %}
+{% if "manage" not in actions %}
+ {% set checked = "checked" %}
+{% endif %}
+<h4>{{ config.extra.consent.title }}</h4>
+<p>{{ config.extra.consent.description }}</p>
+<input class="md-toggle" type="checkbox" id="__settings" {{ checked }}>
+<div class="md-consent__settings">
+ <ul class="task-list">
+ {% for type in cookies %}
+ {% set checked = "" %}
+ {% if cookies[type] is string %}
+ {% set name = cookies[type] %}
+ {% set checked = "checked" %}
+ {% else %}
+ {% set name = cookies[type].name %}
+ {% if cookies[type].checked %}
+ {% set checked = "checked" %}
+ {% endif %}
+ {% endif %}
+ <li class="task-list-item">
+ <label class="task-list-control">
+ <input type="checkbox" name="{{ type }}" {{ checked }}>
+ <span class="task-list-indicator"></span>
+ {{ name }}
+ </label>
+ </li>
+ {% endfor %}
+ </ul>
+</div>
+<div class="md-consent__controls">
+ {% for action in actions %}
+ {% if action == "accept" %}
+ <button class="md-button md-button--primary">
+ {{- lang.t("consent.accept") -}}
+ </button>
+ {% endif %}
+ {% if action == "reject" %}
+ <button type="reset" class="md-button md-button--primary">
+ {{- lang.t("consent.reject") -}}
+ </button>
+ {% endif %}
+ {% if action == "manage" %}
+ <label class="md-button" for="__settings">
+ {{- lang.t("consent.manage") -}}
+ </label>
+ {% endif %}
+ {% endfor %}
+</div>