Skip to content
Snippets Groups Projects
Commit c27f2e30 authored by Serhii Myronets's avatar Serhii Myronets
Browse files

Issue #3392441 by agami4: Improve twig code, remove/improve js library,...

Issue #3392441 by agami4: Improve twig code, remove/improve js library, improve php dependency, add new drupal vesrion
parent 0582384a
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@ base theme: bootstrap
# The supported Drupal version.
core_version_requirement: ^8.8 || ^9
core_version_requirement: ^8.8 || ^9 || ^10
# Libraries-extend is used to attach libraries to other libraries. If the
# original library is conditionally included, the library it is extended with
......@@ -65,33 +65,12 @@ stylesheets-remove:
libraries-override:
# The library name.
core/normalize: false
# Remove jQuery UI styles
core/jquery.ui:
css:
component:
assets/vendor/jquery.ui/themes/base/core.css: false
theme:
assets/vendor/jquery.ui/themes/base/theme.css: false
core/jquery.ui.button:
css:
component:
assets/vendor/jquery.ui/themes/base/button.css: false
core/jquery.ui.dialog:
css:
component:
assets/vendor/jquery.ui/themes/base/dialog.css: false
core/jquery.ui.menu:
css:
component:
assets/vendor/jquery.ui/themes/base/menu.css: false
system/base: false
views/views.module: false
classy/file: false
like_and_dislike/behavior:
js:
js/like_and_dislike_service.js: false
like_and_dislike/icons: false
private_message/inbox_block: false
# Libraries contain CSS and JavaScript files. The libraries setting is used to
# globally add libraries, which means they will appear on every page. Libraries
......
......@@ -9,7 +9,7 @@ base:
dependencies:
- core/drupal
- core/jquery
- core/jquery.once
- core/once
print:
css:
......
......@@ -4,7 +4,7 @@ namespace Drupal\socialbase\Plugin\Preprocess;
use Drupal\bootstrap\Plugin\Preprocess\PreprocessBase;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
use Drupal\Core\Routing\RouteObjectInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
......
......@@ -51,31 +51,35 @@
</svg>
</button>
<ul{{ attributes.addClass('dropdown-menu') }}>
{%- for key, item in links|reverse if key != "comment-reply" -%}
<li{{ item.attributes.addClass(key|clean_class) }}>
{%- if item.link -%}
{{ item.link }}
{%- elseif item.text_attributes -%}
<span{{ item.text_attributes }}>{{ item.text }}</span>
{%- else -%}
{{ item.text }}
{%- endif -%}
</li>
{%- for key, item in links|reverse -%}
{%- if key != "comment-reply" -%}
<li{{ item.attributes.addClass(key|clean_class) }}>
{%- if item.link -%}
{{ item.link }}
{%- elseif item.text_attributes -%}
<span{{ item.text_attributes }}>{{ item.text }}</span>
{%- else -%}
{{ item.text }}
{%- endif -%}
</li>
{%- endif -%}
{%- endfor -%}
</ul>
</div>
{% else %}
{%- for key, item in links if key != "comment-reply" -%}
<li{{ item.attributes.addClass(key|clean_class) }}>
{%- if item.link -%}
{{ item.link }}
{%- elseif item.text_attributes -%}
<span{{ item.text_attributes }}>{{ item.text }}</span>
{%- else -%}
{{ item.text }}
{%- endif -%}
</li>
{%- for key, item in links -%}
{%- if key != "comment-reply" -%}
<li{{ item.attributes.addClass(key|clean_class) }}>
{%- if item.link -%}
{{ item.link }}
{%- elseif item.text_attributes -%}
<span{{ item.text_attributes }}>{{ item.text }}</span>
{%- else -%}
{{ item.text }}
{%- endif -%}
</li>
{%- endif -%}
{%- endfor -%}
{% endif %}
......@@ -85,13 +89,15 @@
{% if links['comment-reply'] %}
<div class="btn comment__reply-btn">
{%- for key, item in links|reverse if key == "comment-reply" -%}
{%- if item.link -%}
{{ item.link }}
{%- elseif item.text_attributes -%}
<span{{ item.text_attributes }}>{{ item.text }}</span>
{%- else -%}
{{ item.text }}
{%- for key, item in links|reverse -%}
{%- if key == "comment-reply" -%}
{%- if item.link -%}
{{ item.link }}
{%- elseif item.text_attributes -%}
<span{{ item.text_attributes }}>{{ item.text }}</span>
{%- else -%}
{{ item.text }}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
</div>
......
......@@ -14,7 +14,7 @@
*/
#}
{{ attach_library('socialbase/file') }}
{% spaceless %}
{% apply spaceless %}
<span{{ attributes }}>
{% if icon_only %}
......@@ -32,4 +32,4 @@
</span>
{% endspaceless %}
{% endapply %}
......@@ -23,7 +23,7 @@
*/
#}
{% block input %}
{% spaceless %}
{% apply spaceless %}
{% if icon_only %}
<button{{ attributes.addClass(classes, 'icon-only') }}>
<span class="sr-only">{{ label }}</span>
......@@ -45,5 +45,5 @@
</span>
{% endif %}
{{ children }}
{% endspaceless %}
{% endapply %}
{% endblock %}
......@@ -66,7 +66,8 @@
depth this forum resides at. This will allow us to use CSS
left-margin for indenting.
#}
{% for i in 1..forum.depth if forum.depth > 0 %}<div class="indent">{% endfor %}
{% for i in 1..forum.depth|filter(forum.depth > 0) %}<div class="indent">{% endfor %}
<div title="{{ forum.icon_title }}">
<span class="visually-hidden">{{ forum.icon_title }}</span>
</div>
......@@ -74,7 +75,8 @@
{% if forum.description.value %}
<div>{{ forum.description.value }}</div>
{% endif %}
{% for i in 1..forum.depth if forum.depth > 0 %}</div>{% endfor %}
{% for i in 1..forum.depth|filter(forum.depth > 0) %}</div>{% endfor %}
</td>
{% if forum.is_container == false %}
<td>
......
{% extends "node--full.html.twig" %}
{% if display_submitted %}
{% block metainfo %}
{% block metainfo %}
{% if display_submitted %}
<header class="metainfo">
<div class="metainfo__avatar">
......@@ -27,8 +28,8 @@
{{ content.links.moderation }}
</header>
{% endblock %}
{% endif %}
{% endif %}
{% endblock %}
{# add specific fields to body for events only #}
{% block nodefull_specialfields %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment