Skip to content
Snippets Groups Projects
Unverified Commit 97d33a8b authored by Lauri Timmanee's avatar Lauri Timmanee
Browse files

Issue #3306289 by phenaproxima: Port #3253286 to Drupal 10

(cherry picked from commit 3d9cd504)
parent 5f3cb8cf
Branches
Tags
24 merge requests!8506Draft: Issue #3456536 by ibrahim tameme,!5646Issue #3350972 by nod_: [random test failure]...,!5600Issue #3350972 by nod_: [random test failure]...,!5343Issue #3305066 by quietone, Rename RedirectLeadingSlashesSubscriber,!4350Issue #3307718: Implement xxHash for non-cryptographic use-cases,!3603#ISSUE 3346218 Add a different message on edit comment,!3555Issue #2473873: Views entity operations lack cacheability support, resulting in incorrect dropbuttons,!3494Issue #3327018 by Spokje, longwave, xjm, mondrake: Update PHPStan to 1.9.3 and...,!3410Issue #3340128: UserLoginForm::submitForm has some dead code,!3389Issue #3325184 by Spokje, andypost, xjm, smustgrave: $this->configFactory is...,!3381Issue #3332363: Refactor Claro's menus-and-lists stylesheet,!3307Issue #3326193: CKEditor 5 can grow past the viewport when there is a lot of content,!3236Issue #3332419: Refactor Claro's messages stylesheet,!3231Draft: Issue #3049525 by longwave, fougere, larowlan, kim.pepper, AaronBauman, Wim...,!3212Issue #3294003: Refactor Claro's entity-meta stylesheet,!3194Issue #3330981: Fix PHPStan L1 error "Relying on entity queries to check access by default is deprecated...",!3143Issue #3313342: [PHP 8.1] Deprecated function: strpos(): Passing null to parameter #1 LayoutBuilderUiCacheContext.php on line 28,!3024Issue #3307509: Empty option for views bulk form,!2972Issue #1845004: Replace custom password hashing library with PHP 5.5 password_hash(),!2719Issue #3110137: Remove Classy from core.,!2688Issue #3261452: [PP-1] Remove tracker module from core,!2437Issue #3238257 by hooroomoo, Wim Leers: Fragment link pointing to <textarea>...,!2296Issue #3100732: Allow specifying `meta` data on JSON:API objects,!1626Issue #3256642: Make life better for database drivers that extend another database driver
Showing
with 0 additions and 625 deletions
/**
* @file
* Styling for the Book module.
*/
.book-navigation .menu {
padding-top: 1em;
padding-bottom: 0;
}
.book-navigation .book-pager {
overflow: auto;
margin: 0;
padding: 0.5em 0;
}
.book-pager__item {
display: inline-block;
list-style-type: none;
vertical-align: top;
}
.book-pager__item--previous {
width: 45%;
text-align: left; /* LTR */
}
[dir="rtl"] .book-pager__item--previous {
float: right;
text-align: right;
}
.book-pager__item--center {
width: 8%;
text-align: center;
}
.book-pager__item--next {
float: right; /* LTR */
width: 45%;
text-align: right; /* LTR */
}
[dir="rtl"] .book-pager__item--next {
float: left;
text-align: left;
}
/**
* @file
* Styling for the Forum module.
*/
.forum__description {
margin: 0.5em;
font-size: 0.9em;
}
.forum__icon {
float: left; /* LTR */
width: 24px;
height: 24px;
margin: 0 9px 0 0; /* LTR */
background-image: url(../../images/icons/forum-icons.png);
background-repeat: no-repeat;
}
[dir="rtl"] .forum__icon {
float: right;
margin: 0 0 0 9px;
}
.forum__title {
overflow: hidden;
}
.forum .indented {
margin-left: 20px; /* LTR */
}
[dir="rtl"] .forum .indented {
margin-right: 20px;
margin-left: 0;
}
.forum__topic-status--new {
background-position: -24px 0;
}
.forum__topic-status--hot {
background-position: -48px 0;
}
.forum__topic-status--hot-new {
background-position: -72px 0;
}
.forum__topic-status--sticky {
background-position: -96px 0;
}
.forum__topic-status--closed {
background-position: -120px 0;
}
/**
* @file
* Media Embed filter: default styling for media embed errors.
*/
/**
* The caption filter's styling overrides ours, so add a more specific selector
* to account for that.
*/
.media-embed-error,
.caption > .media-embed-error {
max-width: 200px;
padding: 100px 20px 20px;
text-align: center;
background-color: #ebebeb;
background-image: url(../../images/icons/no-thumbnail.png);
background-repeat: no-repeat;
background-position: center top;
background-size: 100px 100px;
}
/**
* @file
* Contains minimal layout styling for the media library.
*/
.media-library-wrapper {
display: flex;
}
.media-library-menu {
flex-basis: 20%;
flex-shrink: 0;
}
.media-library-content {
flex-grow: 1;
}
.media-library-views-form {
display: flex;
flex-wrap: wrap;
}
.media-library-views-form .media-library-item {
justify-content: space-between;
max-width: 23%;
margin: 1%;
}
core/themes/starterkit_theme/images/icons/forum-icons.png

