From 8be700961b764dfbc03011f0b775080acb3669f3 Mon Sep 17 00:00:00 2001 From: Jacob Thomas Date: Tue, 21 Aug 2018 02:05:26 -0500 Subject: [PATCH 01/24] add contrib updates --- mainapp/models.py | 27 +++++++++++++++++++++++++++ mainapp/urls.py | 2 ++ mainapp/views.py | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) diff --git a/mainapp/models.py b/mainapp/models.py index 97c14f947..678f8c4c5 100644 --- a/mainapp/models.py +++ b/mainapp/models.py @@ -73,6 +73,13 @@ ('M', 'Medium'), ('L', 'Low')] +contributor_update_status_types = ( + ('hig', 'High priority'), + ('med', 'Medium priority'), + ('low', 'Low priority'), + ('cls', 'Can be closed'), + ('otr', 'Other') +) class Request(models.Model): @@ -424,3 +431,23 @@ class Meta: def __str__(self): return self.document_name + +class ContributorUpdate(models.Model): + contributor = models.ForeignKey(Contributor, on_delete=models.CASCADE) + status = models.CharField( + max_length = 10, + choices = contributor_update_status_types + ) + + other_status = models.CharField(max_length=255, verbose_name='Please specify other status', default='', blank=True) + updater_name = models.CharField(max_length=100, verbose_name='Name of person or group updating', blank=False) + + phone_number_regex = RegexValidator(regex='^((\+91|91|0)[\- ]{0,1})?[456789]\d{9}$', message='Please Enter 10/11 digit mobile number or landline as 0', code='invalid_mobile') + updater_phone = models.CharField(max_length=14,verbose_name='Phone number of person or group updating', validators=[phone_number_regex]) + + notes = models.TextField(verbose_name='Contributor comments', blank=True) + + update_ts = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return self.get_status_display() \ No newline at end of file diff --git a/mainapp/urls.py b/mainapp/urls.py index 6da6b7711..7db8d3644 100644 --- a/mainapp/urls.py +++ b/mainapp/urls.py @@ -45,4 +45,6 @@ path('announcements/', views.announcements, name="Announcements"), path('camp_requirements/', views.camp_requirements_list, name='camp_requirements_list'), path('submission_success/', views.SubmissionSuccess.as_view(), name='submission_success'), + url(r'contributor_update/(?P\d+)/$', views.ContributorUpdateView.as_view(), name='contributorupdateview'), + path('contributor_update_success/', views.ContributorUpdateSuccess.as_view(), name='contributor_update_success') ] diff --git a/mainapp/views.py b/mainapp/views.py index 90ffae6d4..44de16fce 100644 --- a/mainapp/views.py +++ b/mainapp/views.py @@ -704,3 +704,42 @@ def camp_requirements_list(request): page = request.GET.get('page') data = paginator.get_page(page) return render(request, "mainapp/camp_requirements_list.html", {'filter': filter , 'data' : data}) + + +class ContributorUpdateView(CreateView): + model = ContributorUpdate + template_name='mainapp/contributor_update.html' + fields = [ + 'status', + 'other_status', + 'updater_name', + 'updater_phone', + 'notes' + ] + success_url = '/contrib_update_success/' + + def contributor(self): + return self.contributor + + def updates(self): + return self.updates + + #@method_decorator(login_required) + def dispatch(self, request, *args, **kwargs): + #could not use login_required decorator because it redirects to /accounts/login and we need /login + #disable authentication + # if not request.user.is_authenticated: + # return redirect('/login'+'?next=request_updates/'+kwargs['request_id']+'/') + + self.contributor = get_object_or_404(Contributor, pk=kwargs['contributor_id']) + self.updates = ContributorUpdate.objects.all().filter(request_id=kwargs['contributor_id']).order_by('-update_ts') + return super().dispatch(request, *args, **kwargs) + + def form_valid(self, form): + self.object = form.save(commit=False) + self.object.contributor = self.contributor + self.object = form.save() + return HttpResponseRedirect(self.get_success_url()) + +class ContribUpdateSuccess(TemplateView): + template_name = "mainapp/contributor_update_success.html" From 7e4c220a93fa422989607a8d58d58ae2891b2d88 Mon Sep 17 00:00:00 2001 From: Jacob Thomas Date: Tue, 21 Aug 2018 02:16:25 -0500 Subject: [PATCH 02/24] add contributor update --- mainapp/migrations/0062_contributorupdate.py | 28 ++++++ .../templates/mainapp/contributor_update.html | 97 +++++++++++++++++++ .../mainapp/contributor_update_success.html | 9 ++ mainapp/views.py | 10 +- 4 files changed, 139 insertions(+), 5 deletions(-) create mode 100644 mainapp/migrations/0062_contributorupdate.py create mode 100644 mainapp/templates/mainapp/contributor_update.html create mode 100644 mainapp/templates/mainapp/contributor_update_success.html diff --git a/mainapp/migrations/0062_contributorupdate.py b/mainapp/migrations/0062_contributorupdate.py new file mode 100644 index 000000000..2dc870d59 --- /dev/null +++ b/mainapp/migrations/0062_contributorupdate.py @@ -0,0 +1,28 @@ +# Generated by Django 2.1 on 2018-08-21 06:54 + +import django.core.validators +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('mainapp', '0061_auto_20180820_1010'), + ] + + operations = [ + migrations.CreateModel( + name='ContributorUpdate', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('status', models.CharField(choices=[('hig', 'High priority'), ('med', 'Medium priority'), ('low', 'Low priority'), ('cls', 'Can be closed'), ('otr', 'Other')], max_length=10)), + ('other_status', models.CharField(blank=True, default='', max_length=255, verbose_name='Please specify other status')), + ('updater_name', models.CharField(max_length=100, verbose_name='Name of person or group updating')), + ('updater_phone', models.CharField(max_length=14, validators=[django.core.validators.RegexValidator(code='invalid_mobile', message='Please Enter 10/11 digit mobile number or landline as 0', regex='^((\\+91|91|0)[\\- ]{0,1})?[456789]\\d{9}$')], verbose_name='Phone number of person or group updating')), + ('notes', models.TextField(blank=True, verbose_name='Contributor comments')), + ('update_ts', models.DateTimeField(auto_now_add=True)), + ('contributor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Contributor')), + ], + ), + ] diff --git a/mainapp/templates/mainapp/contributor_update.html b/mainapp/templates/mainapp/contributor_update.html new file mode 100644 index 000000000..58c3bce2a --- /dev/null +++ b/mainapp/templates/mainapp/contributor_update.html @@ -0,0 +1,97 @@ +{% extends 'base.html' %} +{% load bootstrap3 %} + +{% block content %} + + +
+ + + + + + + + + + + + + + + + + + + + + +
Contributor Update
District : {{ view.contributor.district }}
Name : {{ view.contributor.name }}
Phone : {{ view.contributor.phone }}
Address : {{ view.contributor.address }}
+ +
+ +

