Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/1.x/13 publication cover page #109

Merged
merged 15 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"require": {
"drupal/auto_heading_ids": "^2.0@beta",
"drupal-ckeditor-libraries-group/fakeobjects": "^4.0",
"drupal/footnotes": "^3.0"
"drupal/footnotes": "^3.0",
"localgovdrupal/localgov_core": ">=2.1.10",
"localgovdrupal/localgov_paragraphs": ">=2.3.2"
},
"require-dev": {
"drupal/coder": "*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mode: publication
content:
field_media_document:
type: file_default
label: visually_hidden
label: hidden
settings:
use_description_as_link_text: true
third_party_settings: { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ dependencies:
- field.field.node.localgov_publication_cover_page.localgov_updated_date
- node.type.localgov_publication_cover_page
module:
- datetime
- entity_reference_revisions
- field_group
- text
- user
Expand All @@ -25,7 +23,7 @@ third_party_settings:
label: Documents
parent_name: ''
region: content
weight: 6
weight: 3
format_type: html_element
format_settings:
classes: ''
Expand All @@ -48,20 +46,25 @@ content:
label: hidden
settings: { }
third_party_settings: { }
weight: 1
weight: 6
region: content
content_moderation_control:
settings: { }
third_party_settings: { }
weight: 0
region: content
field_localgov_services_landing:
type: entity_reference_label
label: inline
settings:
link: true
third_party_settings: { }
weight: 4
weight: 2
region: content
links:
settings: { }
third_party_settings: { }
weight: 0
weight: 1
region: content
localgov_documents:
type: entity_reference_entity_view
Expand All @@ -80,23 +83,7 @@ content:
third_party_settings: { }
weight: 4
region: content
localgov_published_date:
type: datetime_default
label: inline
settings:
timezone_override: ''
format_type: long
third_party_settings: { }
weight: 2
region: content
localgov_updated_date:
type: datetime_default
label: inline
settings:
timezone_override: ''
format_type: long
third_party_settings: { }
weight: 3
region: content
hidden:
localgov_publications_banner: true
localgov_published_date: true
localgov_updated_date: true
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
langcode: en
status: true
status: false
dependencies:
config:
- core.entity_view_mode.node.full
- field.field.node.localgov_publication_cover_page.body
- field.field.node.localgov_publication_cover_page.field_localgov_services_landing
- field.field.node.localgov_publication_cover_page.localgov_publications_banner
- field.field.node.localgov_publication_cover_page.localgov_documents
- field.field.node.localgov_publication_cover_page.localgov_publication
- field.field.node.localgov_publication_cover_page.localgov_publications_banner
- field.field.node.localgov_publication_cover_page.localgov_published_date
- field.field.node.localgov_publication_cover_page.localgov_updated_date
- node.type.localgov_publication_cover_page
module:
- datetime
- field_group
- text
- user
Expand All @@ -25,7 +24,7 @@ third_party_settings:
label: Documents
parent_name: ''
region: content
weight: 4
weight: 2
format_type: html_element
format_settings:
classes: ''
Expand All @@ -48,15 +47,20 @@ content:
label: hidden
settings: { }
third_party_settings: { }
weight: 5
weight: 3
region: content
content_moderation_control:
settings: { }
third_party_settings: { }
weight: -20
region: content
field_localgov_services_landing:
type: entity_reference_label
label: inline
settings:
link: true
third_party_settings: { }
weight: 3
weight: 1
region: content
links:
settings: { }
Expand All @@ -67,7 +71,7 @@ content:
type: entity_reference_entity_view
label: hidden
settings:
view_mode: default
view_mode: publication
link: false
third_party_settings: { }
weight: 5
Expand All @@ -80,23 +84,7 @@ content:
third_party_settings: { }
weight: 4
region: content
localgov_published_date:
type: datetime_default
label: inline
settings:
timezone_override: ''
format_type: long
third_party_settings: { }
weight: 1
region: content
localgov_updated_date:
type: datetime_default
label: inline
settings:
timezone_override: ''
format_type: long
third_party_settings: { }
weight: 2
region: content
hidden:
localgov_publications_banner: true
localgov_published_date: true
localgov_updated_date: true
2 changes: 1 addition & 1 deletion config/install/field.storage.node.localgov_publication.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ settings:
target_type: node
module: core
locked: false
cardinality: 1
cardinality: -1
translatable: true
indexes: { }
persist_with_no_fields: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ visibility:
context_mapping:
node: '@node.node_route_context:node'
bundles:
localgov_publication_cover_page: localgov_publication_cover_page
localgov_publication_page: localgov_publication_page
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ status: true
dependencies:
module:
- localgov_publications
- node
theme:
- localgov_base
id: localgov_base_publication_navigation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ visibility:
context_mapping:
node: '@node.node_route_context:node'
bundles:
localgov_publication_cover_page: localgov_publication_cover_page
localgov_publication_page: localgov_publication_page
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ status: true
dependencies:
module:
- localgov_publications
- node
theme:
- localgov_scarfolk
id: localgov_scarfolk_publication_navigation
Expand Down
4 changes: 4 additions & 0 deletions css/localgov-publications-icons.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
margin-bottom: var(--vertical-rhythm-spacing);
}

.publication-document a {
font-size: var(--font-size-large);
}

/* lifted directly from Gov.uk */
.publication-document__thumbnail-image {
display: block;
Expand Down
3 changes: 2 additions & 1 deletion localgov_publications.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ dependencies:
- drupal:views
- footnotes:footnotes
- pathauto:pathauto
- localgov_paragraphs:localgov_paragraphs
- localgov_media:localgov_media
- localgov_paragraphs:localgov_paragraphs (>=2.3.2)
- localgov_services:localgov_services
2 changes: 1 addition & 1 deletion localgov_publications.module
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function localgov_publications_theme_suggestions_book_navigation(array $variable
function localgov_publications_block_access(Block $block, $operation, AccountInterface $account) {
if ($block->getPluginId() == 'localgov_page_header_block' && $operation == 'view') {
$node = \Drupal::routeMatch()->getParameter('node');
if (!empty($node) && $node instanceof NodeInterface && $node->getType() == 'localgov_publication_page') {
if ($node instanceof NodeInterface && localgov_publications_is_publication_type($node->getType())) {
return AccessResult::forbiddenIf(TRUE)->addCacheableDependency($block);
}
}
Expand Down
4 changes: 1 addition & 3 deletions templates/publication-html-reference.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
'field--type-' ~ field_type|clean_class,
'field--label-' ~ label_display,
label_display == 'inline' ? 'clearfix',
'publication-document',
'publication-document--html'
]
%}
{%
Expand All @@ -61,7 +59,7 @@
{% if multiple %}
<div{{ attributes.addClass(classes, 'field__items') }}>
{% for item in items %}
<div{{ attributes.addClass(classes) }}>
<div{{ attributes.addClass(classes, 'publication-document', 'publication-document--html') }}>
{{ title_suffix.contextual_links }}
<svg class="publication-document__thumbnail-image publication-document__thumbnail-image--html" version="1.1" viewBox="0 0 99 140" width="99" height="140" aria-hidden="true">
<path d="M30,95h57v9H30V95z M30,77v9h39v-9H30z M30,122h48v-9H30V122z M12,68h9v-9h-9V68z M12,104h9v-9h-9V104z M12,86h9v-9h-9V86z M12,122h9v-9h-9V122z M87,12v27H12V12H87z M33,17h-4v8h-6v-8h-4v18h4v-7l6,0v7l4,0V17z M49,17H35l0,3h5v15h4V20l5,0V17z M68,17h-4 l-5,6l-5-6h-4v18h4l0-12l5,6l5-6l0,12h4V17z M81,32h-6V17h-4v18h10V32z M30,68h57v-9H30V68z" stroke-width="0"></path>
Expand Down
Loading