mirror of https://gitlab.crans.org/bde/nk20
Add lorem ipsum, update WEI
This commit is contained in:
parent
8fe060847f
commit
69b7f31eed
|
@ -8,4 +8,3 @@ from django.utils.translation import gettext_lazy as _
|
||||||
class WeiConfig(AppConfig):
|
class WeiConfig(AppConfig):
|
||||||
name = 'wei'
|
name = 'wei'
|
||||||
verbose_name = _('WEI')
|
verbose_name = _('WEI')
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
|
||||||
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
from django import forms
|
||||||
|
from note_kfet.inputs import AmountInput, DatePickerInput
|
||||||
|
|
||||||
|
from .models import WEIClub
|
||||||
|
|
||||||
|
|
||||||
|
class WEIForm(forms.ModelForm):
|
||||||
|
class Meta:
|
||||||
|
model = WEIClub
|
||||||
|
exclude = ('parent_club', 'require_memberships', 'membership_duration', )
|
||||||
|
widgets = {
|
||||||
|
"membership_fee_paid": AmountInput(),
|
||||||
|
"membership_fee_unpaid": AmountInput(),
|
||||||
|
"membership_start": DatePickerInput(),
|
||||||
|
"membership_end": DatePickerInput(),
|
||||||
|
"date_start": DatePickerInput(),
|
||||||
|
"date_end": DatePickerInput(),
|
||||||
|
}
|
|
@ -193,7 +193,7 @@ class WEIRegistration(models.Model):
|
||||||
self.information_json = json.dumps(information)
|
self.information_json = json.dumps(information)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_1A(self):
|
def is_first_year(self):
|
||||||
"""
|
"""
|
||||||
We assume that a user is a new member if it not fully registered yet.
|
We assume that a user is a new member if it not fully registered yet.
|
||||||
"""
|
"""
|
||||||
|
@ -236,4 +236,3 @@ class WEIMembership(Membership):
|
||||||
related_name="membership",
|
related_name="membership",
|
||||||
verbose_name=_("WEI registration"),
|
verbose_name=_("WEI registration"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
import django_tables2 as tables
|
import django_tables2 as tables
|
||||||
from django.urls import reverse_lazy
|
from django.urls import reverse_lazy
|
||||||
|
|
||||||
from wei.models import WEIClub
|
from .models import WEIClub
|
||||||
|
|
||||||
|
|
||||||
class WEITable(tables.Table):
|
class WEITable(tables.Table):
|
||||||
|
|
|
@ -3,11 +3,12 @@
|
||||||
|
|
||||||
from django.urls import path
|
from django.urls import path
|
||||||
|
|
||||||
from .views import WEIListView, WEIDetailView
|
from .views import WEIListView, WEIDetailView, WEIUpdateView
|
||||||
|
|
||||||
|
|
||||||
app_name = 'wei'
|
app_name = 'wei'
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('list/', WEIListView.as_view(), name="wei_list"),
|
path('list/', WEIListView.as_view(), name="wei_list"),
|
||||||
path('detail/<int:pk>/', WEIDetailView.as_view(), name="wei_detail"),
|
path('detail/<int:pk>/', WEIDetailView.as_view(), name="wei_detail"),
|
||||||
|
path('update/<int:pk>/', WEIUpdateView.as_view(), name="wei_update"),
|
||||||
]
|
]
|
||||||
|
|
|
@ -6,17 +6,18 @@ from datetime import datetime
|
||||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from django.views.generic import DetailView
|
from django.urls import reverse_lazy
|
||||||
|
from django.views.generic import DetailView, UpdateView
|
||||||
from django_tables2 import SingleTableView
|
from django_tables2 import SingleTableView
|
||||||
|
|
||||||
from member.models import Membership
|
from member.models import Membership
|
||||||
from member.tables import MembershipTable
|
from member.tables import MembershipTable
|
||||||
from note.models import Transaction
|
from note.models import Transaction
|
||||||
from note.tables import HistoryTable
|
from note.tables import HistoryTable
|
||||||
from permission.backends import PermissionBackend
|
from permission.backends import PermissionBackend
|
||||||
from permission.views import ProtectQuerysetMixin
|
from permission.views import ProtectQuerysetMixin
|
||||||
from wei.models import WEIClub
|
|
||||||
|
|
||||||
|
from .models import WEIClub
|
||||||
|
from .forms import WEIForm
|
||||||
from .tables import WEITable
|
from .tables import WEITable
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,3 +69,15 @@ class WEIDetailView(ProtectQuerysetMixin, LoginRequiredMixin, DetailView):
|
||||||
.has_perm(self.request.user, "member.add_membership", empty_membership)
|
.has_perm(self.request.user, "member.add_membership", empty_membership)
|
||||||
|
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
||||||
|
class WEIUpdateView(ProtectQuerysetMixin, LoginRequiredMixin, UpdateView):
|
||||||
|
"""
|
||||||
|
Update the information of the WEI.
|
||||||
|
"""
|
||||||
|
model = WEIClub
|
||||||
|
context_object_name = "club"
|
||||||
|
form_class = WEIForm
|
||||||
|
|
||||||
|
def get_success_url(self):
|
||||||
|
return reverse_lazy("wei:wei_detail", kwargs={"pk": self.object.pk})
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
{% load static %}
|
||||||
|
{% load i18n %}
|
||||||
|
{% load crispy_forms_tags %}
|
||||||
|
{% block content %}
|
||||||
|
<form method="post">
|
||||||
|
{% csrf_token %}
|
||||||
|
{{ form|crispy }}
|
||||||
|
<button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
|
||||||
|
</form>
|
||||||
|
{% endblock %}
|
|
@ -54,10 +54,11 @@
|
||||||
<a class="btn btn-primary btn-sm my-1" href="{% url 'member:club_add_member' club_pk=club.pk %}"> {% trans "Register 2A+" %}</a>
|
<a class="btn btn-primary btn-sm my-1" href="{% url 'member:club_add_member' club_pk=club.pk %}"> {% trans "Register 2A+" %}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if ".change_"|has_perm:club %}
|
{% if ".change_"|has_perm:club %}
|
||||||
<a class="btn btn-primary btn-sm my-1" href="{% url 'member:club_update' pk=club.pk %}"> {% trans "Edit" %}</a>
|
<a class="btn btn-primary btn-sm my-1" href="{% url 'wei:wei_update' pk=club.pk %}"> {% trans "Edit" %}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% url 'wei:wei_detail' club.pk as club_detail_url %}
|
{% url 'wei:wei_detail' club.pk as club_detail_url %}
|
||||||
{%if request.path_info != club_detail_url %}
|
{%if request.path_info != club_detail_url %}
|
||||||
<a class="btn btn-primary btn-sm my-1" href="{{ club_detail_url }}">{% trans 'View WEI' %}</a>
|
<a class="btn btn-primary btn-sm my-1" href="{{ club_detail_url }}">{% trans 'View WEI' %}</a>
|
||||||
{% endif %} </div>
|
{% endif %}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,62 @@
|
||||||
{% load render_table from django_tables2 %}
|
{% load render_table from django_tables2 %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header text-center">
|
||||||
|
<h4>WEI</h4>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<p>LE WEI, c'est cool !</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
|
||||||
|
magna aliqua. Dapibus ultrices in iaculis nunc sed augue. In hendrerit gravida rutrum quisque non tellus orci
|
||||||
|
ac. Massa vitae tortor condimentum lacinia quis vel eros. Elit ut aliquam purus sit amet. Aliquam faucibus
|
||||||
|
purus in massa tempor. Quisque id diam vel quam elementum pulvinar etiam non. Condimentum id venenatis a
|
||||||
|
condimentum vitae sapien pellentesque habitant. Egestas congue quisque egestas diam in. Vestibulum rhoncus
|
||||||
|
est pellentesque elit ullamcorper. Massa sed elementum tempus egestas sed sed. Sapien pellentesque habitant
|
||||||
|
morbi tristique. Lectus vestibulum mattis ullamcorper velit sed ullamcorper morbi tincidunt ornare. Sed
|
||||||
|
adipiscing diam donec adipiscing. Leo integer malesuada nunc vel risus commodo viverra maecenas.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Fusce id velit ut tortor pretium viverra suspendisse. Urna condimentum mattis pellentesque id nibh tortor id
|
||||||
|
aliquet. Vel facilisis volutpat est velit egestas dui. Turpis egestas sed tempus urna et pharetra pharetra
|
||||||
|
massa massa. Eget nunc scelerisque viverra mauris in. Etiam dignissim diam quis enim. Urna cursus eget nunc
|
||||||
|
scelerisque viverra mauris in aliquam sem. Amet porttitor eget dolor morbi non arcu risus quis. Ullamcorper
|
||||||
|
sit amet risus nullam eget felis. Ullamcorper eget nulla facilisi etiam dignissim diam quis. Enim nulla
|
||||||
|
aliquet porttitor lacus luctus accumsan tortor. Urna condimentum mattis pellentesque id nibh tortor id.
|
||||||
|
Feugiat in fermentum posuere urna nec. Risus nec feugiat in fermentum posuere urna nec tincidunt. Porttitor
|
||||||
|
massa id neque aliquam vestibulum morbi. Diam quis enim lobortis scelerisque. Ornare massa eget egestas
|
||||||
|
purus. Ut tortor pretium viverra suspendisse. Purus in mollis nunc sed. Tristique magna sit amet purus
|
||||||
|
gravida.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Ut porttitor leo a diam sollicitudin tempor. Viverra nam libero justo laoreet sit amet cursus sit amet.
|
||||||
|
Lectus arcu bibendum at varius vel pharetra vel turpis nunc. Vivamus arcu felis bibendum ut tristique et
|
||||||
|
egestas quis ipsum. Parturient montes nascetur ridiculus mus mauris. A cras semper auctor neque vitae
|
||||||
|
tempus quam pellentesque. Netus et malesuada fames ac. Mauris in aliquam sem fringilla ut. Sapien
|
||||||
|
pellentesque habitant morbi tristique. Mauris sit amet massa vitae tortor condimentum. Sagittis
|
||||||
|
aliquam malesuada bibendum arcu vitae elementum curabitur vitae nunc. Amet consectetur adipiscing elit
|
||||||
|
duis tristique sollicitudin nibh sit. Nunc mattis enim ut tellus elementum. Sapien eget mi proin sed libero
|
||||||
|
enim. Pulvinar sapien et ligula ullamcorper. Nibh mauris cursus mattis molestie a iaculis at erat
|
||||||
|
pellentesque. Molestie at elementum eu facilisis. Velit sed ullamcorper morbi tincidunt. Quam vulputate
|
||||||
|
dignissim suspendisse in est ante.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Id cursus metus aliquam eleifend mi. Eu turpis egestas pretium aenean pharetra magna ac. Faucibus ornare
|
||||||
|
suspendisse sed nisi lacus sed viverra tellus. Sed vulputate mi sit amet mauris commodo. Lacus laoreet non
|
||||||
|
curabitur gravida arcu ac. At ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget. Fusce ut
|
||||||
|
placerat orci nulla pellentesque dignissim. Quis blandit turpis cursus in hac habitasse platea dictumst
|
||||||
|
quisque. Tellus id interdum velit laoreet id donec ultrices. Risus feugiat in ante metus dictum. Velit ut
|
||||||
|
tortor pretium viverra suspendisse. Lacus vel facilisis volutpat est velit egestas dui id. Nunc eget lorem
|
||||||
|
dolor sed viverra ipsum nunc aliquet bibendum. Varius quam quisque id diam vel quam. Orci dapibus ultrices
|
||||||
|
in iaculis. Neque gravida in fermentum et sollicitudin ac orci.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% if member_list.data %}
|
{% if member_list.data %}
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header position-relative" id="clubListHeading">
|
<div class="card-header position-relative" id="clubListHeading">
|
||||||
|
|
Loading…
Reference in New Issue