ui: fixup minor issues, add static app

This commit is contained in:
Jens Langhammer 2020-02-21 11:20:55 +01:00
parent d88283a7a9
commit 8fd86a28ff
20 changed files with 34 additions and 30 deletions

View File

@ -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"
}
}

View File

@ -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==

View File

@ -44,13 +44,14 @@
<p>{{ config.login.subtext }}</p> <p>{{ config.login.subtext }}</p>
{% endif %} {% endif %}
<ul class="pf-c-login__main-footer-links"> <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"> <li class="pf-c-login__main-footer-links-item">
<a href="{{ url }}" class="pf-c-login__main-footer-links-item-link"> <a href="{{ source.url }}" class="pf-c-login__main-footer-links-item-link">
{% if icon %} {% if source.icon_path %}
<img src="{% static icon %}"> <img src="{% static source.icon_path %}" alt="{{ source.name }}">
{% else %} {% endif %}
{{ name }} {% if source.icon_url %}
<img src="icon_url" alt="{{ source.name }}">
{% endif %} {% endif %}
</a> </a>
</li> </li>

View File

@ -47,9 +47,9 @@ class LoginView(UserPassesTestMixin, FormView):
kwargs["sources"] = [] kwargs["sources"] = []
sources = Source.objects.filter(enabled=True).select_subclasses() sources = Source.objects.filter(enabled=True).select_subclasses()
for source in sources: for source in sources:
ui_login_button = source.ui_login_button
if ui_login_button: if ui_login_button:
kwargs["sources"].append(ui_login_button) kwargs["sources"].append(ui_login_button)
ui_login_button = source.ui_login_button
# if kwargs["sources"]: # if kwargs["sources"]:
# self.template_name = "login/with_sources.html" # self.template_name = "login/with_sources.html"
return super().get_context_data(**kwargs) return super().get_context_data(**kwargs)

View File

@ -78,6 +78,7 @@ INSTALLED_APPS = [
"guardian", "guardian",
"django_prometheus", "django_prometheus",
"passbook.core.apps.PassbookCoreConfig", "passbook.core.apps.PassbookCoreConfig",
'passbook.static.apps.PassbookStaticConfig',
"passbook.admin.apps.PassbookAdminConfig", "passbook.admin.apps.PassbookAdminConfig",
"passbook.api.apps.PassbookAPIConfig", "passbook.api.apps.PassbookAPIConfig",
"passbook.lib.apps.PassbookLibConfig", "passbook.lib.apps.PassbookLibConfig",

View File

@ -35,7 +35,7 @@ class OAuthSource(Source):
"passbook_sources_oauth:oauth-client-login", "passbook_sources_oauth:oauth-client-login",
kwargs={"source_slug": self.slug}, 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, name=self.name,
) )

10
passbook/static/apps.py Normal file
View File

@ -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"

View File

@ -0,0 +1,6 @@
{
"license": "MIT",
"dependencies": {
"@patternfly/patternfly": "^2.65.3"
}
}

View File

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 343 B

After

Width:  |  Height:  |  Size: 343 B

View File

Before

Width:  |  Height:  |  Size: 351 B

After

Width:  |  Height:  |  Size: 351 B

View File

Before

Width:  |  Height:  |  Size: 402 B

After

Width:  |  Height:  |  Size: 402 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 543 B

View File

Before

Width:  |  Height:  |  Size: 368 B

After

Width:  |  Height:  |  Size: 368 B

View File

@ -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==