This commit is contained in:
HugoNeveux 2020-04-25 19:15:27 +02:00
commit a9030ac398
5 changed files with 62 additions and 3 deletions

1
.gitignore vendored
View File

@ -119,3 +119,4 @@ dmypy.json
.pyre/ .pyre/
# End of https://www.gitignore.io/api/django # End of https://www.gitignore.io/api/django
.idea/

View File

@ -19,6 +19,7 @@ import store, front, doc
urlpatterns = [ urlpatterns = [
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
path('accounts/', include('django.contrib.auth.urls')),
path('', include('front.urls'), name='front'), path('', include('front.urls'), name='front'),
path('store/', include('store.urls'), name='store'), path('store/', include('store.urls'), name='store'),
path('doc/', include('doc.urls'), name='doc'), path('doc/', include('doc.urls'), name='doc'),

View File

@ -20,8 +20,8 @@ from . import views
urlpatterns = [ urlpatterns = [
path('', TemplateView.as_view(template_name='store/index.html'), name='store_front_page'), path('', TemplateView.as_view(template_name='store/index.html'), name='store_front_page'),
path('login/', views.CustomLoginView.as_view(), name='login'), path('login/', views.CustomLoginView.as_view(), name='login_modal'),
path('signup/', views.SignUpView.as_view(), name='signup'), path('signup/', views.SignUpView.as_view(), name='signup_modal'),
path('logout/', LogoutView.as_view(), name='logout'), #path('logout/', LogoutView.as_view(), name='logout'),
path('upload/', views.UploadView.as_view(), name='upload'), path('upload/', views.UploadView.as_view(), name='upload'),
] ]

View File

@ -43,6 +43,8 @@
</nav> </nav>
{% block body %} {% block body %}
{% endblock %} {% endblock %}
</main>
{% block footer %}
{% include "base/legal.html" %} {% include "base/legal.html" %}
<script src="https://code.jquery.com/jquery-3.5.0.min.js" integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ=" crossorigin="anonymous"></script> <script src="https://code.jquery.com/jquery-3.5.0.min.js" integrity="sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ=" crossorigin="anonymous"></script>
<script src="{% static 'js/jquery.bootstrap.modal.forms.min.js' %}"></script> <script src="{% static 'js/jquery.bootstrap.modal.forms.min.js' %}"></script>

View File

@ -0,0 +1,55 @@
{% extends 'base/base.html' %}
{% block extra_static %}
<style>
body {
margin: 50px;
}
</style>
{% endblock %}
{% block body %}
<div class="row justify-content-center align-items-center">
<div class="card col-md-4">
<div class="card-body">
<h4 class="card-title">Login</h4>
{% if form.errors %}
<p>Your username and password didn't match. Please try again.</p>
{% endif %}
{% if next %}
{% if user.is_authenticated %}
<p>Your account doesn't have access to this page. To proceed,
please login with an account that has access.</p>
{% else %}
<p>Please login to see this page.</p>
{% endif %}
{% endif %}
<form method="post" action="{% url 'login' %}">
{% csrf_token %}
<div class="form-group">
<label for="{{ form.username.id_for_label }}">{{ form.username.label }}:</label>
<input id="{{ form.username.id_for_label }}" type="text" class="form-control"
name="{{ form.username.name }}" autofocus autocapitalize="none" autocomplete="username"
required
placeholder="Username">
</div>
<div class="form-group">
<label for="{{ form.password.id_for_label }}">{{ form.password.label }}:</label>
<input id="{{ form.password.id_for_label }}" type="password" class="form-control"
name="{{ form.password.name }}" required autocomplete="password"
placeholder="Password">
<a class="float-right" href="{% url 'password_reset' %}">Forgot?</a>
</div>
<input type="submit" class="btn btn-primary" value="login">
<input type="hidden" name="next" value="{{ next }}">
</form>
</div>
</div>
</div>
{% endblock %}
{% block footer %}
{% endblock %}