Skip to content

Commit ae261cf

Browse files
Merge pull request #67 from OS2borgerPC/66-konfiguration-af-pc-image-download-link
66 konfiguration af pc image download link
2 parents 4fb3829 + 6ce2344 commit ae261cf

File tree

6 files changed

+77
-4
lines changed

6 files changed

+77
-4
lines changed

README.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
=======================
2+
OS2borgerPC: Admin-Site
3+
=======================
4+
5+
This directory contains the OS2borgerPC Admin system, which is a remote
6+
administration system for Debian-based GNU/Linux-systems, especially
7+
Ubuntu systems.
8+
9+
The system was originally developed for public libraries in Denmark and
10+
is specifically designed to manage their OS2borgerPC audience
11+
desktop PCs.
12+
13+
By design, its functionality aims to be similar to that of Canonical's
14+
Landscape product, but less ambitious. A special feature is security
15+
alerts that may be triggered e.g. if a user changes a USB keyboard (some
16+
libraries have experienced problems with people trying to insert key
17+
loggers between keyboard and computer).
18+
19+
Read the documentation for this project in docs/ or at
20+
`Read The Docs <https://os2borgerpc-admin.readthedocs.io/>`_.
21+
22+
The system was developed by Magenta Aps (https://www.magenta.dk) and is part of the
23+
OS2borgerPC project.
24+
25+
For more information about the OS2borgerPC project, please see the
26+
official home page:
27+
28+
https://os2.eu/produkt/os2borgerpc
29+
30+
and the offical Github project:
31+
32+
https://github.com/OS2borgerPC/
33+
34+
All code is made available under Version 3 of the GNU General Public
35+
License - see the LICENSE file for details.
36+
--
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)