diff --git a/mainapp/migrations/0034_auto_20180817_1206.py b/mainapp/migrations/0034_auto_20180817_1206.py new file mode 100644 index 000000000..ef2543a6e --- /dev/null +++ b/mainapp/migrations/0034_auto_20180817_1206.py @@ -0,0 +1,28 @@ +# Generated by Django 2.1 on 2018-08-17 06:36 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('mainapp', '0033_auto_20180817_1003'), + ] + + operations = [ + migrations.AddField( + model_name='rescuecamp', + name='latlng', + field=models.CharField(blank=True, help_text="Comma separated latlng field. Leave blank if you don't know it", max_length=100, verbose_name='GPS Coordinates'), + ), + migrations.AddField( + model_name='rescuecamp', + name='map_link', + field=models.CharField(blank=True, help_text='Copy and paste the full Google Maps link', max_length=250, null=True, verbose_name='Map link'), + ), + migrations.AlterField( + model_name='person', + name='address', + field=models.TextField(blank=True, max_length=150, null=True, verbose_name='Address - വിലാസം'), + ), + ] diff --git a/mainapp/migrations/0034_auto_20180817_1337.py b/mainapp/migrations/0034_auto_20180817_1337.py new file mode 100644 index 000000000..069f024af --- /dev/null +++ b/mainapp/migrations/0034_auto_20180817_1337.py @@ -0,0 +1,25 @@ +# Generated by Django 2.1 on 2018-08-17 08:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('mainapp', '0033_auto_20180817_1003'), + ] + + operations = [ + migrations.AddField( + model_name='rescuecamp', + name='taluk', + field=models.CharField(default=' ', max_length=50, verbose_name='Taluk'), + preserve_default=False, + ), + migrations.AddField( + model_name='rescuecamp', + name='village', + field=models.CharField(default=' ', max_length=50, verbose_name='Village'), + preserve_default=False, + ), + ] diff --git a/mainapp/models.py b/mainapp/models.py index 7b849eb3b..0d0ee4917 100644 --- a/mainapp/models.py +++ b/mainapp/models.py @@ -216,10 +216,14 @@ class RescueCamp(models.Model): max_length=15, choices=districts ) + taluk = models.CharField(max_length=50,verbose_name="Taluk") + village = models.CharField(max_length=50,verbose_name="Village") contacts = models.TextField(verbose_name="Phone Numbers",blank=True,null=True) data_entry_user = models.ForeignKey(User,models.SET_NULL,blank=True,null=True) + map_link = models.CharField(max_length=250, verbose_name='Map link',blank=True,null=True,help_text="Copy and paste the full Google Maps link") + latlng = models.CharField(max_length=100, verbose_name='GPS Coordinates', blank=True,help_text="Comma separated latlng field. Leave blank if you don't know it") class Meta: - verbose_name = 'Relief Camp' + verbose_name = 'Relief Camp' def __str__(self): return self.name @@ -233,7 +237,7 @@ class Person(models.Model): verbose_name='Gender - ലിംഗം', null=True,blank=True ) - address = models.CharField(max_length=150,null=True,blank=True,verbose_name="Address - വിലാസം") + address = models.TextField(max_length=150,null=True,blank=True,verbose_name="Address - വിലാസം") district = models.CharField( max_length = 15, choices = districts, @@ -245,5 +249,3 @@ class Person(models.Model): added_at = models.DateTimeField(auto_now_add=True) def __str__(self): return self.name - - diff --git a/mainapp/templates/mainapp/add_person.html b/mainapp/templates/mainapp/add_person.html index 87886f280..ff4bf9d06 100644 --- a/mainapp/templates/mainapp/add_person.html +++ b/mainapp/templates/mainapp/add_person.html @@ -36,4 +36,10 @@

{{ message }}