1.72 KiB

core/themes/starterkit_theme/images/icons/no-thumbnail.png

7.15 KiB

......@@ -19,11 +19,3 @@ libraries-extend:
- starterkit_theme/file
core/drupal.progress:
- starterkit_theme/progress
media/media_embed_ckeditor_theme:
- starterkit_theme/media_embed_ckeditor_theme
media_library/view:
- starterkit_theme/media_library
media_library/widget:
- starterkit_theme/media_library
ckeditor_stylesheets:
- css/components/media-embed-error.css
......@@ -48,11 +48,6 @@ base:
weight: -10
css/components/ui-dialog.css:
weight: -10
book-navigation:
version: VERSION
css:
component:
css/components/book-navigation.css: { }
dialog:
version: VERSION
css:
......@@ -71,12 +66,6 @@ file:
component:
css/components/file.css:
weight: -10
forum:
version: VERSION
css:
component:
css/components/forum.css:
weight: -10
image-widget:
version: VERSION
css:
......@@ -87,11 +76,6 @@ indented:
css:
component:
css/components/indented.css: { }
media_library:
version: VERSION
css:
layout:
css/layout/media-library.css: { }
messages:
version: VERSION
css:
......@@ -121,12 +105,3 @@ user:
component:
css/components/user.css:
weight: -10
media_embed_error:
version: VERSION
css:
component:
css/components/media-embed-error.css: { }
media_embed_ckeditor_theme:
version: VERSION
js:
js/media_embed_ckeditor.theme.js: { }
......@@ -5,34 +5,6 @@
* Functions to support theming.
*/
use Drupal\Core\Form\FormStateInterface;
use Drupal\views\Form\ViewsForm;
/**
* Implements hook_preprocess_links__media_library_menu().
*
* This targets the menu of available media types in the media library's modal
* dialog.
*
* @todo Do this in the relevant template once
* https://www.drupal.org/project/drupal/issues/3088856 is resolved.
*/
function starterkit_theme_preprocess_links__media_library_menu(array &$variables) {
foreach ($variables['links'] as &$link) {
$link['link']['#options']['attributes']['class'][] = 'media-library-menu__link';
}
}
/**
* Implements hook_form_alter().
*/
function starterkit_theme_form_alter(array &$form, FormStateInterface $form_state, $form_id) {
$form_object = $form_state->getFormObject();
if ($form_object instanceof ViewsForm && strpos($form_object->getBaseFormId(), 'views_form_media_library') === 0) {
$form['#attributes']['class'][] = 'media-library-views-form';
}
}
/**
* Implements hook_preprocess_image_widget().
*/
......
{#
/**
* @file
* Theme override for a single node in a printer-friendly outline.
*
* Available variables:
* - node: Fully loaded node.
* - depth: Depth of the current node inside the outline.
* - title: Node title.
* - content: Node content.
* - children: All the child nodes recursively rendered through this file.
*
* @see template_preprocess_book_node_export_html()
*/
#}
<article id="node-{{ node.id }}" class="section-{{ depth }}">
<h1 class="book-heading">{{ title }}</h1>
{{ content }}
{{ children }}
</article>
{#
/**
* @file
* Theme override for a missing media error.
*
* Available variables
* - message: The message text.
* - attributes: HTML attributes for the containing element.
*
* When a response from the back end can't be returned, a related error message
* is displayed from JavaScript.
*
* @see Drupal.theme.mediaEmbedPreviewError
*
* @ingroup themeable
*/
#}
{{ attach_library('starterkit_theme/media_embed_error') }}
<div{{ attributes.addClass('media-embed-error', 'media-embed-error--missing-source') }}>
{{ message }}
</div>
{#
/**
* @file
* Theme override to display a status icon for a forum post.
*
* Available variables:
* - attributes: HTML attributes to be applied to the wrapper element.
* - class: HTML classes that determine which icon to display. May be one of
* 'hot', 'hot-new', 'new', 'default', 'closed', or 'sticky'.
* - title: Text alternative for the forum icon.
* - icon_title: Text alternative for the forum icon, same as above.
* - new_posts: '1' when this topic contains new posts, otherwise '0'.
* - first_new: '1' when this is the first topic with new posts, otherwise '0'.
* - icon_status: Indicates which status icon should be used.
*
* @see template_preprocess_forum_icon()
*/
#}
{%
set classes = [
'forum__icon',
'forum__topic-status--' ~ icon_status,
]
%}
<div{{ attributes.addClass(classes) }}>
{% if first_new -%}
<a id="new"></a>
{%- endif %}
<span class="visually-hidden">{{ icon_title }}</span>
</div>
{#
/**
* @file
* Theme override to display a list of forums and containers.
*
* Available variables:
* - forums: A collection of forums and containers to display. It is keyed to
* the numeric IDs of all child forums and containers. Each forum in forums
* contains:
* - is_container: A flag indicating if the forum can contain other
* forums. Otherwise, the forum can only contain topics.
* - depth: How deep the forum is in the current hierarchy.
* - zebra: 'even' or 'odd', used for row class.
* - icon_class: 'default' or 'new', used for forum icon class.
* - icon_title: Text alternative for the forum icon.
* - name: The name of the forum.
* - link: The URL to link to this forum.
* - description: The description field for the forum, containing:
* - value: The descriptive text for the forum.
* - new_topics: A flag indicating if the forum contains unread posts.
* - new_url: A URL to the forum's unread posts.
* - new_text: Text for the above URL, which tells how many new posts.
* - old_topics: A count of posts that have already been read.
* - num_posts: The total number of posts in the forum.
* - last_reply: Text representing the last time a forum was posted or
* commented in.
* - forum_id: Forum ID for the current forum. Parent to all items within the
* forums array.
*
* @see template_preprocess_forum_list()
*/
#}
<table id="forum-{{ forum_id }}">
<thead>
<tr>
<th>{{ 'Forum'|t }}</th>
<th>{{ 'Topics'|t }}</th>
<th>{{ 'Posts'|t }}</th>
<th>{{ 'Last post'|t }}</th>
</tr>
</thead>
<tbody>
{% for child_id, forum in forums %}
<tr id="forum-list-{{ child_id }}" class="{{ forum.zebra }}">
<td {% if forum.is_container == true -%}
colspan="4" class="container"
{%- else -%}
class="forum-list__forum"
{%- endif -%}>
{#
Enclose the contents of this cell with X divs, where X is the
depth this forum resides at. This will allow us to use CSS
left-margin for indenting.
#}
{% if forum.depth > 0 %}{% for i in 1..forum.depth %}<div class="indented">{% endfor %}{% endif %}
<div class="forum__icon forum-status-{{ forum.icon_class }}" title="{{ forum.icon_title }}">
<span class="visually-hidden">{{ forum.icon_title }}</span>
</div>
<div class="forum__name"><a href="{{ forum.link }}">{{ forum.label }}</a></div>
{% if forum.description.value %}
<div class="forum__description">{{ forum.description.value }}</div>
{% endif %}
{% if forum.depth > 0 %}{% for i in 1..forum.depth %}</div>{% endfor %}{% endif %}
</td>
{% if forum.is_container == false %}
<td class="forum__topics">
{{ forum.num_topics }}
{% if forum.new_topics == true %}
<br />
<a href="{{ forum.new_url }}">{{ forum.new_text }}</a>
{% endif %}
</td>
<td class="forum__posts">{{ forum.num_posts }}</td>
<td class="forum__last-reply">{{ forum.last_reply }}</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
{#
/**
* @file
* Theme override to display a forum.
*
* May contain forum containers as well as forum topics.
*
* Available variables:
* - forums: The forums to display (as processed by forum-list.html.twig).
* - topics: The topics to display.
* - topics_pager: The topics pager.
* - forums_defined: A flag to indicate that the forums are configured.
*
* @see template_preprocess_forums()
*/
#}
{{ attach_library('starterkit_theme/forum') }}
{% if forums_defined %}
<div class="forum">
{{ forums }}
{{ topics }}
{{ topics_pager }}
</div>
{% endif %}
{#
/**
* @file
* Theme override for printed version of book outline.
*
* Available variables:
* - title: Top level node title.
* - head: Header tags.
* - language: Language object.
* - language_rtl: A flag indicating whether the current display language is a
* right to left language.
* - base_url: URL to the home page.
* - contents: Nodes within the current outline rendered through
* book-node-export-html.html.twig.
*
* @see template_preprocess_book_export_html()
*/
#}
<!DOCTYPE html>
<html{{ html_attributes }}>
<head>
<title>{{ title }}</title>
{{ page.head }}
<base href="{{ base_url }}" />
<link type="text/css" rel="stylesheet" href="misc/print.css" />
</head>
<body>
{#
The given node is embedded to its absolute depth in a top level section.
For example, a child node with depth 2 in the hierarchy is contained in
(otherwise empty) div elements corresponding to depth 0 and depth 1. This
is intended to support WYSIWYG output - e.g., level 3 sections always look
like level 3 sections, no matter their depth relative to the node selected
to be exported as printer-friendly HTML.
#}
{% if depth > 1 %}{% for i in 1..depth-1 %}
<div class="section-{{ i }}">
{% endfor %}{% endif %}
{{ contents }}
{% if depth > 1 %}{% for i in 1..depth-1 %}
</div>
{% endfor %}{% endif %}
</body>
</html>
{#
/**
* @file
* Theme implementation the content area of the modal media library dialog.
*
* The content area is everything that is not the menu of available media
* types. This includes the form to add new media items, if available, and
* the view of available media to select.
*
* Available variables:
* - attributes: HTML attributes for the containing element.
* - children: The rendered child elements of the container.
* - has_parent: A flag to indicate that the container has one or more parent
containers.
*
* @see template_preprocess_container()
*
* @ingroup themeable
*/
#}
{%
set classes = [
has_parent ? 'js-form-wrapper',
has_parent ? 'form-wrapper',
'media-library-content',
]
%}
<div{{ attributes.addClass(classes) }}>{{ children }}</div>
{#
/**
* @file
* Theme implementation of a wrapper for selected media items.
*
* This is used to wrap around the set of media items that are currently
* selected in the media library widget (not the modal dialog), which may
* be used for entity reference fields that target media.
*
* Available variables:
* - attributes: HTML attributes for the containing element.
* - children: The rendered child elements of the container.
* - has_parent: A flag to indicate that the container has one or more parent
containers.
*
* @see template_preprocess_container()
*
* @ingroup themeable
*/
#}
{%
set classes = [
has_parent ? 'js-form-wrapper',
has_parent ? 'form-wrapper',
'media-library-selection',
]
%}
<div{{ attributes.addClass(classes) }}>{{ children }}</div>
{% extends "links.html.twig" %}
{#
/**
* @file
* Theme implementation of the media type menu in the media library dialog.
*
* Available variables:
* - attributes: Attributes for the UL containing the list of links.
* - links: Links to be output.
* Each link will have the following elements:
* - link: (optional) A render array that returns a link. See
* template_preprocess_links() for details how it is generated.
* - text: The link text.
* - attributes: HTML attributes for the list item element.
* - text_attributes: (optional) HTML attributes for the span element if no
* 'url' was supplied.
* - heading: (optional) A heading to precede the links.
* - text: The heading text.
* - level: The heading level (e.g. 'h2', 'h3').
* - attributes: (optional) A keyed list of attributes for the heading.
* If the heading is a string, it will be used as the text of the heading and
* the level will default to 'h2'.
*
* Headings should be used on navigation menus and any list of links that
* consistently appears on multiple pages. To make the heading invisible use
* the 'visually-hidden' CSS class. Do not use 'display:none', which
* removes it from screen readers and assistive technology. Headings allow
* screen reader and keyboard only users to navigate to or skip the links.
* See http://juicystudio.com/article/screen-readers-display-none.php and
* http://www.w3.org/TR/WCAG-TECHS/H42.html for more information.
*
* @see template_preprocess_links()
*/
#}
{% set attributes = attributes.addClass('media-library-menu') %}
{#
/**
* @file
* Theme override of a media item in the media library.
*
* This is used for media that the user can select from the grid of media
* items. It is not used for items that have already been selected in the
* corresponding field widget, or for items that have been previously selected
* before adding new media to the library.
*
* Available variables:
* - media: The entity with limited access to object properties and methods.
* Only method names starting with "get", "has", or "is" and a few common
* methods such as "id", "label", and "bundle" are available. For example:
* - entity.getEntityTypeId() will return the entity type ID.
* - entity.hasField('field_example') returns TRUE if the entity includes
* field_example. (This does not indicate the presence of a value in this
* field.)
* Calling other methods, such as entity.delete(), will result in an exception.
* See \Drupal\Core\Entity\EntityInterface for a full list of methods.
* - name: Name of the media.
* - content: Media content.
* - title_prefix: Additional output populated by modules, intended to be
* displayed in front of the main title tag that appears in the template.
* - title_suffix: Additional output populated by modules, intended to be
* displayed after the main title tag that appears in the template.
* - view_mode: View mode; for example, "teaser" or "full".
* - attributes: HTML attributes for the containing element.
* - title_attributes: Same as attributes, except applied to the main title
* tag that appears in the template.
* - url: Direct URL of the media.
* - preview_attributes: HTML attributes for the preview wrapper.
* - metadata_attributes: HTML attributes for the expandable metadata area.
* - status: Whether or not the Media is published.
*
* @see template_preprocess_media()
*
* @ingroup themeable
*/
#}
<article{{ attributes }}>
{% if content %}
<div{{ preview_attributes.addClass('media-library-item__preview js-media-library-item-preview') }}>
{{ content|without('name') }}
</div>
{% if not status %}
<div class="media-library-item__status">{{ "unpublished" | t }}</div>
{% endif %}
<div{{ metadata_attributes.addClass('media-library-item__attributes') }}>
<div class="media-library-item__name">
{{ name }}
</div>
</div>
{% endif %}
</article>
{#
/**
* @file
* Default theme implementation of a media library item.
*
* This is used when displaying selected media items, either in the field
* widget or in the "Additional selected media" area when adding new
* media items in the media library modal dialog.
*
* Available variables:
* - attributes: HTML attributes for the containing element.
* - content: The content of the media library item, plus any additional
* fields or elements surrounding it.
*
* @see template_preprocess_media_library_item()
*
* @ingroup themeable
*/
#}
{%
set classes = [
'media-library-item',
'media-library-item--grid',
'media-library-item--small',
]
%}
<div{{ attributes.addClass(classes) }}>
{{ content }}
</div>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment