aa-mumble-quick-connect 0.0.3__py3-none-any.whl → 0.0.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aa_mumble_quick_connect/__init__.py +1 -1
- aa_mumble_quick_connect/admin.py +1 -1
- aa_mumble_quick_connect/locale/cs_CZ/LC_MESSAGES/django.mo +0 -0
- aa_mumble_quick_connect/locale/cs_CZ/LC_MESSAGES/django.po +38 -19
- aa_mumble_quick_connect/locale/de/LC_MESSAGES/django.mo +0 -0
- aa_mumble_quick_connect/locale/de/LC_MESSAGES/django.po +32 -12
- aa_mumble_quick_connect/locale/django.pot +38 -12
- aa_mumble_quick_connect/locale/es/LC_MESSAGES/django.mo +0 -0
- aa_mumble_quick_connect/locale/es/LC_MESSAGES/django.po +38 -19
- aa_mumble_quick_connect/locale/fr_FR/LC_MESSAGES/django.mo +0 -0
- aa_mumble_quick_connect/locale/fr_FR/LC_MESSAGES/django.po +38 -19
- aa_mumble_quick_connect/locale/it_IT/LC_MESSAGES/django.mo +0 -0
- aa_mumble_quick_connect/locale/it_IT/LC_MESSAGES/django.po +38 -19
- aa_mumble_quick_connect/locale/ja/LC_MESSAGES/django.mo +0 -0
- aa_mumble_quick_connect/locale/ja/LC_MESSAGES/django.po +38 -19
- aa_mumble_quick_connect/locale/ko_KR/LC_MESSAGES/django.mo +0 -0
- aa_mumble_quick_connect/locale/ko_KR/LC_MESSAGES/django.po +38 -19
- aa_mumble_quick_connect/locale/nl_NL/LC_MESSAGES/django.po +31 -11
- aa_mumble_quick_connect/locale/pl_PL/LC_MESSAGES/django.mo +0 -0
- aa_mumble_quick_connect/locale/pl_PL/LC_MESSAGES/django.po +37 -18
- aa_mumble_quick_connect/locale/ru/LC_MESSAGES/django.mo +0 -0
- aa_mumble_quick_connect/locale/ru/LC_MESSAGES/django.po +38 -19
- aa_mumble_quick_connect/locale/sk/LC_MESSAGES/django.po +31 -11
- aa_mumble_quick_connect/locale/uk/LC_MESSAGES/django.mo +0 -0
- aa_mumble_quick_connect/locale/uk/LC_MESSAGES/django.po +37 -18
- aa_mumble_quick_connect/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
- aa_mumble_quick_connect/locale/zh_Hans/LC_MESSAGES/django.po +38 -19
- aa_mumble_quick_connect/migrations/0002_mumblelink_disable_url_verification.py +28 -0
- aa_mumble_quick_connect/models.py +66 -12
- aa_mumble_quick_connect/templates/aa_mumble_quick_connect/base.html +6 -1
- aa_mumble_quick_connect/templates/aa_mumble_quick_connect/index.html +3 -6
- aa_mumble_quick_connect/templates/aa_mumble_quick_connect/partials/channels-in-sections.html +3 -3
- aa_mumble_quick_connect/templates/aa_mumble_quick_connect/partials/channels-without-sections.html +3 -3
- aa_mumble_quick_connect/templates/aa_mumble_quick_connect/partials/footer/app-translation-footer.html +11 -0
- aa_mumble_quick_connect/tests/test_models.py +115 -3
- aa_mumble_quick_connect/urls.py +1 -0
- aa_mumble_quick_connect/views.py +9 -3
- {aa_mumble_quick_connect-0.0.3.dist-info → aa_mumble_quick_connect-0.0.5.dist-info}/METADATA +2 -2
- aa_mumble_quick_connect-0.0.5.dist-info/RECORD +55 -0
- aa_mumble_quick_connect-0.0.3.dist-info/RECORD +0 -43
- {aa_mumble_quick_connect-0.0.3.dist-info → aa_mumble_quick_connect-0.0.5.dist-info}/WHEEL +0 -0
- {aa_mumble_quick_connect-0.0.3.dist-info → aa_mumble_quick_connect-0.0.5.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
# SOME DESCRIPTIVE TITLE.
|
|
2
2
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
|
3
3
|
# This file is distributed under the same license as the PACKAGE package.
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#, fuzzy
|
|
4
|
+
# Peter Pfeufer <info@ppfeufer.de>, 2025.
|
|
7
5
|
msgid ""
|
|
8
6
|
msgstr ""
|
|
9
7
|
"Project-Id-Version: AA Mumble Quick Connect 0.0.1\n"
|
|
10
8
|
"Report-Msgid-Bugs-To: https://github.com/ppfeufer/aa-mumble-quick-connect/issues\n"
|
|
11
|
-
"POT-Creation-Date: 2025-02-
|
|
12
|
-
"PO-Revision-Date:
|
|
13
|
-
"Last-Translator:
|
|
14
|
-
"Language-Team:
|
|
15
|
-
"Language: \n"
|
|
9
|
+
"POT-Creation-Date: 2025-02-14 09:35+0100\n"
|
|
10
|
+
"PO-Revision-Date: 2025-02-13 22:08+0000\n"
|
|
11
|
+
"Last-Translator: Peter Pfeufer <info@ppfeufer.de>\n"
|
|
12
|
+
"Language-Team: Ukrainian <https://weblate.ppfeufer.de/projects/alliance-auth-apps/aa-mumble-quick-connect/uk/>\n"
|
|
13
|
+
"Language: uk\n"
|
|
16
14
|
"MIME-Version: 1.0\n"
|
|
17
15
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
18
16
|
"Content-Transfer-Encoding: 8bit\n"
|
|
19
17
|
"Plural-Forms: nplurals=4; plural=n==1 ? 3 : (n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
|
18
|
+
"X-Generator: Weblate 5.9.2\n"
|
|
20
19
|
|
|
21
20
|
#: aa_mumble_quick_connect/auth_hooks.py:26
|
|
22
21
|
#: aa_mumble_quick_connect/templates/aa_mumble_quick_connect/base.html:6
|
|
@@ -25,43 +24,55 @@ msgid "Mumble Quick Connect"
|
|
|
25
24
|
msgstr ""
|
|
26
25
|
|
|
27
26
|
#: aa_mumble_quick_connect/models.py:26
|
|
27
|
+
msgid "The Mumble channel URL must start with \"mumble://\""
|
|
28
|
+
msgstr ""
|
|
29
|
+
|
|
30
|
+
#: aa_mumble_quick_connect/models.py:36
|
|
28
31
|
#, python-brace-format
|
|
29
|
-
msgid "The Mumble channel URL must start with
|
|
32
|
+
msgid "The Mumble channel URL must start with \"{mumble_base_url}\""
|
|
30
33
|
msgstr ""
|
|
31
34
|
|
|
32
|
-
#: aa_mumble_quick_connect/models.py:
|
|
35
|
+
#: aa_mumble_quick_connect/models.py:56
|
|
33
36
|
msgid "Can access this app"
|
|
34
37
|
msgstr ""
|
|
35
38
|
|
|
36
|
-
#: aa_mumble_quick_connect/models.py:
|
|
39
|
+
#: aa_mumble_quick_connect/models.py:65
|
|
37
40
|
msgid "Name of the section"
|
|
38
41
|
msgstr ""
|
|
39
42
|
|
|
40
|
-
#: aa_mumble_quick_connect/models.py:
|
|
43
|
+
#: aa_mumble_quick_connect/models.py:74 aa_mumble_quick_connect/models.py:97
|
|
41
44
|
msgid "Section"
|
|
42
45
|
msgstr ""
|
|
43
46
|
|
|
44
|
-
#: aa_mumble_quick_connect/models.py:
|
|
47
|
+
#: aa_mumble_quick_connect/models.py:75
|
|
45
48
|
msgid "Sections"
|
|
46
49
|
msgstr ""
|
|
47
50
|
|
|
48
|
-
#: aa_mumble_quick_connect/models.py:
|
|
51
|
+
#: aa_mumble_quick_connect/models.py:100
|
|
49
52
|
msgid "Section the Mumble channel belongs to. (Optional)"
|
|
50
53
|
msgstr ""
|
|
51
54
|
|
|
52
|
-
#: aa_mumble_quick_connect/models.py:
|
|
55
|
+
#: aa_mumble_quick_connect/models.py:102
|
|
53
56
|
msgid "Name of the Mumble channel"
|
|
54
57
|
msgstr ""
|
|
55
58
|
|
|
56
|
-
#: aa_mumble_quick_connect/models.py:
|
|
59
|
+
#: aa_mumble_quick_connect/models.py:105
|
|
57
60
|
msgid "URL to the channel"
|
|
58
61
|
msgstr ""
|
|
59
62
|
|
|
60
|
-
#: aa_mumble_quick_connect/models.py:
|
|
63
|
+
#: aa_mumble_quick_connect/models.py:109
|
|
64
|
+
msgid "Disable Mumble channel URL verification"
|
|
65
|
+
msgstr ""
|
|
66
|
+
|
|
67
|
+
#: aa_mumble_quick_connect/models.py:111
|
|
68
|
+
msgid "If checked, the Mumble channel URL will not be verified against what is configured for this Auth instance when saving the link. Only use this if you are sure the URL is correct and the Mumble server is controlled by this Auth instance."
|
|
69
|
+
msgstr ""
|
|
70
|
+
|
|
71
|
+
#: aa_mumble_quick_connect/models.py:124
|
|
61
72
|
msgid "Mumble Link"
|
|
62
73
|
msgstr ""
|
|
63
74
|
|
|
64
|
-
#: aa_mumble_quick_connect/models.py:
|
|
75
|
+
#: aa_mumble_quick_connect/models.py:125
|
|
65
76
|
msgid "Mumble Links"
|
|
66
77
|
msgstr ""
|
|
67
78
|
|
|
@@ -76,3 +87,11 @@ msgstr ""
|
|
|
76
87
|
#: aa_mumble_quick_connect/templates/aa_mumble_quick_connect/partials/channels-without-sections.html:10
|
|
77
88
|
msgid "Uncategorized"
|
|
78
89
|
msgstr ""
|
|
90
|
+
|
|
91
|
+
#: aa_mumble_quick_connect/templates/aa_mumble_quick_connect/partials/footer/app-translation-footer.html:5
|
|
92
|
+
msgid "Do you want to help translate this app into your language or improve the existing translation?"
|
|
93
|
+
msgstr "Хочете допомогти перекласти цю програму вашою мовою чи покращити наявний переклад?"
|
|
94
|
+
|
|
95
|
+
#: aa_mumble_quick_connect/templates/aa_mumble_quick_connect/partials/footer/app-translation-footer.html:8
|
|
96
|
+
msgid "Join our team of translators!"
|
|
97
|
+
msgstr "Приєднуйтесь до нашої команди перекладачів!"
|
|
Binary file
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
# SOME DESCRIPTIVE TITLE.
|
|
2
2
|
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
|
3
3
|
# This file is distributed under the same license as the PACKAGE package.
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#, fuzzy
|
|
4
|
+
# Peter Pfeufer <info@ppfeufer.de>, 2025.
|
|
7
5
|
msgid ""
|
|
8
6
|
msgstr ""
|
|
9
7
|
"Project-Id-Version: AA Mumble Quick Connect 0.0.1\n"
|
|
10
8
|
"Report-Msgid-Bugs-To: https://github.com/ppfeufer/aa-mumble-quick-connect/issues\n"
|
|
11
|
-
"POT-Creation-Date: 2025-02-
|
|
12
|
-
"PO-Revision-Date:
|
|
13
|
-
"Last-Translator:
|
|
14
|
-
"Language-Team:
|
|
15
|
-
"Language: \n"
|
|
9
|
+
"POT-Creation-Date: 2025-02-14 09:35+0100\n"
|
|
10
|
+
"PO-Revision-Date: 2025-02-13 22:08+0000\n"
|
|
11
|
+
"Last-Translator: Peter Pfeufer <info@ppfeufer.de>\n"
|
|
12
|
+
"Language-Team: Chinese (Simplified Han script) <https://weblate.ppfeufer.de/projects/alliance-auth-apps/aa-mumble-quick-connect/zh_Hans/>\n"
|
|
13
|
+
"Language: zh_Hans\n"
|
|
16
14
|
"MIME-Version: 1.0\n"
|
|
17
15
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
18
16
|
"Content-Transfer-Encoding: 8bit\n"
|
|
19
17
|
"Plural-Forms: nplurals=1; plural=0;\n"
|
|
18
|
+
"X-Generator: Weblate 5.9.2\n"
|
|
20
19
|
|
|
21
20
|
#: aa_mumble_quick_connect/auth_hooks.py:26
|
|
22
21
|
#: aa_mumble_quick_connect/templates/aa_mumble_quick_connect/base.html:6
|
|
@@ -25,43 +24,55 @@ msgid "Mumble Quick Connect"
|
|
|
25
24
|
msgstr ""
|
|
26
25
|
|
|
27
26
|
#: aa_mumble_quick_connect/models.py:26
|
|
27
|
+
msgid "The Mumble channel URL must start with \"mumble://\""
|
|
28
|
+
msgstr ""
|
|
29
|
+
|
|
30
|
+
#: aa_mumble_quick_connect/models.py:36
|
|
28
31
|
#, python-brace-format
|
|
29
|
-
msgid "The Mumble channel URL must start with
|
|
32
|
+
msgid "The Mumble channel URL must start with \"{mumble_base_url}\""
|
|
30
33
|
msgstr ""
|
|
31
34
|
|
|
32
|
-
#: aa_mumble_quick_connect/models.py:
|
|
35
|
+
#: aa_mumble_quick_connect/models.py:56
|
|
33
36
|
msgid "Can access this app"
|
|
34
|
-
msgstr ""
|
|
37
|
+
msgstr "能够访问此应用程序"
|
|
35
38
|
|
|
36
|
-
#: aa_mumble_quick_connect/models.py:
|
|
39
|
+
#: aa_mumble_quick_connect/models.py:65
|
|
37
40
|
msgid "Name of the section"
|
|
38
41
|
msgstr ""
|
|
39
42
|
|
|
40
|
-
#: aa_mumble_quick_connect/models.py:
|
|
43
|
+
#: aa_mumble_quick_connect/models.py:74 aa_mumble_quick_connect/models.py:97
|
|
41
44
|
msgid "Section"
|
|
42
45
|
msgstr ""
|
|
43
46
|
|
|
44
|
-
#: aa_mumble_quick_connect/models.py:
|
|
47
|
+
#: aa_mumble_quick_connect/models.py:75
|
|
45
48
|
msgid "Sections"
|
|
46
49
|
msgstr ""
|
|
47
50
|
|
|
48
|
-
#: aa_mumble_quick_connect/models.py:
|
|
51
|
+
#: aa_mumble_quick_connect/models.py:100
|
|
49
52
|
msgid "Section the Mumble channel belongs to. (Optional)"
|
|
50
53
|
msgstr ""
|
|
51
54
|
|
|
52
|
-
#: aa_mumble_quick_connect/models.py:
|
|
55
|
+
#: aa_mumble_quick_connect/models.py:102
|
|
53
56
|
msgid "Name of the Mumble channel"
|
|
54
57
|
msgstr ""
|
|
55
58
|
|
|
56
|
-
#: aa_mumble_quick_connect/models.py:
|
|
59
|
+
#: aa_mumble_quick_connect/models.py:105
|
|
57
60
|
msgid "URL to the channel"
|
|
58
61
|
msgstr ""
|
|
59
62
|
|
|
60
|
-
#: aa_mumble_quick_connect/models.py:
|
|
63
|
+
#: aa_mumble_quick_connect/models.py:109
|
|
64
|
+
msgid "Disable Mumble channel URL verification"
|
|
65
|
+
msgstr ""
|
|
66
|
+
|
|
67
|
+
#: aa_mumble_quick_connect/models.py:111
|
|
68
|
+
msgid "If checked, the Mumble channel URL will not be verified against what is configured for this Auth instance when saving the link. Only use this if you are sure the URL is correct and the Mumble server is controlled by this Auth instance."
|
|
69
|
+
msgstr ""
|
|
70
|
+
|
|
71
|
+
#: aa_mumble_quick_connect/models.py:124
|
|
61
72
|
msgid "Mumble Link"
|
|
62
73
|
msgstr ""
|
|
63
74
|
|
|
64
|
-
#: aa_mumble_quick_connect/models.py:
|
|
75
|
+
#: aa_mumble_quick_connect/models.py:125
|
|
65
76
|
msgid "Mumble Links"
|
|
66
77
|
msgstr ""
|
|
67
78
|
|
|
@@ -76,3 +87,11 @@ msgstr ""
|
|
|
76
87
|
#: aa_mumble_quick_connect/templates/aa_mumble_quick_connect/partials/channels-without-sections.html:10
|
|
77
88
|
msgid "Uncategorized"
|
|
78
89
|
msgstr ""
|
|
90
|
+
|
|
91
|
+
#: aa_mumble_quick_connect/templates/aa_mumble_quick_connect/partials/footer/app-translation-footer.html:5
|
|
92
|
+
msgid "Do you want to help translate this app into your language or improve the existing translation?"
|
|
93
|
+
msgstr "您想帮助将此应用程序翻译成您的母语或改进现有的翻译吗?"
|
|
94
|
+
|
|
95
|
+
#: aa_mumble_quick_connect/templates/aa_mumble_quick_connect/partials/footer/app-translation-footer.html:8
|
|
96
|
+
msgid "Join our team of translators!"
|
|
97
|
+
msgstr "加入我们的翻译团队吧!"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Generated by Django 4.2.19 on 2025-02-14 07:35
|
|
2
|
+
|
|
3
|
+
# Django
|
|
4
|
+
from django.db import migrations, models
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
|
|
9
|
+
dependencies = [
|
|
10
|
+
("aa_mumble_quick_connect", "0001_initial"),
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
operations = [
|
|
14
|
+
migrations.AddField(
|
|
15
|
+
model_name="mumblelink",
|
|
16
|
+
name="disable_url_verification",
|
|
17
|
+
field=models.BooleanField(
|
|
18
|
+
default=False,
|
|
19
|
+
help_text="If checked, the Mumble channel URL will not be verified against what is configured for this Auth instance when saving the link. Only use this if you are sure the URL is correct and the Mumble server is controlled by this Auth instance.",
|
|
20
|
+
verbose_name="Disable Mumble channel URL verification",
|
|
21
|
+
),
|
|
22
|
+
),
|
|
23
|
+
migrations.AlterField(
|
|
24
|
+
model_name="mumblelink",
|
|
25
|
+
name="url",
|
|
26
|
+
field=models.CharField(help_text="URL to the channel", max_length=255),
|
|
27
|
+
),
|
|
28
|
+
]
|
|
@@ -9,23 +9,35 @@ from django.db import models
|
|
|
9
9
|
from django.utils.translation import gettext_lazy as _
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
def validate_mumble_url(url: str):
|
|
12
|
+
def validate_mumble_url(url: str, disable_url_verification: bool = False) -> str:
|
|
13
13
|
"""
|
|
14
|
-
Validate Mumble URL
|
|
15
|
-
|
|
16
|
-
:param url:
|
|
17
|
-
:type url:
|
|
18
|
-
:
|
|
19
|
-
:
|
|
14
|
+
Validate Mumble channel URL against the configured Mumble server
|
|
15
|
+
|
|
16
|
+
:param url: URL to validate
|
|
17
|
+
:type url: str
|
|
18
|
+
:param disable_url_verification: Disable URL verification
|
|
19
|
+
:type disable_url_verification: bool
|
|
20
|
+
:return: Validated URL
|
|
21
|
+
:rtype: str
|
|
20
22
|
"""
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if not url.startswith(mumble_base_url):
|
|
24
|
+
if not url.startswith("mumble://"):
|
|
25
25
|
raise ValidationError(
|
|
26
|
-
_(
|
|
26
|
+
{"url": _('The Mumble channel URL must start with "mumble://"')}
|
|
27
27
|
)
|
|
28
28
|
|
|
29
|
+
if not disable_url_verification:
|
|
30
|
+
mumble_base_url = f"mumble://{settings.MUMBLE_URL}"
|
|
31
|
+
|
|
32
|
+
if not url.startswith(mumble_base_url):
|
|
33
|
+
raise ValidationError(
|
|
34
|
+
{
|
|
35
|
+
"url": _(
|
|
36
|
+
_(f'The Mumble channel URL must start with "{mumble_base_url}"')
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
|
|
29
41
|
return url
|
|
30
42
|
|
|
31
43
|
|
|
@@ -63,6 +75,13 @@ class Section(models.Model):
|
|
|
63
75
|
verbose_name_plural = _("Sections")
|
|
64
76
|
|
|
65
77
|
def __str__(self) -> str:
|
|
78
|
+
"""
|
|
79
|
+
String representation
|
|
80
|
+
|
|
81
|
+
:return: Name of the section
|
|
82
|
+
:rtype: str
|
|
83
|
+
"""
|
|
84
|
+
|
|
66
85
|
return self.name
|
|
67
86
|
|
|
68
87
|
|
|
@@ -83,9 +102,18 @@ class MumbleLink(models.Model):
|
|
|
83
102
|
name = models.CharField(max_length=255, help_text=_("Name of the Mumble channel"))
|
|
84
103
|
url = models.CharField(
|
|
85
104
|
max_length=255,
|
|
86
|
-
validators=[validate_mumble_url],
|
|
87
105
|
help_text=_("URL to the channel"),
|
|
88
106
|
)
|
|
107
|
+
disable_url_verification = models.BooleanField(
|
|
108
|
+
default=False,
|
|
109
|
+
verbose_name=_("Disable Mumble channel URL verification"),
|
|
110
|
+
help_text=_(
|
|
111
|
+
"If checked, the Mumble channel URL will not be verified against what is "
|
|
112
|
+
"configured for this Auth instance when saving the link. Only use this "
|
|
113
|
+
"if you are sure the URL is correct and the Mumble server is controlled "
|
|
114
|
+
"by this Auth instance."
|
|
115
|
+
),
|
|
116
|
+
)
|
|
89
117
|
|
|
90
118
|
class Meta: # pylint: disable=too-few-public-methods
|
|
91
119
|
"""
|
|
@@ -97,4 +125,30 @@ class MumbleLink(models.Model):
|
|
|
97
125
|
verbose_name_plural = _("Mumble Links")
|
|
98
126
|
|
|
99
127
|
def __str__(self) -> str:
|
|
128
|
+
"""
|
|
129
|
+
String representation
|
|
130
|
+
|
|
131
|
+
:return: Name of the Mumble channel
|
|
132
|
+
:rtype: str
|
|
133
|
+
"""
|
|
134
|
+
|
|
100
135
|
return self.name
|
|
136
|
+
|
|
137
|
+
def clean(self):
|
|
138
|
+
"""
|
|
139
|
+
Clean method
|
|
140
|
+
|
|
141
|
+
:param args: Arguments
|
|
142
|
+
:type args: tuple
|
|
143
|
+
:param kwargs: Keyword arguments
|
|
144
|
+
:type kwargs: dict
|
|
145
|
+
:return: None
|
|
146
|
+
:rtype: None
|
|
147
|
+
"""
|
|
148
|
+
|
|
149
|
+
# Validate Mumble URL
|
|
150
|
+
self.url = validate_mumble_url(
|
|
151
|
+
url=self.url, disable_url_verification=self.disable_url_verification
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
super().clean() # pragma: no cover
|
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
|
|
13
13
|
{% block content %}
|
|
14
14
|
<div class="aa-mumble-quick-connect">
|
|
15
|
-
{% block
|
|
15
|
+
{% block aa_mumble_quick_connect_body %}
|
|
16
|
+
{% endblock aa_mumble_quick_connect_body %}
|
|
17
|
+
|
|
18
|
+
<div class="aa-mumble-quick-connect-footer mt-3 pt-3 border-top border-light">
|
|
19
|
+
{% include "aa_mumble_quick_connect/partials/footer/app-translation-footer.html" %}
|
|
20
|
+
</div>
|
|
16
21
|
</div>
|
|
17
22
|
{% endblock %}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
{% load i18n %}
|
|
4
4
|
{% load humanize %}
|
|
5
5
|
|
|
6
|
-
{% block
|
|
6
|
+
{% block aa_mumble_quick_connect_body %}
|
|
7
7
|
{% if mumble_service_installed %}
|
|
8
8
|
{% if request.user.mumble %}
|
|
9
9
|
<div class="row mb-3" data-masonry='{"percentPosition": true }'>
|
|
@@ -20,11 +20,8 @@
|
|
|
20
20
|
{% translate "Mumble service is not installed!" %}
|
|
21
21
|
</div>
|
|
22
22
|
{% endif %}
|
|
23
|
-
{% endblock %}
|
|
23
|
+
{% endblock aa_mumble_quick_connect_body %}
|
|
24
24
|
|
|
25
25
|
{% block extra_javascript %}
|
|
26
26
|
{% include "aa_mumble_quick_connect/bundles/masonry-layout-js.html" %}
|
|
27
|
-
{% endblock %}
|
|
28
|
-
|
|
29
|
-
{% block extra_css %}
|
|
30
|
-
{% endblock %}
|
|
27
|
+
{% endblock extra_javascript %}
|
aa_mumble_quick_connect/templates/aa_mumble_quick_connect/partials/channels-in-sections.html
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
{% for section in channels_in_sections %}
|
|
6
6
|
{% if section.mumble_links.count %}
|
|
7
7
|
<div class="col-sm-6 col-lg-4 mb-3">
|
|
8
|
-
<div id="section-{{ section.name|slugify }}" class="card card-primary{% if
|
|
9
|
-
<div class="card-header{% if
|
|
8
|
+
<div id="section-{{ section.name|slugify }}" class="card card-primary{% if section_highlight == section.name|slugify %} border-success{% endif %}">
|
|
9
|
+
<div class="card-header{% if section_highlight == section.name|slugify %} bg-success{% endif %}">
|
|
10
10
|
<div class="card-title">
|
|
11
11
|
<span>{{ section.name }}</span>
|
|
12
12
|
<span class="float-end">
|
|
13
|
-
<a href="{% url "aa_mumble_quick_connect:index"
|
|
13
|
+
<a href="{% url "aa_mumble_quick_connect:index" section.name|slugify %}">
|
|
14
14
|
<i class="fa-solid fa-link"></i>
|
|
15
15
|
</a>
|
|
16
16
|
</span>
|
aa_mumble_quick_connect/templates/aa_mumble_quick_connect/partials/channels-without-sections.html
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
{% if channels_without_sections %}
|
|
6
6
|
<div class="col-sm-6 col-lg-4 mb-3">
|
|
7
|
-
<div id="section-uncategorized" class="card card-primary{% if
|
|
8
|
-
<div class="card-header{% if
|
|
7
|
+
<div id="section-uncategorized" class="card card-primary{% if section_highlight == 'uncategorized' %} border-success{% endif %}">
|
|
8
|
+
<div class="card-header{% if section_highlight == 'uncategorized' %} bg-success{% endif %}">
|
|
9
9
|
<div class="card-title">
|
|
10
10
|
<span>{% translate "Uncategorized" %}</span>
|
|
11
11
|
<span class="float-end">
|
|
12
|
-
<a href="{% url "aa_mumble_quick_connect:index" %}
|
|
12
|
+
<a href="{% url "aa_mumble_quick_connect:index" "uncategorized" %}">
|
|
13
13
|
<i class="fa-solid fa-link"></i>
|
|
14
14
|
</a>
|
|
15
15
|
</span>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{% load i18n %}
|
|
2
|
+
|
|
3
|
+
<div class="app-translation-footer text-muted">
|
|
4
|
+
<p class="small">
|
|
5
|
+
{% translate "Do you want to help translate this app into your language or improve the existing translation?" %}
|
|
6
|
+
-
|
|
7
|
+
<a href="https://weblate.ppfeufer.de/engage/alliance-auth-apps/" target="_blank" rel="noopener noreferer">
|
|
8
|
+
{% translate "Join our team of translators!" %}
|
|
9
|
+
</a>
|
|
10
|
+
</p>
|
|
11
|
+
</div>
|
|
@@ -63,7 +63,7 @@ class TestMumbleLink(TestCase):
|
|
|
63
63
|
@override_settings(MUMBLE_URL="mumble.example.com")
|
|
64
64
|
def test_validate_mumble_url_with_invalid_url(self):
|
|
65
65
|
"""
|
|
66
|
-
Test validate Mumble URL with invalid URL
|
|
66
|
+
Test validate Mumble URL with invalid URL raises ValidationError
|
|
67
67
|
|
|
68
68
|
:return:
|
|
69
69
|
:rtype:
|
|
@@ -73,6 +73,118 @@ class TestMumbleLink(TestCase):
|
|
|
73
73
|
|
|
74
74
|
with self.assertRaisesMessage(
|
|
75
75
|
expected_exception=ValidationError,
|
|
76
|
-
expected_message=f
|
|
76
|
+
expected_message=f'The Mumble channel URL must start with "{expected_mumble_base_url}"',
|
|
77
77
|
):
|
|
78
|
-
validate_mumble_url("
|
|
78
|
+
validate_mumble_url("mumble://example.com")
|
|
79
|
+
|
|
80
|
+
@override_settings(MUMBLE_URL="mumble.example.com")
|
|
81
|
+
def test_validate_mumble_url_with_disabled_url_verification(self):
|
|
82
|
+
"""
|
|
83
|
+
Test validate Mumble URL with disabled URL verification
|
|
84
|
+
|
|
85
|
+
:return:
|
|
86
|
+
:rtype:
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
self.assertEqual(
|
|
90
|
+
first=validate_mumble_url(
|
|
91
|
+
url="mumble://example.com", disable_url_verification=True
|
|
92
|
+
),
|
|
93
|
+
second="mumble://example.com",
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
@override_settings(MUMBLE_URL="mumble.example.com")
|
|
97
|
+
def test_validate_mumble_url_with_invalid_url_protocol(self):
|
|
98
|
+
"""
|
|
99
|
+
Test validate Mumble URL with invalid URL protocol raises ValidationError
|
|
100
|
+
|
|
101
|
+
:return:
|
|
102
|
+
:rtype:
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
with self.assertRaisesMessage(
|
|
106
|
+
expected_exception=ValidationError,
|
|
107
|
+
expected_message='The Mumble channel URL must start with "mumble://"',
|
|
108
|
+
):
|
|
109
|
+
validate_mumble_url(url="https://example.com")
|
|
110
|
+
|
|
111
|
+
@override_settings(MUMBLE_URL="mumble.example.com")
|
|
112
|
+
def test_validate_mumble_url_with_invalid_url_protocol_and_disabled_url_verification(
|
|
113
|
+
self,
|
|
114
|
+
):
|
|
115
|
+
"""
|
|
116
|
+
Test validate Mumble URL with invalid URL protocol and disabled URL verification raises ValidationError
|
|
117
|
+
|
|
118
|
+
:return:
|
|
119
|
+
:rtype:
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
with self.assertRaisesMessage(
|
|
123
|
+
expected_exception=ValidationError,
|
|
124
|
+
expected_message='The Mumble channel URL must start with "mumble://"',
|
|
125
|
+
):
|
|
126
|
+
validate_mumble_url(
|
|
127
|
+
url="https://example.com", disable_url_verification=True
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
@override_settings(MUMBLE_URL="mumble.example.com")
|
|
131
|
+
def test_save_with_valid_url(self):
|
|
132
|
+
"""
|
|
133
|
+
Test save with valid URL
|
|
134
|
+
|
|
135
|
+
:return:
|
|
136
|
+
:rtype:
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
mumble_link = MumbleLink(
|
|
140
|
+
name="Foobar",
|
|
141
|
+
url="mumble://mumble.example.com",
|
|
142
|
+
section=Section.objects.create(name="Foobar"),
|
|
143
|
+
)
|
|
144
|
+
mumble_link.save()
|
|
145
|
+
|
|
146
|
+
self.assertEqual(first=mumble_link.url, second="mumble://mumble.example.com")
|
|
147
|
+
|
|
148
|
+
@override_settings(MUMBLE_URL="mumble.example.com")
|
|
149
|
+
def test_save_with_invalid_url_raises_validation_error(self):
|
|
150
|
+
"""
|
|
151
|
+
Test save with invalid URL raises ValidationError
|
|
152
|
+
|
|
153
|
+
:return:
|
|
154
|
+
:rtype:
|
|
155
|
+
"""
|
|
156
|
+
|
|
157
|
+
mumble_link = MumbleLink(
|
|
158
|
+
name="Foobar",
|
|
159
|
+
url="mumble://example.com",
|
|
160
|
+
section=Section.objects.create(name="Foobar"),
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
expected_mumble_base_url = f"mumble://{settings.MUMBLE_URL}"
|
|
164
|
+
|
|
165
|
+
with self.assertRaisesMessage(
|
|
166
|
+
expected_exception=ValidationError,
|
|
167
|
+
expected_message=f'The Mumble channel URL must start with "{expected_mumble_base_url}"',
|
|
168
|
+
):
|
|
169
|
+
mumble_link.clean()
|
|
170
|
+
|
|
171
|
+
@override_settings(MUMBLE_URL="mumble.example.com")
|
|
172
|
+
def tes_save_with_invalid_url_does_not_raise_validation_error(self):
|
|
173
|
+
"""
|
|
174
|
+
Test save with invalid URL does not raise ValidationError
|
|
175
|
+
|
|
176
|
+
:return:
|
|
177
|
+
:rtype:
|
|
178
|
+
"""
|
|
179
|
+
|
|
180
|
+
mumble_link = MumbleLink(
|
|
181
|
+
name="Foobar",
|
|
182
|
+
url="mumble://example.com",
|
|
183
|
+
section=Section.objects.create(name="Foobar"),
|
|
184
|
+
disable_url_verification=True,
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
mumble_link.clean()
|
|
188
|
+
mumble_link.save()
|
|
189
|
+
|
|
190
|
+
self.assertEqual(first=mumble_link.url, second="mumble://example.com")
|
aa_mumble_quick_connect/urls.py
CHANGED
aa_mumble_quick_connect/views.py
CHANGED
|
@@ -14,11 +14,16 @@ from aa_mumble_quick_connect.models import MumbleLink, Section
|
|
|
14
14
|
@login_required
|
|
15
15
|
@permission_required("aa_mumble_quick_connect.basic_access")
|
|
16
16
|
@permission_required("mumble.access_mumble")
|
|
17
|
-
def index(request: WSGIRequest) -> HttpResponse:
|
|
17
|
+
def index(request: WSGIRequest, section: str = None) -> HttpResponse:
|
|
18
18
|
"""
|
|
19
19
|
Index view
|
|
20
|
-
|
|
21
|
-
:
|
|
20
|
+
|
|
21
|
+
:param request: The request
|
|
22
|
+
:type request: WSGIRequest
|
|
23
|
+
:param section: The section (optional)
|
|
24
|
+
:type section: str
|
|
25
|
+
:return: The response
|
|
26
|
+
:rtype: HttpResponse
|
|
22
27
|
"""
|
|
23
28
|
|
|
24
29
|
channels_in_sections = Section.objects.prefetch_related("mumble_links").all()
|
|
@@ -28,6 +33,7 @@ def index(request: WSGIRequest) -> HttpResponse:
|
|
|
28
33
|
"mumble_service_installed": mumble_service_installed(),
|
|
29
34
|
"channels_in_sections": channels_in_sections,
|
|
30
35
|
"channels_without_sections": channels_without_sections,
|
|
36
|
+
"section_highlight": section,
|
|
31
37
|
}
|
|
32
38
|
|
|
33
39
|
return render(
|
{aa_mumble_quick_connect-0.0.3.dist-info → aa_mumble_quick_connect-0.0.5.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aa-mumble-quick-connect
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.5
|
|
4
4
|
Summary: Quick connect links to your Mumble server channels
|
|
5
5
|
Project-URL: Changelog, https://github.com/ppfeufer/aa-mumble-quick-connect/blob/master/CHANGELOG.md
|
|
6
6
|
Project-URL: Documentation, https://github.com/ppfeufer/aa-mumble-quick-connect/blob/master/README.md
|
|
@@ -771,7 +771,7 @@ Add the app to your `INSTALLED_APPS` in your `local.py`:
|
|
|
771
771
|
|
|
772
772
|
```python
|
|
773
773
|
INSTALLED_APPS += [
|
|
774
|
-
"
|
|
774
|
+
"aa_mumble_quick_connect", # https://github.com/ppfeufer/aa-mumble-quick-connect
|
|
775
775
|
]
|
|
776
776
|
```
|
|
777
777
|
|