+ + + {% endblock %} diff --git a/mainapp/templates/mainapp/districtmanager_list.html b/mainapp/templates/mainapp/districtmanager_list.html index ec34f1bc7..88e9eb4e6 100644 --- a/mainapp/templates/mainapp/districtmanager_list.html +++ b/mainapp/templates/mainapp/districtmanager_list.html @@ -14,9 +14,9 @@
- - - + + + {% for req in filter.qs %} diff --git a/mainapp/templates/mainapp/error.html b/mainapp/templates/mainapp/error.html new file mode 100644 index 000000000..ba931d23a --- /dev/null +++ b/mainapp/templates/mainapp/error.html @@ -0,0 +1,9 @@ +{% extends 'base.html' %} +{% load bootstrap3 %} + +{% block content %} +
+

Error

+

{{ error_text }}

+
+{% endblock %} diff --git a/mainapp/templates/mainapp/relief_camps.html b/mainapp/templates/mainapp/relief_camps.html index e48080745..0c252b19f 100644 --- a/mainapp/templates/mainapp/relief_camps.html +++ b/mainapp/templates/mainapp/relief_camps.html @@ -26,13 +26,26 @@

+
+ +
+

Select District to see Relief Camps

+
+ +
+ {{ filter.form }} + + + +{% if relief_camps.count > 0 %}

NamePhoneEmailName - പേര്Phone - ഫോൺOther Contact - മറ്റ് കോൺടാക്റ്റ്
+ - + {% for item in relief_camps %} @@ -42,10 +55,13 @@

{{ item.name }}

+
District Camp NameMap AddressContactContact Numbers Registrations
- {{ item.location | linebreaks }} + {% if item.map_link %} Map Link {% else %} N/A {% endif %} - {{ item.contacts }} + {{ item.location | linebreaks }} + {{ item.count }} @@ -54,4 +70,21 @@

{% endfor %}

+{% elif district_chosen %} +
+ No relief camps listed for this district yet. +
+{% endif %} + + + + {% endblock %} diff --git a/mainapp/templates/mainapp/request_details.html b/mainapp/templates/mainapp/request_details.html new file mode 100644 index 000000000..728abdf9c --- /dev/null +++ b/mainapp/templates/mainapp/request_details.html @@ -0,0 +1,53 @@ +{% extends 'base.html' %} +{% load bootstrap3 %} + +{% block content %} + +
+ {{ filter.form.as_p }} + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Request details
District : {{ req.get_district_display }}
Location : {{ req.location }}
GPS Location : + {% if not req.is_request_for_others and req.latlng %} + Open in maps +
+ Accuracy: {{ req.latlng_accuracy }} + {% else %} + NA + {% endif %} +
Requestee : {{ req.requestee }}
Contact number : {{ req.requestee_phone }}
Summary of request : {{ req.summarise | linebreaks }}
Date : {{ req.dateadded }}
+ +
+{% endblock %} diff --git a/mainapp/templates/mainapp/request_list.html b/mainapp/templates/mainapp/request_list.html index 96af599df..c4c718bb7 100644 --- a/mainapp/templates/mainapp/request_list.html +++ b/mainapp/templates/mainapp/request_list.html @@ -1,43 +1,86 @@ {% extends 'base.html' %} {% load bootstrap3 %} +{% block css %} + +{% endblock %} + {% block content %}
{{ filter.form.as_p }}
-
+
- - - - - - - - - + + + + + + + + + + + {% for req in data %} - - - + + {% endfor %} - +
DistrictLocationGPS LocationRequesteeContact numberSummary of requestDate
DistrictLocationRequesteePhoneDateMore details
{{ req.get_district_display }} {{ req.location }} - {% if not req.is_request_for_others and req.latlng %} - Open in maps -
- Accuracy: {{ req.latlng_accuracy }} - {% else %} - NA - {% endif %} -
{{ req.requestee }}{{ req.requestee_phone }}{{ req.summarise | linebreaks }}{{ req.requestee_phone }} {{ req.dateadded }}More details