Skip to content

Commit 3c5fbaf

Browse files
committed
Improve the backend widget
1 parent 70ce232 commit 3c5fbaf

11 files changed

Lines changed: 37 additions & 19 deletions

File tree

assets/tags-widget.scss

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,25 @@ $select-padding-y: 5px;
2020
margin-bottom: 3px;
2121

2222
&__all {
23-
display: flex;
24-
flex-wrap: wrap;
25-
gap: 3px;
26-
margin-bottom: 3px;
23+
margin-top: 3px;
24+
25+
&-headline {
26+
margin-bottom: 5px;
27+
margin-top: 5px;
28+
font-size: .75rem;
29+
}
30+
31+
&-items {
32+
display: flex;
33+
flex-wrap: wrap;
34+
gap: 3px;
35+
}
2736
}
2837

2938
&__tag {
3039
display: block;
3140
padding: 5px 10px 5px 25px;
32-
background: var(--form-button) url('./add.svg') no-repeat 6px center;
41+
background: transparent url('./add.svg') no-repeat 6px center;
3342
border: 1px solid var(--form-border);
3443
border-radius: var(--border-radius);
3544
box-sizing: border-box;

contao/languages/de/default.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
declare(strict_types=1);
44

5-
$GLOBALS['TL_LANG']['MSC']['cfg_tags.add'] = 'Hinzufügen';
5+
$GLOBALS['TL_LANG']['MSC']['cfg_tags_add'] = 'Hinzufügen';
6+
$GLOBALS['TL_LANG']['MSC']['cfg_tags_search'] = 'Zum Suchen eingeben …';
7+
$GLOBALS['TL_LANG']['MSC']['cfg_tags_suggestions'] = 'Vorschläge:';

contao/languages/en/default.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
declare(strict_types=1);
44

5-
$GLOBALS['TL_LANG']['MSC']['cfg_tags.add'] = 'Add';
5+
$GLOBALS['TL_LANG']['MSC']['cfg_tags_add'] = 'Add';
6+
$GLOBALS['TL_LANG']['MSC']['cfg_tags_search'] = 'Type to search …';
7+
$GLOBALS['TL_LANG']['MSC']['cfg_tags_suggestions'] = 'Suggestions:';
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
{% trans_default_domain 'contao_default' %}
2+
13
{% set widget_attributes = attrs()
24
.addClass(['cfg-tags-widget', css_class])
35
.set('data-controller', 'codefog--tags-widget')
@@ -7,15 +9,18 @@
79
{% block widget %}
810
<div{{ widget_attributes }}>
911
{% block widget_inner %}
12+
<input type="text" name="{{ name }}" id="ctrl_{{ id }}" placeholder="{{ 'MSC.cfg_tags_search'|trans }}" data-codefog--tags-widget-target="input">
13+
1014
{% if all_tags and not hide_list %}
1115
<div class="cfg-tags-widget__all">
12-
{% for tag in all_tags %}
13-
<button type="button" value="{{ tag.value }}" class="cfg-tags-widget__tag" data-action="click->codefog--tags-widget#add:prevent">{{ tag.text }}</button>
14-
{% endfor %}
16+
<div class="cfg-tags-widget__all-headline">{{ 'MSC.cfg_tags_suggestions'|trans }}</div>
17+
<div class="cfg-tags-widget__all-items">
18+
{% for tag in all_tags %}
19+
<button type="button" value="{{ tag.value }}" class="cfg-tags-widget__tag" title="{{ 'MSC.cfg_tags_add'|trans }}" data-action="click->codefog--tags-widget#add:prevent">{{ tag.text }}</button>
20+
{% endfor %}
21+
</div>
1522
</div>
1623
{% endif %}
17-
18-
<input type="text" name="{{ name }}" id="ctrl_{{ id }}" data-codefog--tags-widget-target="input">
1924
{% endblock %}
2025
</div>
2126
{% endblock %}

docs/images/preview.png

40.2 KB
Loading

public/entrypoints.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"entrypoints": {
33
"tags-widget": {
44
"css": [
5-
"/bundles/codefogtags/tags-widget.c2ea0e46.css"
5+
"/bundles/codefogtags/tags-widget.f1a58ca1.css"
66
],
77
"js": [
88
"/bundles/codefogtags/tags-widget.92015867.js"

public/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"tags-widget.css": "/bundles/codefogtags/tags-widget.c2ea0e46.css",
2+
"tags-widget.css": "/bundles/codefogtags/tags-widget.f1a58ca1.css",
33
"tags-widget.js": "/bundles/codefogtags/tags-widget.92015867.js",
44
"images/add--dark.svg": "/bundles/codefogtags/images/add--dark.642bad3d.svg",
55
"images/add.svg": "/bundles/codefogtags/images/add.a31d1889.svg",
6-
"tags-widget.c2ea0e46.css.map": "/bundles/codefogtags/tags-widget.c2ea0e46.css.map",
6+
"tags-widget.f1a58ca1.css.map": "/bundles/codefogtags/tags-widget.f1a58ca1.css.map",
77
"tags-widget.92015867.js.map": "/bundles/codefogtags/tags-widget.92015867.js.map"
88
}

public/tags-widget.c2ea0e46.css.map

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/tags-widget.f1a58ca1.css.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)