-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Updated the design of the cookies component
- Loading branch information
1 parent
06d8784
commit 8c04be3
Showing
4 changed files
with
160 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
157 changes: 54 additions & 103 deletions
157
resources/views/components/_cookie-categories.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,107 +1,58 @@ | ||
@php | ||
$alwaysOpen = $alwaysOpen ?? false; | ||
$cookieCategories = config('cookies_consent.cookies'); | ||
@endphp | ||
|
||
<div class="accordion" id="cookieAccordion"> | ||
<div class="accordion-item cookies-consent-category-item"> | ||
<h5 class="accordion-header h5" id="heading-necessary"> | ||
<button class="accordion-button" type="button" data-toggle="collapse" | ||
data-target="#collapse-necessary" aria-expanded="false" aria-controls="collapse-necessary"> | ||
Necessary | ||
</button> | ||
</h5> | ||
<div id="collapse-necessary" class="accordion-collapse collapse" aria-labelledby="heading-necessary" | ||
data-parent="#cookieAccordion"> | ||
<div class="accordion-body"> | ||
<div class="form-check form-switch"> | ||
<input class="form-check-input cookie-category" type="checkbox" id="necessary" checked="" | ||
disabled=""> | ||
<label class="form-check-label" for="necessary"> | ||
Necessary </label> | ||
@foreach($cookieCategories as $category => $cookies) | ||
<div class="accordion-item cookies-consent-category-item"> | ||
<h5 class="accordion-header h5" id="heading-{{ $category }}"> | ||
<button class="accordion-button" type="button" data-toggle="collapse" | ||
data-target="#collapse-{{ $category }}" aria-expanded="{{ $alwaysOpen ? 'true' : 'false' }}" | ||
aria-controls="collapse-{{ $category }}"> | ||
{{ ucfirst(str_replace('_', ' ', $category)) }} | ||
</button> | ||
</h5> | ||
<div id="collapse-{{ $category }}" class="accordion-collapse collapse {{ $alwaysOpen ? 'show' : '' }}" | ||
aria-labelledby="heading-{{ $category }}" | ||
data-parent="#cookieAccordion"> | ||
<div class="accordion-body"> | ||
<div class="form-check form-switch"> | ||
<input class="form-check-input cookie-category" type="checkbox" | ||
id="{{ $category }}" {{ in_array($category, config('cookies_consent.required')) ? 'checked disabled' : '' }}> | ||
<label class="form-check-label" for="{{ $category }}"> | ||
{{ ucfirst(str_replace('_', ' ', $category)) }} | ||
</label> | ||
</div> | ||
<ul class="list-group mt-3"> | ||
@foreach($cookies as $cookie) | ||
<li class="list-group-item cookie-content-text small"> | ||
<dl> | ||
<dt> | ||
<strong>Cookie: </strong> | ||
<code>{{ $cookie['name'] }}</code> | ||
</dt> | ||
<dd> | ||
<strong>Description: </strong> | ||
{{ $cookie['description'] }} | ||
</dd> | ||
<dd> | ||
<strong>Duration: </strong> | ||
{{ $cookie['duration'] }} | ||
</dd> | ||
@if($cookie['policy_external_link']) | ||
<dd> | ||
<strong>Policy link: </strong> | ||
<a href="{{ $cookie['policy_external_link'] }}" | ||
target="_blank">{{ $cookie['policy_external_link'] }}</a> | ||
</dd> | ||
@endif | ||
</dl> | ||
</li> | ||
@endforeach | ||
</ul> | ||
</div> | ||
<ul class="list-group mt-3"> | ||
<li class="list-group-item cookie-content-text small"> | ||
<dl> | ||
<dt> | ||
<strong>Cookie: </strong> | ||
<code>wp_consent_necessary</code> | ||
</dt> | ||
<dd> | ||
<strong>Duration: </strong> | ||
1 month <br> | ||
</dd> | ||
<dd> | ||
<strong>Description: </strong> | ||
Stores your Cookie Consent Settings for Necessary Cookies. | ||
</dd> | ||
</dl> | ||
</li> | ||
<li class="list-group-item cookie-content-text small"> | ||
<dl> | ||
<dt> | ||
<strong>Cookie: </strong> | ||
<code>wp_consent_statistics</code> | ||
</dt> | ||
<dd> | ||
<strong>Duration: </strong> | ||
1 month <br> | ||
</dd> | ||
<dd> | ||
<strong>Description: </strong> | ||
Stores your Cookie Consent Settings for Statistics Cookies. | ||
</dd> | ||
</dl> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="accordion-item cookies-consent-category-item"> | ||
<h5 class="accordion-header h5" id="heading-statistics"> | ||
<button class="accordion-button" type="button" data-toggle="collapse" | ||
data-target="#collapse-statistics" aria-expanded="false" aria-controls="collapse-statistics"> | ||
Analytics (optional) | ||
</button> | ||
</h5> | ||
<div id="collapse-statistics" class="accordion-collapse collapse" aria-labelledby="heading-statistics" | ||
data-parent="#cookieAccordion"> | ||
<div class="accordion-body"> | ||
<div class="form-check form-switch"> | ||
<input class="form-check-input cookie-category" type="checkbox" id="statistics"> | ||
<label class="form-check-label" for="statistics"> | ||
Analytics (optional) </label> | ||
</div> | ||
<ul class="list-group mt-3"> | ||
<li class="list-group-item cookie-content-text small"> | ||
<dl> | ||
<dt> | ||
<strong>Cookie: </strong> | ||
<code>_ga</code> | ||
</dt> | ||
<dd> | ||
<strong>Duration: </strong> | ||
2 years <br> | ||
</dd> | ||
<dd> | ||
<strong>Description: </strong> | ||
Used to distinguish users for Google Analytics. | ||
</dd> | ||
</dl> | ||
</li> | ||
<li class="list-group-item cookie-content-text small"> | ||
<dl> | ||
<dt> | ||
<strong>Cookie: </strong> | ||
<code>_gid</code> | ||
</dt> | ||
<dd> | ||
<strong>Duration: </strong> | ||
24 hours <br> | ||
</dd> | ||
<dd> | ||
<strong>Description: </strong> | ||
Used to distinguish users for Google Analytics. | ||
</dd> | ||
</dl> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
@endforeach | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters