Compare commits
No commits in common. "43ec6aafc496466cdbd991a21be6f33d8322eee1" and "20b90f410ee9ce296659a10445a2dd43158a1ca1" have entirely different histories.
43ec6aafc4
...
20b90f410e
9 changed files with 3 additions and 68 deletions
|
|
@ -1,11 +0,0 @@
|
|||
from django import forms
|
||||
from django.contrib.auth.forms import UserCreationForm
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
|
||||
class UserSignupForm(UserCreationForm):
|
||||
email = forms.EmailField()
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
fields = ["username", "email"]
|
||||
|
|
@ -37,30 +37,3 @@ a.group {
|
|||
color: var(--pico-color-zinc-500);
|
||||
margin-left: .5em;
|
||||
}
|
||||
|
||||
article.message {
|
||||
&::before {
|
||||
margin-right: .5em;
|
||||
font-family: remixicon;
|
||||
}
|
||||
&.debug::before {
|
||||
content: "\eb06";
|
||||
color: var(--pico-color-zinc-500);
|
||||
}
|
||||
&.info::before {
|
||||
content: "\ee58";
|
||||
color: var(--pico-color-indigo-600);
|
||||
}
|
||||
&.success::before {
|
||||
content: "\eb80";
|
||||
color: var(--pico-color-green-500);
|
||||
}
|
||||
&.warning::before {
|
||||
content: "\eca0";
|
||||
color: var(--pico-color-amber-200);
|
||||
}
|
||||
&.error::before {
|
||||
content: "\eca0";
|
||||
color: var(--pico-color-red-500);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% load form %}
|
||||
{% block content %}
|
||||
<h1>Créer un compte</h1>
|
||||
{% form form %}
|
||||
{% endblock content %}
|
||||
|
|
@ -11,7 +11,6 @@
|
|||
Musik
|
||||
{% endblock title %}
|
||||
</title>
|
||||
<link rel="icon" href="{% static "logo.svg" %}">
|
||||
<link rel="stylesheet" href="{% static "css/main.css" %}">
|
||||
<link rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.purple.min.css">
|
||||
|
|
@ -57,7 +56,6 @@
|
|||
</div>
|
||||
</header>
|
||||
<main class="container">
|
||||
{% for message in messages %}<article class="message {{ message.tags }}">{{ message }}</article>{% endfor %}
|
||||
{% block content %}
|
||||
{% endblock content %}
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -2,8 +2,5 @@
|
|||
{% load form %}
|
||||
{% block content %}
|
||||
<h1>Connexion</h1>
|
||||
<p>
|
||||
<a href="{% url "signup" %}">Créer un compte</a>
|
||||
</p>
|
||||
{% form form submit="Se connecter" %}
|
||||
{% endblock content %}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,5 @@ from . import views
|
|||
|
||||
urlpatterns = [
|
||||
path("", views.HomePageView.as_view(), name="index"),
|
||||
path("accounts/signup/", views.SignupView.as_view(), name="signup"),
|
||||
path("accounts/", include("django.contrib.auth.urls")),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,17 +1,5 @@
|
|||
from django.contrib.auth.models import User
|
||||
from django.contrib.messages.views import SuccessMessageMixin
|
||||
from django.views.generic.base import TemplateView
|
||||
from django.views.generic.edit import CreateView
|
||||
|
||||
from . import forms
|
||||
|
||||
|
||||
class HomePageView(TemplateView):
|
||||
template_name = "index.html"
|
||||
|
||||
|
||||
class SignupView(SuccessMessageMixin, CreateView):
|
||||
model = User
|
||||
form_class = forms.UserSignupForm
|
||||
success_url = "/"
|
||||
success_message = "Le compte %(username)s a été créé avec succès."
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@
|
|||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td colspan="4">Aucune musique.</td>
|
||||
<td colspan="2">Aucune musique.</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import googleapiclient.discovery
|
|||
from django.conf import settings
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.messages.views import SuccessMessageMixin
|
||||
from django.db.models import Count, Q
|
||||
from django.http import JsonResponse
|
||||
from django.shortcuts import get_object_or_404, redirect
|
||||
|
|
@ -47,9 +46,8 @@ class GroupUpdateView(OwnerFilterMixin, GroupMixin, UpdateView):
|
|||
pass
|
||||
|
||||
|
||||
class GroupDeleteView(OwnerFilterMixin, GroupMixin, SuccessMessageMixin, DeleteView):
|
||||
class GroupDeleteView(OwnerFilterMixin, GroupMixin, DeleteView):
|
||||
success_url = "/"
|
||||
success_message = "Le groupe a été supprimé avec succès."
|
||||
|
||||
|
||||
class GroupDetailView(MemberFilterMixin, GroupMixin, DetailView):
|
||||
|
|
@ -126,9 +124,8 @@ class GroupRemoveMemberView(View):
|
|||
return redirect(group)
|
||||
|
||||
|
||||
class GroupRemoveGameView(SingleObjectMixin, SuccessMessageMixin, View):
|
||||
class GroupRemoveGameView(SingleObjectMixin, View):
|
||||
model = models.MusikGame
|
||||
success_message = "Le jeu du %(date)s a été supprimé avec succès."
|
||||
|
||||
def get_queryset(self):
|
||||
return super().get_queryset().filter(group__owner=self.request.user)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue