started rgpd integration
This commit is contained in:
@@ -21,3 +21,11 @@ materio_user.login_block:
|
||||
_format: json
|
||||
requirements:
|
||||
_access: 'TRUE'
|
||||
|
||||
materio_user.privacy_policy:
|
||||
path: '/privacy-policy'
|
||||
defaults:
|
||||
_controller: '\Drupal\materio_user\Controller\MaterioUserPrivacyPolicy::getPp'
|
||||
_title_callback: '\Drupal\materio_user\Controller\MaterioUserPrivacyPolicy::getTitle'
|
||||
requirements:
|
||||
_permission: 'access content'
|
||||
|
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\materio_commerce\Controller;
|
||||
|
||||
use Drupal\Core\Controller\ControllerBase;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Drupal\Core\Language\LanguageManagerInterface;
|
||||
use Drupal\Core\Url;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
// use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Drupal\config_pages\Entity\ConfigPages;
|
||||
use Drupal\config_pages\Entity\ConfigPagesType;
|
||||
|
||||
/**
|
||||
* Class AjaxHomeController.
|
||||
*/
|
||||
class MaterioCommerceTermsViewer extends ControllerBase {
|
||||
|
||||
|
||||
/*
|
||||
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
|
||||
*/
|
||||
protected $languageManager;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function create(ContainerInterface $container) {
|
||||
return new static(
|
||||
$container->get('language_manager')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new MaterioDecoupledLanguageLinks object.
|
||||
*
|
||||
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
|
||||
* The language manager.
|
||||
*/
|
||||
public function __construct(LanguageManagerInterface $language_manager) {
|
||||
$this->languageManager = $language_manager;
|
||||
}
|
||||
|
||||
/**
|
||||
* getTerms
|
||||
*
|
||||
* @return string
|
||||
* Return config_page terms_of_services display.
|
||||
*/
|
||||
public function getTos(Request $request) {
|
||||
$config_page = $this->getConfigPage();
|
||||
|
||||
// Correct metatags attachment.
|
||||
if (function_exists('metatag_get_tags_from_route')) {
|
||||
$metatag_attachments = &drupal_static('metatag_attachments');
|
||||
$metatag_attachments = metatag_get_tags_from_route($config_page);
|
||||
}
|
||||
|
||||
return parent::entityTypeManager()->getViewBuilder('config_pages')->view($config_page, 'full');
|
||||
|
||||
}
|
||||
|
||||
public function getTitle(Request $request) {
|
||||
$config_page = $this->getConfigPage();
|
||||
return $config_page->get('field_title')->getString();
|
||||
}
|
||||
|
||||
private function getConfigPage(){
|
||||
return ConfigPages::load("terms_of_services");
|
||||
}
|
||||
}
|
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\materio_user\Controller;
|
||||
|
||||
use Drupal\Core\Controller\ControllerBase;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Drupal\Core\Language\LanguageManagerInterface;
|
||||
use Drupal\Core\Url;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
// use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Drupal\config_pages\Entity\ConfigPages;
|
||||
use Drupal\config_pages\Entity\ConfigPagesType;
|
||||
|
||||
/**
|
||||
* Class AjaxHomeController.
|
||||
*/
|
||||
class MaterioUserPrivacyPolicy extends ControllerBase {
|
||||
|
||||
|
||||
/*
|
||||
* @var \Drupal\Core\Entity\EntityTypeManagerInterface
|
||||
*/
|
||||
protected $languageManager;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function create(ContainerInterface $container) {
|
||||
return new static(
|
||||
$container->get('language_manager')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new MaterioDecoupledLanguageLinks object.
|
||||
*
|
||||
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
|
||||
* The language manager.
|
||||
*/
|
||||
public function __construct(LanguageManagerInterface $language_manager) {
|
||||
$this->languageManager = $language_manager;
|
||||
}
|
||||
|
||||
/**
|
||||
* getTerms
|
||||
*
|
||||
* @return string
|
||||
* Return config_page terms_of_services display.
|
||||
*/
|
||||
public function getPp(Request $request) {
|
||||
$config_page = $this->getConfigPage();
|
||||
|
||||
// Correct metatags attachment.
|
||||
if (function_exists('metatag_get_tags_from_route')) {
|
||||
$metatag_attachments = &drupal_static('metatag_attachments');
|
||||
$metatag_attachments = metatag_get_tags_from_route($config_page);
|
||||
}
|
||||
|
||||
return parent::entityTypeManager()->getViewBuilder('config_pages')->view($config_page, 'full');
|
||||
|
||||
}
|
||||
|
||||
public function getTitle(Request $request) {
|
||||
$config_page = $this->getConfigPage();
|
||||
return $config_page->get('field_title')->getString();
|
||||
}
|
||||
|
||||
private function getConfigPage(){
|
||||
return ConfigPages::load("privacy_policy");
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -573,6 +573,11 @@ header[role="banner"]{
|
||||
color: #fff;
|
||||
background-color: $color-showrooms;
|
||||
}
|
||||
body.path-privacy-policy &,
|
||||
body.path-tos & {
|
||||
color: #fff;
|
||||
background-color: $color-main-text;
|
||||
}
|
||||
}
|
||||
@include col-mediaquery-max(3){
|
||||
body.path-frontpage &, body.path-home & {
|
||||
@@ -2818,50 +2823,80 @@ form#user-pass{
|
||||
// | _/ _ \/ _ \ _/ -_) '_|
|
||||
// |_|\___/\___/\__\___|_|
|
||||
footer[role="contentinfo"]{
|
||||
body:not(.path-home) & {
|
||||
display:none;
|
||||
// body:not(.path-home) & {
|
||||
// display:none;
|
||||
// }
|
||||
>.wrapper{
|
||||
display:flex;
|
||||
flex-flow: row nowrap;
|
||||
>div{
|
||||
flex: 1 1 auto;
|
||||
align-self: center;
|
||||
}
|
||||
}
|
||||
#block-materiosimplenewssubscription{
|
||||
form{
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
align-items: center;
|
||||
font-size: 0.756em;
|
||||
>*{
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
#edit-subscriptions{
|
||||
#footer-left{
|
||||
#block-materiosimplenewssubscription{
|
||||
form{
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
align-items: center;
|
||||
font-size: 0.756em;
|
||||
>*{
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
#edit-subscriptions{
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
align-items: center;
|
||||
>*{
|
||||
margin-right: 0.5em;
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
align-items: center;
|
||||
}
|
||||
input{
|
||||
margin-right: 0.3em;
|
||||
}
|
||||
}
|
||||
input{
|
||||
margin-right: 0.3em;
|
||||
#edit-mail-wrapper{
|
||||
input[type="email"]{
|
||||
width:10em;
|
||||
}
|
||||
}
|
||||
#edit-actions--2{
|
||||
input[type="submit"]{
|
||||
border: none;
|
||||
background: none;
|
||||
background-color: $color-base;
|
||||
border-radius: 5px;
|
||||
color: #fff;
|
||||
padding: 0.45em 1em;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
}
|
||||
#edit-mail-wrapper{
|
||||
input[type="email"]{
|
||||
width:10em;
|
||||
}
|
||||
}
|
||||
#edit-actions--2{
|
||||
input[type="submit"]{
|
||||
border: none;
|
||||
background: none;
|
||||
background-color: $color-base;
|
||||
border-radius: 5px;
|
||||
color: #fff;
|
||||
padding: 0.45em 1em;
|
||||
font-weight: 700;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#footer-middle{
|
||||
|
||||
}
|
||||
|
||||
#footer-right{
|
||||
text-align: right;
|
||||
nav.block-menu.menu--footer{
|
||||
display: inline-block;
|
||||
font-size: 0.756em;
|
||||
ul.menu{
|
||||
padding:0; margin:0;
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
li.menu-item{
|
||||
padding: 1em 0.5em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -92,9 +92,15 @@
|
||||
{% if page.footer_left or page.footer_center or page.footer_right %}
|
||||
<footer role="contentinfo">
|
||||
<div class="wrapper">
|
||||
{{ page.footer_left }}
|
||||
{{ page.footer_center }}
|
||||
{{ page.footer_right }}
|
||||
<div id="footer-left">
|
||||
{{ page.footer_left }}
|
||||
</div>
|
||||
<div id="footer-middle">
|
||||
{{ page.footer_center }}
|
||||
</div>
|
||||
<div id="footer-right">
|
||||
{{ page.footer_right }}
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user