Skip to content

Commit d3e32b3

Browse files
authored
added unsubscribe template in campaigns, displayed contacts count in contacts list view pages (#308)
* updated testcases, update code for account view page, modified code for attachments and comments for assigned user * updated testcases in events, invoices, tasks modules * added duplicate contacts tabs, fixed time format in marketing campaign list page, added test cases in marketing, added contacts list filter in contacts page * updated requirements * added email search using elasticsearch, changes for unsubscribing contacts, added blocked emails, domains in settings pages * added elasticsearch in travis file * blocked domain and email filter in sales, elasticsearch related changes * added unsubscribe template in campaigns, displayed contacts count in contacts list view pages
1 parent f4e2344 commit d3e32b3

File tree

25 files changed

+854
-432
lines changed

25 files changed

+854
-432
lines changed

.travis.yml

-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ python:
33
- "3.5.2"
44

55
services:
6-
- elasticsearch
76
- redis-server
87
- elasticsearch
98

10-
119
#Django & Database
1210
addons:
1311
postgresql: "9.4"

README.rst

+26-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Django CRM is opensource CRM developed on django framework. It has all the basic
1616
:target: https://travis-ci.org/MicroPyramid/Django-CRM
1717
:alt: Travis
1818

19-
.. image:: https://readthedocs.org/projects/django-crm/badge/?version=latest
20-
:target: http://django-crm.readthedocs.io/en/latest/
21-
:alt: Documentation Status
19+
.. image:: https://landscape.io/github/MicroPyramid/Django-CRM/master/landscape.svg?style=flat
20+
:target: https://landscape.io/github/MicroPyramid/Django-CRM/master
21+
:alt: Code Health
2222

2323
- .. image:: https://api.codacy.com/project/badge/Grade/b11da5f09dd542479fd3bd53944595d2
2424
:target: https://app.codacy.com/project/ashwin/Django-CRM/dashboard
@@ -134,6 +134,29 @@ This project exists thanks to all the people who contribute!
134134

135135
.. image:: https://opencollective.com/django-crm/contributors.svg?width=890&button=false
136136

137+
Backers
138+
-------
139+
140+
Thank you to all our backers! `Become a backer`__.
141+
142+
.. image:: https://opencollective.com/django-crm/backers.svg?width=890
143+
:target: https://opencollective.com/django-crm#backers
144+
145+
__ Backer_
146+
.. _Backer: https://opencollective.com/django-crm#backer
147+
148+
Sponsors
149+
--------
150+
151+
Support us by becoming a sponsor. Your logo will show up here with a link to your website. `Become a sponsor`__.
152+
153+
.. image:: https://opencollective.com/django-crm/sponsor/0/avatar.svg
154+
:target: https://opencollective.com/django-crm/sponsor/0/website
155+
156+
__ Sponsor_
157+
.. _Sponsor: https://opencollective.com/django-crm#sponsor
158+
159+
137160

138161
Feature requests and bug reports
139162
================================

accounts/templates/create_account.html

+36-35
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ <h3 class="mt-5">Create a <a href="{% url 'contacts:add_contact' %}">contact</a>
249249
$("#id_lead").select2();
250250
$("#id_assigned_to").select2()
251251
$("#id_teams").select2()
252-
$("#id_assigned_to").change(function () {
253-
$("#id_assigned_to").attr('name', 'assigned_to')
254-
})
252+
// $("#id_assigned_to").change(function () {
253+
// $("#id_assigned_to").attr('name', 'assigned_to')
254+
// })
255255
// $("#id_assigned_to")
256256
// var data_assigned_to = []
257257
// data_assigned_to = $('#id_assigned_to').val()
@@ -354,41 +354,42 @@ <h3 class="mt-5">Create a <a href="{% url 'contacts:add_contact' %}">contact</a>
354354
}
355355
});
356356

