Skip to content

Commit 84efe3e

Browse files
author
Simon L. Lange
committed
Merge branch 'develop' of github.com:OS2web/os2web8 into develop
2 parents b20bfe1 + 36cef76 commit 84efe3e

File tree

11 files changed

+121
-18791
lines changed

11 files changed

+121
-18791
lines changed

.docksal/docksal.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ services:
1414
- PMA_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}
1515
labels:
1616
- io.docksal.virtual-host=pma.${VIRTUAL_HOST}
17+
solr:
18+
image: docksal/solr:7.5-edge
19+
volumes:
20+
- ${PROJECT_ROOT}/.docksal/etc/solr/conf:/var/lib/solr/conf:ro
21+
extends:
22+
file: ${HOME}/.docksal/stacks/services.yml
23+
service: solr
24+
labels:
25+
- 'io.docksal.virtual-host=solr.${VIRTUAL_HOST}'
26+
1727

1828
# blackfire:
1929
# extends:

web/sites/default/dev.settings.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,5 @@
161161
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
162162
'driver' => 'mysql',
163163
);
164+
165+
$settings['file_private_path'] = 'private';

web/themes/custom/fds_faxe_theme/dist/stylesheets/stylesheet.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/themes/custom/fds_faxe_theme/fds_faxe_theme.theme

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,26 @@ use Drupal\node\Entity\Node;
88
use Drupal\taxonomy\Entity\Term;
99

1010

11+
/**
12+
* Implements hook_theme_suggestions_page().
13+
*/
14+
function fds_faxe_theme_theme_suggestions_block_alter(array &$suggestions, array $variables) {
15+
if ($variables['elements']['#id'] == 'lastupdated') {
16+
if (file_exists(__DIR__ . '/templates/block/block--lastupdated.html.twig')) {
17+
$suggestions = ["block__lastupdated"];
18+
}
19+
}
20+
}
21+
22+
23+
24+
1125
/**
1226
* Implements hook_preprocess_block().
1327
*/
1428
function fds_faxe_theme_preprocess_block(&$variables) {
15-
if ($variables['elements']['#id'] == 'fds_faxe_theme_indholdfield') {
29+
30+
if ($variables['elements']['#id'] == 'fds_faxe_theme_indholdfield') {
1631
$node = $variables['content']['field']['#object'];
1732
$ext_links = $node->get('field_ext_links')->getValue();
1833
foreach( $ext_links as $ext_link) {
@@ -21,6 +36,14 @@ function fds_faxe_theme_preprocess_block(&$variables) {
2136
$variables['content']['field'][] = $link->toRenderable();
2237
}
2338
}
39+
40+
if ($variables['elements']['#id'] == 'lastupdated') {
41+
$node = \Drupal::routeMatch()->getParameter('node');
42+
if ($node && !empty($node->getType()) && $node->getType() == 'os2web_page') {
43+
$variables['lastupdated'] = strftime("%d.%m.%Y", $node->getChangedTime());
44+
}
45+
}
46+
2447
}
2548

2649
/**
@@ -31,6 +54,7 @@ function fds_faxe_theme_preprocess_page(array &$variables) {
3154
$variables['theme_settings']['footer']['footer_show_latest_content'] = theme_get_setting('footer_show_latest_content');
3255
$variables['theme_settings']['branding']['branding_toggle'] = theme_get_setting('branding_toggle');
3356
$variables['theme_settings']['branding']['branding_text'] = theme_get_setting('branding_text');
57+
$variables['lastupdated'] = time();
3458
}
3559

3660
/**
@@ -206,6 +230,12 @@ function fds_faxe_theme_preprocess_node(array &$variables) {
206230
$variables['content']['field_os2web_event_end_date'][0]['#text'] = 'til ' . $newEndDate;
207231
}
208232
}
233+
234+
// if ($node->getType() == 'os2web_page') {
235+
$variables['#lastupdated'] = time();
236+
// }
237+
238+
209239
}
210240

211241
/**
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
.block-last-updated {
3+
background-color: $background-normal;
4+
color: rgb(65, 65, 65);
5+
padding: 12px;
6+
text-align: center;
7+
}

web/themes/custom/fds_faxe_theme/src/styles/theme/components/_loader.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@
3333
@import "pace-loading-bar";
3434
@import "field--name-field-os2web-banner-links";
3535
@import "entity-default--os2web-news-block";
36+
@import "last_updated";
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{%
2+
set classes = [
3+
'block',
4+
'block-' ~ configuration.provider|clean_class,
5+
'block-' ~ plugin_id|clean_class,
6+
'block-last-updated'
7+
]
8+
%}
9+
{% if lastupdated %}
10+
<div{{ attributes.addClass(classes) }}>
11+
{{ "Last updated"|trans }}<br>
12+
{{ lastupdated }}
13+
</div>
14+
{% endif %}

web/themes/custom/subsites/fds_fredericia_theme/dist/stylesheets/stylesheet.css

Lines changed: 11 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)