Updates

+
+ + + + + + + + + + + + + + {% for update in view.updates %} + + + + + + + + {% endfor %} + + +
StatusUpdater NameUpdater PhoneNotesUpdate Time
{{ update.status }} {{ update.other_status }}{{ update.updater_name }}{{ update.updater_phone }}{{ update.notes }}{{ update.update_ts }}
+ +
+ +

Contributor Updates

+

placeholder for malayalam ‍

+
+ {% csrf_token %} + {% bootstrap_form form %} + + {% buttons %} + + {% endbuttons %} +
+ + + +{% endblock %} \ No newline at end of file diff --git a/mainapp/templates/mainapp/contributor_update_success.html b/mainapp/templates/mainapp/contributor_update_success.html new file mode 100644 index 000000000..5d9806725 --- /dev/null +++ b/mainapp/templates/mainapp/contributor_update_success.html @@ -0,0 +1,9 @@ +{% extends 'base.html' %} +{% load bootstrap3 %} + +{% block content %} + +

Thank You for updating Contributor info

+

Malayalam placeholder

+ +{% endblock %} \ No newline at end of file diff --git a/mainapp/views.py b/mainapp/views.py index 44de16fce..6f0a5d6fa 100644 --- a/mainapp/views.py +++ b/mainapp/views.py @@ -6,7 +6,7 @@ from mainapp.redis_queue import sms_queue from mainapp.sms_handler import send_confirmation_sms from .models import Request, Volunteer, DistrictManager, Contributor, DistrictNeed, Person, RescueCamp, NGO, \ - Announcements , districts + Announcements , districts, ContributorUpdate import django_filters from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator from django.http import JsonResponse @@ -16,7 +16,7 @@ from django.contrib.messages.views import SuccessMessageMixin from django.contrib.auth import logout from django.contrib import admin -from django.shortcuts import redirect +from django.shortcuts import redirect, get_object_or_404 from django.db.models import Count, QuerySet from django.core.cache import cache from django.conf import settings @@ -716,7 +716,7 @@ class ContributorUpdateView(CreateView): 'updater_phone', 'notes' ] - success_url = '/contrib_update_success/' + success_url = '/contributor_update_success/' def contributor(self): return self.contributor @@ -732,7 +732,7 @@ def dispatch(self, request, *args, **kwargs): # return redirect('/login'+'?next=request_updates/'+kwargs['request_id']+'/') self.contributor = get_object_or_404(Contributor, pk=kwargs['contributor_id']) - self.updates = ContributorUpdate.objects.all().filter(request_id=kwargs['contributor_id']).order_by('-update_ts') + self.updates = ContributorUpdate.objects.all().filter(contributor_id=kwargs['contributor_id']).order_by('-update_ts') return super().dispatch(request, *args, **kwargs) def form_valid(self, form): @@ -741,5 +741,5 @@ def form_valid(self, form): self.object = form.save() return HttpResponseRedirect(self.get_success_url()) -class ContribUpdateSuccess(TemplateView): +class ContributorUpdateSuccess(TemplateView): template_name = "mainapp/contributor_update_success.html" From 507af2f75161a04d322057678ce918010f7ba3d3 Mon Sep 17 00:00:00 2001 From: Jacob Thomas Date: Tue, 21 Aug 2018 02:23:40 -0500 Subject: [PATCH 03/24] update view, add missing fields --- mainapp/templates/mainapp/contributor_update.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mainapp/templates/mainapp/contributor_update.html b/mainapp/templates/mainapp/contributor_update.html index 58c3bce2a..38a76f9bd 100644 --- a/mainapp/templates/mainapp/contributor_update.html +++ b/mainapp/templates/mainapp/contributor_update.html @@ -8,7 +8,7 @@ - + @@ -25,6 +25,13 @@ + + + + + + +
Contributor Update

Contributor Info

