Skip to content

Commit

Permalink
#44 Move Piwik privacy policy to blade
Browse files Browse the repository at this point in the history
  • Loading branch information
MGHollander committed Sep 22, 2023
1 parent f39c38a commit cbdb4a8
Show file tree
Hide file tree
Showing 7 changed files with 170 additions and 72 deletions.
6 changes: 3 additions & 3 deletions app/Http/Controllers/PrivacyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ class PrivacyController extends Controller
* Display a listing of the resource.
*
* @param Request $request
* @return \Inertia\Response
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View|\Illuminate\Foundation\Application
*/
public function __invoke(): Response
public function __invoke(): \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View|\Illuminate\Foundation\Application
{
return Inertia::render('Privacy');
return view('privacy');
}

}
2 changes: 1 addition & 1 deletion resources/js/Layouts/Default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ watchEffect(() => {
<footer>
<div class="py-2">
<div class="mx-auto max-w-7xl sm:px-6 lg:px-8">
<Link :href="route('privacy')" class="text-gray-900 hover:text-gray-500">Privacy</Link>
<a :href="route('privacy')" class="text-gray-900 hover:text-gray-500">Privacy</a>
</div>
</div>
</footer>
Expand Down
32 changes: 0 additions & 32 deletions resources/js/Pages/Privacy.vue

This file was deleted.

43 changes: 7 additions & 36 deletions resources/views/app.blade.php
Original file line number Diff line number Diff line change
@@ -1,40 +1,11 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
@extends('layout')

<title inertia>{{ config('app.name', 'Laravel') }}</title>

<!-- Fonts -->
<link rel="stylesheet" href="https://fonts.bunny.net/css2?family=Nunito:wght@400;600;700&display=swap">

<!-- Favicons -->
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#047857">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">

@if(isset($open_graph) && is_array($open_graph))
@foreach($open_graph as $key => $value)
<meta property="og:{{ $key }}" content="{{ $value }}"/>
@endforeach
@endif

<!-- Scripts -->
@section('head')
@routes
@vite('resources/js/app.js')
@inertiaHead
</head>
<body class="font-sans antialiased min-w-80">
{{-- @formatter:off --}}
@production
<script type="text/javascript">(function(window, document, dataLayerName, id) {window[dataLayerName]=window[dataLayerName]||[],window[dataLayerName].push({start:(new Date).getTime(),event:"stg.start"});var scripts=document.getElementsByTagName('script')[0],tags=document.createElement('script');function stgCreateCookie(a,b,c){var d="";if(c){var e=new Date;e.setTime(e.getTime()+24*c*60*60*1e3),d="; expires="+e.toUTCString();f="; SameSite=Strict"}document.cookie=a+"="+b+d+f+"; path=/"}var isStgDebug=(window.location.href.match("stg_debug")||document.cookie.match("stg_debug"))&&!window.location.href.match("stg_disable_debug");stgCreateCookie("stg_debug",isStgDebug?1:"",isStgDebug?14:-1);var qP=[];dataLayerName!=="dataLayer"&&qP.push("data_layer_name="+dataLayerName),isStgDebug&&qP.push("stg_debug");var qPString=qP.length>0?("?"+qP.join("&")):"";tags.async=!0,tags.src="https://koken-maruc-nl.containers.piwik.pro/"+id+".js"+qPString,scripts.parentNode.insertBefore(tags,scripts);!function(a,n,i){a[n]=a[n]||{};for(var c=0;c<i.length;c++)!function(i){a[n][i]=a[n][i]||{},a[n][i].api=a[n][i].api||function(){var a=[].slice.call(arguments,0);"string"==typeof a[0]&&window[dataLayerName].push({event:n+"."+i+":"+a[0],parameters:[].slice.call(arguments,1)})}}(i[c])}(window,"ppms",["tm","cm"]);})(window, document, 'dataLayer', 'b84fa7e9-60bf-4ccf-b2fb-ab92d7230e3e');</script>
@endproduction
{{-- @formatter:on --}}
@inertia
</body>
</html>
@endsection

@section('content')
@inertia
@endsection
35 changes: 35 additions & 0 deletions resources/views/layout.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

@section('title')
<title inertia>{{ config('app.name', 'Laravel') }}</title>
@endsection

<!-- Fonts -->
<link rel="stylesheet" href="https://fonts.bunny.net/css2?family=Nunito:wght@400;600;700&display=swap">

<!-- Favicons -->
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#047857">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">

@if(isset($open_graph) && is_array($open_graph))
@foreach($open_graph as $key => $value)
<meta property="og:{{ $key }}" content="{{ $value }}"/>
@endforeach
@endif

@yield('head')
</head>
<body class="font-sans antialiased min-w-80">
@include('piwik')
@yield('content')
</body>
</html>
6 changes: 6 additions & 0 deletions resources/views/piwik.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

{{-- @formatter:off --}}
{{--@production--}}
<script type="text/javascript">(function(window, document, dataLayerName, id) {window[dataLayerName]=window[dataLayerName]||[],window[dataLayerName].push({start:(new Date).getTime(),event:"stg.start"});var scripts=document.getElementsByTagName('script')[0],tags=document.createElement('script');function stgCreateCookie(a,b,c){var d="";if(c){var e=new Date;e.setTime(e.getTime()+24*c*60*60*1e3),d="; expires="+e.toUTCString();f="; SameSite=Strict"}document.cookie=a+"="+b+d+f+"; path=/"}var isStgDebug=(window.location.href.match("stg_debug")||document.cookie.match("stg_debug"))&&!window.location.href.match("stg_disable_debug");stgCreateCookie("stg_debug",isStgDebug?1:"",isStgDebug?14:-1);var qP=[];dataLayerName!=="dataLayer"&&qP.push("data_layer_name="+dataLayerName),isStgDebug&&qP.push("stg_debug");var qPString=qP.length>0?("?"+qP.join("&")):"";tags.async=!0,tags.src="https://koken-maruc-nl.containers.piwik.pro/"+id+".js"+qPString,scripts.parentNode.insertBefore(tags,scripts);!function(a,n,i){a[n]=a[n]||{};for(var c=0;c<i.length;c++)!function(i){a[n][i]=a[n][i]||{},a[n][i].api=a[n][i].api||function(){var a=[].slice.call(arguments,0);"string"==typeof a[0]&&window[dataLayerName].push({event:n+"."+i+":"+a[0],parameters:[].slice.call(arguments,1)})}}(i[c])}(window,"ppms",["tm","cm"]);})(window, document, 'dataLayer', 'b84fa7e9-60bf-4ccf-b2fb-ab92d7230e3e');</script>
{{--@endproduction--}}
{{-- @formatter:on --}}
Loading

0 comments on commit cbdb4a8

Please sign in to comment.