mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Added support for always showing settings in cookie consent
This commit is contained in:
parent
c8eac99591
commit
006f520f37
@ -115,9 +115,12 @@ The following properties are available:
|
|||||||
consent:
|
consent:
|
||||||
actions:
|
actions:
|
||||||
- accept
|
- accept
|
||||||
- manage
|
- manage # (1)!
|
||||||
```
|
```
|
||||||
|
|
||||||
|
1. If the `manage` settings button is omitted from the `actions` property,
|
||||||
|
the settings are always shown.
|
||||||
|
|
||||||
The cookie consent form includes three types of buttons:
|
The cookie consent form includes three types of buttons:
|
||||||
|
|
||||||
- `accept` – Button to accept selected cookies
|
- `accept` – Button to accept selected cookies
|
||||||
|
@ -16,11 +16,15 @@
|
|||||||
{% if not actions %}
|
{% if not actions %}
|
||||||
{% set actions = ["accept", "manage"] %}
|
{% set actions = ["accept", "manage"] %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if not "manage" in actions %}
|
||||||
|
{% set checked = "checked" %}
|
||||||
|
{% endif %}
|
||||||
<h4>{{ config.extra.consent.title }}</h4>
|
<h4>{{ config.extra.consent.title }}</h4>
|
||||||
<p>{{ config.extra.consent.description }}</p>
|
<p>{{ config.extra.consent.description }}</p>
|
||||||
<input type="checkbox" class="md-toggle" id="__settings">
|
<input class="md-toggle" type="checkbox" id="__settings" {{ checked }}>
|
||||||
<div class="md-consent__settings">
|
<div class="md-consent__settings">
|
||||||
<ul class="task-list">
|
<ul class="task-list">
|
||||||
|
{% set checked = "" %}
|
||||||
{% for type in cookies %}
|
{% for type in cookies %}
|
||||||
{% if cookies[type] is string %}
|
{% if cookies[type] is string %}
|
||||||
{% set name = cookies[type] %}
|
{% set name = cookies[type] %}
|
||||||
|
@ -39,14 +39,25 @@
|
|||||||
{% set actions = ["accept", "manage"] %}
|
{% set actions = ["accept", "manage"] %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- Determine initial settings state -->
|
||||||
|
{% if not "manage" in actions %}
|
||||||
|
{% set checked = "checked" %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<!-- Consent title -->
|
<!-- Consent title -->
|
||||||
<h4>{{ config.extra.consent.title }}</h4>
|
<h4>{{ config.extra.consent.title }}</h4>
|
||||||
<p>{{ config.extra.consent.description }}</p>
|
<p>{{ config.extra.consent.description }}</p>
|
||||||
|
|
||||||
<!-- Consent settings -->
|
<!-- Consent settings -->
|
||||||
<input type="checkbox" class="md-toggle" id="__settings" />
|
<input
|
||||||
|
class="md-toggle"
|
||||||
|
type="checkbox"
|
||||||
|
id="__settings"
|
||||||
|
{{ checked }}
|
||||||
|
/>
|
||||||
<div class="md-consent__settings">
|
<div class="md-consent__settings">
|
||||||
<ul class="task-list">
|
<ul class="task-list">
|
||||||
|
{% set checked = "" %}
|
||||||
{% for type in cookies %}
|
{% for type in cookies %}
|
||||||
{% if cookies[type] is string %}
|
{% if cookies[type] is string %}
|
||||||
{% set name = cookies[type] %}
|
{% set name = cookies[type] %}
|
||||||
|
Loading…
Reference in New Issue
Block a user