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

SUPP0RT-775: Unpublished documents #332

Merged
merged 3 commits into from
Dec 6, 2022
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
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@
},
"drupal/devel": {
"Public methods are not visible in kint (https://www.drupal.org/project/devel/issues/3112201)": "https://www.drupal.org/files/issues/2022-04-26/devel_3112201_4.patch"
},
"drupal/view_unpublished": {
"Grants are not cached if the user has \"view any unpublished content\" permission (https://www.drupal.org/project/view_unpublished/issues/3226756)": "https://www.drupal.org/files/issues/2021-08-04/view_unpublished-cache_ignored-3226756-2-8.x.patch"
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -85,33 +85,41 @@
{% set document = item.document %}
{% set short_type = document.getType|split('_')|last %}
{% set is_active_document = current_node_id is same as(document.id) %}
<div class="container list-group-item list-group-item-action d-inline-flex align-items-top">
{# icon #}
<div class="list-display-icon">
{{ source("#{active_theme_path()}/assets/svg/#{short_type}.svg", ignore_missing=true) }}
</div>
<div class="container px-0 list-display-information">
<div class="row no-gutters">
<div class="col list-display-text d-inline-flex mx-30">
{# text #}
<div class="h5 m-0">
<a href="{{ path('entity.node.canonical', {node: document.id, collection: collection.id}) }}" class="link-unstyled">
{{ document.title.value }}
</a>
<span class="badge badge-primary badge-{{ short_type }} align-top ml-20">{{ document.type.entity.label }}</span>
{% if is_active_document %}
<span class="badge badge-primary align-top ml-20">{{ 'Open document'|t }}</span>
{% endif %}
{% if is_granted('view', document) %}
<div class="container list-group-item list-group-item-action d-inline-flex align-items-top">
{# icon #}
<div class="list-display-icon">
{{ source("#{active_theme_path()}/assets/svg/#{short_type}.svg", ignore_missing=true) }}
</div>
<div class="container px-0 list-display-information">
<div class="row no-gutters">
<div class="col list-display-text d-inline-flex mx-30">
{# text #}
<div class="h5 m-0">
{% if not document.published and is_granted('update', document) %}
<div class="alert alert-danger">
{{ 'Document not published'|t }}
(<a href="{{ path('entity.node.edit_form', {node: document.id}) }}" class="alert-link">{{ 'Edit document'|t }}</a>)
</div>
{% endif %}
<a href="{{ path('entity.node.canonical', {node: document.id, collection: collection.id}) }}" class="link-unstyled">
{{ document.title.value }}
</a>
<span class="badge badge-primary badge-{{ short_type }} align-top ml-20">{{ document.type.entity.label }}</span>
{% if is_active_document %}
<span class="badge badge-primary align-top ml-20">{{ 'Open document'|t }}</span>
{% endif %}
</div>
</div>
<div class="col-auto ml-auto list-display-date text-sm">
{# date #}
{{ document.createdtime|date('d-m-Y') }}
</div>
</div>
<div class="col-auto ml-auto list-display-date text-sm">
{# date #}
{{ document.createdtime|date('d-m-Y') }}
</div>
</div>
</div>
</div>
{{ item.children ? _self.table_of_contents(item.children, collection, current_node_id) }}
{{ item.children ? _self.table_of_contents(item.children, collection, current_node_id) }}
{% endif %}
{% endfor %}
</div>
{% endif %}
Expand Down