Project

General

Profile

« Previous | Next » 

Revision 7cd2f6fb

Added by Jérôme Schneider almost 13 years ago

actes: fix new act dialog

Fix #2792

  • actes/templates/actes/act_listing.html: cleaning
  • actes/templates/actes/act_update.html: fix new act dialog
  • actes/urls.py: rename url nouvel-acte to new-act
  • actes/views.py: fix new act
  • agenda/templates/agenda/base.html: rename /spam to /span
  • dossiers/views.py: cut lines to 80 characters

View differences:

calebasse/actes/templates/actes/act_listing.html
{% extends "calebasse/base.html" %}
{% load url from future %}
{% block extrascripts %}
{{ block.super }}
<script src="{{ STATIC_URL }}js/calebasse.datesel.js"></script>
<script src="{{ STATIC_URL }}js/calebasse.dialog.js"></script>
<script>
$(function() {
$('table#actes tr').click(function() {
......
}
});
$('.date').datepicker();
$('#new-acte').click(function() {
$('#new-acte-dlg').dialog({title: 'Nouvel acte',
width: '550px',
buttons: [ { text: "Fermer",
click: function() { $(this).dialog("close"); } },
{ text: "Ajouter",
click: function() { $(this).dialog("close"); } }
]}
);
$('.new-act').click(function() {
generic_ajaxform_dialog($(this).data('url'), 'Nouvel acte',
'#acte-dlg', '850px', 'Ajouter', '..');
});
$('#search-form input[type="checkbox"]').on('change', function () {
$('#search-form').submit();
......
<div id="appbar">
<h2>Saisie des actes</h2>
<a href="../..">Retourner à l'accueil</a>
<button class="dialog-button"
data-url="nouvel-acte/"
data-default-button="Ajouter"
>Ajouter un acte</button>
<button class="new-act"
data-url="{% url 'act-new' service=service date=date %}">
Ajouter un acte
</button>
</div>
{% endblock %}
calebasse/actes/templates/actes/act_update.html
{% for state in object.actvalidationstate_set.all %}
<li>{{ state }} le {{ state.created }}</li>
{% endfor %}
<!-- <li>Rendez-vous pris le 5 juillet 2012 à 10:36</li>
<li>Acte validé le 10 août 2012 à 9h10</li>
<li>En cours de facturation (123) <button class="flat">Acte perdu</button></li> -->
</ul>
</td>
</tr>
calebasse/actes/urls.py
act_patterns = patterns('calebasse.actes.views',
url(r'^$', 'act_listing', name='act-listing'),
url(r'^nouvel-acte/$', 'act_new', name='act-new'),
url(r'^act-new/$', 'act_new', name='act-new'),
url(r'^(?P<pk>\d+)/update$', update_act),
)
calebasse/actes/views.py
from django.shortcuts import redirect
from calebasse.cbv import ListView, UpdateView
from calebasse.agenda import views as agenda_views
from calebasse.agenda.views import NewAppointmentView
import models
import forms
......
return ctx
act_listing = ActListingView.as_view()
act_new = agenda_views.NewAppointmentView.as_view()
act_new = NewAppointmentView.as_view()
class UpdateActView(UpdateView):
model = models.Act
calebasse/agenda/templates/agenda/base.html
{% block header %}
{{ block.super }}
<span>Agenda - {{ service_name }}</spam>
<span>Agenda - {{ service_name }}</span>
{% endblock %}
{% block content %}
calebasse/dossiers/views.py
))) \
.distinct() \
.select_related() \
.prefetch_related('participants', 'exceptions__eventwithact', 'act_set__actvalidationstate_set')
.prefetch_related('participants', 'exceptions__eventwithact',
'act_set__actvalidationstate_set')
occurrences = []
for event in qs:
occurrences.extend(filter(lambda e: e.start_datetime.date() >= today, event.all_occurences(limit=180)))
occurrences.extend(filter(lambda e: e.start_datetime.date() >= today,
event.all_occurences(limit=180)))
occurrences = sorted(occurrences, key=lambda e: e.start_datetime)
for event in occurrences:
state = None

Also available in: Unified diff