Revision a87d6ad7
Added by Jérôme Schneider over 12 years ago
calebasse/agenda/appointments.py | ||
---|---|---|
11 | 11 |
|
12 | 12 |
def __init__(self, title=None, begin_time=None, type=None, |
13 | 13 |
length=None, description=None, room=None, convocation_sent=None, |
14 |
service_name=None, patient_record_id=None): |
|
14 |
service_name=None, patient_record_id=None, event_id=None):
|
|
15 | 15 |
""" """ |
16 | 16 |
self.title = title |
17 | 17 |
self.type = type |
... | ... | |
21 | 21 |
self.convocation_sent = None |
22 | 22 |
self.service_name = None |
23 | 23 |
self.patient_record_id = None |
24 |
self.event_id = None |
|
24 | 25 |
self.__set_time(begin_time) |
25 | 26 |
|
26 | 27 |
def __set_time(self, time): |
... | ... | |
41 | 42 |
else: |
42 | 43 |
self.type = "busy-elsewhere" |
43 | 44 |
self.service_name = service.name |
45 |
self.event_id = occurrence.event.id |
|
44 | 46 |
if occurrence.event.room: |
45 | 47 |
self.room = occurrence.event.room.name |
46 | 48 |
self.description = occurrence.event.description |
calebasse/agenda/templates/agenda/index.html | ||
---|---|---|
46 | 46 |
$('#'+anchor.substr(1)).each(function (i, worker_selector) { toggle_worker(worker_selector); }); |
47 | 47 |
}); |
48 | 48 |
|
49 |
$('.textedit').on('keydown', function() { |
|
50 |
$('button', this).removeAttr("disabled"); |
|
51 |
}); |
|
52 |
$('.textedit button').on('click', function() { |
|
53 |
var textarea = $(this).prev(); |
|
54 |
$.ajax({ |
|
55 |
url: '/api/event/' + $(this).data("event-id") + '/?format=json', |
|
56 |
type: 'PATCH', |
|
57 |
contentType: 'application/json', |
|
58 |
data: '{"description": "' + textarea.val() + '"}' |
|
59 |
}); |
|
60 |
}); |
|
61 |
|
|
62 |
|
|
49 | 63 |
/* Gestion du filtre sur les utilisateurs */ |
50 | 64 |
$('#filtre input').keyup(function() { |
51 | 65 |
var filtre = $(this).val(); |
... | ... | |
219 | 233 |
{% if appointment.type == 'free' %}<button class='booking' data-hour="{{ appointment.begin_hour }}">Prendre un rendez-vous</button> {% endif %} |
220 | 234 |
{% if appointment.description %} |
221 | 235 |
<div class="tabs-worker-{{ worker_agenda.worker.id }} textedit"> |
222 |
<textarea>{{ appointment.description }}</textarea> |
|
223 |
<button disabled="disabled">✔</button>
|
|
236 |
<textarea>{{ appointment.description }}</textarea>
|
|
237 |
<button disabled="disabled" data-event-id="{{ appointment.event_id }}">✔</button>
|
|
224 | 238 |
</div> |
225 | 239 |
{% endif %} |
226 | 240 |
{% if appointment.patient_record_id %} |
... | ... | |
243 | 257 |
</table> |
244 | 258 |
</div> |
245 | 259 |
|
260 |
|
|
246 | 261 |
{% endblock %} |
247 | 262 |
|
248 | 263 |
{% block dialogs %} |
calebasse/api.py | ||
---|---|---|
1 | 1 |
|
2 |
from tastypie.authorization import DjangoAuthorization |
|
2 | 3 |
from tastypie.resources import ModelResource |
3 | 4 |
from calebasse.agenda.models import Event |
4 | 5 |
|
... | ... | |
7 | 8 |
class Meta: |
8 | 9 |
queryset = Event.objects.all() |
9 | 10 |
resource_name = 'event' |
11 |
authorization = DjangoAuthorization() |
calebasse/urls.py | ||
---|---|---|
31 | 31 |
(r'^$', redirect_to, { 'url': '/cmpp/' }), |
32 | 32 |
url(r'^admin/', include(admin.site.urls)), |
33 | 33 |
url(r'^accounts/', include('django.contrib.auth.urls')), |
34 |
url(r'^api/', include(event_resource.urls)),
|
|
34 |
url(r'^api/', decorated_includes(login_required, include(event_resource.urls))),
|
|
35 | 35 |
url(r'^(?P<service>[a-z-]+)/', decorated_includes(login_required, |
36 | 36 |
include(service_patterns))), |
37 | 37 |
url(r'^lookups/', include('ajax_select.urls')), |
Also available in: Unified diff
agenda: description is now editable