Address : {{ view.contributor.address }}
Commodities : {{ view.contributor.commodities }}
Status : {{ view.contributor.status }}
From fdd7c2bd80751f6b4ba0c80fb71183a09b4de963 Mon Sep 17 00:00:00 2001 From: Anoop Sundaresh Date: Tue, 21 Aug 2018 04:37:42 -0400 Subject: [PATCH 04/24] Updated the status field. --- mainapp/models.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/mainapp/models.py b/mainapp/models.py index 678f8c4c5..407312bfa 100644 --- a/mainapp/models.py +++ b/mainapp/models.py @@ -73,15 +73,6 @@ ('M', 'Medium'), ('L', 'Low')] -contributor_update_status_types = ( - ('hig', 'High priority'), - ('med', 'Medium priority'), - ('low', 'Low priority'), - ('cls', 'Can be closed'), - ('otr', 'Other') -) - - class Request(models.Model): district = models.CharField( max_length = 15, @@ -436,7 +427,8 @@ class ContributorUpdate(models.Model): contributor = models.ForeignKey(Contributor, on_delete=models.CASCADE) status = models.CharField( max_length = 10, - choices = contributor_update_status_types + choices = contrib_status_types, + default = 'new' ) other_status = models.CharField(max_length=255, verbose_name='Please specify other status', default='', blank=True) @@ -450,4 +442,4 @@ class ContributorUpdate(models.Model): update_ts = models.DateTimeField(auto_now_add=True) def __str__(self): - return self.get_status_display() \ No newline at end of file + return self.get_status_display() From 216e40031a81601d679e726d41d874c0ec548eac Mon Sep 17 00:00:00 2001 From: Jacob Thomas Date: Tue, 21 Aug 2018 02:05:26 -0500 Subject: [PATCH 05/24] add contrib updates --- mainapp/models.py | 26 +++++++++++++++++++++++++- mainapp/urls.py | 2 ++ mainapp/views.py | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 1 deletion(-) diff --git a/mainapp/models.py b/mainapp/models.py index 116280cdc..e5066c0b8 100644 --- a/mainapp/models.py +++ b/mainapp/models.py @@ -81,6 +81,13 @@ ('M', 'Medium'), ('L', 'Low')] +contributor_update_status_types = ( + ('hig', 'High priority'), + ('med', 'Medium priority'), + ('low', 'Low priority'), + ('cls', 'Can be closed'), + ('otr', 'Other') +) class Request(models.Model): @@ -489,9 +496,26 @@ class RequestUpdate(models.Model): phone_number_regex = RegexValidator(regex='^((\+91|91|0)[\- ]{0,1})?[456789]\d{9}$', message='Please Enter 10/11 digit mobile number or landline as 0', code='invalid_mobile') updater_phone = models.CharField(max_length=14,verbose_name='Phone number of person or group updating', validators=[phone_number_regex]) - notes = models.TextField(verbose_name='Volunteer comments', blank=True) + update_ts = models.DateTimeField(auto_now_add=True) + def __str__(self): + return self.get_status_display() + + +class ContributorUpdate(models.Model): + contributor = models.ForeignKey(Contributor, on_delete=models.CASCADE) + status = models.CharField( + max_length = 10, + choices = contributor_update_status_types + ) + + other_status = models.CharField(max_length=255, verbose_name='Please specify other status', default='', blank=True) + updater_name = models.CharField(max_length=100, verbose_name='Name of person or group updating', blank=False) + + phone_number_regex = RegexValidator(regex='^((\+91|91|0)[\- ]{0,1})?[456789]\d{9}$', message='Please Enter 10/11 digit mobile number or landline as 0', code='invalid_mobile') + updater_phone = models.CharField(max_length=14,verbose_name='Phone number of person or group updating', validators=[phone_number_regex]) + notes = models.TextField(verbose_name='Contributor comments', blank=True) update_ts = models.DateTimeField(auto_now_add=True) def __str__(self): diff --git a/mainapp/urls.py b/mainapp/urls.py index 1e17948ed..f4484664a 100644 --- a/mainapp/urls.py +++ b/mainapp/urls.py @@ -49,4 +49,6 @@ path('announcements/', views.announcements, name="Announcements"), path('camp_requirements/', views.camp_requirements_list, name='camp_requirements_list'), path('submission_success/', views.SubmissionSuccess.as_view(), name='submission_success'), + url(r'contributor_update/(?P\d+)/$', views.ContributorUpdateView.as_view(), name='contributorupdateview'), + path('contributor_update_success/', views.ContributorUpdateSuccess.as_view(), name='contributor_update_success') ] diff --git a/mainapp/views.py b/mainapp/views.py index f63df1d38..9bd54a99a 100644 --- a/mainapp/views.py +++ b/mainapp/views.py @@ -720,3 +720,42 @@ def camp_requirements_list(request): page = request.GET.get('page') data = paginator.get_page(page) return render(request, "mainapp/camp_requirements_list.html", {'filter': filter , 'data' : data}) + + +class ContributorUpdateView(CreateView): + model = ContributorUpdate + template_name='mainapp/contributor_update.html' + fields = [ + 'status', + 'other_status', + 'updater_name', + 'updater_phone', + 'notes' + ] + success_url = '/contrib_update_success/' + + def contributor(self): + return self.contributor + + def updates(self): + return self.updates + + #@method_decorator(login_required) + def dispatch(self, request, *args, **kwargs): + #could not use login_required decorator because it redirects to /accounts/login and we need /login + #disable authentication + # if not request.user.is_authenticated: + # return redirect('/login'+'?next=request_updates/'+kwargs['request_id']+'/') + + self.contributor = get_object_or_404(Contributor, pk=kwargs['contributor_id']) + self.updates = ContributorUpdate.objects.all().filter(request_id=kwargs['contributor_id']).order_by('-update_ts') + return super().dispatch(request, *args, **kwargs) + + def form_valid(self, form): + self.object = form.save(commit=False) + self.object.contributor = self.contributor + self.object = form.save() + return HttpResponseRedirect(self.get_success_url()) + +class ContribUpdateSuccess(TemplateView): + template_name = "mainapp/contributor_update_success.html" From eda23deabade566a4f4d226af1715f63fbe9c450 Mon Sep 17 00:00:00 2001 From: Jacob Thomas Date: Tue, 21 Aug 2018 02:16:25 -0500 Subject: [PATCH 06/24] add contributor update --- mainapp/migrations/0062_contributorupdate.py | 28 ++++++ .../templates/mainapp/contributor_update.html | 97 +++++++++++++++++++ .../mainapp/contributor_update_success.html | 9 ++ mainapp/views.py | 10 +- 4 files changed, 139 insertions(+), 5 deletions(-) create mode 100644 mainapp/migrations/0062_contributorupdate.py create mode 100644 mainapp/templates/mainapp/contributor_update.html create mode 100644 mainapp/templates/mainapp/contributor_update_success.html diff --git a/mainapp/migrations/0062_contributorupdate.py b/mainapp/migrations/0062_contributorupdate.py new file mode 100644 index 000000000..2dc870d59 --- /dev/null +++ b/mainapp/migrations/0062_contributorupdate.py @@ -0,0 +1,28 @@ +# Generated by Django 2.1 on 2018-08-21 06:54 + +import django.core.validators +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('mainapp', '0061_auto_20180820_1010'), + ] + + operations = [ + migrations.CreateModel( + name='ContributorUpdate', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('status', models.CharField(choices=[('hig', 'High priority'), ('med', 'Medium priority'), ('low', 'Low priority'), ('cls', 'Can be closed'), ('otr', 'Other')], max_length=10)), + ('other_status', models.CharField(blank=True, default='', max_length=255, verbose_name='Please specify other status')), + ('updater_name', models.CharField(max_length=100, verbose_name='Name of person or group updating')), + ('updater_phone', models.CharField(max_length=14, validators=[django.core.validators.RegexValidator(code='invalid_mobile', message='Please Enter 10/11 digit mobile number or landline as 0', regex='^((\\+91|91|0)[\\- ]{0,1})?[456789]\\d{9}$')], verbose_name='Phone number of person or group updating')), + ('notes', models.TextField(blank=True, verbose_name='Contributor comments')), + ('update_ts', models.DateTimeField(auto_now_add=True)), + ('contributor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Contributor')), + ], + ), + ] diff --git a/mainapp/templates/mainapp/contributor_update.html b/mainapp/templates/mainapp/contributor_update.html new file mode 100644 index 000000000..58c3bce2a --- /dev/null +++ b/mainapp/templates/mainapp/contributor_update.html @@ -0,0 +1,97 @@ +{% extends 'base.html' %} +{% load bootstrap3 %} + +{% block content %} + + +
+ + + + + + + + + + + + + + + + + + + + + +
Contributor Update
District : {{ view.contributor.district }}
Name : {{ view.contributor.name }}
Phone : {{ view.contributor.phone }}
Address : {{ view.contributor.address }}
+ +
+ +

Updates

+
+ + + + + + + + + + + + + + {% for update in view.updates %} + + + + + + + + {% endfor %} + + +
StatusUpdater NameUpdater PhoneNotesUpdate Time
{{ update.status }} {{ update.other_status }}{{ update.updater_name }}{{ update.updater_phone }}{{ update.notes }}{{ update.update_ts }}
+ +
+ +

Contributor Updates

+

