Randomg things.
This commit is contained in:
parent
73b1faf9cc
commit
09043d7884
8102
web/db.sql
Normal file
8102
web/db.sql
Normal file
File diff suppressed because one or more lines are too long
BIN
web/db/backup.sqlite
Normal file
BIN
web/db/backup.sqlite
Normal file
Binary file not shown.
5
web/modules/custom/dc_tests/dc_tests.libraries.yml
Normal file
5
web/modules/custom/dc_tests/dc_tests.libraries.yml
Normal file
@ -0,0 +1,5 @@
|
||||
testing:
|
||||
js:
|
||||
js/testing.js: {}
|
||||
dependencies:
|
||||
- core/drupal
|
||||
5
web/modules/custom/dc_tests/dc_tests.module
Normal file
5
web/modules/custom/dc_tests/dc_tests.module
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
function dc_tests_preprocess_node(&$variables) {
|
||||
$variables['#attached']['library'][] = 'dc_tests/testing';
|
||||
}
|
||||
10
web/modules/custom/dc_tests/js/testing.js
Normal file
10
web/modules/custom/dc_tests/js/testing.js
Normal file
@ -0,0 +1,10 @@
|
||||
((Drupal, once) => {
|
||||
Drupal.behaviors.myBehavior = {
|
||||
attach(context) {
|
||||
let target = once('myBehavior', 'body');
|
||||
target.forEach((t) => {
|
||||
alert('Behavior attached test');
|
||||
});
|
||||
},
|
||||
};
|
||||
})(Drupal, once);
|
||||
@ -0,0 +1 @@
|
||||
<h1>Hello World</h1>
|
||||
File diff suppressed because one or more lines are too long
@ -12,19 +12,19 @@
|
||||
# This means that if you want to override any value of a parameter, the
|
||||
# whole parameter array needs to be copied from
|
||||
# sites/default/default.services.yml or from core/core.services.yml file.
|
||||
parameters:
|
||||
http.response.debug_cacheability_headers: true
|
||||
services:
|
||||
cache.backend.null:
|
||||
class: Drupal\Core\Cache\NullBackendFactory
|
||||
logger.channel.config_schema:
|
||||
parent: logger.channel_base
|
||||
arguments: [ 'config_schema' ]
|
||||
config.schema_checker:
|
||||
class: Drupal\Core\Config\Development\LenientConfigSchemaChecker
|
||||
arguments:
|
||||
- '@config.typed'
|
||||
- '@messenger'
|
||||
- '@logger.channel.config_schema'
|
||||
tags:
|
||||
- { name: event_subscriber }
|
||||
# parameters:
|
||||
# http.response.debug_cacheability_headers: true
|
||||
# services:
|
||||
# cache.backend.null:
|
||||
# class: Drupal\Core\Cache\NullBackendFactory
|
||||
# logger.channel.config_schema:
|
||||
# parent: logger.channel_base
|
||||
# arguments: [ 'config_schema' ]
|
||||
# config.schema_checker:
|
||||
# class: Drupal\Core\Config\Development\LenientConfigSchemaChecker
|
||||
# arguments:
|
||||
# - '@config.typed'
|
||||
# - '@messenger'
|
||||
# - '@logger.channel.config_schema'
|
||||
# tags:
|
||||
# - { name: event_subscriber }
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
name: Alert
|
||||
props:
|
||||
type: object
|
||||
properties:
|
||||
alertType:
|
||||
type: string
|
||||
title: Alert Type
|
||||
description: 'The type of alert.'
|
||||
slots:
|
||||
alertText:
|
||||
title: Alert Text
|
||||
required: true
|
||||
description: The test for the alert.
|
||||
21
web/themes/custom/dchadwick/components/alert/alert.css
Normal file
21
web/themes/custom/dchadwick/components/alert/alert.css
Normal file
@ -0,0 +1,21 @@
|
||||
.alert-wrapper .field_alert_text {
|
||||
padding: 20px 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.alert.normal {
|
||||
background-color: deepskyblue;
|
||||
color: darkblue;
|
||||
}
|
||||
|
||||
.alert.warning {
|
||||
background-color: goldenrod;
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.alert.danger {
|
||||
background-color: lightpink;
|
||||
color: darkred;
|
||||
font-weight: bolder;
|
||||
}
|
||||
3
web/themes/custom/dchadwick/components/alert/alert.twig
Normal file
3
web/themes/custom/dchadwick/components/alert/alert.twig
Normal file
@ -0,0 +1,3 @@
|
||||
<div class="alert {{ alertType }}">
|
||||
{% block alertText %}{% endblock %}
|
||||
</div>
|
||||
@ -0,0 +1,26 @@
|
||||
{#
|
||||
* Component variables
|
||||
*
|
||||
* props:
|
||||
* alerType
|
||||
*
|
||||
* slots
|
||||
* alertText
|
||||
*
|
||||
#}
|
||||
<div {{ attributes.addClass('alert-wrapper') }}>
|
||||
{{ title_prefix }}
|
||||
{{ title_suffix }}
|
||||
|
||||
{% set alertType = content.field_alert_type.0['#markup']|clean_class %}
|
||||
{% embed 'dchadwick:alert' with {
|
||||
alertType: alertType,
|
||||
}%}
|
||||
|
||||
{% block alertText %}
|
||||
<p>{{ content.field_alert_text }}</p>
|
||||
{% endblock%}
|
||||
|
||||
{% endembed %}
|
||||
|
||||
</div>
|
||||
Loading…
x
Reference in New Issue
Block a user