ui: fixup minor issues, add static app
|
@ -1,14 +0,0 @@
|
|||
{
|
||||
"name": "passbook-static",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@patternfly/patternfly": "2.56.3"
|
||||
}
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@patternfly/patternfly@2.56.3":
|
||||
version "2.56.3"
|
||||
resolved "https://registry.yarnpkg.com/@patternfly/patternfly/-/patternfly-2.56.3.tgz#ca70eec632863f4ab62dada040f0979998a1355b"
|
||||
integrity sha512-merUreEz4ul84s+OXwJ27AtMtcBdzExDX+Xn/T84OD6OAgG8iU1x1dnWdFBeEFKOlTpKxwjXxS/Zc8tSxpfRBw==
|
|
@ -44,13 +44,14 @@
|
|||
<p>{{ config.login.subtext }}</p>
|
||||
{% endif %}
|
||||
<ul class="pf-c-login__main-footer-links">
|
||||
{% for url, icon, name in sources %}
|
||||
{% for source in sources %}
|
||||
<li class="pf-c-login__main-footer-links-item">
|
||||
<a href="{{ url }}" class="pf-c-login__main-footer-links-item-link">
|
||||
{% if icon %}
|
||||
<img src="{% static icon %}">
|
||||
{% else %}
|
||||
{{ name }}
|
||||
<a href="{{ source.url }}" class="pf-c-login__main-footer-links-item-link">
|
||||
{% if source.icon_path %}
|
||||
<img src="{% static source.icon_path %}" alt="{{ source.name }}">
|
||||
{% endif %}
|
||||
{% if source.icon_url %}
|
||||
<img src="icon_url" alt="{{ source.name }}">
|
||||
{% endif %}
|
||||
</a>
|
||||
</li>
|
||||
|
|
|
@ -47,9 +47,9 @@ class LoginView(UserPassesTestMixin, FormView):
|
|||
kwargs["sources"] = []
|
||||
sources = Source.objects.filter(enabled=True).select_subclasses()
|
||||
for source in sources:
|
||||
ui_login_button = source.ui_login_button
|
||||
if ui_login_button:
|
||||
kwargs["sources"].append(ui_login_button)
|
||||
ui_login_button = source.ui_login_button
|
||||
# if kwargs["sources"]:
|
||||
# self.template_name = "login/with_sources.html"
|
||||
return super().get_context_data(**kwargs)
|
||||
|
|
|
@ -78,6 +78,7 @@ INSTALLED_APPS = [
|
|||
"guardian",
|
||||
"django_prometheus",
|
||||
"passbook.core.apps.PassbookCoreConfig",
|
||||
'passbook.static.apps.PassbookStaticConfig',
|
||||
"passbook.admin.apps.PassbookAdminConfig",
|
||||
"passbook.api.apps.PassbookAPIConfig",
|
||||
"passbook.lib.apps.PassbookLibConfig",
|
||||
|
|
|
@ -35,7 +35,7 @@ class OAuthSource(Source):
|
|||
"passbook_sources_oauth:oauth-client-login",
|
||||
kwargs={"source_slug": self.slug},
|
||||
),
|
||||
icon_path=f"img/logos/{self.provider_type}.svg",
|
||||
icon_path=f"passbook/sources/{self.provider_type.replace(' ', '-')}.svg",
|
||||
name=self.name,
|
||||
)
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
"""passbook static app config"""
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class PassbookStaticConfig(AppConfig):
|
||||
"""passbook static app config"""
|
||||
|
||||
name = "passbook.static"
|
||||
label = "passbook_static"
|
||||
verbose_name = "passbook Static"
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@patternfly/patternfly": "^2.65.3"
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 343 B After Width: | Height: | Size: 343 B |
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 351 B |
Before Width: | Height: | Size: 402 B After Width: | Height: | Size: 402 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 543 B After Width: | Height: | Size: 543 B |
Before Width: | Height: | Size: 368 B After Width: | Height: | Size: 368 B |
|
@ -0,0 +1,8 @@
|
|||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@patternfly/patternfly@^2.65.3":
|
||||
version "2.65.3"
|
||||
resolved "https://registry.yarnpkg.com/@patternfly/patternfly/-/patternfly-2.65.3.tgz#0856d6ca13d971f18b1d7889a60a73eb78cad3c8"
|
||||
integrity sha512-pOmj1r6nOU8WOI0y6s0vfILG8dLxxhDpzBCYUtnx+i8bqq3Ci6F1tekGqs0AfjAR1+OF5lfJEb+dhixs0Z8yrg==
|