dos not work

This commit is contained in:
Qwann 2018-10-12 18:04:27 +02:00
parent 1042b9f9e4
commit abdd893309
5 changed files with 61 additions and 2 deletions

View file

@ -0,0 +1,12 @@
{% extends "shared/fluid.html" %}
{% load i18n staticfiles event_tags %}
{% block extra_js %}
{{ block.super }}
<script type="text/javascript" src="{% static "js/enrol_event.js" %}"></script>
{% endblock %}
{% block content %}
lolilol
{% endblock %}

View file

@ -1,10 +1,11 @@
from django.conf.urls import url
from event.views import Index, EventView, ActivityView, EnrolActivityView
from event.views import Index, EventView, ActivityView, EnrolActivityView, EventCalendar
app_name = 'event'
urlpatterns = [
# url(r'^$', Index.as_view(), name='index'),
url(r'^(?P<slug>[-\w]+)/$', EventView.as_view(), name='event'),
url(r'^(?P<slug>[-\w]+)/calendar$', EventCalendar.as_view(), name='calendar'),
url(r'^activity/(?P<pk>[0-9]+)/$', ActivityView.as_view(),
name='activity'),
url(r'^activity/(?P<pk>[0-9]+)/enrol/$',

View file

@ -12,6 +12,19 @@ class Index(TemplateView):
template_name = "event/index.html"
class EventCalendar(LoginRequiredMixin, DetailView):
model = Event
template_name = 'event/calendar.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
event = self.object
context['activities'] = (Activity.objects.filter(event=event)
.order_by('beginning').prefetch_related(
'tags', 'places', 'staff', 'parent'))
return context
class EventView(LoginRequiredMixin, DetailView):
model = Event
template_name = 'event/event.html'

View file

@ -32,6 +32,7 @@
</header>
<div id="principal">
{% block principal %}
<div class="container">
{% if messages %}
@ -66,8 +67,9 @@
</aside>
{% endblock %}
</div>
</div><!-- /.container -->
{% endblock %}
</div><!-- /#principal -->
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

View file

@ -0,0 +1,31 @@
{% extends "shared/base.html" %}
{% load i18n %}
{% block principal %}
<div class="container-fluid">
{% if messages %}
<div class="row">
{% for message in messages %}
<div class="alert message-{{ message.tags }} alter-dismissible fade in" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="{% trans "Close" %}">
<span aria-hidden="true">×</span>
</button>
<strong>
{% if message.level == DEFAULT_MESSAGE_LEVELS.DEBUG %}{% trans "DEBUG" %}&#8239;:
{% elif message.level == DEFAULT_MESSAGE_LEVELS.INFO %}{% trans "Info"%}&#8239;:
{% elif message.level == DEFAULT_MESSAGE_LEVELS.SUCCESS %}{% trans "Succès"%}&#8239;:
{% elif message.level == DEFAULT_MESSAGE_LEVELS.WARNING %}{% trans "Attention" %}&#8239;:
{% elif message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}{% trans "Erreur" %}&#8239;:
{% endif %}
</strong>
{{ message }}
</div>
{% endfor %}
</div>
{% endif %}
<div class="row">
{% block content %}{% endblock %}
</div>
</div><!-- /.container -->
{% endblock %}