placeholder for malayalam ‍

+
+ {% csrf_token %} + {% bootstrap_form form %} + + {% buttons %} + + {% endbuttons %} +
+ + + +{% endblock %} \ No newline at end of file diff --git a/mainapp/templates/mainapp/contributor_update_success.html b/mainapp/templates/mainapp/contributor_update_success.html new file mode 100644 index 000000000..5d9806725 --- /dev/null +++ b/mainapp/templates/mainapp/contributor_update_success.html @@ -0,0 +1,9 @@ +{% extends 'base.html' %} +{% load bootstrap3 %} + +{% block content %} + +

Thank You for updating Contributor info

+

Malayalam placeholder

+ +{% endblock %} \ No newline at end of file diff --git a/mainapp/views.py b/mainapp/views.py index 9bd54a99a..3589cb33c 100644 --- a/mainapp/views.py +++ b/mainapp/views.py @@ -6,7 +6,7 @@ from mainapp.redis_queue import sms_queue from mainapp.sms_handler import send_confirmation_sms from .models import Request, Volunteer, DistrictManager, Contributor, DistrictNeed, Person, RescueCamp, NGO, \ - Announcements , districts , PrivateRescueCamp + Announcements , districts , PrivateRescueCamp, ContributorUpdate import django_filters from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator from django.http import JsonResponse @@ -16,7 +16,7 @@ from django.contrib.messages.views import SuccessMessageMixin from django.contrib.auth import logout from django.contrib import admin -from django.shortcuts import redirect +from django.shortcuts import redirect, get_object_or_404 from django.db.models import Count, QuerySet from django.core.cache import cache from django.conf import settings @@ -732,7 +732,7 @@ class ContributorUpdateView(CreateView): 'updater_phone', 'notes' ] - success_url = '/contrib_update_success/' + success_url = '/contributor_update_success/' def contributor(self): return self.contributor @@ -748,7 +748,7 @@ def dispatch(self, request, *args, **kwargs): # return redirect('/login'+'?next=request_updates/'+kwargs['request_id']+'/') self.contributor = get_object_or_404(Contributor, pk=kwargs['contributor_id']) - self.updates = ContributorUpdate.objects.all().filter(request_id=kwargs['contributor_id']).order_by('-update_ts') + self.updates = ContributorUpdate.objects.all().filter(contributor_id=kwargs['contributor_id']).order_by('-update_ts') return super().dispatch(request, *args, **kwargs) def form_valid(self, form): @@ -757,5 +757,5 @@ def form_valid(self, form): self.object = form.save() return HttpResponseRedirect(self.get_success_url()) -class ContribUpdateSuccess(TemplateView): +class ContributorUpdateSuccess(TemplateView): template_name = "mainapp/contributor_update_success.html" From 09312b77311375f641b156636d469749bd928d8f Mon Sep 17 00:00:00 2001 From: Jacob Thomas Date: Tue, 21 Aug 2018 02:23:40 -0500 Subject: [PATCH 07/24] update view, add missing fields --- mainapp/templates/mainapp/contributor_update.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mainapp/templates/mainapp/contributor_update.html b/mainapp/templates/mainapp/contributor_update.html index 58c3bce2a..38a76f9bd 100644 --- a/mainapp/templates/mainapp/contributor_update.html +++ b/mainapp/templates/mainapp/contributor_update.html @@ -8,7 +8,7 @@ - + @@ -25,6 +25,13 @@ + + + + + + +
Contributor Update

Contributor Info

Address : {{ view.contributor.address }}
Commodities : {{ view.contributor.commodities }}
Status : {{ view.contributor.status }}
From 24881098dce9d3b2bc34d15c401ccfa50111952c Mon Sep 17 00:00:00 2001 From: Anoop Sundaresh Date: Tue, 21 Aug 2018 04:37:42 -0400 Subject: [PATCH 08/24] Updated the status field. --- mainapp/models.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/mainapp/models.py b/mainapp/models.py index e5066c0b8..3d929b169 100644 --- a/mainapp/models.py +++ b/mainapp/models.py @@ -81,15 +81,6 @@ ('M', 'Medium'), ('L', 'Low')] -contributor_update_status_types = ( - ('hig', 'High priority'), - ('med', 'Medium priority'), - ('low', 'Low priority'), - ('cls', 'Can be closed'), - ('otr', 'Other') -) - - class Request(models.Model): district = models.CharField( max_length = 15, @@ -507,7 +498,8 @@ class ContributorUpdate(models.Model): contributor = models.ForeignKey(Contributor, on_delete=models.CASCADE) status = models.CharField( max_length = 10, - choices = contributor_update_status_types + choices = contrib_status_types, + default = 'new' ) other_status = models.CharField(max_length=255, verbose_name='Please specify other status', default='', blank=True) From dfb9aaa1a03be4e3bc07e80ac496768d9b81b782 Mon Sep 17 00:00:00 2001 From: Anoop Date: Tue, 21 Aug 2018 05:00:49 -0400 Subject: [PATCH 09/24] Updated the ContribView to have update button. --- mainapp/migrations/0065_merge_20180821_1426.py | 14 ++++++++++++++ mainapp/templates/mainapp/contrib_list.html | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 mainapp/migrations/0065_merge_20180821_1426.py diff --git a/mainapp/migrations/0065_merge_20180821_1426.py b/mainapp/migrations/0065_merge_20180821_1426.py new file mode 100644 index 000000000..12a285006 --- /dev/null +++ b/mainapp/migrations/0065_merge_20180821_1426.py @@ -0,0 +1,14 @@ +# Generated by Django 2.1 on 2018-08-21 08:56 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('mainapp', '0062_contributorupdate'), + ('mainapp', '0064_privaterescuecamp'), + ] + + operations = [ + ] diff --git a/mainapp/templates/mainapp/contrib_list.html b/mainapp/templates/mainapp/contrib_list.html index 281228f70..1e1b58d87 100644 --- a/mainapp/templates/mainapp/contrib_list.html +++ b/mainapp/templates/mainapp/contrib_list.html @@ -83,6 +83,7 @@

malayalam placeholder

address -ml- commodities -ml- Status -ml- + Update @@ -94,6 +95,7 @@

malayalam placeholder

{{ req.address }} {{ req.commodities }} {{ req.get_status_display }} + Update {% endfor %} From 6779f25b813ce339ac0e0f7403e711493386502b Mon Sep 17 00:00:00 2001 From: Anoop Date: Tue, 21 Aug 2018 05:27:43 -0400 Subject: [PATCH 10/24] Fixed Merge issues. --- mainapp/urls.py | 2 +- mainapp/views.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/mainapp/urls.py b/mainapp/urls.py index 682dcdf4d..ec144bca7 100644 --- a/mainapp/urls.py +++ b/mainapp/urls.py @@ -50,7 +50,7 @@ path('camp_requirements/', views.camp_requirements_list, name='camp_requirements_list'), path('submission_success/', views.SubmissionSuccess.as_view(), name='submission_success'), url(r'contributor_update/(?P\d+)/$', views.ContributorUpdateView.as_view(), name='contributorupdateview'), - path('contributor_update_success/', views.ContributorUpdateSuccess.as_view(), name='contributor_update_success') + path('contributor_update_success/', views.ContributorUpdateSuccess.as_view(), name='contributor_update_success'), path('consent_success/', views.ConsentSuccess.as_view(), name='consent_success'), url(r'c/(?P\d+)/(?P\d+)/$', views.VolunteerConsent.as_view(), name='volunteer_consent'), ] diff --git a/mainapp/views.py b/mainapp/views.py index e982fd845..5ea96bf6d 100644 --- a/mainapp/views.py +++ b/mainapp/views.py @@ -782,4 +782,3 @@ def form_valid(self, form): class ContributorUpdateSuccess(TemplateView): template_name = "mainapp/contributor_update_success.html" - return render(request, "mainapp/camp_requirements_list.html", {'filter': filter , 'data' : data}) From eb03386d33a0b0a315779407e39f6b105b48523d Mon Sep 17 00:00:00 2001 From: Anoop Date: Tue, 21 Aug 2018 05:31:10 -0400 Subject: [PATCH 11/24] MakeMigrations update for Travis. --- mainapp/migrations/0066_merge_20180821_1500.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 mainapp/migrations/0066_merge_20180821_1500.py diff --git a/mainapp/migrations/0066_merge_20180821_1500.py b/mainapp/migrations/0066_merge_20180821_1500.py new file mode 100644 index 000000000..0fdede841 --- /dev/null +++ b/mainapp/migrations/0066_merge_20180821_1500.py @@ -0,0 +1,14 @@ +# Generated by Django 2.1 on 2018-08-21 09:30 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('mainapp', '0065_merge_20180821_1422'), + ('mainapp', '0065_merge_20180821_1426'), + ] + + operations = [ + ] From 9b77cc7894fa28354043b3a8404ddb20f2a1409f Mon Sep 17 00:00:00 2001 From: Jacob Thomas Date: Tue, 21 Aug 2018 02:05:26 -0500 Subject: [PATCH 12/24] add contrib updates --- mainapp/models.py | 27 ++++++++++++++++++++++++++- mainapp/urls.py | 2 ++ mainapp/views.py | 38 +++++++++++++++++++++++++++++++++++++- 3 files changed, 65 insertions(+), 2 deletions(-) diff --git a/mainapp/models.py b/mainapp/models.py index b98302dcc..4b860e414 100644 --- a/mainapp/models.py +++ b/mainapp/models.py @@ -85,6 +85,13 @@ ('M', 'Medium'), ('L', 'Low')] +contributor_update_status_types = ( + ('hig', 'High priority'), + ('med', 'Medium priority'), + ('low', 'Low priority'), + ('cls', 'Can be closed'), + ('otr', 'Other') +) class LSGTypes(Enum): CORPORATION = 0 @@ -513,7 +520,6 @@ class RequestUpdate(models.Model): phone_number_regex = RegexValidator(regex='^((\+91|91|0)[\- ]{0,1})?[456789]\d{9}$', message='Please Enter 10/11 digit mobile number or landline as 0', code='invalid_mobile') updater_phone = models.CharField(max_length=14,verbose_name='Phone number of person or group updating', validators=[phone_number_regex]) - notes = models.TextField(verbose_name='Volunteer comments', blank=True) update_ts = models.DateTimeField(auto_now_add=True) @@ -521,6 +527,25 @@ class RequestUpdate(models.Model): def __str__(self): return self.get_status_display() +class ContributorUpdate(models.Model): + contributor = models.ForeignKey(Contributor, on_delete=models.CASCADE) + status = models.CharField( + max_length = 10, + choices = contributor_update_status_types + ) + + other_status = models.CharField(max_length=255, verbose_name='Please specify other status', default='', blank=True) + updater_name = models.CharField(max_length=100, verbose_name='Name of person or group updating', blank=False) + + phone_number_regex = RegexValidator(regex='^((\+91|91|0)[\- ]{0,1})?[456789]\d{9}$', message='Please Enter 10/11 digit mobile number or landline as 0', code='invalid_mobile') + updater_phone = models.CharField(max_length=14,verbose_name='Phone number of person or group updating', validators=[phone_number_regex]) + notes = models.TextField(verbose_name='Contributor comments', blank=True) + + update_ts = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return self.get_status_display() + class CollectionCenter(models.Model): diff --git a/mainapp/urls.py b/mainapp/urls.py index bc733936c..db3a9fb63 100644 --- a/mainapp/urls.py +++ b/mainapp/urls.py @@ -56,4 +56,6 @@ path('submission_success/', views.SubmissionSuccess.as_view(), name='submission_success'), path('consent_success/', views.ConsentSuccess.as_view(), name='consent_success'), url(r'c/(?P\d+)/(?P\d+)/$', views.VolunteerConsent.as_view(), name='volunteer_consent'), + url(r'contributor_update/(?P\d+)/$', views.ContributorUpdateView.as_view(), name='contributorupdateview'), + path('contributor_update_success/', views.ContributorUpdateSuccess.as_view(), name='contributor_update_success') ] diff --git a/mainapp/views.py b/mainapp/views.py index 2f979658f..e83207243 100644 --- a/mainapp/views.py +++ b/mainapp/views.py @@ -780,7 +780,6 @@ def camp_requirements_list(request): data = paginator.get_page(page) return render(request, "mainapp/camp_requirements_list.html", {'filter': filter , 'data' : data}) - class CollectionCenterListView(ListView): model = CollectionCenter paginate_by = PER_PAGE @@ -804,5 +803,42 @@ class CollectionCenterView(CreateView): 'ward_name', 'is_inside_kerala', 'city', + ] + +class ContributorUpdateView(CreateView): + model = ContributorUpdate + template_name='mainapp/contributor_update.html' + fields = [ + 'status', + 'other_status', + 'updater_name', + 'updater_phone', + 'notes' ] + success_url = '/contrib_update_success/' + + def contributor(self): + return self.contributor + + def updates(self): + return self.updates + + #@method_decorator(login_required) + def dispatch(self, request, *args, **kwargs): + #could not use login_required decorator because it redirects to /accounts/login and we need /login + #disable authentication + # if not request.user.is_authenticated: + # return redirect('/login'+'?next=request_updates/'+kwargs['request_id']+'/') + + self.contributor = get_object_or_404(Contributor, pk=kwargs['contributor_id']) + self.updates = ContributorUpdate.objects.all().filter(request_id=kwargs['contributor_id']).order_by('-update_ts') + return super().dispatch(request, *args, **kwargs) + + def form_valid(self, form): + self.object = form.save(commit=False) + self.object.contributor = self.contributor + self.object = form.save() + return HttpResponseRedirect(self.get_success_url()) +class ContribUpdateSuccess(TemplateView): + template_name = "mainapp/contributor_update_success.html" From 9f0a2be97fdb47ccd1ec3c7c78c7d6761969d2d3 Mon Sep 17 00:00:00 2001 From: Jacob Thomas Date: Tue, 21 Aug 2018 02:16:25 -0500 Subject: [PATCH 13/24] add contributor update --- mainapp/migrations/0062_contributorupdate.py | 28 ++++++ .../templates/mainapp/contributor_update.html | 97 +++++++++++++++++++ .../mainapp/contributor_update_success.html | 9 ++ mainapp/views.py | 8 +- 4 files changed, 138 insertions(+), 4 deletions(-) create mode 100644 mainapp/migrations/0062_contributorupdate.py create mode 100644 mainapp/templates/mainapp/contributor_update.html create mode 100644 mainapp/templates/mainapp/contributor_update_success.html diff --git a/mainapp/migrations/0062_contributorupdate.py b/mainapp/migrations/0062_contributorupdate.py new file mode 100644 index 000000000..2dc870d59 --- /dev/null +++ b/mainapp/migrations/0062_contributorupdate.py @@ -0,0 +1,28 @@ +# Generated by Django 2.1 on 2018-08-21 06:54 + +import django.core.validators +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('mainapp', '0061_auto_20180820_1010'), + ] + + operations = [ + migrations.CreateModel( + name='ContributorUpdate', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('status', models.CharField(choices=[('hig', 'High priority'), ('med', 'Medium priority'), ('low', 'Low priority'), ('cls', 'Can be closed'), ('otr', 'Other')], max_length=10)), + ('other_status', models.CharField(blank=True, default='', max_length=255, verbose_name='Please specify other status')), + ('updater_name', models.CharField(max_length=100, verbose_name='Name of person or group updating')), + ('updater_phone', models.CharField(max_length=14, validators=[django.core.validators.RegexValidator(code='invalid_mobile', message='Please Enter 10/11 digit mobile number or landline as 0', regex='^((\\+91|91|0)[\\- ]{0,1})?[456789]\\d{9}$')], verbose_name='Phone number of person or group updating')), + ('notes', models.TextField(blank=True, verbose_name='Contributor comments')), + ('update_ts', models.DateTimeField(auto_now_add=True)), + ('contributor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Contributor')), + ], + ), + ] diff --git a/mainapp/templates/mainapp/contributor_update.html b/mainapp/templates/mainapp/contributor_update.html new file mode 100644 index 000000000..58c3bce2a --- /dev/null +++ b/mainapp/templates/mainapp/contributor_update.html @@ -0,0 +1,97 @@ +{% extends 'base.html' %} +{% load bootstrap3 %} + +{% block content %} + + +
+ + + + + + + + + + + + + + + + + + + + + +
Contributor Update
District : {{ view.contributor.district }}
Name : {{ view.contributor.name }}
Phone : {{ view.contributor.phone }}
Address : {{ view.contributor.address }}
+ +
+ +

