From f0627db09fcee9e67f1dd2e9760709f660bd7859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Fri, 22 Apr 2016 03:06:00 +0200 Subject: [PATCH] Removed legacy html templates. Added select rendering to template so we can use whatever styles we like --- server/src/uds/templates/uds/base.html | 49 --------- server/src/uds/templates/uds/downloads.html | 25 ----- server/src/uds/templates/uds/error.html | 16 --- server/src/uds/templates/uds/html5/login.html | 25 +++-- server/src/uds/templates/uds/index.html | 83 -------------- .../src/uds/templates/uds/internal_page.html | 44 -------- server/src/uds/templates/uds/login.html | 103 ------------------ server/src/uds/templates/uds/prefs.html | 21 ---- .../uds/templates/uds/service_not_ready.html | 8 -- .../src/uds/templates/uds/show_transport.html | 13 --- server/src/uds/web/forms/LoginForm.py | 3 + 11 files changed, 20 insertions(+), 370 deletions(-) delete mode 100644 server/src/uds/templates/uds/base.html delete mode 100644 server/src/uds/templates/uds/downloads.html delete mode 100644 server/src/uds/templates/uds/error.html delete mode 100644 server/src/uds/templates/uds/index.html delete mode 100644 server/src/uds/templates/uds/internal_page.html delete mode 100644 server/src/uds/templates/uds/login.html delete mode 100644 server/src/uds/templates/uds/prefs.html delete mode 100644 server/src/uds/templates/uds/service_not_ready.html delete mode 100644 server/src/uds/templates/uds/show_transport.html diff --git a/server/src/uds/templates/uds/base.html b/server/src/uds/templates/uds/base.html deleted file mode 100644 index f7ebe2199..000000000 --- a/server/src/uds/templates/uds/base.html +++ /dev/null @@ -1,49 +0,0 @@ -{% load i18n %} -{% load static %} - - - - - {% block title %} {% trans "UDS" %}{% endblock %} - - - - - - - - - - - - - - - - - - - - {% block script %}{% endblock %} - - - - - -
- {% block content %} - Contenido - {% endblock %} -
- - - - - \ No newline at end of file diff --git a/server/src/uds/templates/uds/downloads.html b/server/src/uds/templates/uds/downloads.html deleted file mode 100644 index c7404fc36..000000000 --- a/server/src/uds/templates/uds/downloads.html +++ /dev/null @@ -1,25 +0,0 @@ -{% extends "uds/internal_page.html" %} -{% load i18n %} -{% load static %} - -{% block content %} -{% spaceless %} -

-{% trans "Downloads" %} -

-
-

{% trans "This page contains a list of downloadables provided by different modules" %}

