This commit is contained in:
Ashwin 2018-08-23 12:23:29 +05:30
parent 7459187435
commit d3f712a8ed
5 changed files with 13 additions and 19 deletions

View file

@ -1,3 +0,0 @@
from django.test import TestCase
# Create your tests here.

View file

@ -9,7 +9,7 @@ from django.views.generic import (
from accounts.models import Account
from common.forms import BillingAddressForm
from common.models import User, Address, Comment, Team
from common.models import User, Comment, Team
from common.utils import LEAD_STATUS, LEAD_SOURCE, COUNTRIES
from leads.models import Lead
from leads.forms import LeadCommentForm, LeadForm

View file

@ -1,10 +1,7 @@
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db.models import Q
from django.http import HttpResponseRedirect, JsonResponse
from django.http import JsonResponse
from django.shortcuts import get_object_or_404, redirect
from django.urls import reverse
from django.views.generic import (
CreateView, UpdateView, DetailView, ListView, TemplateView, View, DeleteView)
from django.views.generic import CreateView, UpdateView, DetailView, ListView, TemplateView, View
from accounts.models import Account
from common.models import User, Comment, Team
from common.utils import STAGES, SOURCES, CURRENCY_CODES

View file

@ -11,7 +11,7 @@ $("#comment_form").submit(function (e) {
processData: false,
success: function (data) {
if (data.error) {
$("#CommentError").html(data.error).show()
$("#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 + "'>" +
@ -22,19 +22,19 @@ $("#comment_form").submit(function (e) {
"<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>"
"<div class='stream-container'><pre class='float-left'>"+data.commented_by+"</pre><pre class='float-right'>"+data.commented_on.toGMTString()+"</pre></div>"
);
$("#id_comments").val("");
alert("Comment Submitted");
$("#CommentError").html('');
}
}
})
})
});
});
function edit_comment(x) {
$('#Comments_Cases_Modal').modal('show');
$("#Comments_Cases_Modal").modal("show");
comment = $("#comment_name" + x).text();
$("#commentid").val(x);
$("#id_editcomment").val(comment);
@ -54,10 +54,10 @@ $("#comment_edit").click(function (e) {
if (data.error) {
$("#CommentEditError").html(data.error).show();
} else {
$("#comment_name" + data.comment_id).html('<pre>' + data.comment + '</pre>');
$('#Comments_Cases_Modal').modal('hide');
$("#comment_name" + data.comment_id).html("<pre>" + data.comment + "</pre>");
$("#Comments_Cases_Modal").modal("hide");
$("#id_editcomment").val("");
$("#CommentEditError").html('');
$("#CommentEditError").html("");
}
}
});
@ -71,7 +71,7 @@ function HideError(e) {
function remove_comment(x) {
var con = confirm("Do you want to Delete it for Sure!?");
if (con == true) {
$.post('/cases/comment/remove/', {
$.post("/cases/comment/remove/", {
"comment_id": x
}, function (data) {
if (data.error) {

View file

@ -1,6 +1,6 @@
$("body").on("click", "#home", function (e) {
e.preventDefault();
window.location = '/';
window.location = "/";
});
//
// $('body').on('click', '#loadmeetings', function (e) {