Updates

+
+ + + + + + + + + + + + + + {% for update in view.updates %} + + + + + + + + {% endfor %} + + +
StatusUpdater NameUpdater PhoneNotesUpdate Time
{{ update.status }} {{ update.other_status }}{{ update.updater_name }}{{ update.updater_phone }}{{ update.notes }}{{ update.update_ts }}
+ +
+ +

Contributor Updates

+

placeholder for malayalam ‍

+
+ {% csrf_token %} + {% bootstrap_form form %} + + {% buttons %} + + {% endbuttons %} +
+ + + +{% endblock %} \ No newline at end of file diff --git a/mainapp/templates/mainapp/contributor_update_success.html b/mainapp/templates/mainapp/contributor_update_success.html new file mode 100644 index 000000000..5d9806725 --- /dev/null +++ b/mainapp/templates/mainapp/contributor_update_success.html @@ -0,0 +1,9 @@ +{% extends 'base.html' %} +{% load bootstrap3 %} + +{% block content %} + +

Thank You for updating Contributor info

+

Malayalam placeholder

+ +{% endblock %} \ No newline at end of file diff --git a/mainapp/views.py b/mainapp/views.py index e83207243..569f12628 100644 --- a/mainapp/views.py +++ b/mainapp/views.py @@ -7,7 +7,7 @@ from mainapp.redis_queue import sms_queue from mainapp.sms_handler import send_confirmation_sms from .models import Request, Volunteer, DistrictManager, Contributor, DistrictNeed, Person, RescueCamp, NGO, \ - Announcements , districts , PrivateRescueCamp + Announcements , districts , PrivateRescueCamp, ContributorUpdate import django_filters from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator from django.http import JsonResponse @@ -815,7 +815,7 @@ class ContributorUpdateView(CreateView): 'updater_phone', 'notes' ] - success_url = '/contrib_update_success/' + success_url = '/contributor_update_success/' def contributor(self): return self.contributor @@ -831,7 +831,7 @@ def dispatch(self, request, *args, **kwargs): # return redirect('/login'+'?next=request_updates/'+kwargs['request_id']+'/') self.contributor = get_object_or_404(Contributor, pk=kwargs['contributor_id']) - self.updates = ContributorUpdate.objects.all().filter(request_id=kwargs['contributor_id']).order_by('-update_ts') + self.updates = ContributorUpdate.objects.all().filter(contributor_id=kwargs['contributor_id']).order_by('-update_ts') return super().dispatch(request, *args, **kwargs) def form_valid(self, form): @@ -840,5 +840,5 @@ def form_valid(self, form): self.object = form.save() return HttpResponseRedirect(self.get_success_url()) -class ContribUpdateSuccess(TemplateView): +class ContributorUpdateSuccess(TemplateView): template_name = "mainapp/contributor_update_success.html" From cca3d300b1ba131f84f74b5034fb6f8949904795 Mon Sep 17 00:00:00 2001 From: Jacob Thomas Date: Tue, 21 Aug 2018 02:23:40 -0500 Subject: [PATCH 14/24] update view, add missing fields --- mainapp/templates/mainapp/contributor_update.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mainapp/templates/mainapp/contributor_update.html b/mainapp/templates/mainapp/contributor_update.html index 58c3bce2a..38a76f9bd 100644 --- a/mainapp/templates/mainapp/contributor_update.html +++ b/mainapp/templates/mainapp/contributor_update.html @@ -8,7 +8,7 @@ - + @@ -25,6 +25,13 @@ + + + + + + +
Contributor Update

Contributor Info

Address : {{ view.contributor.address }}
Commodities : {{ view.contributor.commodities }}
Status : {{ view.contributor.status }}
From 97f25609a62c3dae43f8310b25ddd14409485bd9 Mon Sep 17 00:00:00 2001 From: Anoop Sundaresh Date: Tue, 21 Aug 2018 04:37:42 -0400 Subject: [PATCH 15/24] Updated the status field. --- mainapp/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mainapp/models.py b/mainapp/models.py index 4b860e414..c860f44a9 100644 --- a/mainapp/models.py +++ b/mainapp/models.py @@ -531,7 +531,8 @@ class ContributorUpdate(models.Model): contributor = models.ForeignKey(Contributor, on_delete=models.CASCADE) status = models.CharField( max_length = 10, - choices = contributor_update_status_types + choices = contrib_status_types, + default = 'new' ) other_status = models.CharField(max_length=255, verbose_name='Please specify other status', default='', blank=True) @@ -546,7 +547,6 @@ class ContributorUpdate(models.Model): def __str__(self): return self.get_status_display() - class CollectionCenter(models.Model): lsg_types = [ From 7e14132902704be8b24e2be62ab1fac906978b8f Mon Sep 17 00:00:00 2001 From: Jacob Thomas Date: Tue, 21 Aug 2018 02:05:26 -0500 Subject: [PATCH 16/24] add contrib updates --- mainapp/models.py | 18 ++++++++++++++++++ mainapp/views.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/mainapp/models.py b/mainapp/models.py index c860f44a9..be7c537e5 100644 --- a/mainapp/models.py +++ b/mainapp/models.py @@ -521,7 +521,25 @@ class RequestUpdate(models.Model): phone_number_regex = RegexValidator(regex='^((\+91|91|0)[\- ]{0,1})?[456789]\d{9}$', message='Please Enter 10/11 digit mobile number or landline as 0', code='invalid_mobile') updater_phone = models.CharField(max_length=14,verbose_name='Phone number of person or group updating', validators=[phone_number_regex]) notes = models.TextField(verbose_name='Volunteer comments', blank=True) + update_ts = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return self.get_status_display() + + +class ContributorUpdate(models.Model): + contributor = models.ForeignKey(Contributor, on_delete=models.CASCADE) + status = models.CharField( + max_length = 10, + choices = contributor_update_status_types + ) + + other_status = models.CharField(max_length=255, verbose_name='Please specify other status', default='', blank=True) + updater_name = models.CharField(max_length=100, verbose_name='Name of person or group updating', blank=False) + phone_number_regex = RegexValidator(regex='^((\+91|91|0)[\- ]{0,1})?[456789]\d{9}$', message='Please Enter 10/11 digit mobile number or landline as 0', code='invalid_mobile') + updater_phone = models.CharField(max_length=14,verbose_name='Phone number of person or group updating', validators=[phone_number_regex]) + notes = models.TextField(verbose_name='Contributor comments', blank=True) update_ts = models.DateTimeField(auto_now_add=True) def __str__(self): diff --git a/mainapp/views.py b/mainapp/views.py index 569f12628..2cae585df 100644 --- a/mainapp/views.py +++ b/mainapp/views.py @@ -804,7 +804,7 @@ class CollectionCenterView(CreateView): 'is_inside_kerala', 'city', ] - + class ContributorUpdateView(CreateView): model = ContributorUpdate template_name='mainapp/contributor_update.html' From 5f92d3ecabbe07f103ae7eb3af8c4aa1262fccfe Mon Sep 17 00:00:00 2001 From: Anoop Sundaresh Date: Tue, 21 Aug 2018 04:37:42 -0400 Subject: [PATCH 17/24] Updated the status field. --- mainapp/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mainapp/models.py b/mainapp/models.py index be7c537e5..f0492a29a 100644 --- a/mainapp/models.py +++ b/mainapp/models.py @@ -98,7 +98,6 @@ class LSGTypes(Enum): MUNICIPALITY = 1 GRAMA_PANCHAYATH = 2 - class Request(models.Model): district = models.CharField( max_length = 15, @@ -531,7 +530,8 @@ class ContributorUpdate(models.Model): contributor = models.ForeignKey(Contributor, on_delete=models.CASCADE) status = models.CharField( max_length = 10, - choices = contributor_update_status_types + choices = contrib_status_types, + default = 'new' ) other_status = models.CharField(max_length=255, verbose_name='Please specify other status', default='', blank=True) From 5dc045cfc7d0ab5baea82c9d9c79a754f99fcb77 Mon Sep 17 00:00:00 2001 From: Anoop Date: Tue, 21 Aug 2018 05:00:49 -0400 Subject: [PATCH 18/24] Updated the ContribView to have update button. --- mainapp/migrations/0065_merge_20180821_1426.py | 14 ++++++++++++++ mainapp/templates/mainapp/contrib_list.html | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 mainapp/migrations/0065_merge_20180821_1426.py diff --git a/mainapp/migrations/0065_merge_20180821_1426.py b/mainapp/migrations/0065_merge_20180821_1426.py new file mode 100644 index 000000000..12a285006 --- /dev/null +++ b/mainapp/migrations/0065_merge_20180821_1426.py @@ -0,0 +1,14 @@ +# Generated by Django 2.1 on 2018-08-21 08:56 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('mainapp', '0062_contributorupdate'), + ('mainapp', '0064_privaterescuecamp'), + ] + + operations = [ + ] diff --git a/mainapp/templates/mainapp/contrib_list.html b/mainapp/templates/mainapp/contrib_list.html index 281228f70..1e1b58d87 100644 --- a/mainapp/templates/mainapp/contrib_list.html +++ b/mainapp/templates/mainapp/contrib_list.html @@ -83,6 +83,7 @@

malayalam placeholder

address -ml- commodities -ml- Status -ml- + Update @@ -94,6 +95,7 @@

malayalam placeholder

{{ req.address }} {{ req.commodities }} {{ req.get_status_display }} + Update {% endfor %} From a30535e0e03bc670cfdc90ac051bbc2942131aaa Mon Sep 17 00:00:00 2001 From: Anoop Date: Tue, 21 Aug 2018 05:27:43 -0400 Subject: [PATCH 19/24] Fixed Merge issues. --- mainapp/urls.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mainapp/urls.py b/mainapp/urls.py index db3a9fb63..b5690c6da 100644 --- a/mainapp/urls.py +++ b/mainapp/urls.py @@ -54,6 +54,8 @@ path('announcements/', views.announcements, name="Announcements"), path('camp_requirements/', views.camp_requirements_list, name='camp_requirements_list'), path('submission_success/', views.SubmissionSuccess.as_view(), name='submission_success'), + url(r'contributor_update/(?P\d+)/$', views.ContributorUpdateView.as_view(), name='contributorupdateview'), + path('contributor_update_success/', views.ContributorUpdateSuccess.as_view(), name='contributor_update_success'), path('consent_success/', views.ConsentSuccess.as_view(), name='consent_success'), url(r'c/(?P\d+)/(?P\d+)/$', views.VolunteerConsent.as_view(), name='volunteer_consent'), url(r'contributor_update/(?P\d+)/$', views.ContributorUpdateView.as_view(), name='contributorupdateview'), From b03542a45b3634e2e8de4b0f3979b6c0e78ac463 Mon Sep 17 00:00:00 2001 From: Anoop Date: Tue, 21 Aug 2018 05:31:10 -0400 Subject: [PATCH 20/24] MakeMigrations update for Travis. --- mainapp/migrations/0066_merge_20180821_1500.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 mainapp/migrations/0066_merge_20180821_1500.py diff --git a/mainapp/migrations/0066_merge_20180821_1500.py b/mainapp/migrations/0066_merge_20180821_1500.py new file mode 100644 index 000000000..0fdede841 --- /dev/null +++ b/mainapp/migrations/0066_merge_20180821_1500.py @@ -0,0 +1,14 @@ +# Generated by Django 2.1 on 2018-08-21 09:30 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('mainapp', '0065_merge_20180821_1422'), + ('mainapp', '0065_merge_20180821_1426'), + ] + + operations = [ + ] From a2c2e4c06a7f3dd2e0e3cff3d76058720db94c32 Mon Sep 17 00:00:00 2001 From: Anoop Date: Tue, 21 Aug 2018 14:33:31 -0400 Subject: [PATCH 21/24] Phone Number visible only for Authenticated users. --- mainapp/templates/mainapp/contrib_list.html | 8 ++++++-- mainapp/templates/mainapp/contributor_update.html | 14 ++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/mainapp/templates/mainapp/contrib_list.html b/mainapp/templates/mainapp/contrib_list.html index 1e1b58d87..afc91a85e 100644 --- a/mainapp/templates/mainapp/contrib_list.html +++ b/mainapp/templates/mainapp/contrib_list.html @@ -79,7 +79,9 @@

malayalam placeholder

District - ജില്ല Name - ml - Phone - ഫോണ്‍ നമ്പര്‍ + {% if user.is_authenticated %} + Phone - ഫോണ്‍ നമ്പര്‍ + {% endif %} address -ml- commodities -ml- Status -ml- @@ -91,7 +93,9 @@

malayalam placeholder

{{ req.get_district_display }} {{ req.name }} - {{ req.phone }} + {% if user.is_authenticated %} + {{ req.phone }} + {% endif %} {{ req.address }} {{ req.commodities }} {{ req.get_status_display }} diff --git a/mainapp/templates/mainapp/contributor_update.html b/mainapp/templates/mainapp/contributor_update.html index 38a76f9bd..b44653134 100644 --- a/mainapp/templates/mainapp/contributor_update.html +++ b/mainapp/templates/mainapp/contributor_update.html @@ -19,9 +19,11 @@ Name : {{ view.contributor.name }} + {% if user.is_authenticated %} Phone : {{ view.contributor.phone }} + {% endif %} Address : {{ view.contributor.address }} @@ -43,8 +45,10 @@

Updates

Status - Updater Name - Updater Phone + Updater Name + {% if user.is_authenticated %} + Updater Phone + {% endif %} Notes Update Time @@ -55,8 +59,10 @@

Updates

{% for update in view.updates %} {{ update.status }} {{ update.other_status }} - {{ update.updater_name }} - {{ update.updater_phone }} + {{ update.updater_name }} + {% if user.is_authenticated %} + {{ update.updater_phone }} + {% endif %} {{ update.notes }} {{ update.update_ts }} From 5f58e5689ca09371dd98886e53fe9f0cf3e2096e Mon Sep 17 00:00:00 2001 From: Anoop Date: Tue, 21 Aug 2018 14:34:34 -0400 Subject: [PATCH 22/24] Merged Migrations. --- mainapp/migrations/0069_merge_20180821_2300.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 mainapp/migrations/0069_merge_20180821_2300.py diff --git a/mainapp/migrations/0069_merge_20180821_2300.py b/mainapp/migrations/0069_merge_20180821_2300.py new file mode 100644 index 000000000..a90360b1e --- /dev/null +++ b/mainapp/migrations/0069_merge_20180821_2300.py @@ -0,0 +1,14 @@ +# Generated by Django 2.1 on 2018-08-21 17:30 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('mainapp', '0066_merge_20180821_1500'), + ('mainapp', '0068_auto_20180821_1710'), + ] + + operations = [ + ] From a677a9dc905a1e916c9bace8acd1c83d051cdeea Mon Sep 17 00:00:00 2001 From: Anoop Date: Tue, 21 Aug 2018 14:49:15 -0400 Subject: [PATCH 23/24] Again MakeMigrations merge. --- mainapp/migrations/0073_merge_20180822_0018.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 mainapp/migrations/0073_merge_20180822_0018.py diff --git a/mainapp/migrations/0073_merge_20180822_0018.py b/mainapp/migrations/0073_merge_20180822_0018.py new file mode 100644 index 000000000..df9d79bff --- /dev/null +++ b/mainapp/migrations/0073_merge_20180822_0018.py @@ -0,0 +1,14 @@ +# Generated by Django 2.1 on 2018-08-21 18:48 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('mainapp', '0069_merge_20180821_2300'), + ('mainapp', '0072_auto_20180822_0000'), + ] + + operations = [ + ] From e04ae2e85cf21eaf23d13d9a1b0b8a5347bf336b Mon Sep 17 00:00:00 2001 From: Anoop Date: Tue, 21 Aug 2018 14:54:08 -0400 Subject: [PATCH 24/24] :( Update MakeMigrations. --- mainapp/migrations/0074_merge_20180822_0024.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 mainapp/migrations/0074_merge_20180822_0024.py diff --git a/mainapp/migrations/0074_merge_20180822_0024.py b/mainapp/migrations/0074_merge_20180822_0024.py new file mode 100644 index 000000000..97e010d56 --- /dev/null +++ b/mainapp/migrations/0074_merge_20180822_0024.py @@ -0,0 +1,14 @@ +# Generated by Django 2.1 on 2018-08-21 18:54 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('mainapp', '0073_merge_20180822_0018'), + ('mainapp', '0073_merge_20180822_0015'), + ] + + operations = [ + ]