Skip to content
Snippets Groups Projects
Commit a21815ba authored by Piotr Gawron's avatar Piotr Gawron
Browse files

old unused code removed

parent c8311676
No related branches found
No related tags found
1 merge request!27Resolve "there should be a way to add an appointment with external person (neither a subject nor control)"
Pipeline #
......@@ -24,46 +24,6 @@
{% block maincontent %}
<div class="row">
<div class="col-md-5">
<h3>Planning</h3>
{% if planning_list %}
<table id="planning_table" class="table table-bordered table-striped">
<thead>
<tr>
<th>Subject name</th>
<th>Subject's details</th>
<th>Suggested date</th>
<th>Plan/Modify</th>
</tr>
</thead>
<tbody>
{% for planned in planning_list %}
<tr>
<td>{{ planned.visit.subject.first_name }} {{ planned.visit.subject.last_name }}</td>
<td>
<a href="{% url 'web.views.subject_edit' planned.visit.subject.id %}" type="button"
class="btn btn-block btn-default">Subject's details</a>
</td>
<td>
{{ planned.datetime_when }}
</td>
<td>
<a href="{% url 'web.views.appointment_edit_datetime' planned.id %}" type="button"
class="btn btn-block btn-default">Plan/Modify</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No visits to plan in close future.</p>
{% endif %}
<hr/>
<h3>Approaching</h3>
{% if approaching_list %}
<table id="approaching_table" class="table table-bordered table-striped">
<thead>
......
......@@ -28,8 +28,6 @@ urlpatterns = [
url(r'^appointments/add/(?P<visit_id>\d+)$', views.appointment.appointment_add, name='web.views.appointment_add'),
url(r'^appointments/add/general$', views.appointment.appointment_add, name='web.views.appointment_add'),
url(r'^appointments/edit/(?P<id>\d+)$', views.appointment.appointment_edit, name='web.views.appointment_edit'),
url(r'^appointments/edit_datetime/(?P<id>\d+)$', views.appointment.appointment_edit_datetime,
name='web.views.appointment_edit_datetime'),
url(r'^visits$', views.visit.visits, name='web.views.visits'),
url(r'^visits/exceeded$', views.visit.exceeded_visits, name='web.views.exceeded_visits'),
......
......@@ -99,17 +99,4 @@ def appointment_edit(request, id):
'subject_form': subject_form,
'id': id,
'appointment': the_appointment
})
def appointment_edit_datetime(request, id):
the_appointment = get_object_or_404(Appointment, id=id)
if request.method == 'POST':
form = AppointmentEditForm(request.POST, request.FILES, instance=the_appointment, user=request.user)
if form.is_valid():
form.save()
return redirect('web.views.appointments')
else:
the_appointment.datetime_when = the_appointment.visit.datetime_begin
form = AppointmentEditForm(instance=the_appointment, user=request.user)
return wrap_response(request, 'appointments/edit.html', {'form': form})
})
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment