[sso-admin] load svg from DOMAIN
This was previously using digitaldemocratic.netmejoras_instalacion
parent
c39f780cce
commit
701be40cf5
|
@ -28,10 +28,11 @@ from typing import TYPE_CHECKING, Any, Callable, Dict, List, Tuple
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
from cerberus import Validator
|
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.api_exceptions import Error
|
||||||
from admin.lib.keys import ThirdPartyIntegrationKeys
|
from admin.lib.keys import ThirdPartyIntegrationKeys
|
||||||
|
from admin.views import render_template
|
||||||
from admin.views.decorators import OptionalJsonResponse
|
from admin.views.decorators import OptionalJsonResponse
|
||||||
from admin.views.ApiViews import setup_api_views
|
from admin.views.ApiViews import setup_api_views
|
||||||
from admin.views.AppViews import setup_app_views
|
from admin.views.AppViews import setup_app_views
|
||||||
|
|
|
@ -27,7 +27,7 @@ import traceback
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from uuid import uuid4
|
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 (
|
from flask_socketio import (
|
||||||
SocketIO,
|
SocketIO,
|
||||||
close_room,
|
close_room,
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
<div class="animate form login_form">
|
<div class="animate form login_form">
|
||||||
<section class="login_content">
|
<section class="login_content">
|
||||||
<form id="login-form" action="{{ url_for('login') }}" method="POST" novalidate>
|
<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>
|
<h1></h1>
|
||||||
<div>
|
<div>
|
||||||
<input type="text" name="user" class="form-control" placeholder="Username" required="" autofocus />
|
<input type="text" name="user" class="form-control" placeholder="Username" required="" autofocus />
|
||||||
|
|
|
@ -32,13 +32,14 @@ import time
|
||||||
import traceback
|
import traceback
|
||||||
from uuid import uuid4
|
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 flask_login import current_user, login_required
|
||||||
|
|
||||||
from typing import TYPE_CHECKING, cast, Any, Callable, Dict, List, Optional, Tuple
|
from typing import TYPE_CHECKING, cast, Any, Callable, Dict, List, Optional, Tuple
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from admin.flaskapp import AdminFlaskApp
|
from admin.flaskapp import AdminFlaskApp
|
||||||
|
|
||||||
|
from admin.views import render_template
|
||||||
from ..lib.helpers import system_group
|
from ..lib.helpers import system_group
|
||||||
from .decorators import login_or_token, OptionalJsonResponse
|
from .decorators import login_or_token, OptionalJsonResponse
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
import os
|
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 flask_login import current_user, login_required, login_user, logout_user
|
||||||
from werkzeug.wrappers import Response
|
from werkzeug.wrappers import Response
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ from typing import TYPE_CHECKING
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from admin.flaskapp import AdminFlaskApp
|
from admin.flaskapp import AdminFlaskApp
|
||||||
|
|
||||||
|
from admin.views import render_template
|
||||||
from ..auth.authentication import *
|
from ..auth.authentication import *
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -39,22 +39,19 @@ from flask import (
|
||||||
send_file,
|
send_file,
|
||||||
url_for,
|
url_for,
|
||||||
)
|
)
|
||||||
from flask import render_template as render_template_flask
|
|
||||||
from flask_login import login_required
|
from flask_login import login_required
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from admin.flaskapp import AdminFlaskApp
|
from admin.flaskapp import AdminFlaskApp
|
||||||
|
|
||||||
|
|
||||||
|
from admin.views import render_template
|
||||||
from .decorators import is_admin
|
from .decorators import is_admin
|
||||||
|
|
||||||
from ..lib.legal import gen_legal_if_not_exists
|
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:
|
def setup_web_views(app : "AdminFlaskApp") -> None:
|
||||||
@app.route("/users")
|
@app.route("/users")
|
||||||
@login_required
|
@login_required
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#
|
#
|
||||||
# Copyright © 2021,2022 IsardVDI S.L.
|
# Copyright © 2021,2022 IsardVDI S.L.
|
||||||
|
# Copyright © 2022 Evilham <contact@evilham.com>
|
||||||
#
|
#
|
||||||
# This file is part of DD
|
# This file is part of DD
|
||||||
#
|
#
|
||||||
|
@ -17,3 +18,12 @@
|
||||||
# along with DD. If not, see <https://www.gnu.org/licenses/>.
|
# along with DD. If not, see <https://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
# 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)
|
||||||
|
|
Loading…
Reference in New Issue