From 0650155e83f180721c27e7f36a0007ac606f3a55 Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Wed, 30 Oct 2019 14:08:14 +0100 Subject: [PATCH] Retrieve and show user domains on the dashboard. --- musician/templates/musician/dashboard.html | 4 ++-- musician/views.py | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/musician/templates/musician/dashboard.html b/musician/templates/musician/dashboard.html index c5a653a..b738440 100644 --- a/musician/templates/musician/dashboard.html +++ b/musician/templates/musician/dashboard.html @@ -18,10 +18,10 @@

Domains and websites

Little description of what to be expected...

-{% for i in "123"|make_list %} +{% for domain in domains %}
-

domain.com

+

{{ domain.name }}

{% for service in "123"|make_list %}
diff --git a/musician/views.py b/musician/views.py index 6374c49..2035df6 100644 --- a/musician/views.py +++ b/musician/views.py @@ -15,6 +15,18 @@ from .mixins import CustomContextMixin, UserTokenRequiredMixin class DashboardView(CustomContextMixin, UserTokenRequiredMixin, TemplateView): template_name = "musician/dashboard.html" + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + + # TODO retrieve all data needed from orchestra + raw_domains = self.orchestra.retrieve_domains() + + context.update({ + 'domains': raw_domains + }) + + return context + class LoginView(FormView): template_name = 'auth/login.html'