-
-
- -
-{% endspaceless %} -{% include "uds/snippets/back_to_list.html" %} -{% endblock %} - diff --git a/server/src/uds/templates/uds/error.html b/server/src/uds/templates/uds/error.html deleted file mode 100644 index a02a6fafb..000000000 --- a/server/src/uds/templates/uds/error.html +++ /dev/null @@ -1,16 +0,0 @@ -{% extends "uds/internal_page.html" %} -{% load i18n %} -{% load static %} - -{% block title %} -{% trans "Error" %} -{% endblock %} - -{% block content %} -
-{% trans "Error" %}: {{ errorString }} -
-
-
-{% include "uds/snippets/back_to_list.html" %} -{% endblock %} \ No newline at end of file diff --git a/server/src/uds/templates/uds/html5/login.html b/server/src/uds/templates/uds/html5/login.html index 59a54a298..9455a77b9 100644 --- a/server/src/uds/templates/uds/html5/login.html +++ b/server/src/uds/templates/uds/html5/login.html @@ -16,7 +16,7 @@ }); } } - + $(document).ready(function() { var nonStandard = $('#id_nonStandard').val(); @@ -47,9 +47,9 @@ // Check initial value (may default auth is non Standard) chkNonStandardAuth($('#id_authenticator').val(), nonStandard); }); - - - + + + {% endblock %} {% block body %} @@ -73,9 +73,18 @@
- {{ form.authenticator }} -
- +
+ {% if form.fields.authenticator.choices|length > 1 %} +
+ + +
+ {% endif %} +
- {% autoescape off %} + {% autoescape off %} {{ customHtml }} {% endautoescape %}
diff --git a/server/src/uds/templates/uds/index.html b/server/src/uds/templates/uds/index.html deleted file mode 100644 index c898103ea..000000000 --- a/server/src/uds/templates/uds/index.html +++ /dev/null @@ -1,83 +0,0 @@ -{% extends "uds/internal_page.html" %} -{% load i18n %} -{% load static %} -{% block script %} -{{ block.super }} - -{% endblock script %} - -{% block content %} -
-

{% trans "Services" %}

- -
-{% if not java %} -
-

{% trans "Java is not available on your browser, and the selected transport needs it." %}

-

{% trans "Please, install latest version from" %} {% trans "Java website" %} {% trans "and restart browser" %}

-
-{% endif %} - -{% if user.isStaff %} -
-

{% trans "Ip" %}: {{ ip }}

-

{% trans "Networks" %}: {{ nets }}

-

{% trans "Transports" %}: {{ transports }}

-
-{% endif %} -{% endblock content %} \ No newline at end of file diff --git a/server/src/uds/templates/uds/internal_page.html b/server/src/uds/templates/uds/internal_page.html deleted file mode 100644 index 15b39b935..000000000 --- a/server/src/uds/templates/uds/internal_page.html +++ /dev/null @@ -1,44 +0,0 @@ -{% extends "uds/base.html" %} -{% load i18n %} -{% load static %} -{% block script %} - -{% endblock script %} -{% block top %} - -
- {% trans "User" %} {{ user.real_name }} -
- {% if user.staff_member or user.is_admin %} - {% include "uds/snippets/admin_user.html" %} - {% endif %} -
- {% trans "Preferences" %} -
- {% if not nolang %} - {% include "uds/snippets/lang.html" %} - {% endif %} -
- {% trans "Log out" %} -
- - -{% endblock top %} diff --git a/server/src/uds/templates/uds/login.html b/server/src/uds/templates/uds/login.html deleted file mode 100644 index 5b4f4c62d..000000000 --- a/server/src/uds/templates/uds/login.html +++ /dev/null @@ -1,103 +0,0 @@ -{% extends "uds/base.html" %} -{% load i18n %} -{% load static %} - -{% block title %} -{% trans "Login to UDS" %} -{% endblock %} - -{% block script %} - - -{% endblock %} - -{% block top %} - - {% include "uds/snippets/lang.html" %} -{% endblock %} - -{% block content %} - -
-

{% trans "Login" %}

-
-
- {% csrf_token %} -
- {% trans "Login data" %} - {{ form.as_p }} -
- -
- -
-
-
- {% autoescape off %} - {{ customHtml }} - {% endautoescape %} -
-{% endblock %} \ No newline at end of file diff --git a/server/src/uds/templates/uds/prefs.html b/server/src/uds/templates/uds/prefs.html deleted file mode 100644 index 930d84cca..000000000 --- a/server/src/uds/templates/uds/prefs.html +++ /dev/null @@ -1,21 +0,0 @@ -{% extends "uds/internal_page.html" %} -{% load i18n %} -{% load static %} - -{% block title %} -{% trans "UDS User Preferences" %} -{% endblock %} - -{% block content %} -
- -

{% trans "Preferences" %}

-
- {% csrf_token %} - {% autoescape off %}{{ prefs_form }}{% endautoescape %} - -
- {% include "uds/snippets/back_to_list.html" %} - -
-{% endblock %} \ No newline at end of file diff --git a/server/src/uds/templates/uds/service_not_ready.html b/server/src/uds/templates/uds/service_not_ready.html deleted file mode 100644 index 95ef2ec5c..000000000 --- a/server/src/uds/templates/uds/service_not_ready.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "uds/internal_page.html" %} -{% load i18n %} -{% load static %} - -{% block content %} -{% trans "Service not ready at this moment. Please, try again in a while." %} -{% include "uds/snippets/back_to_list.html" %} -{% endblock %} \ No newline at end of file diff --git a/server/src/uds/templates/uds/show_transport.html b/server/src/uds/templates/uds/show_transport.html deleted file mode 100644 index 58e35f527..000000000 --- a/server/src/uds/templates/uds/show_transport.html +++ /dev/null @@ -1,13 +0,0 @@ -{% extends "uds/internal_page.html" %} -{% load i18n %} -{% load static %} - -{% block content %} -
-{% autoescape off %} -{{ transport }} -{% endautoescape %} -
-
-{% include "uds/snippets/back_to_list.html" %} -{% endblock %} \ No newline at end of file diff --git a/server/src/uds/web/forms/LoginForm.py b/server/src/uds/web/forms/LoginForm.py index f24e0444f..0edb0c628 100644 --- a/server/src/uds/web/forms/LoginForm.py +++ b/server/src/uds/web/forms/LoginForm.py @@ -45,6 +45,9 @@ logger = logging.getLogger(__name__) class CustomSelect(forms.Select): + + bootstrap = False + def render(self, name, value, attrs=None): if len(self.choices) < 2: visible = ' style="display: none;"'