forked from beba/foerderbarometer
Merge branch 'master' of https://code.basabuuka.org/alpcentaur/foerderbarometer into HEAD
This commit is contained in:
commit
fba77f0fe7
|
@ -163,7 +163,7 @@ DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
|
|||
|
||||
|
||||
# OAuth Settings
|
||||
OAUTH_URL_WHITELISTS = ['/admin']
|
||||
OAUTH_URL_WHITELISTS = ['/admin', '/index']
|
||||
|
||||
OAUTH_CLIENT_NAME = '<name-of-the-configured-wikimedia-app>'
|
||||
OAUTH_CLIENT_NAME = get_secret('OAUTH_CLIENT_NAME')
|
||||
|
|
|
@ -14,6 +14,9 @@ class OAuthMiddleware(MiddlewareMixin):
|
|||
self.oauth = OAuth()
|
||||
|
||||
def process_request(self, request):
|
||||
# added this if clause to get the landing page before oauth
|
||||
if request.path == '/':
|
||||
return self.get_response(request)
|
||||
if settings.OAUTH_URL_WHITELISTS is not None:
|
||||
for w in settings.OAUTH_URL_WHITELISTS:
|
||||
if request.path.startswith(w):
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
{% load static %}
|
||||
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/base.css' %}" />
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/widgets.css' %}" />
|
||||
|
||||
|
||||
{% load i18n %}
|
||||
|
||||
{% csrf_token %}
|
||||
|
||||
|
||||
<center>
|
||||
<style>
|
||||
ul > li {
|
||||
list-style-type: none;
|
||||
}
|
||||
ul {
|
||||
padding-left: 10;
|
||||
}
|
||||
label.required::after {
|
||||
content: ' *';
|
||||
color: red;
|
||||
}
|
||||
.div15 {
|
||||
height: 15%;
|
||||
}
|
||||
.div5 {
|
||||
height: 5%;
|
||||
}
|
||||
.button1 {
|
||||
width: 40vw;
|
||||
height: 6vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-weight: bold;
|
||||
font-size: 4vh;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="div5"></div>
|
||||
<p>
|
||||
Herzlich willkommen im Förderanfrageportal von Wikimedia Deutschland!
|
||||
</p>
|
||||
<div class="div5"></div>
|
||||
<a href="http://localhost:8000/extern"style="float:right;padding-right:10%;">OAUTH</a>
|
||||
<a href="http://localhost:8000/extern" style="float:left;padding-left:10%;">OAUTH</a>
|
||||
<p>
|
||||
<img src="https://upload.wikimedia.org/wikipedia/commons/c/c4/Figuren_klein.jpg"><p>
|
||||
Um eine Unterstützungsleistung im Rahmen der Förderangebote anfragen zu können, verifiziere dich bitte mit deinem Wikimedia-Konto.
|
||||
<br>Weitere Informationen und Hintergründe findest du unter
|
||||
<a href="https://de.wikipedia.org/wiki/Wikipedia:Förderung/Förderangebote">
|
||||
Förderportal</a> in der deutschsprachigen Wikipedia.
|
||||
<p>
|
||||
<div class="div5"></div>
|
||||
<div class="button button1"><div class="button1_text">Anmelden</div></div>
|
||||
<div class="div5"></div>
|
||||
<div class="div5"></div>
|
||||
<br>Für alle Fragen wende dich gern an das <a href="https://de.wikipedia.org/wiki/Wikipedia:Förderung/Wikimedia_Deutschland">Team Communitys und Engagement</a>.
|
||||
<br>Für interessierte Hacker gibts auch den <a href="https://srcsrv.wikimedia.de/beba/foerderbarometer">Sourcecode</a> zum Formular und was damit passiert.
|
||||
<p>
|
||||
<a href="https://www.wikimedia.de/impressum/">Impressum</a>
|
||||
<p>
|
||||
</center>
|
||||
|
||||
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
from django.urls import path
|
||||
from .views import ExternView, done, authorize, deny, InternView, export
|
||||
from .views import ExternView, index, done, authorize, deny, InternView, export
|
||||
from django.contrib import admin
|
||||
|
||||
urlpatterns = [
|
||||
path('', ExternView.as_view(), name='extern'),
|
||||
path('', index, name='index'),
|
||||
path('extern', ExternView.as_view(), name='extern'),
|
||||
# path('intern', InternView.as_view(), name='intern'),
|
||||
path('admin/', admin.site.urls),
|
||||
path('saved', done, name='done'),
|
||||
|
|
|
@ -70,6 +70,8 @@ def deny(request, choice, pk):
|
|||
def done(request):
|
||||
return HttpResponse("Deine Anfrage wurde gesendet. Du erhältst in Kürze eine E-Mail-Benachrichtigung mit deinen Angaben. Für alle Fragen kontaktiere bitte das Team Communitys und Engagement unter community@wikimedia.de.")
|
||||
|
||||
def index(request):
|
||||
return render(request, 'input/index.html')
|
||||
|
||||
class InternView(LoginRequiredMixin, CookieWizardView):
|
||||
'''This View is for WMDE-employees only'''
|
||||
|
|
Loading…
Reference in New Issue