From a21815ba49a77d52196a8245b5feb98a564f6774 Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Mon, 27 Mar 2017 12:53:45 +0200
Subject: [PATCH] old unused code removed

---
 smash/web/templates/appointments/index.html | 40 ---------------------
 smash/web/urls.py                           |  2 --
 smash/web/views/appointment.py              | 15 +-------
 3 files changed, 1 insertion(+), 56 deletions(-)

diff --git a/smash/web/templates/appointments/index.html b/smash/web/templates/appointments/index.html
index 94a7f026..703c851c 100644
--- a/smash/web/templates/appointments/index.html
+++ b/smash/web/templates/appointments/index.html
@@ -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>
diff --git a/smash/web/urls.py b/smash/web/urls.py
index 9fb19ef8..1e503772 100644
--- a/smash/web/urls.py
+++ b/smash/web/urls.py
@@ -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'),
diff --git a/smash/web/views/appointment.py b/smash/web/views/appointment.py
index d0a4582f..279f44fa 100644
--- a/smash/web/views/appointment.py
+++ b/smash/web/views/appointment.py
@@ -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
-- 
GitLab