Skip to content

Commit bf07060

Browse files
authored
Merge pull request #638 from itk-dev/hotfix/flags-as-buttons
Changed flag a tags to buttons
2 parents 9f3959f + e69af8d commit bf07060

7 files changed

Lines changed: 17 additions & 13 deletions

File tree

.docker/templates/default.conf.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ server {
8989
# Define which paths to protect
9090
location ~ ^/(flag/flag|admin|user/login) {
9191
# Block bots on these paths only
92-
if ($http_user_agent ~* (bot|crawler|spider|scraper)) {
92+
if ($http_user_agent ~* (bot|crawl|crawler|spider|scraper)) {
9393
return 403;
9494
}
9595

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
88

9+
* [PR-638](https://github.com/itk-dev/deltag.aarhus.dk/pull/638)
10+
Changed flags templates to use html button instead of anchor tag.
11+
912
## [4.16.0] - 2026-03-09
1013

1114
* [PR-635](https://github.com/itk-dev/deltag.aarhus.dk/pull/635)

web/themes/custom/hoeringsportal/assets/css/module/_animated-svg.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
a:has(svg) {
1+
button:has(svg) {
22
/* prettier-ignore */
33
--ease-spring-lazy: linear(0, 0.008 1.1%, 0.034 2.3%, 0.134 4.9%, 0.264 7.3%, 0.683 14.3%, 0.797 16.5%, 0.89 18.6%, 0.967 20.7%, 1.027 22.8%, 1.073 25%, 1.104 27.3%, 1.123 30.6%, 1.119 34.3%, 1.018 49.5%, 0.988 58.6%, 0.985 65.2%, 1 84.5%, 1);
44
/* prettier-ignore */
@@ -80,8 +80,8 @@ a:has(svg) {
8080
}
8181
}
8282

83-
/* Click on <a> with thumbs-up svg */
84-
.liked a:has(svg) {
83+
/* Click on <button> with thumbs-up svg */
84+
.liked button:has(svg) {
8585
g.thumbs-up {
8686
path:first-of-type {
8787
animation: rotatePop 500ms var(--ease-spring-lazy);
@@ -93,7 +93,7 @@ a:has(svg) {
9393
}
9494

9595
/* Thumbs-up already set*/
96-
.action-unflag a:has(svg) {
96+
.action-unflag button:has(svg) {
9797
g.thumbs-up {
9898
path:last-child {
9999
fill: var(--interactive-primary);

web/themes/custom/hoeringsportal/assets/css/module/_dialogue.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@
1212
}
1313

1414
.flag-wrapper {
15-
.flag a {
15+
.flag button {
16+
background: none;
17+
border: 0;
1618
color: inherit;
19+
letter-spacing: 0.05em;
1720
text-decoration: none;
21+
text-transform: lowercase;
22+
padding: 0;
1823
}
1924

2025
.ajax-progress-throbber {

web/themes/custom/hoeringsportal/templates/content/flag--support-comment.html.twig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
]
3535
%}
3636

37-
{# Set nofollow to prevent search bots from crawling anonymous flag links #}
38-
{% set attributes = attributes.setAttribute('rel', 'nofollow') %}
3937
<div class="{{ classes|join(' ') }}">
40-
<a{{ attributes.setAttribute('rel', 'nofollow').setAttribute('title', title) }}>{{ include('themes/custom/hoeringsportal/templates/animated-svg/icon-deltag-thumbs-up.svg.html.twig') }}{{ flagcount(flag, flaggable) }} {{ 'like this'|t }}</a>
38+
<button{{ attributes.setAttribute('title', 'Like this'|t) }}>{{ include('themes/custom/hoeringsportal/templates/animated-svg/icon-deltag-thumbs-up.svg.html.twig') }} {{ flagcount(flag, flaggable) }} {{ 'Like this'|t }} </button>
4139
</div>

web/themes/custom/hoeringsportal/templates/content/flag--support-proposal.html.twig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
]
3535
%}
3636

37-
{# Set nofollow to prevent search bots from crawling anonymous flag links #}
38-
{% set attributes = attributes.setAttribute('rel', 'nofollow') %}
3937
<div class="{{ classes|join(' ') }}">
40-
<a{{ attributes.setAttribute('rel', 'nofollow').setAttribute('title', title) }} title="{{ 'Like this'|t }}">{{ include('themes/custom/hoeringsportal/templates/animated-svg/icon-deltag-thumbs-up.svg.html.twig') }}{{ flagcount(flag, flaggable) }} {{ 'like this'|t }}</a>
38+
<button{{ attributes.setAttribute('title', 'Like this'|t) }}>{{ include('themes/custom/hoeringsportal/templates/animated-svg/icon-deltag-thumbs-up.svg.html.twig') }} {{ flagcount(flag, flaggable) }} {{ 'Like this'|t }} </button>
4139
</div>

web/themes/custom/hoeringsportal/templates/content/node--dialogue-proposal--full.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<div class="col">
2222
<div class="d-flex flex-wrap px-0">
2323
<div class="me-3">
24-
<!--<span class="flag-wrapper">{{ content.flag_support_proposal }}</span>-->
24+
<span class="flag-wrapper">{{ content.flag_support_proposal }}</span>
2525
</div>
2626
<div>
2727
<a href="#comments" class="text-secondary">{{ include('themes/custom/hoeringsportal/templates/animated-svg/icon-deltag-comment.svg.html.twig') }}<span>{% trans %}1 comment{% plural node.field_comments.comment_count %}{{ count }} comments{% endtrans %}</span></a>

0 commit comments

Comments
 (0)