357-
var assigned_to_users = []
358-
359-
$("#id_teams").change(function (e) {
360-
// console.log($(this).val())
361-
// console.log($('option:selected', this).attr('data-users'));
362-
363-
// users = $('option:selected', this).attr('data-users')
364-
365-
// $('#id_assigned_to').select2({multiple:true}).val(users).trigger('change');
366-
367-
368-
// if (users) {
369-
370-
// users = JSON.parse(users)
371-
372-
// for (let i = 0; i < users.length; i++) {
373-
// const element = users[i];
374-
// // $('#id_assigned_to').val(element)
375-
// assigned_to_users.push(element)
376-
// }
377-
// }
357+
$('#multiple').change(function () {
358+
var $value = $('option:selected', this).attr('type');
359+
console.log($value);
360+
});
378361

379-
// // console.log(assigned_to_users)
380362

381-
// if ($(this).val().length === 0) {
382-
// assigned_to_users = [];
383-
// }
363+
$("#id_teams").change(function (e) {
364+
try {
365+
var users = []
366+
$('#id_teams option:selected').each(function () {
367+
// users.push($(this).attr('data-users'))
368+
_data = $(this).attr('data-users');
369+
if (!users) {
370+
// users = []
371+
} else {
372+
users = users.concat(_data.split(','))
373+
}
374+
})
375+
// users = $('option:selected', this).attr('data-users')
376+
// if (!users) {
377+
// users = []
378+
// } else {
379+
// users = users.split(',')
380+
// }
381+
console.log('selected users teams data', users)
382+
var existingUsers = $('#id_assigned_to').val();
383+
var allUsers = users.concat(existingUsers)
384+
console.log(existingUsers)
385+
if (users.length) {
386+
$('#id_assigned_to').select2().val(allUsers).trigger('change');
384387

385-
// for (let i = 0; i < assigned_to_users.length; i++) {
386-
// const element = assigned_to_users[i];
387-
// // $('#id_assigned_to').val(element).change()
388-
// console.log('element checkd', element)
389-
// // $('#id_assigned_to').select2({multiple:true}).val(element).trigger('change');
390-
// $('#id_assigned_to option[value="' + element + '"]').prop('selected', true)
391-
// }
388+
}
389+
} catch (error) {
390+
console.log(error)
391+
$('#id_assigned_to').select2().val(existingUsers).trigger('change');
392+
}
392393

393394
});
394395
// $('#call_save').click(function (e) {

cases/templates/create_cases.html

+34-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
<div class="filter_col col-md-12">
8484
<div class="form-group">
8585
<label for="exampleInputEmail1">Assigned Users</label>
86-
<select class="assigned_users form-control" name="assigned_to" multiple="multiple">
86+
<select class="assigned_users form-control" name="assigned_to" multiple="multiple" id="id_assigned_to">
8787
{% for user in users %}
8888
<option value="{{user.id}}" {% if user in case_obj.assigned_to.all or user.id in assignedto_list %} selected="" {% endif %}>{{user.email}}</option>
8989
{% endfor %}
@@ -274,5 +274,38 @@
274274
})
275275
}
276276
}
277+
278+
$("#id_teams").change(function (e) {
279+
try {
280+
var users = []
281+
$('#id_teams option:selected').each(function () {
282+
// users.push($(this).attr('data-users'))
283+
_data = $(this).attr('data-users');
284+
if (!users) {
285+
// users = []
286+
} else {
287+
users = users.concat(_data.split(','))
288+
}
289+
})
290+
// users = $('option:selected', this).attr('data-users')
291+
// if (!users) {
292+
// users = []
293+
// } else {
294+
// users = users.split(',')
295+
// }
296+
console.log('selected users teams data', users)
297+
var existingUsers = $('#id_assigned_to').val();
298+
var allUsers = users.concat(existingUsers)
299+
console.log(existingUsers)
300+
if (users.length) {
301+
$('#id_assigned_to').select2().val(allUsers).trigger('change');
302+
303+
}
304+
} catch (error) {
305+
console.log(error)
306+
$('#id_assigned_to').select2().val(existingUsers).trigger('change');
307+
}
308+
309+
});
277310
</script>
278311
{% endblock js_block %}

0 commit comments

Comments
 (0)