Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.

Commit 4986a9f

Browse files
ckleemannmiterion
authored andcommitted
remove website from url path #463
1 parent 022a5e8 commit 4986a9f

File tree

9 files changed

+84
-95
lines changed

9 files changed

+84
-95
lines changed
File renamed without changes.
File renamed without changes.

ophasebase/templates/ophasebase/frontend_base.html

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,27 @@
4141
<div class="row">
4242
<div class="col-sm-12 col-md-10 mt-4">
4343
<h1>
44-
<a href="{% url 'website:homepage' %}" class="no-underline d-none d-sm-inline">
45-
<img src="{% static 'website/ophasen-wesen.svg' %}" class="header-img-wesen"/>
44+
<a href="{% url 'landing_page' %}" class="no-underline d-none d-sm-inline">
45+
<img src="{% static 'ophasebase/ophasen-wesen.svg' %}"
46+
class="header-img-wesen"/>
4647
</a>
47-
{% block heading %}{% endblock %}
48-
</h1>
49-
</div>
50-
<div class="col-md-2 d-none d-md-block right">
51-
<img src="{% static 'website/logo_ohne_rand.svg' %}" class="float-right header-img-logo" />
52-
</div>
48+
{% block heading %}{% endblock %}
49+
</h1>
5350
</div>
51+
<div class="col-md-2 d-none d-md-block right">
52+
<img src="{% static 'ophasebase/logo_ohne_rand.svg' %}" class="float-right
53+
header-img-logo"/>
54+
</div>
55+
</div>
5456

55-
<!-- Main component -->
56-
{% block content %}{% endblock %}
57+
<!-- Main component -->
58+
{% block content %}{% endblock %}
5759

58-
<!-- Footer menu -->
59-
<p class="text-muted footer">
60-
<span class="float-left">Fachschaft Informatik - TU Darmstadt &bull; <a href="https://www.fachschaft.informatik.tu-darmstadt.de/impressum">Impressum</a></span>&nbsp;&bull;
61-
{% if user.is_authenticated %}
60+
<!-- Footer menu -->
61+
<p class="text-muted footer">
62+
<span class="float-left">Fachschaft Informatik - TU Darmstadt &bull; <a
63+
href="https://www.fachschaft.informatik.tu-darmstadt.de/impressum">Impressum</a></span>&nbsp;&bull;
64+
{% if user.is_authenticated %}
6265
{% trans "Angemeldet als" %} {{ user.username }}
6366
{% if user.is_staff %}
6467
&bull; <a href="{% url 'admin:index' %}">{% trans "Zum Adminbereich" %}</a>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{% extends "ophasebase/frontend_base.html" %}{% load static i18n %}{% load icons %}
2+
{% block title %}{% trans "Startseite" %}{% endblock %}
3+
{% block heading %}{% trans "Willkommen zur Ophase Informatik!" %}{% endblock %}
4+
5+
{% block content %}
6+
7+
<div class="margin-top-1"></div>
8+
9+
{% if any_staff_registration_enabled %}
10+
<div class="box box-highlight box-lilac">
11+
<h3>Helfer*innen gesucht!</h3>
12+
<p class="box-big">Du hast Lust, uns bei der Ophase zu unterstützen? Super, schreibe eine Mail an <a href="mailto:[email protected]">[email protected]</a></p>
13+
</div>
14+
{% endif %}
15+
16+
{% if student_registration_enabled %}
17+
<div class="box box-highlight box-gray">
18+
<h3>{% trans "Für Tutorinnen und Tutoren während der Ophase" %}</h3>
19+
<p class="box-big"><a href="{% url 'students:registration' %}">{% trans "Die Erstsemester deiner Kleingruppe registrieren" %}</a></p>
20+
</div>
21+
{% endif %}
22+
23+
{% endblock %}
24+
25+
26+
{% block bottom_script %}
27+
{% include "ophasebase/semantics.html" %}
28+
{% endblock %}
File renamed without changes.

ophasebase/views.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
from django.views.generic import TemplateView
22

3+
from ophasebase.models import Ophase
4+
from staff.models import Settings as StaffSettings
5+
from students.models import Settings as StudentsSettings
6+
from workshops.models import Settings as WorkshopSettings
7+
8+
39
class LoginSelectView(TemplateView):
410
template_name = "ophasebase/login-select.html"
511

@@ -9,3 +15,32 @@ def get_context_data(self, **kwargs):
915
if next_url is not None:
1016
context['next_url'] = "?next={}".format(next_url)
1117
return context
18+
19+
20+
class LandingPageView(TemplateView):
21+
template_name = "ophasebase/landing_page.html"
22+
23+
def get_context_data(self, **kwargs):
24+
context = super().get_context_data(**kwargs)
25+
26+
students_settings = StudentsSettings.instance()
27+
staff_settings = StaffSettings.instance()
28+
workshop_settings = WorkshopSettings.instance()
29+
30+
current_ophase = Ophase.current()
31+
context['current_ophase'] = Ophase.current()
32+
33+
context['student_registration_enabled'] = False
34+
context['any_staff_registration_enabled'] = False
35+
if current_ophase is not None:
36+
if students_settings is not None:
37+
context[
38+
'student_registration_enabled'] = students_settings.student_registration_enabled
39+
if staff_settings is not None:
40+
context[
41+
'any_staff_registration_enabled'] = staff_settings.any_registration_enabled()
42+
if workshop_settings is not None:
43+
context['any_staff_registration_enabled'] = context[
44+
'any_staff_registration_enabled'] or workshop_settings.workshop_submission_enabled
45+
46+
return context

pyophase/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373

7474
ROOT_URLCONF = 'pyophase.urls'
7575

76-
LOGIN_REDIRECT_URL = 'website:homepage'
76+
LOGIN_REDIRECT_URL = 'landing_page'
7777

7878
TEMPLATES = [
7979
{

pyophase/urls.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
from django.contrib.auth.views import LoginView, LogoutView
44
from django.urls import include, path, reverse_lazy
55

6-
from ophasebase.views import LoginSelectView
6+
from ophasebase.views import LoginSelectView, LandingPageView
77

88
admin.autodiscover()
99

1010
urlpatterns = [
11-
path('', include('website.urls', namespace='website')),
11+
path('', LandingPageView.as_view(), name='landing_page'),
1212
path('mitmachen/', include('staff.urls', namespace='staff')),
1313
path('teilnehmer/', include('students.urls', namespace='students')),
1414
path('klausur/', include('exam.urls', namespace='exam')),
@@ -21,7 +21,7 @@
2121
LoginView.as_view(template_name='admin/login.html'),
2222
name='local_login'),
2323
path('accounts/logout/',
24-
LogoutView.as_view(next_page=reverse_lazy('website:homepage')),
24+
LogoutView.as_view(next_page=reverse_lazy('landing_page')),
2525
name='logout'),
2626
path('i18n/', include('django.conf.urls.i18n')),
2727
path('accounts/', include('allauth.urls')),

website/templates/website/homepage.html

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)