From 3ebe96734e6c1690658bca9225e2b9f82ca14a70 Mon Sep 17 00:00:00 2001 From: Tom Price Date: Tue, 4 Nov 2014 00:11:04 +0000 Subject: [PATCH] Added buttons to view and edit people from index. Updated additional ajax realted template things --- .idea/PyRIGS.iml | 2 +- .idea/dataSources.xml | 2 +- PyRIGS/settings.py | 11 ++++++++++ RIGS/templates/RIGS/person_detail.html | 29 ++++++++++++++++++-------- RIGS/templates/RIGS/person_list.html | 7 ++++++- 5 files changed, 39 insertions(+), 12 deletions(-) diff --git a/.idea/PyRIGS.iml b/.idea/PyRIGS.iml index 28c5f8b9..f6cbf3c5 100644 --- a/.idea/PyRIGS.iml +++ b/.idea/PyRIGS.iml @@ -11,7 +11,7 @@ - + diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml index 5cabf5c9..f2b8fe89 100644 --- a/.idea/dataSources.xml +++ b/.idea/dataSources.xml @@ -4,7 +4,7 @@ sqlite.xerial org.sqlite.JDBC - jdbc:sqlite:$PROJECT_DIR$/db.sqlite3 + jdbc:sqlite:D:\Users\Ghost\PycharmProjects\pyrigs\db.sqlite3 diff --git a/PyRIGS/settings.py b/PyRIGS/settings.py index 8a47e84a..7f0eba3f 100644 --- a/PyRIGS/settings.py +++ b/PyRIGS/settings.py @@ -99,6 +99,17 @@ USE_L10N = True USE_TZ = True +TEMPLATE_CONTEXT_PROCESSORS = ( + "django.contrib.auth.context_processors.auth", + "django.core.context_processors.debug", + "django.core.context_processors.i18n", + "django.core.context_processors.media", + "django.core.context_processors.static", + "django.core.context_processors.tz", + "django.core.context_processors.request", + "django.contrib.messages.context_processors.messages", +) + # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.7/howto/static-files/ diff --git a/RIGS/templates/RIGS/person_detail.html b/RIGS/templates/RIGS/person_detail.html index a126e198..5e80cd98 100644 --- a/RIGS/templates/RIGS/person_detail.html +++ b/RIGS/templates/RIGS/person_detail.html @@ -4,15 +4,17 @@ {% block title %}{{ object.name }}{% endblock %} {% block content %} -
-

{{ object.name }}

+
+ {% if not request.is_ajax %} +

{{ object.name }}

-
- Edit -
-
-
+
+ Edit +
+ {% endif %} +
+
Name
{{ object.name }}
@@ -32,4 +34,13 @@
-{% endblock %} \ No newline at end of file +{% endblock %} + +{% if request.is_ajax %} + {% block footer %} +
+ Edit +
+ {% endblock %} +{% endif %} \ No newline at end of file diff --git a/RIGS/templates/RIGS/person_list.html b/RIGS/templates/RIGS/person_list.html index 46093097..7099a9df 100644 --- a/RIGS/templates/RIGS/person_list.html +++ b/RIGS/templates/RIGS/person_list.html @@ -28,7 +28,12 @@ {{ person.email }} {{ person.phone }} {{ person.notes|yesno|capfirst }} - Add buttons + + + + + + {% empty %}