Skip to content

Commit 6ce2344

Browse files
committed
Update 'Images' button to link to ISO releases
The 'Images' button in the user GUI now provides links for releases of PC and kiosk image ISOs. Previously, ISO images were uploaded to the running admin-site container and displayed in the GUI. With this change, only URLs to the releases are configured and supplied during startup, streamlining the process.
1 parent a2eb506 commit 6ce2344

File tree

5 files changed

+41
-4
lines changed

5 files changed

+41
-4
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from django.conf import settings
2+
3+
def iso_urls(request):
4+
"""
5+
Adds PC and Kiosk ISO URLs to the context for all templates.
6+
"""
7+
return {
8+
"pc_image_releases_url": getattr(settings, "PC_IMAGE_RELEASES_URL", ""),
9+
"kiosk_image_releases_url": getattr(settings, "KIOSK_IMAGE_RELEASES_URL", ""),
10+
}

admin_site/os2borgerpc_admin/settings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
else None
2525
)
2626

27+
PC_IMAGE_RELEASES_URL = os.environ.get("PC_IMAGE_RELEASES_URL")
28+
KIOSK_IMAGE_RELEASES_URL = os.environ.get("KIOSK_IMAGE_RELEASES_URL")
29+
2730
MANAGERS = ADMINS
2831

2932
# Template settings
@@ -41,6 +44,7 @@
4144
"django.template.context_processors.request",
4245
"django.contrib.auth.context_processors.auth",
4346
"django.contrib.messages.context_processors.messages",
47+
'os2borgerpc_admin.context_processors.iso_urls',
4448
],
4549
"builtins": [
4650
"system.templatetags.custom_tags",

admin_site/system/views.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3934,7 +3934,6 @@ def get_context_data(self, **kwargs): # noqa
39343934

39353935
return context
39363936

3937-
39383937
class ImageVersionRedirect(RedirectView):
39393938
def get_redirect_url(self, **kwargs):
39403939
site = get_object_or_404(Site, uid=kwargs["slug"])

admin_site/templates/site_with_navigation.html

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,31 @@ <h2 class="text-light">{% translate "Users & Images" %}</h2>
117117
</a>
118118

119119
{% set_css_class_active request.resolver_match.url_name "images" as current_url_images %}
120-
<a class="nav-link link-light {{ current_url_images }}" href="{% url 'images' slug=site.url %}">
121-
<span class="material-icons"> cloud_download </span> {% translate "Images" %}
122-
</a>
120+
<div class="nav-item dropdown">
121+
<a
122+
class="nav-link link-light dropdown-toggle"
123+
href="#"
124+
id="imageDropdown"
125+
role="button"
126+
data-bs-toggle="dropdown"
127+
aria-expanded="false"
128+
>
129+
<span class="material-icons"> cloud_download </span> {% translate "Images" %}
130+
</a>
131+
<ul class="dropdown-menu" aria-labelledby="imageDropdown">
132+
<li>
133+
<a class="dropdown-item" href="{{ pc_image_releases_url }}" target="_blank" rel="noopener noreferrer">
134+
PC Image releases
135+
</a>
136+
</li>
137+
<li>
138+
<a class="dropdown-item" href="{{ kiosk_image_releases_url }}" target="_blank" rel="noopener noreferrer">
139+
Kiosk Image releases
140+
</a>
141+
</li>
142+
</ul>
143+
</div>
144+
123145
<hr>
124146

125147
<h2 class="text-light">{% translate "Documentation" %}</h2>

compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ services:
2222
ALLOWED_HOSTS: "*"
2323
CORE_SCRIPT_COMMIT_HASH: db319672efdcc0f7402c4a7370aa763be9960c38
2424
CORE_SCRIPT_VERSION_TAG: v0.1.4
25+
PC_IMAGE_RELEASES_URL: https://github.com/OS2borgerPC/os2borgerpc-image/releases
26+
KIOSK_IMAGE_RELEASES_URL: https://github.com/OS2borgerPC/os2borgerpc-kiosk-image/releases
2527
DEBUG: True
2628
SECRET_KEY: v3rys1kr3t
2729
# Admin contact - fill in your own name and email as desired.

0 commit comments

Comments
 (0)