diff --git a/computes/forms.py b/computes/forms.py index 99d0a26d..0adb06b5 100644 --- a/computes/forms.py +++ b/computes/forms.py @@ -33,8 +33,10 @@ class TagsWidget(forms.SelectMultiple): """The tags there are and those given, to choose from or add to (Tom Select).""" def __init__(self): - # Tom Select's line for a new name typed (searchable_select.js) - super().__init__(attrs={"data-tags": "", "data-add": _("Add tag %(tag)s")}) + # Tom Select's line for a new name typed, and for one that cannot be a tag (searchable_select.js) + super().__init__(attrs={"data-tags": "", "data-add": _("Add tag %(tag)s"), "data-rule": _( + "A new tag: letters a-z, digits, dots, dashes and underscores, beginning with a letter or digit; " + "at most 12 characters")}) def optgroups(self, name, value, attrs=None): self.choices = [(n, n) for n in sorted(set(Tag.objects.values_list("name", flat=True)) | set(value))] diff --git a/computes/tests/test_tags.py b/computes/tests/test_tags.py index 3fb94333..950fb6ab 100644 --- a/computes/tests/test_tags.py +++ b/computes/tests/test_tags.py @@ -35,6 +35,9 @@ class TagsFieldTests(TestCase): with translation.override("tr"): html = TagsForm().as_p() self.assertIn('data-add="Etiket ekle: %(tag)s"', html) + # and what a new name may be, shown when the one typed cannot be a tag + self.assertIn('data-rule="Yeni etiket: a-z harfleri, rakamlar, nokta, tire ve alt çizgi, harf ya da rakamla başlar; ' + 'en fazla 12 karakter"', html) def test_the_tags_are_made_when_saved(self): Tag.objects.create(name="prod") diff --git a/instances/tests/js/table_filter.test.js b/instances/tests/js/table_filter.test.js index e0fffabc..16f6326f 100644 --- a/instances/tests/js/table_filter.test.js +++ b/instances/tests/js/table_filter.test.js @@ -150,7 +150,7 @@ function run(elements, stored) { return listeners.click; } const listPage = () => ({ - filter: {value: "", hasAttribute: () => false, addEventListener() {}}, + filter: {value: "", hasAttribute: () => false, addEventListener() {}, focus() { this.focused = true; }}, "state-filter": {value: "", addEventListener() {}}, "state-pills": pillRow(["", "Active", "Off"]), "tag-filter": {value: ""}, @@ -182,6 +182,15 @@ const listPage = () => ({ assert.strictEqual(focused, "plain"); } +// "Clear the filters" hides with the message it is in: the search box takes the focus +{ + const elements = listPage(); + elements["clear-filters"] = {addEventListener: (name, fn) => { elements["clear-filters"].click = fn; }}; + run(elements, {"VMs_filter_tag": "prod"}); + elements["clear-filters"].click(); + assert.deepStrictEqual([elements["tag-filter"].value, elements.filter.focused], ["", true]); +} + // a kept tag no pill has any longer is forgotten: made again later, it is not chosen by itself { const stored = {"VMs_filter_tag": "gone"}; diff --git a/locale/tr/LC_MESSAGES/django.mo b/locale/tr/LC_MESSAGES/django.mo index 71190eba..c76d1ce6 100644 Binary files a/locale/tr/LC_MESSAGES/django.mo and b/locale/tr/LC_MESSAGES/django.mo differ diff --git a/locale/tr/LC_MESSAGES/django.po b/locale/tr/LC_MESSAGES/django.po index 6b96fa9a..3cd953fb 100644 --- a/locale/tr/LC_MESSAGES/django.po +++ b/locale/tr/LC_MESSAGES/django.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-11-19 06:32+0000\n" +"POT-Creation-Date: 2026-11-19 07:03+0000\n" "PO-Revision-Date: 2020-11-04 12:00+0000\n" "Last-Translator: catborise , 2020\n" "Language-Team: Turkish (https://www.transifex.com/catborise/teams/110663/tr/)\n" @@ -1030,7 +1030,7 @@ msgid "Failed" msgstr "Başarısız" #: admin/templates/admin/tag_list.html:5 admin/templates/admin/tag_list.html:7 -#: computes/forms.py:53 instances/templates/instances/settings_tab.html:925 +#: computes/forms.py:55 instances/templates/instances/settings_tab.html:925 #: instances/views.py:244 templates/common/tag_filter.html:5 #: templates/navbar.html:39 msgid "Tags" @@ -2032,7 +2032,15 @@ msgstr "Kayıtlı, korumak için boş bırakın" msgid "Add tag %(tag)s" msgstr "Etiket ekle: %(tag)s" -#: computes/forms.py:97 computes/templates/computes/instances.html:53 +#: computes/forms.py:38 +msgid "" +"A new tag: letters a-z, digits, dots, dashes and underscores, beginning with " +"a letter or digit; at most 12 characters" +msgstr "" +"Yeni etiket: a-z harfleri, rakamlar, nokta, tire ve alt çizgi, harf ya da " +"rakamla başlar; en fazla 12 karakter" + +#: computes/forms.py:99 computes/templates/computes/instances.html:53 #: instances/templates/instances/settings_tab.html:872 #: instances/templates/instances/settings_tab.html:904 #: instances/templates/instances/snapshots_tab.html:27 @@ -2040,43 +2048,43 @@ msgstr "Etiket ekle: %(tag)s" msgid "Description" msgstr "Tanım" -#: computes/forms.py:98 +#: computes/forms.py:100 msgid "Shown on the hosts list" msgstr "Sunucu listesinde gösterilir" -#: computes/forms.py:99 +#: computes/forms.py:101 msgid "SASL login" msgstr "SASL kullanıcı adı" -#: computes/forms.py:99 +#: computes/forms.py:101 msgid "SASL password" msgstr "SASL parolası" -#: computes/forms.py:105 computes/templates/create_comp_block.html:10 +#: computes/forms.py:107 computes/templates/create_comp_block.html:10 msgid "libvirt over TCP, with a SASL login" msgstr "TCP üzerinden libvirt, SASL girişiyle" -#: computes/forms.py:119 computes/templates/create_comp_block.html:14 +#: computes/forms.py:121 computes/templates/create_comp_block.html:14 msgid "libvirt over SSH, with the panel's SSH key" msgstr "SSH üzerinden libvirt, panelin SSH anahtarıyla" -#: computes/forms.py:120 +#: computes/forms.py:122 msgid "FQDN/IP" msgstr "FQDN/IP" -#: computes/forms.py:125 +#: computes/forms.py:127 msgid "SSH user" msgstr "SSH kullanıcısı" -#: computes/forms.py:133 computes/templates/create_comp_block.html:18 +#: computes/forms.py:135 computes/templates/create_comp_block.html:18 msgid "libvirt over TLS, with certificates" msgstr "TLS üzerinden libvirt, sertifikalarla" -#: computes/forms.py:146 computes/templates/create_comp_block.html:21 +#: computes/forms.py:148 computes/templates/create_comp_block.html:21 msgid "Local" msgstr "Yerel" -#: computes/forms.py:147 computes/templates/create_comp_block.html:22 +#: computes/forms.py:149 computes/templates/create_comp_block.html:22 msgid "the libvirt of the host the panel runs on, by its socket" msgstr "panelin çalıştığı sunucunun libvirt'i, soketi üzerinden" diff --git a/locale/zh/LC_MESSAGES/django.mo b/locale/zh/LC_MESSAGES/django.mo index 28d3c378..a96ff30e 100644 Binary files a/locale/zh/LC_MESSAGES/django.mo and b/locale/zh/LC_MESSAGES/django.mo differ diff --git a/locale/zh/LC_MESSAGES/django.po b/locale/zh/LC_MESSAGES/django.po index cb2c9f6f..c76b5e32 100644 --- a/locale/zh/LC_MESSAGES/django.po +++ b/locale/zh/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-11-19 06:32+0000\n" +"POT-Creation-Date: 2026-11-19 07:03+0000\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" @@ -1002,7 +1002,7 @@ msgid "Failed" msgstr "失败" #: admin/templates/admin/tag_list.html:5 admin/templates/admin/tag_list.html:7 -#: computes/forms.py:53 instances/templates/instances/settings_tab.html:925 +#: computes/forms.py:55 instances/templates/instances/settings_tab.html:925 #: instances/views.py:244 templates/common/tag_filter.html:5 #: templates/navbar.html:39 msgid "Tags" @@ -1956,7 +1956,13 @@ msgstr "已保存,留空则保持不变" msgid "Add tag %(tag)s" msgstr "添加标签:%(tag)s" -#: computes/forms.py:97 computes/templates/computes/instances.html:53 +#: computes/forms.py:38 +msgid "" +"A new tag: letters a-z, digits, dots, dashes and underscores, beginning with " +"a letter or digit; at most 12 characters" +msgstr "新标签:字母 a-z、数字、点、短横线和下划线,以字母或数字开头;最多 12 个字符" + +#: computes/forms.py:99 computes/templates/computes/instances.html:53 #: instances/templates/instances/settings_tab.html:872 #: instances/templates/instances/settings_tab.html:904 #: instances/templates/instances/snapshots_tab.html:27 @@ -1964,43 +1970,43 @@ msgstr "添加标签:%(tag)s" msgid "Description" msgstr "描述" -#: computes/forms.py:98 +#: computes/forms.py:100 msgid "Shown on the hosts list" msgstr "显示在主机列表中" -#: computes/forms.py:99 +#: computes/forms.py:101 msgid "SASL login" msgstr "SASL 登录名" -#: computes/forms.py:99 +#: computes/forms.py:101 msgid "SASL password" msgstr "SASL 密码" -#: computes/forms.py:105 computes/templates/create_comp_block.html:10 +#: computes/forms.py:107 computes/templates/create_comp_block.html:10 msgid "libvirt over TCP, with a SASL login" msgstr "通过 TCP 连接 libvirt,使用 SASL 登录" -#: computes/forms.py:119 computes/templates/create_comp_block.html:14 +#: computes/forms.py:121 computes/templates/create_comp_block.html:14 msgid "libvirt over SSH, with the panel's SSH key" msgstr "通过 SSH 连接 libvirt,使用面板的 SSH 密钥" -#: computes/forms.py:120 +#: computes/forms.py:122 msgid "FQDN/IP" msgstr "FQDN/IP" -#: computes/forms.py:125 +#: computes/forms.py:127 msgid "SSH user" msgstr "SSH 用户" -#: computes/forms.py:133 computes/templates/create_comp_block.html:18 +#: computes/forms.py:135 computes/templates/create_comp_block.html:18 msgid "libvirt over TLS, with certificates" msgstr "通过 TLS 连接 libvirt,使用证书" -#: computes/forms.py:146 computes/templates/create_comp_block.html:21 +#: computes/forms.py:148 computes/templates/create_comp_block.html:21 msgid "Local" msgstr "本地" -#: computes/forms.py:147 computes/templates/create_comp_block.html:22 +#: computes/forms.py:149 computes/templates/create_comp_block.html:22 msgid "the libvirt of the host the panel runs on, by its socket" msgstr "面板所在主机的 libvirt,通过其套接字连接" diff --git a/static/js/searchable_select.js b/static/js/searchable_select.js index 960ab495..6b50ef46 100644 --- a/static/js/searchable_select.js +++ b/static/js/searchable_select.js @@ -8,23 +8,32 @@ document.querySelectorAll("select[data-searchable]").forEach(function (select) { }); // A