This commit is contained in:
Ashwin 2018-04-11 22:21:51 +05:30
parent 384aaec907
commit 32b6cd72f2
51 changed files with 482 additions and 426 deletions

View file

@ -1 +0,0 @@
web: sh -c 'gunicorn crm.wsgi && pip install -r requirements.txt'

View file

@ -1,7 +1,8 @@
Django-CRM
==========
Django-CRM provides a Customer relationship management dashboard where you can manage customers at sales of the organization. It Provides to manage leads information and its activity, track issues from leads, manage contacts to send emails of their progress.
Django CRM is opensourse CRM developed on django framework. It has all the basic features of CRM to start with. We welcome code contributions and feature requests via github.
.. image:: https://travis-ci.org/MicroPyramid/Django-CRM.svg?branch=master
:target: https://travis-ci.org/MicroPyramid/Django-CRM
@ -31,11 +32,19 @@ This project contains the following modules.
* Opportunity
* Planner
Installation
============
dependency for debian and ubuntu:
apt install ruby-sass
Installation - Requirements
===========================
Ubuntu 64bit - 16.04
--------------------
$ sudo apt-get update && apt-get upgrade -y
$ sudo apt-get install -y curl wget libpq-dev python3-dev gem ruby ruby-dev build-essential libssl-dev libffi-dev python-dev python-virtualenv python-pip git redis-server libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev tcl8.6-dev tk8.6-dev python-tk
$ sudo gem install sass
If you cloned the package from git use virtualenv to install requirements::
@ -54,4 +63,6 @@ Credentials to CRM Dashboard:
We welcome your feedback and support, raise github ticket if you want to report a bug. Need new features? `Contact us here`_
.. _contact us here: https://micropyramid.com/contact-us/
.. _Demo: https://django-crm.micropyramid.com/

View file

@ -0,0 +1,17 @@
# Generated by Django 2.0 on 2018-04-10 08:42
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0002_auto_20170926_1752'),
]
operations = [
migrations.AlterModelOptions(
name='account',
options={'ordering': ['-created_on']},
),
]

View file

@ -25,7 +25,7 @@ def accounts_list(request):
industry = request.POST.get('industry')
if name:
accounts_list = Account.objects.filter(name__icontains=name)
accounts_list = accounts_list.filter(name__icontains=name)
if city:
accounts_list = accounts_list.filter(
billing_address__in=[i.id for i in Address.objects.filter(city__contains=city)])

View file

@ -1,10 +0,0 @@
{
"name": "Django-CRM",
"description": "Customer Relationship Management Dashboard",
"repository": "https://github.com/MicroPyramid/Django-CRM.git",
"addons": ["heroku-postgresql:hobby-dev"],
"scripts": {
"postdeploy": "python manage.py makemigrations && python manage.py migrate && echo \"from common.models import User; User.objects.create_superuser('Admin001', 'admin001')\" | python manage.py shell"
},
"env": {}
}

View file

@ -0,0 +1,17 @@
# Generated by Django 2.0 on 2018-04-10 08:42
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cases', '0002_auto_20170926_1752'),
]
operations = [
migrations.AlterModelOptions(
name='case',
options={'ordering': ['-created_on']},
),
]

View file

@ -25,7 +25,7 @@ def cases_list(request):
if not account:
account = 0
if name:
cases = Case.objects.filter(name__contains=name)
cases = cases.filter(name__contains=name)
if account:
cases = cases.filter(account=account)
if status:

View file

@ -119,3 +119,20 @@ class LoginForm(forms.ModelForm):
raise forms.ValidationError("Invalid email and password")
return self.cleaned_data
class ChangePasswordForm(forms.Form):
CurrentPassword = forms.CharField(max_length=100)
Newpassword = forms.CharField(max_length=100)
confirm = forms.CharField(max_length=100)
def __init__(self, *args, **kwargs):
super(ChangePasswordForm, self).__init__(*args, **kwargs)
def clean_confirm(self):
if len(self.data.get('confirm')) < 4:
raise forms.ValidationError(
'Password must be at least 4 characters long!')
if self.data.get('confirm') != self.cleaned_data.get('Newpassword'):
raise forms.ValidationError(
'Confirm password do not match with new password')
return self.data.get('confirm')

View file

@ -1,25 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-03-21 06:05
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('common', '0002_auto_20170926_1752'),
]
operations = [
migrations.AddField(
model_name='user',
name='first_name',
field=models.CharField(blank=True, max_length=150),
),
migrations.AddField(
model_name='user',
name='last_name',
field=models.CharField(blank=True, max_length=150),
),
]

View file

@ -3,9 +3,10 @@ from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponseRedirect, JsonResponse
from django.contrib.auth import logout, authenticate, login
from django.contrib.auth.hashers import check_password
from common.models import User
from common.forms import UserForm, LoginForm
from common.forms import UserForm, LoginForm, ChangePasswordForm
@login_required
@ -15,13 +16,29 @@ def home(request):
@login_required
def change_pass(request):
return render(request, 'change_password.html')
error, errors = "", ""
form = ChangePasswordForm()
if request.method == 'POST':
form = ChangePasswordForm(request.POST)
if form.is_valid():
user = request.user
if not check_password(request.POST['CurrentPassword'], user.password):
error = "Invalid old password"
else:
user.set_password(request.POST.get('Newpassword'))
user.is_active = True
user.save()
return HttpResponseRedirect('/')
else:
errors = form.errors
return render(request, "change_password.html", {'error': error,
'errors': errors})
@login_required
def profile(request):
user = request.user
user_obj = User.objects.filter(id=user.id)
user_obj = User.objects.get(id=user.id)
return render(request, "profile.html", {'user_obj': user_obj})
@csrf_exempt
@ -64,13 +81,13 @@ def users_list(request):
active_users = User.objects.filter(is_active=True)
inactive_users = User.objects.filter(is_active=False)
if first_name:
users_list = User.objects.filter(first_name__icontains=first_name)
users_list = users_list.filter(first_name__icontains=first_name)
if last_name:
users_list = User.objects.filter(last_name__icontains=last_name)
users_list = users_list.filter(last_name__icontains=last_name)
if username:
users_list = User.objects.filter(username__icontains=username)
users_list = users_list.filter(username__icontains=username)
if email:
users_list = User.objects.filter(email__icontains=email)
users_list = users_list.filter(email__icontains=email)
return render(request, "users/list.html", {
'users': users_list, 'active_users': active_users,
'per_page': page, 'inactive_users': inactive_users
@ -117,7 +134,10 @@ def edit_user(request, user_id):
user_form = UserForm(request.POST, instance=user_obj)
if user_form.is_valid():
user_form.save()
return redirect("common:users_list")
if not request.user.is_staff:
return redirect("common:profile")
else:
return redirect("common:users_list")
else:
return render(request, 'users/create.html', {'user_form': user_form, "errors": user_form.errors})
else:

View file

@ -1,5 +1,4 @@
import os
import dj_database_url
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@ -73,25 +72,19 @@ WSGI_APPLICATION = 'crm.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
if 'DATABASE_URL' in os.environ:
DATABASES = {
'default': dj_database_url.config(
default='sqlite:////{0}'.format(
os.path.join(BASE_DIR, 'db.sqlite3'))
)
}
STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
STATIC_ROOT = (os.path.join(BASE_DIR, "static"))
else:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'dj_crm',
'USER': 'postgres',
'PASSWORD': 'root',
'HOST': '127.0.0.1',
'PORT': '5432'
}
}
STATICFILES_DIRS = [os.path.join(BASE_DIR, "static"), ]
STATICFILES_DIRS = [os.path.join(BASE_DIR, "static"), ]
# Password validation

View file

@ -1,7 +1,6 @@
import os
import sys
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise
PROJECT_DIR = os.path.abspath(__file__)
@ -11,4 +10,3 @@ sys.path.append(PROJECT_DIR)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "crm.settings")
application = get_wsgi_application()
application = DjangoWhiteNoise(application)

View file

@ -32,10 +32,9 @@ Installation - Requirements
Ubuntu 64bit - 16.04
--------------------
$ sudo apt-get update && apt-get upgrade -y
$ sudo apt-get install -y curl wget libpq-dev python3-dev gem ruby ruby-dev build-essential libssl-dev libffi-dev python-dev python-virtualenv python-pip git redis-server libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev tcl8.6-dev tk8.6-dev python-tk
$ sudo gem install sass
Visit our Django web development page [Here](https://micropyramid.com/django-ecommerce-development/)

View file

@ -0,0 +1,17 @@
# Generated by Django 2.0 on 2018-04-10 08:42
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('emails', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='email',
options={'ordering': ['-id']},
),
]

View file

@ -16,3 +16,6 @@ class Email(models.Model):
def __unicode__(self):
return self.timedelta
class Meta:
ordering = ['-id']

View file

@ -0,0 +1,17 @@
# Generated by Django 2.0 on 2018-04-10 08:42
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('leads', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='lead',
options={'ordering': ['-created_on']},
),
]

View file

@ -12,31 +12,32 @@ from common.models import User, Address, Comment, Team
from common.utils import LEAD_STATUS, LEAD_SOURCE, INDCHOICES, TYPECHOICES, COUNTRIES
from leads.forms import LeadCommentForm, LeadForm
from accounts.forms import AccountForm
from common.forms import BillingAddressForm
from common.forms import BillingAddressForm, ShippingAddressForm
from accounts.models import Account
from planner.models import Event, Reminder
from planner.forms import ReminderForm
from opportunity.forms import OpportunityForm
# CRUD Operations Start
@login_required
def leads_list(request):
lead_obj = Lead.objects.all()
lead_obj = Lead.objects.all().exclude(status='converted')
page = request.POST.get('per_page')
first_name = request.POST.get('first_name')
last_name = request.POST.get('last_name')
city = request.POST.get('city')
email = request.POST.get('email')
if first_name:
lead_obj = Lead.objects.filter(first_name__icontains=first_name)
lead_obj = lead_obj.filter(first_name__icontains=first_name)
if last_name:
lead_obj = Lead.objects.filter(last_name__icontains=last_name)
lead_obj = lead_obj.filter(last_name__icontains=last_name)
if city:
lead_obj = Lead.objects.filter(address=Address.objects.filter
lead_obj = lead_obj.filter(address=Address.objects.filter
(city__icontains=city))
if email:
lead_obj = Lead.objects.filter(email__icontains=email)
lead_obj = lead_obj.filter(email__icontains=email)
return render(request, 'leads/leads.html', {
'lead_obj': lead_obj, 'per_page': page})
@ -66,10 +67,12 @@ def add_lead(request):
lead_obj.assigned_to.add(*assignedto_list)
lead_obj.teams.add(*teams_list)
if request.POST.get('status') == "converted":
Account.objects.create(
account_object = Account.objects.create(
created_by=request.user, name=lead_account,
email=lead_email, phone=lead_phone
)
account_object.billing_address = address_object
account_object.save()
if request.POST.get("savenewform"):
return HttpResponseRedirect(reverse("leads:add_lead"))
else:
@ -144,10 +147,12 @@ def edit_lead(request, lead_id):
lead_obj.teams.clear()
lead_obj.teams.add(*teams_list)
if request.POST.get('status') == "converted":
Account.objects.create(
account_object = Account.objects.create(
created_by=request.user, name=lead_account,
email=lead_email, phone=lead_phone
)
account_object.billing_address = dis_address_obj
account_object.save()
return HttpResponseRedirect(reverse('leads:list'))
else:
return render(request, 'leads/create_lead.html', {

View file

@ -0,0 +1,17 @@
# Generated by Django 2.0 on 2018-04-10 08:42
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('opportunity', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='opportunity',
options={'ordering': ['-created_on']},
),
]

View file

@ -28,7 +28,7 @@ def opp_list(request):
opp_stage = request.POST.get('stage')
opp_source = request.POST.get('lead_source')
if opp_name:
opportunity_list = Opportunity.objects.filter(name__contains=opp_name)
opportunity_list = opportunity_list.filter(name__contains=opp_name)
if opp_stage:
opportunity_list = opportunity_list.filter(stage=opp_stage)
if opp_source:

View file

@ -0,0 +1,20 @@
# Generated by Django 2.0 on 2018-04-10 08:42
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.query_utils
class Migration(migrations.Migration):
dependencies = [
('planner', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='event',
name='content_type',
field=models.ForeignKey(blank=True, choices=[(10, 'Account'), (13, 'Lead'), (14, 'Opportunity'), (11, 'Case')], limit_choices_to=django.db.models.query_utils.Q(django.db.models.query_utils.Q(('app_label', 'account'), ('model', 'Account'), ('id', 10), _connector='AND'), django.db.models.query_utils.Q(('app_label', 'leads'), ('model', 'Lead'), ('id', 13), _connector='AND'), django.db.models.query_utils.Q(('app_label', 'opportunity'), ('model', 'Opportunity'), ('id', 14), _connector='AND'), django.db.models.query_utils.Q(('app_label', 'cases'), ('model', 'Case'), ('id', 11), _connector='AND'), _connector='OR'), null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType'),
),
]

View file

@ -2,9 +2,6 @@ Django==2.0
django-simple-pagination==1.1.8
pytz==2018.3
psycopg2==2.7.4
gunicorn==19.7.1
whitenoise==3.3.1
dj-database-url==0.4.2
redis
django-compressor==2.2
coverage
coverage

View file

@ -634,3 +634,29 @@ $color_2: #000;
list-style-type: none;
padding: 0px;
}
.view-pad{
padding:0px !important;
h5{
width: 79%;
margin-bottom: 0;
position: relative;
font-size: 13px;
display: inline-block;
text-align: left;
padding-top: 0px;
}
a{
float: right;
margin-right: 95px;
border-radius: 0;
font-size: 12px;
padding: 3px 10px;
color: #fff;
margin-top: -4px;
&:hover{
text-decoration:none;
}
}
}

View file

@ -1,108 +0,0 @@
/*Cookie Js Starts*/
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}
return cookieValue;
}
/*Cookie Js Ends*/
/*Comment Add Js Start*/
$("#comment_form").submit(function(e){
e.preventDefault()
var formData = new FormData($("#comment_form")[0]);
$.ajax({
url : "/accounts/comment/add/",
type : "POST",
data : formData,
cache: false,
contentType: false,
processData: false,
success: function(data){
if(data.error){
$("#CommentError").html(data.error).show()
}
else {
$("#comments_div").prepend("<li class='list-group-item list-row' id='comment"+data.com_id+"'>"+
"<div class='pull-right right-container'>"+
"<div class='list-row-buttons btn-group pull-right'>"+
"<button class='btn btn-link btn-sm dropdown-toggle' data-toggle='dropdown' type='button'><span class='caret'></span></button>"+
"<ul class='dropdown-menu pull-right'>"+
"<li><a class='action' onclick='edit_comment("+data.com_id+")'>Edit</a></li>"+
"<li><a class='action' onclick='remove_comment("+data.com_id+")''>Remove</a></li></ul></div></div>"+
"<div class='stream-head-container'> "+data.com_user+" Commented</div>"+
"<div class='stream-post-container' id='comment_name"+data.com_id+"'>"+data.comment+"</div>"+
"<div class='stream-date-container"+data.com_id+"'>"+data.comment_date+"</div></div><div class='stream-date-container' id='comment_file_div"+data.com_id+"'><div id='new_comment"+data.com_id+"'</div></div></li>"
)
$("#id_comments").val("")
alert("Comment Submitted")
}
}
});
});
/*Comment Add Js Ends*/
/*Comment Remove Js Start*/
function edit_comment(x){
$('#myModal_comment').modal('show');
comment = $("#comment_name"+x).text()
$("#commentid").val(x)
$("#id_editcomment").val(comment)
}
$("#comment_edit").click(function(e){
e.preventDefault()
var formData = new FormData($("#comment_edit_form")[0]);
$.ajax({
url : "/accounts/comment/edit/",
type : "POST",
data : formData,
cache: false,
contentType: false,
processData: false,
success:function(data){
if(data.error) {
alert(data.error)
} else {
$("#comment_name"+data.commentid).text(data.comment)
$('#myModal_comment').modal('hide');
$("#id_editcomment").val("")
}
}
})
});
/*Comment Remove Js Ends*/
/*Comment Remove Js Start*/
function remove_comment(x){
var csrftoken = getCookie('csrftoken');
var warn = confirm("Are You Sure, you Want to Delete this Comment!?")
if (warn == true){
$.post('/accounts/comment/remove/', {"comment_id":x, "csrfmiddlewaretoken": csrftoken, }, function(data){
if(data.error){
alert(data.error)
} else {
$("#comment"+data.cid).remove()
}
})
}
}
/*Comment Remove Js Ends*/

View file

@ -1,53 +1,61 @@
/*Cookie Js Starts*/
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}
}
return cookieValue;
return cookieValue;
}
$("#comment_form").submit(function (e) {
/*Cookie Js Ends*/
/*Comment Add Js Start*/
$("#comment_form").submit(function(e){
e.preventDefault()
var formData = new FormData($("#comment_form")[0]);
$.ajax({
url: "/accounts/comment/add/",
type: "POST",
data: formData,
url : "/accounts/comment/add/",
type : "POST",
data : formData,
cache: false,
contentType: false,
processData: false,
success: function (data) {
if (data.error) {
success: function(data){
if(data.error){
$("#CommentError").html(data.error).show()
} else {
d = new Date(data.commented_on);
$("#comments_div").prepend("<li class='list-group-item list-row' id='comment" + data.comment_id + "'>" +
"<div class='pull-right right-container'>" +
"<div class='list-row-buttons btn-group pull-right'>" +
"<button class='btn btn-link btn-sm dropdown-toggle' data-toggle='dropdown' type='button'><span class='caret'></span></button>" +
"<ul class='dropdown-menu pull-right'>" +
"<li><a class='action' onclick='edit_comment(" + data.comment_id + ")'>Edit</a></li>" +
"<li><a class='action' onclick='remove_comment(" + data.comment_id + ")''>Remove</a></li></ul></div></div>" +
"<div class='stream-head-container'> " + data.commented_by + " Commented</div>" +
"<div class='stream-post-container' id='comment_name" + data.comment_id + "'><pre>" + data.comment + "</pre></div>" +
"<div class='stream-date-container" + data.comment_id + "'>" + d.toGMTString() + "</div></div><div class='stream-date-container' id='comment_file_div" + data.comment_id + "'><div id='new_comment" + data.comment_id + "'</div></div></li>"
)
$("#comments_div").prepend("<li class='list-group-item list-row' id='comment"+data.comment_id+"'>"+
"<div class='float-right right-container'>"+
"<div class='list-row-buttons btn-group float-right'>"+
"<button class='btn btn-link btn-sm dropdown-toggle' data-toggle='dropdown' type='button'><span class='caret'></span></button>"+
"<ul class='dropdown-menu text-center'>"+
"<li><a class='action' onclick='edit_comment("+data.comment_id+")'>Edit</a></li>"+
"<li><a class='action' onclick='remove_comment("+data.comment_id+")''>Remove</a></li></ul></div></div>"+
"<div class='stream-post-container' id='comment_name"+data.comment_id+"'><pre>"+data.comment+"</pre></div>"+
"<div class='stream-container'><pre class='float-left'>"+data.commented_by+"</pre><pre class='float-right'>"+d.toGMTString()+"</pre></div>"
)
$("#id_comments").val("")
alert("Comment Submitted")
$("#CommentError").html('')
}
}
})
})
});
});
/*Comment Add Js Ends*/
/*Comment Edit Js Start*/
function edit_comment(x) {
$('#Comments_Accounts_Modal').modal('show');
@ -80,12 +88,15 @@ $("#comment_edit").click(function (e) {
})
})
/*Comment Edit Js Ends*/
function HideError(e) {
$("#CommentError").hide()
$("#CommentEditError").hide()
}
/*Comment Remove Js Start*/
function remove_comment(x) {
var csrftoken = getCookie('csrftoken');
var con = confirm("Do you want to Delete it for Sure!?")
@ -102,3 +113,5 @@ function remove_comment(x) {
})
}
}
/*Comment Remove Js Ends*/

