diff --git a/accounts/templates/accounts.html b/accounts/templates/accounts.html index 85e7db96..8b7231b4 100644 --- a/accounts/templates/accounts.html +++ b/accounts/templates/accounts.html @@ -115,8 +115,12 @@ {% for each_account in open_accounts %} {{ forloop.counter }} - {% if each_account.name %}{% if each_account.name %}{{ each_account.name }}{% endif %} + --> + {% if each_account.name %}{{ each_account.name }}{% endif %} {% if each_account.created_by %} @@ -149,7 +153,8 @@ {% endwith %} - {# View #} + {{ forloop.counter }} - {% if each_account.name %}{{ each_account.name }}{% endif %} + {% if each_account.name %}{{ each_account.name }}{% endif %} {% if each_account.created_by %} @@ -237,6 +242,8 @@ {% endwith %} + + + +{% for account_record in open_accounts %} + + + +{% endfor %} + + + +{% for account_record in close_accounts %} + + + +{% endfor %} + + {% endblock %} {% block js_block %} @@ -275,6 +645,37 @@ $("#tab_status").val('Closed'); }) + // $(".account_modal").click(function (e) { + // console.log('clicked') + // console.log(e) + // console.log($(this).attr('data-id')) + + // $.ajax({ + // url:`get-account-details/${$(this).attr('data-id')}/`, + // type: 'GET', + // success:function(data){ + // console.log(data) + // console.log((data.data.fields)) + // $('#modal_body_ajax').empty() + // for(key in data.data.fields){ + // console.log(key, data.data.fields[key]) + // $('#modal_body_ajax').append( + // "
" + key + "    " + "" + data.data.fields[key] + "" + "
" + // ) + // } + // // $('textarea#modal_data').val(JSON.stringify(data)) + // $('#exampleModalCenter_account').modal() + // if(data.error){ + // // TODO + // data.fields + // } + // else{ + + // } + // } + // }) + // }) + $("#open-tab").click(function (e) { $("#tab_status").val('Open') }) diff --git a/accounts/urls.py b/accounts/urls.py index d1b2f759..40fd66f6 100644 --- a/accounts/urls.py +++ b/accounts/urls.py @@ -2,7 +2,7 @@ from django.urls import path from accounts.views import ( AccountsListView, CreateAccountView, AccountDetailView, AccountUpdateView, AccountDeleteView, AddCommentView, UpdateCommentView, DeleteCommentView, - AddAttachmentView, DeleteAttachmentsView, create_mail + AddAttachmentView, DeleteAttachmentsView, create_mail, #get_account_details ) app_name = 'accounts' @@ -25,4 +25,6 @@ urlpatterns = [ name="remove_attachment"), path('create-mail//', create_mail, name="create_mail"), +# path('get-account-details//', get_account_details, name="get_account_details"), + ] diff --git a/accounts/views.py b/accounts/views.py index 01d455c5..e2af8a55 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -542,3 +542,14 @@ def create_mail(request, account_id): return JsonResponse({'error': False}) else: return JsonResponse({'error': True, 'errors': form.errors}) + + +# @login_required +# def get_account_details(request, account_id): +# from django.core import serializers +# import json +# fields = ['name', 'email', 'phone', 'industry', 'billing_address_line', 'billing_street', 'billing_city', +# 'billing_state', 'billing_postcode', 'billing_country', 'website', 'description', +# 'created_by__email', 'created_on', 'tags__name', 'status', 'contacts__email', 'assigned_to__email'] +# data = serializers.serialize('json', Account.objects.filter(id=account_id), fields=fields) +# return JsonResponse({'data': json.loads(data)[0]}) \ No newline at end of file diff --git a/cases/templates/cases.html b/cases/templates/cases.html index 3b12d2ed..743549e0 100644 --- a/cases/templates/cases.html +++ b/cases/templates/cases.html @@ -7,30 +7,34 @@
- Add New Case + Add New + Case
-
+
Filters
- +
- {% for each_status in case_status %} - + {% endfor%}
@@ -38,10 +42,12 @@
- {% for each_priority in case_priority %} - + {% endfor%}
@@ -52,7 +58,7 @@ @@ -79,9 +85,10 @@
- Cases - {% if show_pageitems %} {% show_pageitems %}{% else %}{{ cases|length }}{% endif %} + Cases - {% if show_pageitems %} + {% show_pageitems %}{% else %}{{ cases|length }}{% endif %} - +
@@ -107,7 +114,7 @@ {% for case in cases %} {{ forloop.counter }} - {{ case.name }} + {{ case.name }} {% if case.account %} {{ case.account }} @@ -118,12 +125,15 @@ {{ case.status }} {{ case.priority }} - {# View #} - + + {% if request.user == case.created_by or request.user.role == "ADMIN" or request.user.is_superuser %} - + {% if case.status != 'Closed' %} - + {% endif %} {% endif %} @@ -143,45 +153,176 @@
+ + +{% for case_record in cases %} + + + + +{% endfor %} + + {% endblock %} {% block js_block %} diff --git a/contacts/templates/contacts.html b/contacts/templates/contacts.html index a88aaa3a..077fc5f9 100644 --- a/contacts/templates/contacts.html +++ b/contacts/templates/contacts.html @@ -11,7 +11,8 @@
@@ -25,28 +26,31 @@
- +
- +
- + Clear
@@ -65,11 +69,12 @@
- Contacts - {% if show_pageitems %} {% show_pageitems %}{% else %} {{contact_obj_list|length}}{% endif %} - - - - + Contacts - {% if show_pageitems %} {% show_pageitems %}{% else %} + {{contact_obj_list|length}}{% endif %} + + + +
@@ -77,12 +82,12 @@ {% if contact_obj_list|length > 0 %} - S.no - Name + S.no + Name Assigned To - City - State - Actions + City + State + Actions {% endif %} @@ -95,25 +100,26 @@ {% for contact in contact_obj_list %} {{ forloop.counter }} - {{contact.first_name}} {{contact.last_name}} + {{contact.first_name}} + {{contact.last_name}} - {% with contact_users=contact.assigned_to.all %} - {% for user in contact_users %} - {% if user.profile_pic %} + {% with contact_users=contact.assigned_to.all %} + {% for user in contact_users %} + {% if user.profile_pic %} {% thumbnail user.profile_pic "40x40" crop="center" as im %} {% endthumbnail %} - {% else %} - - - - {% endif %} - {% empty %} - None - {% endfor %} - {% endwith %} + {% else %} + + + + {% endif %} + {% empty %} + None + {% endfor %} + {% endwith %} {% if contact.address.city %} @@ -130,10 +136,12 @@ {% endif %} - {# View #} - + + {% if request.user == contact.created_by or request.user.role == "ADMIN" or request.user.is_superuser %} - + {% endif %} @@ -155,30 +163,140 @@
+ + +{% for contact_record in contact_obj_list %} + + + +{% endfor %} + + + {%endblock%} {% block js_block %} diff --git a/invoices/templates/invoices_list.html b/invoices/templates/invoices_list.html index 24babbcb..89f95506 100644 --- a/invoices/templates/invoices_list.html +++ b/invoices/templates/invoices_list.html @@ -143,7 +143,7 @@ {% for invoice in invoices %} {{ forloop.counter }} - + {{ invoice.invoice_title }} {{ invoice.invoice_number }} {{ invoice.email }} @@ -188,6 +188,8 @@ {% if request.user == invoice.created_by or request.user.role == "ADMIN" or request.user.is_superuser %} + {% if invoice.is_draft %} @@ -330,6 +332,222 @@
+ + +{% for invoice in invoices %} + + + + + + +{% endfor %} + + {% endblock %} {% block js_block %} diff --git a/leads/models.py b/leads/models.py index e7aa7822..41109e9d 100644 --- a/leads/models.py +++ b/leads/models.py @@ -1,12 +1,13 @@ +import arrow from django.db import models from django.utils.translation import pgettext_lazy from django.utils.translation import ugettext_lazy as _ - -from common.models import User -from common.utils import (LEAD_STATUS, LEAD_SOURCE, - COUNTRIES, return_complete_address) from phonenumber_field.modelfields import PhoneNumberField + from accounts.models import Tags +from common.models import User +from common.utils import (COUNTRIES, LEAD_SOURCE, LEAD_STATUS, + return_complete_address) from contacts.models import Contact @@ -66,3 +67,7 @@ class Lead(models.Model): def get_complete_address(self): return return_complete_address(self) + + @property + def created_on_arrow(self): + return arrow.get(self.created_on).humanize() diff --git a/leads/templates/leads.html b/leads/templates/leads.html index 0342c213..38b07ec2 100644 --- a/leads/templates/leads.html +++ b/leads/templates/leads.html @@ -144,8 +144,13 @@ {% for lead in open_leads %} {{ forloop.counter }} - - {{ lead.title }} + + + + {{ lead.title }} + + {% if lead.created_by %} {% if lead.created_by.profile_pic %} @@ -198,8 +203,10 @@ {% endif %} {% endwith %} - {{ lead.created_on }} + {{ lead.created_on_arrow }} + {% if request.user == lead.created_by or request.user.role == "ADMIN" or request.user.is_superuser %} @@ -256,7 +263,7 @@ {% for lead in close_leads %} {{ forloop.counter }} - + {{ lead.title }} {{ lead.source }} {{ lead.get_status_display }} @@ -293,6 +300,8 @@ {{ lead.created_on }} + {% if request.user == lead.created_by %} @@ -319,6 +328,334 @@
+ + + +{% for lead_record in open_leads %} + + + + +{% endfor %} + + +{% for lead_record in close_leads %} + + + + +{% endfor %} + {% endblock %} {% block js_block %} diff --git a/leads/templates/view_leads.html b/leads/templates/view_leads.html index 9b1c92c2..27fb33f3 100644 --- a/leads/templates/view_leads.html +++ b/leads/templates/view_leads.html @@ -36,8 +36,10 @@
diff --git a/marketing/forms.py b/marketing/forms.py index fa71c06a..235dd637 100644 --- a/marketing/forms.py +++ b/marketing/forms.py @@ -11,7 +11,7 @@ from marketing.models import ( EmailTemplate, Campaign, Tag ) -email_regex = '^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$' +email_regex = '^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,4})$' def csv_doc_validate(document): diff --git a/opportunity/templates/opportunity.html b/opportunity/templates/opportunity.html index 33f17f1c..620d81dd 100644 --- a/opportunity/templates/opportunity.html +++ b/opportunity/templates/opportunity.html @@ -117,7 +117,7 @@ S.No Name Assigned To - Tags + Tags Account Stage @@ -135,7 +135,9 @@ {% for opportunity in opportunity_list %} {{ forloop.counter }} - {{ opportunity.name }} + {{ opportunity.name }} {% with opportunity_users=opportunity.assigned_to.all %} {% for user in opportunity_users %} @@ -188,7 +190,7 @@ {% if opportunity.lead_source %}{{ opportunity.lead_source }}{% else %}Not Specified{% endif %} - + {% if request.user == opportunity.created_by or request.user.role == "ADMIN" or request.user.is_superuser %} @@ -216,6 +218,170 @@
+ + +{% for opportunity_record in opportunity_list %} + + + + +{% endfor %} {% endblock %} {% block js_block %} diff --git a/requirements.txt b/requirements.txt index a128e721..46b7499f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -Django==2.2.2 +Django==2.2.3 boto==2.49.0 boto3==1.9.94 django-simple-pagination==1.3 @@ -25,3 +25,4 @@ vine==1.2.0 openpyxl==2.6.0 lxml==4.3.2 cssselect==1.0.3 +arrow==0.14.2 \ No newline at end of file diff --git a/tasks/templates/tasks_tasks_list.html b/tasks/templates/tasks_tasks_list.html index fab37e74..399dfa33 100644 --- a/tasks/templates/tasks_tasks_list.html +++ b/tasks/templates/tasks_tasks_list.html @@ -116,7 +116,7 @@ {% if task.due_date < today and task.status != 'completed' %} {{ forloop.counter }} - {% if task.title %}{% if task.title %}{{ task.title }}{% endif %} @@ -165,6 +165,8 @@ {% if request.user == task.created_by or request.user.role == 'ADMIN' %} + {{ forloop.counter }} - {% if task.title %}{{ task.title }}{% endif %} + {% if task.title %}{{ task.title }}{% endif %} {% if task.created_by %} @@ -225,6 +227,8 @@ {% if request.user == task.created_by or request.user.role == 'ADMIN' %} + {{ forloop.counter }} - {% if task.title %}{{ task.title }}{% endif %} + {% if task.title %}{{ task.title }}{% endif %} {% if task.created_by %} @@ -284,6 +288,8 @@ {% if request.user == task.created_by or request.user.role == 'ADMIN' %} +
+ +{% for task in tasks %} + + + + +{% endfor %} + + + {% endblock %} {% block js_block %} diff --git a/teams/templates/teams.html b/teams/templates/teams.html index ed51eb0b..d4df5acc 100644 --- a/teams/templates/teams.html +++ b/teams/templates/teams.html @@ -120,7 +120,7 @@ {% for team in teams %} {{ forloop.counter }} - + {{ team.name }} {{ team.description }} @@ -161,6 +161,8 @@ {{ team.created_on|date:'d-m-Y' }} {% if request.user == team.created_by or request.user.role == 'ADMIN' or reques.user.is_superuser %} +
+ +{% for team_obj in teams %} + + + + + + +{% endfor %} + {% endblock %} {% block js_block %}