From abcd47f6006b95342c280e4b26628587d01cdb22 Mon Sep 17 00:00:00 2001 From: Ashwin Date: Thu, 11 Jul 2019 20:07:12 +0530 Subject: [PATCH] marketing module and invoicing enhancements --- accounts/templates/accounts.html | 19 +- cases/templates/cases.html | 7 + common/models.py | 5 + common/templates/doc_list.html | 7 +- contacts/templates/contacts.html | 5 + events/models.py | 6 + events/templates/events_list.html | 7 +- invoices/models.py | 5 + invoices/templates/invoice_create_1.html | 6 + invoices/templates/invoices_detail_1.html | 4 + invoices/templates/invoices_list.html | 7 +- leads/templates/leads.html | 17 +- leads/views.py | 3 + marketing/forms.py | 39 +- marketing/models.py | 29 + marketing/templatetags/__init__.py | 0 marketing/templatetags/digg_paginator.py | 87 +++ marketing/urls.py | 4 +- marketing/views.py | 92 +++- opportunity/templates/opportunity.html | 23 +- static/css/main.scss | 2 +- tasks/templates/tasks_tasks_list.html | 3 + teams/models.py | 6 + teams/templates/teams.html | 7 +- templates/contact_list_digg_paginator.html | 46 ++ templates/marketing/campaign/index.html | 4 +- templates/marketing/dashboard.html | 2 +- templates/marketing/email_template/index.html | 2 +- templates/marketing/lists/all.html | 4 +- templates/marketing/lists/detail.html | 511 ++++++++++++++---- templates/marketing/lists/index.html | 31 +- templates/marketing/lists/new.html | 2 +- templates/sales/index.html | 67 ++- 33 files changed, 881 insertions(+), 178 deletions(-) create mode 100644 marketing/templatetags/__init__.py create mode 100644 marketing/templatetags/digg_paginator.py create mode 100644 templates/contact_list_digg_paginator.html diff --git a/accounts/templates/accounts.html b/accounts/templates/accounts.html index 8b7231b4..92c90d3f 100644 --- a/accounts/templates/accounts.html +++ b/accounts/templates/accounts.html @@ -1,9 +1,14 @@ {% extends 'sales/base.html' %} {% load staticfiles %} {% load paginate %} -{% block extralinks %} {% load thumbnail %} +{% block extralinks %} + {% endblock %} {% block content %} @@ -145,7 +150,8 @@ {% with tags=each_account.tags.all %} {% if tags %} {% for tag in tags %} - {{ tag.name }} + {{ tag.name }} {% endfor %} {% else %} No Tags @@ -234,7 +240,8 @@ {% with tags=each_account.tags.all %} {% if tags %} {% for tag in tags %} - {{ tag.name }} + {{ tag.name }} {% endfor %} {% else %} No Tags @@ -644,6 +651,12 @@ $("#close-tab").click(function (e) { $("#tab_status").val('Closed'); }) + $(".tag_class_acc").click(function () { + // $(".tag_class_acc").css('cursor', 'pointer') + url = "{% url 'accounts:list' %}" + url = url + "?tag=" + $(this).attr('data-link') + window.location.href = url; + }); // $(".account_modal").click(function (e) { // console.log('clicked') diff --git a/cases/templates/cases.html b/cases/templates/cases.html index 743549e0..f8d5d661 100644 --- a/cases/templates/cases.html +++ b/cases/templates/cases.html @@ -1,6 +1,13 @@ {% extends 'sales/base.html' %} {% load staticfiles %} {% load paginate %} +{% block extralinks %} + +{% endblock %} {% block content %}
diff --git a/common/models.py b/common/models.py index 86eb04de..b5dfa6cf 100644 --- a/common/models.py +++ b/common/models.py @@ -1,3 +1,4 @@ +import arrow import binascii import os import time @@ -280,6 +281,10 @@ class Document(models.Model): def __str__(self): return self.title + @property + def created_on_arrow(self): + return arrow.get(self.created_on).humanize() + def generate_key(): return binascii.hexlify(os.urandom(8)).decode() diff --git a/common/templates/doc_list.html b/common/templates/doc_list.html index 7fe4a533..80c500db 100644 --- a/common/templates/doc_list.html +++ b/common/templates/doc_list.html @@ -4,6 +4,11 @@ {% load thumbnail %} {% block extralinks %} + {% endblock %} {% block content %} @@ -119,7 +124,7 @@ None {% endif %} - {{document.created_on}} + {{document.created_on_arrow}} {{document.status}} {% with document_users=document.shared_to.all %} diff --git a/contacts/templates/contacts.html b/contacts/templates/contacts.html index 077fc5f9..42b98682 100644 --- a/contacts/templates/contacts.html +++ b/contacts/templates/contacts.html @@ -4,6 +4,11 @@ {% load thumbnail %} {% block extralinks %} + {% endblock %} {% block content %} diff --git a/events/models.py b/events/models.py index 2664fa17..d6a0e9a8 100644 --- a/events/models.py +++ b/events/models.py @@ -1,3 +1,5 @@ +import arrow + from django.db import models from django.utils.translation import pgettext_lazy from django.utils.translation import ugettext_lazy as _ @@ -43,3 +45,7 @@ class Event(models.Model): disabled = models.BooleanField(default=False) date_of_meeting = models.DateField(blank=True, null=True) # tags = models.ManyToManyField(Tag) + + @property + def created_on_arrow(self): + return arrow.get(self.created_on).humanize() diff --git a/events/templates/events_list.html b/events/templates/events_list.html index 34c13979..976f7a0b 100644 --- a/events/templates/events_list.html +++ b/events/templates/events_list.html @@ -4,6 +4,11 @@ {% load thumbnail %} {% block extralinks %} + {% endblock %} {% block content %} @@ -179,7 +184,7 @@ {{ event.start_date }} {{ event.date_of_meeting }} {{ event.end_date }} - {{ event.created_on|date:'d-m-Y' }} + {{ event.created_on_arrow }} {% if event.created_by %} {% if event.created_by.profile_pic %} diff --git a/invoices/models.py b/invoices/models.py index 4d2ae3bd..76c196db 100644 --- a/invoices/models.py +++ b/invoices/models.py @@ -1,3 +1,4 @@ +import arrow from django.db import models from django.utils.translation import ugettext_lazy as _ from common.models import Address, User @@ -93,3 +94,7 @@ class Invoice(models.Model): return True else: return False + + @property + def created_on_arrow(self): + return arrow.get(self.created_on).humanize() \ No newline at end of file diff --git a/invoices/templates/invoice_create_1.html b/invoices/templates/invoice_create_1.html index 81ef34ab..f36d1eb3 100644 --- a/invoices/templates/invoice_create_1.html +++ b/invoices/templates/invoice_create_1.html @@ -6,6 +6,12 @@ + {% endblock %}