View file

@ -30,15 +30,14 @@ $("#comment_form").submit(function (e) {
} else {
d = new Date(data.commented_on);
$("#comments_div").prepend("<li class='list-group-item list-row' id='comment" + data.comment_id + "'>" +
"<div class='pull-right right-container'>" +
"<div class='list-row-buttons btn-group pull-right'>" +
"<div class='float-right right-container'>" +
"<div class='list-row-buttons btn-group float-right'>" +
"<button class='btn btn-link btn-sm dropdown-toggle' data-toggle='dropdown' type='button'><span class='caret'></span></button>" +
"<ul class='dropdown-menu pull-right'>" +
"<ul class='dropdown-menu text-center'>" +
"<li><a class='action' onclick='edit_comment(" + data.comment_id + ")'>Edit</a></li>" +
"<li><a class='action' onclick='remove_comment(" + data.comment_id + ")''>Remove</a></li></ul></div></div>" +
"<div class='stream-head-container'> " + data.commented_by + " Commented</div>" +
"<div class='stream-post-container' id='comment_name" + data.comment_id + "'><pre>" + data.comment + "</pre></div>" +
"<div class='stream-date-container" + data.comment_id + "'>" + d.toGMTString() + "</div></div><div class='stream-date-container' id='comment_file_div" + data.comment_id + "'><div id='new_comment" + data.comment_id + "'</div></div></li>"
"<div class='stream-post-container' id='comment_name"+data.comment_id+"'><pre>"+data.comment+"</pre></div>"+
"<div class='stream-container'><pre class='float-left'>"+data.commented_by+"</pre><pre class='float-right'>"+d.toGMTString()+"</pre></div>"
)
$("#id_comments").val("")
alert("Comment Submitted")

View file

@ -30,15 +30,14 @@ $("#comment_form").submit(function (e) {
} else {
d = new Date(data.commented_on);
$("#comments_div").prepend("<li class='list-group-item list-row' id='comment" + data.comment_id + "'>" +
"<div class='pull-right right-container'>" +
"<div class='list-row-buttons btn-group pull-right'>" +
"<div class='float-right right-container'>" +
"<div class='list-row-buttons btn-group float-right'>" +
"<button class='btn btn-link btn-sm dropdown-toggle' data-toggle='dropdown' type='button'><span class='caret'></span></button>" +
"<ul class='dropdown-menu pull-right'>" +
"<ul class='dropdown-menu text-center'>" +
"<li><a class='action' onclick='edit_comment(" + data.comment_id + ")'>Edit</a></li>" +
"<li><a class='action' onclick='remove_comment(" + data.comment_id + ")''>Remove</a></li></ul></div></div>" +
"<div class='stream-head-container'> " + data.commented_by + " Commented</div>" +
"<div class='stream-post-container' id='comment_name" + data.comment_id + "'><pre>" + data.comment + "</pre></div>" +
"<div class='stream-date-container" + data.comment_id + "'>" + d.toGMTString() + "</div></div><div class='stream-date-container' id='comment_file_div" + data.comment_id + "'><div id='new_comment" + data.comment_id + "'</div></div></li>"
"<div class='stream-post-container' id='comment_name"+data.comment_id+"'><pre>"+data.comment+"</pre></div>"+
"<div class='stream-container'><pre class='float-left'>"+data.commented_by+"</pre><pre class='float-right'>"+d.toGMTString()+"</pre></div>"
)
$("#id_comments").val("")
alert("Comment Submitted")

View file

@ -1,75 +0,0 @@
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}
return cookieValue;
}
$('#comment_submit').click(function(e) {
e.preventDefault();
$.ajax({
url: '/leads/create_comment/',
type: 'POST',
dataType: 'html',
data: $('#comment_form').serialize(),
success: function(response) {
window.location = ""
console.log(response);
},
error: function(e) {
console.log(e);
}
});
});
function edit_comment(x){
$('#myModal').modal('show');
comment = $("#comment_name"+x).text()
$("#commentid").val(x)
$("#id_editcomment").val(comment)
}
$("#comment_edit").click(function(e){
e.preventDefault()
$.get('/leads/create_comment/', $("#comment_edit_form").serialize(), function(data){
if(data.error)
{
$('#id_editcomment').attr('placeholder',data.error);
}
else{
$("#comment_name"+data.commentid).text(data.comment)
$('#myModal').modal('hide');
}
})
})
function HideError(e){
$("#CommentError").hide()
}
function remove_comment(x){
var csrftoken = getCookie('csrftoken');
$.post('/leads/remove_comment/', {"comment_id":x, "csrfmiddlewaretoken": csrftoken,}, function(data){
$("#comment"+data.cid).remove()
})
}
$(function () {
$('#start_date').datetimepicker();
});

View file

@ -30,15 +30,15 @@ $("#comment_form").submit(function (e) {
} else {
d = new Date(data.commented_on);
$("#comments_div").prepend("<li class='list-group-item list-row' id='comment" + data.comment_id + "'>" +
"<div class='pull-right right-container'>" +
"<div class='list-row-buttons btn-group pull-right'>" +
"<div class='float-right right-container'>" +
"<div class='list-row-buttons btn-group float-right'>" +
"<button class='btn btn-link btn-sm dropdown-toggle' data-toggle='dropdown' type='button'><span class='caret'></span></button>" +
"<ul class='dropdown-menu pull-right'>" +
"<ul class='dropdown-menu text-center'>" +
"<li><a class='action' onclick='edit_comment(" + data.comment_id + ")'>Edit</a></li>" +
"<li><a class='action' onclick='remove_comment(" + data.comment_id + ")''>Remove</a></li></ul></div></div>" +
"<div class='stream-head-container'> " + data.commented_by + " Commented</div>" +
"<div class='stream-post-container' id='comment_name" + data.comment_id + "'><pre>" + data.comment + "</pre></div>" +
"<div class='stream-date-container" + data.comment_id + "'>" + d.toGMTString() + "</div></div><div class='stream-date-container' id='comment_file_div" + data.comment_id + "'><div id='new_comment" + data.comment_id + "'</div></div></li>"
"<div class='stream-post-container' id='comment_name"+data.comment_id+"'><pre>"+data.comment+"</pre></div>"+
"<div class='stream-container'><pre class='float-left'>"+data.commented_by+"</pre><pre class='float-right'>"+d.toGMTString()+"</pre></div>"+
"<div class='stream-date-container' id='comment_file_div"+data.comment_id+"'><div id='new_comment"+data.comment_id+"'</div></div></li>"
)
$("#id_comments").val("")
alert("Comment Submitted")

View file

@ -30,15 +30,14 @@ $("#comment_form").submit(function (e) {
} else {
d = new Date(data.commented_on);
$("#comments_div").prepend("<li class='list-group-item list-row' id='comment" + data.comment_id + "'>" +
"<div class='pull-right right-container'>" +
"<div class='list-row-buttons btn-group pull-right'>" +
"<div class='float-right right-container'>" +
"<div class='list-row-buttons btn-group float-right'>" +
"<button class='btn btn-link btn-sm dropdown-toggle' data-toggle='dropdown' type='button'><span class='caret'></span></button>" +
"<ul class='dropdown-menu pull-right'>" +
"<ul class='dropdown-menu text-center'>" +
"<li><a class='action' onclick='edit_comment(" + data.comment_id + ")'>Edit</a></li>" +
"<li><a class='action' onclick='remove_comment(" + data.comment_id + ")''>Remove</a></li></ul></div></div>" +
"<div class='stream-head-container'> " + data.commented_by + " Commented</div>" +
"<div class='stream-post-container' id='comment_name" + data.comment_id + "'><pre>" + data.comment + "</pre></div>" +
"<div class='stream-date-container" + data.comment_id + "'>" + d.toGMTString() + "</div></div><div class='stream-date-container' id='comment_file_div" + data.comment_id + "'><div id='new_comment" + data.comment_id + "'</div></div></li>"
"<div class='stream-post-container' id='comment_name"+data.comment_id+"'><pre>"+data.comment+"</pre></div>"+
"<div class='stream-container'><pre class='float-left'>"+data.commented_by+"</pre><pre class='float-right'>"+d.toGMTString()+"</pre></div>"
)
$("#id_comments").val("")
alert("Comment Submitted")

View file

@ -1 +0,0 @@
{"paths": {"admin/js/vendor/xregexp/xregexp.min.js": "admin/js/vendor/xregexp/xregexp.min.c95393b8ca4d.js", "admin/js/vendor/xregexp/xregexp.js": "admin/js/vendor/xregexp/xregexp.1865b1cf5085.js", "admin/js/vendor/xregexp/LICENSE-XREGEXP.txt": "admin/js/vendor/xregexp/LICENSE-XREGEXP.d64cecf4f157.txt", "admin/js/vendor/jquery/jquery.min.js": "admin/js/vendor/jquery/jquery.min.33cabfa15c10.js", "admin/js/vendor/jquery/LICENSE-JQUERY.txt": "admin/js/vendor/jquery/LICENSE-JQUERY.a158210a2737.txt", "admin/js/vendor/jquery/jquery.js": "admin/js/vendor/jquery/jquery.aacc43d6f308.js", "admin/img/gis/move_vertex_off.svg": "admin/img/gis/move_vertex_off.7a23bf31ef8a.svg", "admin/img/gis/move_vertex_on.svg": "admin/img/gis/move_vertex_on.0047eba25b67.svg", "admin/js/admin/DateTimeShortcuts.js": "admin/js/admin/DateTimeShortcuts.1536fb6bea1d.js", "admin/js/admin/RelatedObjectLookups.js": "admin/js/admin/RelatedObjectLookups.d2bdb1018963.js", "admin/fonts/Roboto-Light-webfont.woff": "admin/fonts/Roboto-Light-webfont.b446c2399bb6.woff", "admin/fonts/LICENSE.txt": "admin/fonts/LICENSE.d273d63619c9.txt", "admin/fonts/Roboto-Regular-webfont.woff": "admin/fonts/Roboto-Regular-webfont.ec39515ae8c6.woff", "admin/fonts/Roboto-Bold-webfont.woff": "admin/fonts/Roboto-Bold-webfont.2ad99072841e.woff", "admin/fonts/README.txt": "admin/fonts/README.2c3d0bcdede2.txt", "admin/img/selector-icons.svg": "admin/img/selector-icons.b4555096cea2.svg", "admin/img/LICENSE": "admin/img/LICENSE.2c54f4e1ca1c", "admin/img/icon-yes.svg": "admin/img/icon-yes.d2f9f035226a.svg", "admin/img/icon-changelink.svg": "admin/img/icon-changelink.18d2fd706348.svg", "admin/img/icon-calendar.svg": "admin/img/icon-calendar.ac7aea671bea.svg", "admin/img/sorting-icons.svg": "admin/img/sorting-icons.3a097b59f104.svg", "admin/img/icon-deletelink.svg": "admin/img/icon-deletelink.564ef9dc3854.svg", "admin/img/tooltag-add.svg": "admin/img/tooltag-add.e59d620a9742.svg", "admin/img/icon-clock.svg": "admin/img/icon-clock.e1d4dfac3f2b.svg", "admin/img/icon-unknown-alt.svg": "admin/img/icon-unknown-alt.81536e128bb6.svg", "admin/img/calendar-icons.svg": "admin/img/calendar-icons.39b290681a8b.svg", "admin/img/search.svg": "admin/img/search.7cf54ff789c6.svg", "admin/img/icon-addlink.svg": "admin/img/icon-addlink.d519b3bab011.svg", "admin/img/icon-no.svg": "admin/img/icon-no.439e821418cd.svg", "admin/img/tooltag-arrowright.svg": "admin/img/tooltag-arrowright.bbfb788a849e.svg", "admin/img/inline-delete.svg": "admin/img/inline-delete.fec1b761f254.svg", "admin/img/README.txt": "admin/img/README.837277fa1908.txt", "admin/img/icon-unknown.svg": "admin/img/icon-unknown.a18cb4398978.svg", "admin/img/icon-alert.svg": "admin/img/icon-alert.034cc7d8a67f.svg", "admin/css/forms.css": "admin/css/forms.2003a066ae02.css", "admin/css/dashboard.css": "admin/css/dashboard.7ac78187c567.css", "admin/css/widgets.css": "admin/css/widgets.5e372b41c483.css", "admin/css/login.css": "admin/css/login.a846c0e2ef65.css", "admin/css/rtl.css": "admin/css/rtl.4c867197b256.css", "admin/css/fonts.css": "admin/css/fonts.494e4ec545c9.css", "admin/css/changelists.css": "admin/css/changelists.f6dc691f8d62.css", "admin/css/base.css": "admin/css/base.6b517d0d5813.css", "admin/js/inlines.min.js": "admin/js/inlines.min.d75b9ed03975.js", "admin/js/SelectBox.js": "admin/js/SelectBox.b49f008d186b.js", "admin/js/popup_response.js": "admin/js/popup_response.6ce3197f8fc8.js", "admin/js/actions.js": "admin/js/actions.32861b6cbdf9.js", "admin/js/timeparse.js": "admin/js/timeparse.51258861a46a.js", "admin/js/actions.min.js": "admin/js/actions.min.f51f04edab28.js", "admin/js/core.js": "admin/js/core.fd861d43f0f5.js", "admin/js/prepopulate.min.js": "admin/js/prepopulate.min.f4057ebb9b62.js", "admin/js/inlines.js": "admin/js/inlines.eda404ee376d.js", "admin/js/change_form.js": "admin/js/change_form.9e85003a1a38.js", "admin/js/SelectFilter2.js": "admin/js/SelectFilter2.17009b6d4428.js", "admin/js/jquery.init.js": "admin/js/jquery.init.95b62fa19378.js", "admin/js/prepopulate_init.js": "admin/js/prepopulate_init.0d3b53c37074.js", "admin/js/cancel.js": "admin/js/cancel.1d69cba4b4bf.js", "admin/js/urlify.js": "admin/js/urlify.411bc3bb651c.js", "admin/js/collapse.min.js": "admin/js/collapse.min.dc930adb2821.js", "admin/js/prepopulate.js": "admin/js/prepopulate.ff9208865444.js", "admin/js/collapse.js": "admin/js/collapse.17d715df2104.js", "admin/js/calendar.js": "admin/js/calendar.9ac94d055fbd.js"}, "version": "1.0"}

View file

@ -104,7 +104,7 @@
<td class="actions">
<a href="{% url 'accounts:view_account' each_account.id %}" class="btn btn-info view"><i class="fas fa-eye"></i> View</a>
<a href="{% url 'accounts:edit_account' each_account.id %}" class="btn btn-success edit"><i class="fas fa-pencil-alt"></i>Edit</a>
<a href="{% url 'accounts:remove_account' each_account.id %}" class="btn btn-danger delete remove_account"><i class="fas fa-trash"></i>Delete</a>
<a href="{% url 'accounts:remove_account' each_account.id %}" class="btn btn-danger delete remove_account"><i class="fas fa-trash-alt"></i>Delete</a>
</td>
</tr>
{% endfor %}

View file

@ -1,6 +1,9 @@
{% extends 'base.html' %}
{% load staticfiles %}
{% block breadcrumb %}
{% block extralinks %}
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" />
{% endblock %}
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{% url 'accounts:list' %}">Accounts</a></li>
@ -98,7 +101,11 @@
<div class="filter_col col-12">
<div class="form-group">
<label for="exampleInputEmail1">Assigned Users</label>
{{ account_form.assigned_to }}
<select class="assigned_users form-control" name="assigned_to" multiple="multiple">
{% for user in users %}
<option value="{{user.id}}" {% if user in account_obj.assigned_to.all %} selected="" {% endif %}>{{user.email}}</option>
{% endfor %}
</select>
{{ account_form.assigned_to.errors }}
</div>
</div>
@ -133,10 +140,10 @@
<div>
<h6 style="color:white;">Copy Address</h6>
</div>
<div class="col-md-12 buttons_row" style="text-align:center;">
<!-- <div class="col-md-12 buttons_row" style="text-align:center;">
<button type="button" id="copy_billing_btn" class="btn btn-primary save">Copy Billing Address</button>
</div>
<div class="filter_col shipping_block col-md-12">
</div> -->
<!-- <div class="filter_col shipping_block col-md-12">
<div class="form-group">
<label for="exampleInputEmail1">Shipping Address</label>
{{ shipping_form.address_line }}
@ -162,7 +169,7 @@
<span class="error">{{ shipping_form.country.errors }}</span>
</div>
</div>
</div>
</div> -->
</div>
</div>
<br clear="all">
@ -183,6 +190,7 @@
</form>
{% endblock %}
{% block js_block %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script>
<script type="text/javascript">
$("#copy_billing_btn").click(function(){
var address_line = $("#id_address_line").val()
@ -204,5 +212,8 @@
$("#save_new_form").val('true')
$('#formid').submit()
});
$(document).ready(function() {
$('.assigned_users').select2();
});
</script>
{% endblock js_block %}

View file

@ -163,10 +163,10 @@
<ul class="list-group" id="comments_div">
{% for comment in comments %}
<li class="list-group-item list-row" id="comment{{comment.id}}">
<div class="pull-right right-container">
<div class="list-row-buttons btn-group pull-right">
<div class="float-right right-container">
<div class="list-row-buttons btn-group float-right">
<button class="btn btn-link btn-sm dropdown-toggle" data-toggle="dropdown" type="button"><span class="caret"></span></button>
<ul class="dropdown-menu pull-right">
<ul class="dropdown-menu text-center">
<li>
<a class="action" onclick="edit_comment({{comment.id}})">Edit</a>
</li>
@ -176,9 +176,11 @@
</ul>
</div>
</div>
<div class="stream-head-container">{{ comment.commented_by }} Commented</div>
<div class="stream-post-container" id="comment_name{{comment.id}}"><pre>{{ comment.comment }}</pre></div>
<div class="stream-date-container">{{ comment.commented_on }}</div>
<div class="stream-container">
<pre class="float-left">{{ comment.commented_by }}</pre>
<pre class="float-right">{{ comment.commented_on }}</pre>
</div>
</li>
{% endfor %}
</ul>
@ -220,16 +222,14 @@
<div class="row marl">
<div class="filter_col col-md-12">
<div class="form-group">
<label class="acc_field_label" for="id_assigned_user" data-name="name">Assigned User(s)</label>
<div class="account_field" id="account_assigned_users" data-name="name">
{%if not account_record.assigned_to.all %}
Not Assigned Yet
{% else %}
{%if account_record.assigned_to.all %}
<label class="acc_field_label" for="id_assigned_user" data-name="name">Assigned User(s)</label>
<div class="account_field" id="account_assigned_users" data-name="name">
{% for user in account_record.assigned_to.all %}
<li>{{ user }}</li>
{% endfor %}
{% endif %}
</div>
</div>
{% endif %}
</div>
</div>
<!-- <div class="filter_col col-md-12">
@ -301,7 +301,7 @@
<td class="actions">
<button type="button" class="btn conview btn-info" id="con_view" data-toggle="modal" data-dismiss="modal" data-target="#conViewModal_{{contact.id}}">View</button>
<button type="button" class="btn conedit btn-success" id="con_edit" data-toggle="modal" data-dismiss="modal" data-target="#conEditModal_{{contact.id}}">Edit</button>
<button type="button" class="btn con_remove btn-danger" id="{{ contact.id }}" data-href="{% url 'contacts:remove_contact' pk=contact.id %}">Delete</button>
<a href="{% url 'contacts:remove_contact' pk=contact.id %}" class="btn btn-danger delete remove_contact">Delete</a>
</td>
</tr>
{% endfor %}
@ -815,7 +815,7 @@
<td class="actions">
<button type="button" class="btn oppview btn-info" id="opp_view" data-toggle="modal" data-dismiss="modal1_view" data-target="#oppViewModal_{{opportunity.id}}">VIEW</button>
<button type="button" class="btn oppedit btn-success" id="opp_edit" data-toggle="modal" data-dismiss="modal1_edit" data-target="#oppEditModal_{{opportunity.id}}">EDIT</button>
<button type="button" class="btn opp_remove btn-danger" id="{{ opportunity.id }}" data-href="{% url 'opportunities:opp_remove' pk=opportunity.id %}">REMOVE</button>
<a href="{% url 'opportunities:opp_remove' pk=opportunity.id %}" class="btn btn-danger delete remove_opportunity">REMOVE</a>
</td>
</tr>
{% endfor %}
@ -1375,7 +1375,8 @@
<td class="actions">
<button type="button" class="btn caseview btn-info" id="case_view" data-toggle="modal" data-dismiss="modal" data-target="#caseViewModal_{{case.id}}">VIEW</button>
<button type="button" class="btn caseedit btn-success" id="case_edit" data-toggle="modal" data-dismiss="modal" data-target="#caseEditModal_{{case.id}}">EDIT</button>
<button type="button" class="btn case_remove btn-danger" id="{{ case.id }}" data-href="{% url 'cases:remove_case' case_id=case.id %}">REMOVE</button>
<a href="{% url 'cases:remove_case' case_id=case.id %}" class="btn btn-danger delete remove_case">REMOVE</a>
</td>
</tr>
{% endfor %}
@ -2016,5 +2017,12 @@
$('.error').hide()
document.getElementById("form_case").reset();
}
$('.remove_contact, .remove_opportunity, .remove_case').click(function(e){
e.preventDefault()
url = $(this).attr('href')
if (!confirm('Are you sure you want to delete?'))
return;
window.location = $(this).attr('href')
});
</script>
{% endblock js_block %}

View file

@ -1,5 +1,5 @@
{% load staticfiles %}
{% load compress %}
{% load staticfiles %}
{% load compress %}
<!DOCTYPE html>
<html lang="en">
@ -13,13 +13,13 @@
<!-- Bootstrap core CSS -->
<link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.min.css" />
<script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.9/css/all.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css" />
<!-- Custom styling plus plugins -->
{% compress css %}
<link href="{% static 'css/main.scss' %}" type="text/x-scss" rel="stylesheet">
{% endcompress %}
{% block extralinks %}{% endblock %}
{% block extralinks %} {% endblock %}
</head>
<body class="main_body_bg_color">
<div class="wrapper">
@ -43,6 +43,7 @@
<!-- assigned_teams starts here -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.20.1/moment-with-locales.min.js"></script>
<script defer src="https://use.fontawesome.com/releases/v5.0.9/js/all.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.13.0/umd/popper.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>

View file

@ -13,7 +13,7 @@
</div>
<div class="col-md-6">
<div class="create_new text-right">
<a href="{% url 'cases:add_case' %}"><i class="fa fa-plus"></i>Add New Case</a>
<a href="{% url 'cases:add_case' %}"><i class="fa fa-plus"></i> Add New Case</a>
</div>
</div>
</div>
@ -128,8 +128,10 @@
<td class="actions">
<a href="{% url 'cases:view_case' case.id %}" class="btn btn-info view"><i class="fas fa-eye"></i> View</a>
<a href="{% url 'cases:edit_case' case.id %}" class="btn btn-success edit"><i class="fas fa-pencil-alt"></i>Edit</a>
<a onclick="remove_case({{case.id}}, '{% url 'cases:remove_case' case.id %}')" class="btn btn-danger delete remove_account"><i class="fas fa-trash"></i>Delete</a>
<a onclick="remove_case({{case.id}}, '{% url 'cases:remove_case' case.id %}')" class="btn btn-danger delete remove_account"><i class="fas fa-trash-alt"></i>Delete</a>
{% if case.status != 'Closed' %}
<a onclick="close_case({{case.id}}, '{% url 'cases:close_case' %}')" class="btn btn-warning"><i class="fas fa-times"></i> Close</a>
{% endif %}
</td>
</tr>
{% endfor %}

View file

@ -1,6 +1,9 @@
{% extends 'base.html' %}
{% load staticfiles %}
{% block breadcrumb %}
{% block extralinks %}
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" />
{% endblock %}
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{% url 'cases:list' %}">Cases</a></li>
@ -94,7 +97,12 @@
<div class="filter_col col-md-12">
<div class="form-group">
<label for="exampleInputEmail1">Assigned Users</label>
{{ case_form.assigned_to }}
<select class="assigned_users form-control" name="assigned_to" multiple="multiple">
{% for user in users %}
<option value="{{user.id}}" {% if user in case_obj.assigned_to.all %} selected="" {% endif %}>{{user.email}}</option>
{% endfor %}
</select>
<span class="error">{{ case_form.assigned_to.errors }}</span>
</div>
</div>
<div class="filter_col col-md-12">
@ -136,6 +144,7 @@
</form>
{% endblock %}
{% block js_block %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script>
<script src="{% static 'js/cases/create_case.js' %}"></script>
<script type="text/javascript">
$(function () {
@ -152,5 +161,8 @@
$("#save_new_form").val('true')
$('#submitForm').submit()
});
$(document).ready(function() {
$('.assigned_users').select2();
});
</script>
{% endblock js_block %}

View file

@ -115,10 +115,10 @@
<ul class="list-group" id="comments_div">
{% for comment in comments %}
<li class="list-group-item list-row" id="comment{{comment.id}}">
<div class="pull-right right-container">
<div class="list-row-buttons btn-group pull-right">
<div class="float-right right-container">
<div class="list-row-buttons btn-group float-right">
<button class="btn btn-link btn-sm dropdown-toggle" data-toggle="dropdown" type="button"><span class="caret"></span></button>
<ul class="dropdown-menu pull-right">
<ul class="dropdown-menu text-center">
<li>
<a class="action" onclick="edit_comment({{comment.id}})">Edit</a>
</li>
@ -128,9 +128,11 @@
</ul>
</div>
</div>
<div class="stream-head-container">{{ comment.commented_by }} Commented</div>
<div class="stream-post-container" id="comment_name{{comment.id}}"><pre>{{ comment.comment }}</pre></div>
<div class="stream-date-container">{{ comment.commented_on }}</div>
<div class="stream-container">
<pre class="float-left">{{ comment.commented_by }}</pre>
<pre class="float-right">{{ comment.commented_on }}</pre>
</div>
</li>
{% endfor %}
</ul>
@ -172,16 +174,14 @@
<div class="row marl">
<div class="filter_col col-md-12">
<div class="form-group">
<label class="case_field_label" for="id_assigned_user" data-name="name">Assigned User(s)</label>
<div class="case_field" id="case_assigned_users" data-name="name">
{% if not case_record.assigned_to %}
Not Assigned Yet
{% else %}
{% if case_record.assigned_to.all %}
<label class="case_field_label" for="id_assigned_user" data-name="name">Assigned User(s)</label>
<div class="case_field" id="case_assigned_users" data-name="name">
{% for user in case_record.assigned_to.all %}
<li>{{ user }}</li>
{% endfor %}
{% endif %}
</div>
</div>
{% endif %}
</div>
</div>
<!-- <div class="filter_col col-md-12">
@ -355,4 +355,12 @@
{% block js_block %}
<script src="{% static 'js/cases/view_case.js' %}"></script>
<script src="{% static 'js/cases/create_case.js' %}"></script>
<script type="text/javascript">
$('#remove_case').click(function(e){
var result = confirm("Are You Sure You Want to delete?");
if (result==false) {
e.preventDefault()
}
});
</script>
{% endblock js_block %}

View file

@ -17,27 +17,30 @@
<div class="filter_col col-md-12">
<div class="form-group">
<label for="exampleInputEmail1">Old Password</label>
<input type="password" class="form-control" name="password" value="{{request.POST.password}}">
<input type="password" class="form-control" name="CurrentPassword" value="{{request.POST.CurrentPassword}}">
</div>
{{ errors.password }}
<span class="error">{{ errors.CurrentPassword }}</span>
{% if error %}
<span class="error">{{error}}</span>
{% endif %}
</div>
{% endif %}
{% if not user_obj %}
<div class="filter_col col-md-12">
<div class="form-group">
<label for="exampleInputEmail1">New Password</label>
<input type="password" class="form-control" name="password" value="{{request.POST.password}}">
<input type="password" class="form-control" name="Newpassword" value="{{request.POST.Newpassword}}">
</div>
{{ errors.password }}
<span class="error">{{ errors.Newpassword }}</span>
</div>
{% endif %}
{% if not user_obj %}
<div class="filter_col col-md-12">
<div class="form-group">
<label for="exampleInputEmail1">Confirm New Password</label>
<input type="password" class="form-control" name="password" value="{{request.POST.password}}">
<input type="password" class="form-control" name="confirm" value="{{request.POST.confirm}}">
</div>
{{ errors.password }}
<span class="error">{{ errors.confirm }}</span>
</div>
{% endif %}
</div>

View file

@ -82,9 +82,9 @@
<tr>
<th width="5%" style="text-align:center;">S.no</th>
<th width="20%" style="text-align:center;">Name</th>
<th width="20%" style="text-align:center;">Account</th>
<th width="15%" style="text-align:center;">City</th>
<th width="15%" style="text-align:center;">State</th>
<th width="20%" style="text-align:center;">Industry</th>
<th width="25%" style="text-align:center;">Actions</th>
</tr>
</thead>
@ -122,7 +122,7 @@
<td class="actions">
<a href="{% url 'contacts:view_contact' contact.id %}" class="btn btn-info view"><i class="fas fa-eye"></i> View</a>
<a href="{% url 'contacts:edit_contact' contact.id%}" class="btn btn-success edit"><i class="fas fa-pencil-alt"></i>Edit</a>
<a href="{% url 'contacts:remove_contact' contact.id %}" class="btn btn-danger delete remove_account"><i class="fas fa-trash"></i>Delete</a>
<a href="{% url 'contacts:remove_contact' contact.id %}" class="btn btn-danger delete remove_account"><i class="fas fa-trash-alt"></i>Delete</a>
</td>
</tr>
{% endfor%}

View file

@ -1,6 +1,9 @@
{% extends 'base.html' %}
{% load staticfiles %}
{% block breadcrumb %}
{% block extralinks %}
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" />
{% endblock %}
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{% url 'contacts:list' %}">Contacts</a></li>
@ -89,8 +92,12 @@
<div class="filter_col col-12">
<div class="form-group">
<label for="exampleInputEmail1">Assigned Users</label>
{{ contact_form.assigned_to }}
{{ contact_form.assigned_to.errors }}
<select class="assigned_users form-control" name="assigned_to" multiple="multiple">
{% for user in users %}
<option value="{{user.id}}" {% if user in contact_obj.assigned_to.all %} selected="" {% endif %}>{{user.email}}</option>
{% endfor %}
</select>
<span class="error">{{ contact_form.assigned_to.errors }}</span>
</div>
</div>
</div>
@ -147,11 +154,15 @@
</form>
{% endblock %}
{% block js_block %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script>
<script type="text/javascript">
$(".savenew").on('click', function(e){
e.preventDefault()
$("#save_new_form").val('true')
$('#add_form').submit()
});
$(document).ready(function() {
$('.assigned_users').select2();
});
</script>
{% endblock js_block %}

View file

@ -118,10 +118,10 @@
<ul class="list-group" id="comments_div">
{% for comment in comments %}
<li class="list-group-item list-row" id="comment{{comment.id}}">
<div class="pull-right right-container">
<div class="list-row-buttons btn-group pull-right">
<div class="float-right right-container">
<div class="list-row-buttons btn-group float-right">
<button class="btn btn-link btn-sm dropdown-toggle" data-toggle="dropdown" type="button"><span class="caret"></span></button>
<ul class="dropdown-menu pull-right">
<ul class="dropdown-menu text-center">
<li>
<a class="action" onclick="edit_comment({{comment.id}})">Edit</a>
</li>
@ -131,9 +131,11 @@
</ul>
</div>
</div>
<div class="stream-head-container">{{ comment.commented_by }} Commented</div>
<div class="stream-post-container" id="comment_name{{comment.id}}"><pre>{{ comment.comment }}</pre></div>
<div class="stream-date-container">{{ comment.commented_on }}</div>
<div class="stream-container">
<pre class="float-left">{{ comment.commented_by }}</pre>
<pre class="float-right">{{ comment.commented_on }}</pre>
</div>
</li>
{% endfor %}
</ul>
@ -175,16 +177,14 @@
<div class="row marl">
<div class="filter_col col-md-12">
<div class="form-group">
<label class="contact_field_label" for="id_assigned_user" data-name="name">Assigned User(s)</label>
<div class="contact_field" id="contact_assigned_users" data-name="name">
{%if not contact_record.assigned_to %}
Not Assigned Yet
{% else %}
{%if contact_record.assigned_to.all %}
<label class="contact_field_label" for="id_assigned_user" data-name="name">Assigned User(s)</label>
<div class="contact_field" id="contact_assigned_users" data-name="name">
{% for user in contact_record.assigned_to.all %}
<li>{{ user }}</li>
{% endfor %}
{% endif %}
</div>
</div>
{% endif %}
</div>
</div>
<!-- <div class="filter_col col-md-12">
@ -227,4 +227,12 @@
{% endblock%}
{% block js_block %}
<script src="{% static 'js/contacts/view_contact.js' %}"></script>
<script type="text/javascript">
$('#remove_contact').click(function(e){
var result = confirm("Are You Sure You Want to delete?");
if (result==false) {
e.preventDefault()
}
});
</script>
{% endblock js_block %}

View file

@ -1,6 +1,9 @@
{% extends 'base.html' %}
{% load staticfiles %}
{% block breadcrumb %}
{% block extralinks %}
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" />
{% endblock %}
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{% url 'leads:list' %}">Leads</a></li>
@ -105,8 +108,12 @@
<div class="filter_col col-md-12">
<div class="form-group">
<label for="exampleInputEmail1">Assigned Users</label>
{{ lead_form.assigned_to }}
{{ lead_form.assigned_to.errors }}
<select class="assigned_users form-control" name="assigned_to" multiple="multiple">
{% for user in users %}
<option value="{{user.id}}" {% if user in lead_obj.assigned_to.all %} selected="" {% endif %}>{{user.email}}</option>
{% endfor %}
</select>
<span class="error">{{ lead_form.assigned_to.errors }}</span>
</div>
</div>
<br>
@ -177,11 +184,15 @@
</form>
{% endblock %}
{% block js_block %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script>
<script type="text/javascript">
$(".savenew").on('click', function(e){
e.preventDefault()
$("#save_new_form").val('true')
$('#add_form').submit()
});
$(document).ready(function() {
$('.assigned_users').select2();
});
</script>
{% endblock js_block %}

View file

@ -115,7 +115,7 @@
<td class="actions">
<a href="{% url 'leads:view_lead' lead.id %}" class="btn btn-info view"><i class="fas fa-eye"></i> View</a>
<a href="{% url 'leads:edit_lead' lead.id %}" class="btn btn-success edit"><i class="fas fa-pencil-alt"></i>Edit</a>
<a href="{% url 'leads:remove_lead' lead.id %}" class="btn btn-danger delete remove_account"><i class="fas fa-trash"></i>Delete</a>
<a href="{% url 'leads:remove_lead' lead.id %}" class="btn btn-danger delete remove_account"><i class="fas fa-trash-alt"></i>Delete</a>
</td>
</tr>
{% endfor %}

View file

@ -153,10 +153,10 @@
<ul class="list-group" id="comments_div">
{% for comment in comments %}
<li class="list-group-item list-row" id="comment{{comment.id}}">
<div class="pull-right right-container">
<div class="list-row-buttons btn-group pull-right">
<div class="float-right right-container">
<div class="list-row-buttons btn-group float-right">
<button class="btn btn-link btn-sm dropdown-toggle" data-toggle="dropdown" type="button"><span class="caret"></span></button>
<ul class="dropdown-menu pull-right">
<ul class="dropdown-menu text-center">
<li>
<a class="action" onclick="edit_comment({{comment.id}})">Edit</a>
</li>
@ -166,9 +166,11 @@
</ul>
</div>
</div>
<div class="stream-head-container">{{ comment.commented_by }} Commented</div>
<div class="stream-post-container" id="comment_name{{comment.id}}"><pre>{{ comment.comment }}</pre></div>
<div class="stream-date-container">{{ comment.commented_on }}</div>
<div class="stream-container">
<pre class="float-left">{{ comment.commented_by }}</pre>
<pre class="float-right">{{ comment.commented_on }}</pre>
</div>
</li>
{% endfor %}
</ul>
@ -211,16 +213,14 @@
<div class="row marl">
<div class="filter_col col-md-12">
<div class="form-group">
{%if lead_record.assigned_to.all %}
<label class="lead_field_label" for="id_assigned_user" data-name="name" >Assigned User(s)</label>
<div class="lead_field" id="lead_assigned_users" data-name="name">
{%if not lead_record.assigned_to %}
Not Assigned Yet
{% else %}
{% for user in lead_record.assigned_to.all %}
<li>{{ user }}</li>
{% endfor %}
{% endif %}
</div>
{% endif %}
</div>
</div>
<!-- <div class="filter_col col-md-12">
@ -261,7 +261,7 @@
</div>
{% endblock %}
{% block js_block %}
<script src="{% static 'js/view_lead.js' %}"></script>
<script src="{% static 'js/leads/view_lead.js' %}"></script>
<script src="{% static 'js/calls.js' %}"></script>
<script src="{% static 'js/meetings.js' %}"></script>
{% endblock js_block %}

View file

@ -7,7 +7,9 @@
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
{% if request.user.is_staff %}
<li class="nav-item"><a class="nav-link" href="{% url 'common:users_list' %}">Users</a></li>
{% endif %}
<li class="nav-item"><a class="nav-link" href="{% url 'accounts:list' %}">Accounts</a></li>
<li class="nav-item"><a class="nav-link" href="{% url 'contacts:list' %}">Contacts</a></li>
<li class="nav-item"><a class="nav-link" href="{% url 'leads:list' %}">Leads</a></li>

View file

@ -1,7 +1,9 @@
{% extends 'base.html' %}
{% load staticfiles %}
{% block breadcrumb %}
{% block extralinks %}
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" />
{% endblock %}
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{% url 'opportunities:list' %}">Opportunities</a></li>
@ -102,7 +104,11 @@
<div class="filter_col col-md-12">
<div class="form-group">
<label for="exampleInputEmail1">Assigned Users</label>
{{ opportunity_form.assigned_to }}
<select class="assigned_users form-control" name="assigned_to" multiple="multiple">
{% for user in users %}
<option value="{{user.id}}" {% if user in opportunity_obj.assigned_to.all %} selected="" {% endif %}>{{user.email}}</option>
{% endfor %}
</select>
</div>
</div>
<br>
@ -149,6 +155,7 @@
</form>
{% endblock %}
{% block js_block %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script>
<script src="{% static 'js/opportunities/contacts.js' %}"></script>
<script type="text/javascript">
$(function () {
@ -165,5 +172,8 @@
$("#save_new_form").val('true')
$('.form_user').submit()
});
$(document).ready(function() {
$('.assigned_users').select2();
});
</script>
{% endblock js_block %}

View file

@ -138,7 +138,7 @@
<td class="actions">
<a href="{% url 'opportunities:opp_view' opportunity.id %}" class="btn btn-info view"><i class="fas fa-eye"></i> View</a>
<a href="{% url 'opportunities:opp_edit' opportunity.id %}" class="btn btn-success edit"><i class="fas fa-pencil-alt"></i>Edit</a>
<a href="{% url 'opportunities:opp_remove' opportunity.id %}" class="btn btn-danger delete remove_account"><i class="fas fa-trash"></i>Delete</a>
<a href="{% url 'opportunities:opp_remove' opportunity.id %}" class="btn btn-danger delete remove_account"><i class="fas fa-trash-alt"></i>Delete</a>
</td>
</tr>
{% endfor %}

View file

@ -27,7 +27,7 @@
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="{% url 'opportunities:opp_edit' opportunity_record.id %}" >Edit</a></li>
<li class="delete_contact"><a href="{% url 'opportunities:opp_remove' opportunity_record.id %}" id="remove_contact">REMOVE</a></li>
<li class="delete_contact"><a href="{% url 'opportunities:opp_remove' opportunity_record.id %}" id="remove_opportunity">REMOVE</a></li>
</ul>
</div>
</span>
@ -133,10 +133,10 @@
<ul class="list-group" id="comments_div">
{% for comment in comments %}
<li class="list-group-item list-row" id="comment{{comment.id}}">
<div class="pull-right right-container">
<div class="list-row-buttons btn-group pull-right">
<div class="float-right right-container">
<div class="list-row-buttons btn-group float-right">
<button class="btn btn-link btn-sm dropdown-toggle" data-toggle="dropdown" type="button"><span class="caret"></span></button>
<ul class="dropdown-menu pull-right">
<ul class="dropdown-menu text-center">
<li>
<a class="action" onclick="edit_comment({{comment.id}})">Edit</a>
</li>
@ -146,9 +146,11 @@
</ul>
</div>
</div>
<div class="stream-head-container">{{ comment.commented_by }} Commented</div>
<div class="stream-post-container" id="comment_name{{comment.id}}"><pre>{{ comment.comment }}</pre></div>
<div class="stream-date-container">{{ comment.commented_on }}</div>
<div class="stream-container">
<pre class="float-left">{{ comment.commented_by }}</pre>
<pre class="float-right">{{ comment.commented_on }}</pre>
</div>
</li>
{% endfor %}
</ul>
@ -190,16 +192,14 @@
<div class="row marl">
<div class="filter_col col-md-12">
<div class="form-group">
<label class="opportunity_field_label" for="id_assigned_user" data-name="name">Assigned User(s)</label>
<div class="opportunity_field" id="opportunity_assigned_users" data-name="name">
{%if not opportunity_record.assigned_to %}
Not Assigned Yet
{% else %}
{% for user in opportunity_record.assigned_to.all %}
<li>{{ user }}</li>
{% endfor %}
{% endif %}
</div>
{%if opportunity_record.assigned_to.all %}
<label class="opportunity_field_label" for="id_assigned_user" data-name="name">Assigned User(s)</label>
<div class="opportunity_field" id="opportunity_assigned_users" data-name="name">
{% for user in opportunity_record.assigned_to.all %}
<li>{{ user }}</li>
{% endfor %}
</div>
{% endif %}
</div>
</div>
<!-- <div class="filter_col col-md-12">
@ -244,5 +244,11 @@
'format': 'YYYY-MM-DD',
});
});
$('#remove_opportunity').click(function(e){
var result = confirm("Are You Sure You Want to delete?");
if (result==false) {
e.preventDefault()
}
});
</script>
{% endblock js_block %}

View file

@ -22,26 +22,26 @@
</div>
</span> -->
</h5>
<a href="{% url 'common:edit_user' user_obj.id %}" class="btn btn-success edit">Edit</a>
</div>
{% for user in user_obj %}
<div class="row marl no-gutters">
<div class="col-md-8">
<div class="filter_col col-md-12">
<div class="form-group">
<label class="contact_field_label" for="id_name" data-name="name">Name</label>
<div class="contact_field" id="contact_name" data-name="name">{{ user.first_name }} {{ user.last_name }}</div>
<div class="contact_field" id="contact_name" data-name="name">{{ user_obj.first_name }} {{ user_obj.last_name }}</div>
</div>
</div>
<div class="filter_col col-md-12">
<div class="form-group">
<label class="contact_field_label" for="id_contact_account" data-name="name">UserName</label>
<div class="contact_field" id="contact_account" data-name="name">{{ user.username }}</div>
<div class="contact_field" id="contact_account" data-name="name">{{ user_obj.username }}</div>
</div>
</div>
<div class="filter_col col-md-12">
<div class="form-group">
<label class="contact_field_label" for="id_email" data-name="name">Email</label>
<div class="contact_field" id="contact_email" data-name="name">{{ user.email }}</div>
<div class="contact_field" id="contact_email" data-name="name">{{ user_obj.email }}</div>
</div>
</div>
</div>
@ -51,7 +51,6 @@
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>

View file

@ -44,7 +44,7 @@
<div class="filter_col col-md-12">
<div class="form-group">
<label for="exampleInputEmail1">Email Address{% if user_form.email.field.required %}<span class="error">*</span>{% endif %}</label>
<input type="text" class="form-control" name="email" value="{% if user_obj %} {{ user_obj.email }} {% else %} {{request.POST.email}} {% endif %}">
<input type="text" class="form-control" name="email" value="{% if user_obj %} {{ user_obj.email }} {% else %} {{request.POST.email}} {% endif %}" {% if user_obj and not user_obj.is_staff %} readonly=""{% endif %}>
</div>
<span class="error">{{ errors.email }}</span>
</div>

View file

@ -102,7 +102,7 @@
<td class="actions">
<!-- <a href="{% url 'common:view_user' user.id %}" class="btn btn-info view"><i class="fas fa-eye"></i>View</a> -->
<a href="{% url 'common:edit_user' user.id %}" class="btn btn-success edit"><i class="fas fa-pencil-alt"></i>Edit</a>
<a href="{% url 'common:remove_user' user.id %}" class="btn btn-danger trash"><i class="fas fa-trash"></i>Delete</a>
<a href="{% url 'common:remove_user' user.id %}" class="btn btn-danger trash" {% if request.user.email == user.email and user.is_staff %} style="visibility: hidden;" {% endif %}><i class="fas fa-trash-alt"></i>Delete</a>
</td>
</tr>
{% endfor %}