diff --git a/passbook/admin/templates/administration/outpost/list.html b/passbook/admin/templates/administration/outpost/list.html index f8a0dc27d..2821164d4 100644 --- a/passbook/admin/templates/administration/outpost/list.html +++ b/passbook/admin/templates/administration/outpost/list.html @@ -3,6 +3,7 @@ {% load i18n %} {% load humanize %} {% load passbook_utils %} +{% load admin_reflection %} {% block head %} {{ block.super }} @@ -69,7 +70,10 @@ {% trans 'Edit' %} {% trans 'Delete' %} - {% trans 'Deploy' %} + {% get_htmls outpost as htmls %} + {% for html in htmls %} + {{ html|safe }} + {% endfor %} {% endfor %} diff --git a/passbook/outposts/models.py b/passbook/outposts/models.py index 9ebd90bc9..147ed432c 100644 --- a/passbook/outposts/models.py +++ b/passbook/outposts/models.py @@ -9,12 +9,14 @@ from django.contrib.postgres.fields import ArrayField from django.core.cache import cache from django.db import models, transaction from django.db.models.base import Model +from django.http import HttpRequest from django.utils.translation import gettext_lazy as _ from guardian.models import UserObjectPermission from guardian.shortcuts import assign_perm from passbook.core.models import Provider, Token, TokenIntents, User from passbook.lib.config import CONFIG +from passbook.lib.utils.template import render_to_string @dataclass @@ -149,5 +151,12 @@ class Outpost(models.Model): objects.append(provider) return objects + def html_deployment_view(self, request: HttpRequest) -> Optional[str]: + """return template and context modal to view token and other config info""" + return render_to_string( + "outposts/deployment_modal.html", + {"outpost": self, "full_url": request.build_absolute_uri("/")}, + ) + def __str__(self) -> str: return f"Outpost {self.name}" diff --git a/passbook/outposts/templates/outposts/deployment_modal.html b/passbook/outposts/templates/outposts/deployment_modal.html new file mode 100644 index 000000000..831068233 --- /dev/null +++ b/passbook/outposts/templates/outposts/deployment_modal.html @@ -0,0 +1,43 @@ +{% load i18n %} +{% load static %} + + + diff --git a/passbook/providers/saml/models.py b/passbook/providers/saml/models.py index c9460cbab..ce680c370 100644 --- a/passbook/providers/saml/models.py +++ b/passbook/providers/saml/models.py @@ -129,7 +129,7 @@ class SAMLProvider(Provider): return None def html_metadata_view(self, request: HttpRequest) -> Optional[str]: - """return template and context modal with to view Metadata without downloading it""" + """return template and context modal to view Metadata without downloading it""" from passbook.providers.saml.views import DescriptorDownloadView try: