[sso-admin] load svg from DOMAIN

This was previously using digitaldemocratic.net
mejoras_instalacion
Evilham 2022-08-08 13:06:42 +02:00
parent c39f780cce
commit 701be40cf5
No known key found for this signature in database
GPG Key ID: AE3EE30D970886BF
7 changed files with 20 additions and 10 deletions

View File

@ -28,10 +28,11 @@ from typing import TYPE_CHECKING, Any, Callable, Dict, List, Tuple
import yaml
from cerberus import Validator
from flask import Flask, Response, jsonify, render_template, send_from_directory
from flask import Flask, Response, jsonify, send_from_directory
from admin.lib.api_exceptions import Error
from admin.lib.keys import ThirdPartyIntegrationKeys
from admin.views import render_template
from admin.views.decorators import OptionalJsonResponse
from admin.views.ApiViews import setup_api_views
from admin.views.AppViews import setup_app_views

View File

@ -27,7 +27,7 @@ import traceback
from time import sleep
from uuid import uuid4
from flask import Response, jsonify, redirect, render_template, request, url_for
from flask import Response, jsonify, redirect, request, url_for
from flask_socketio import (
SocketIO,
close_room,

View File

@ -50,7 +50,7 @@
<div class="animate form login_form">
<section class="login_content">
<form id="login-form" action="{{ url_for('login') }}" method="POST" novalidate>
<img src="https://nextcloud.digitaldemocratic.net/themes/digitaldemocratic/core/img/dd.svg" height="75px">
<img src="https://nextcloud.{{ DOMAIN }}/themes/dd/core/img/dd.svg" height="75px">
<h1></h1>
<div>
<input type="text" name="user" class="form-control" placeholder="Username" required="" autofocus />

View File

@ -32,13 +32,14 @@ import time
import traceback
from uuid import uuid4
from flask import Response, jsonify, redirect, render_template, request, url_for
from flask import Response, jsonify, redirect, request, url_for
from flask_login import current_user, login_required
from typing import TYPE_CHECKING, cast, Any, Callable, Dict, List, Optional, Tuple
if TYPE_CHECKING:
from admin.flaskapp import AdminFlaskApp
from admin.views import render_template
from ..lib.helpers import system_group
from .decorators import login_or_token, OptionalJsonResponse

View File

@ -20,7 +20,7 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
import os
from flask import flash, redirect, render_template, request, url_for
from flask import flash, redirect, request, url_for
from flask_login import current_user, login_required, login_user, logout_user
from werkzeug.wrappers import Response
@ -28,6 +28,7 @@ from typing import TYPE_CHECKING
if TYPE_CHECKING:
from admin.flaskapp import AdminFlaskApp
from admin.views import render_template
from ..auth.authentication import *

View File

@ -39,22 +39,19 @@ from flask import (
send_file,
url_for,
)
from flask import render_template as render_template_flask
from flask_login import login_required
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from admin.flaskapp import AdminFlaskApp
from admin.views import render_template
from .decorators import is_admin
from ..lib.legal import gen_legal_if_not_exists
def render_template(*args : str, **kwargs : str) -> str:
kwargs["DOMAIN"] = os.environ["DOMAIN"]
return render_template_flask(*args, **kwargs)
def setup_web_views(app : "AdminFlaskApp") -> None:
@app.route("/users")
@login_required

View File

@ -1,5 +1,6 @@
#
# Copyright © 2021,2022 IsardVDI S.L.
# Copyright © 2022 Evilham <contact@evilham.com>
#
# This file is part of DD
#
@ -17,3 +18,12 @@
# along with DD. If not, see <https://www.gnu.org/licenses/>.
#
# SPDX-License-Identifier: AGPL-3.0-or-later
import os
from flask import render_template as render_template_flask
def render_template(*args : str, **kwargs : str) -> str:
kwargs["DOMAIN"] = os.environ["DOMAIN"]
return render_template_flask(*args, **kwargs)