From 457b0c4dc94be1fed9eaee487a5f91cca55ec8fd Mon Sep 17 00:00:00 2001 From: Tiberiu Chibici Date: Sun, 30 Dec 2018 12:43:14 +0200 Subject: [PATCH] Added setup errors banner to welcome page. --- .../setup_errors_banner.html} | 0 .../YtManagerApp/first_time_setup/step0_welcome.html | 3 +++ app/YtManagerApp/templates/YtManagerApp/index.html | 2 +- .../templates/YtManagerApp/index_unauthenticated.html | 2 +- app/YtManagerApp/views/first_time.py | 9 +++++++++ 5 files changed, 14 insertions(+), 2 deletions(-) rename app/YtManagerApp/templates/YtManagerApp/{index_errors_banner.html => controls/setup_errors_banner.html} (100%) diff --git a/app/YtManagerApp/templates/YtManagerApp/index_errors_banner.html b/app/YtManagerApp/templates/YtManagerApp/controls/setup_errors_banner.html similarity index 100% rename from app/YtManagerApp/templates/YtManagerApp/index_errors_banner.html rename to app/YtManagerApp/templates/YtManagerApp/controls/setup_errors_banner.html diff --git a/app/YtManagerApp/templates/YtManagerApp/first_time_setup/step0_welcome.html b/app/YtManagerApp/templates/YtManagerApp/first_time_setup/step0_welcome.html index bad5b7a..770ece5 100644 --- a/app/YtManagerApp/templates/YtManagerApp/first_time_setup/step0_welcome.html +++ b/app/YtManagerApp/templates/YtManagerApp/first_time_setup/step0_welcome.html @@ -4,6 +4,9 @@ {% block body %}
+ + {% include "YtManagerApp/controls/setup_errors_banner.html" %} +

Welcome

This wizard will guide you through setting up the application.

{% crispy form %} diff --git a/app/YtManagerApp/templates/YtManagerApp/index.html b/app/YtManagerApp/templates/YtManagerApp/index.html index ae9cf82..46ef6d9 100644 --- a/app/YtManagerApp/templates/YtManagerApp/index.html +++ b/app/YtManagerApp/templates/YtManagerApp/index.html @@ -24,7 +24,7 @@
- {% include 'YtManagerApp/index_errors_banner.html' %} + {% include 'YtManagerApp/controls/setup_errors_banner.html' %}
diff --git a/app/YtManagerApp/templates/YtManagerApp/index_unauthenticated.html b/app/YtManagerApp/templates/YtManagerApp/index_unauthenticated.html index 66d1ca0..0e12a9a 100644 --- a/app/YtManagerApp/templates/YtManagerApp/index_unauthenticated.html +++ b/app/YtManagerApp/templates/YtManagerApp/index_unauthenticated.html @@ -3,7 +3,7 @@ {% block body %} - {% include 'YtManagerApp/index_errors_banner.html' %} + {% include 'YtManagerApp/controls/setup_errors_banner.html' %}

Hello

Please log in to continue

diff --git a/app/YtManagerApp/views/first_time.py b/app/YtManagerApp/views/first_time.py index 94aedc0..6d243b4 100644 --- a/app/YtManagerApp/views/first_time.py +++ b/app/YtManagerApp/views/first_time.py @@ -1,5 +1,6 @@ import logging +from django.conf import settings from django.contrib.auth import authenticate, login from django.contrib.auth.models import User from django.http import HttpResponseForbidden @@ -44,6 +45,14 @@ class Step0WelcomeView(WizardStepMixin, FormView): form_class = WelcomeForm success_url = reverse_lazy('first_time_1') + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context.update({ + 'config_errors': settings.CONFIG_ERRORS, + 'config_warnings': settings.CONFIG_WARNINGS, + }) + return context + # # Step 1: setup API key