From d3f712a8ed02259aba2ac7ee5fc376aa3be6d3f7 Mon Sep 17 00:00:00 2001 From: Ashwin Date: Thu, 23 Aug 2018 12:23:29 +0530 Subject: [PATCH] js fixes --- emails/tests.py | 3 --- leads/views.py | 2 +- opportunity/views.py | 7 ++----- static/js/cases/view_case.js | 18 +++++++++--------- static/js/index.js | 2 +- 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/emails/tests.py b/emails/tests.py index 7ce503c2..e69de29b 100644 --- a/emails/tests.py +++ b/emails/tests.py @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/leads/views.py b/leads/views.py index 97b4a659..090fb7a5 100644 --- a/leads/views.py +++ b/leads/views.py @@ -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 diff --git a/opportunity/views.py b/opportunity/views.py index a298d2fb..33618bc1 100644 --- a/opportunity/views.py +++ b/opportunity/views.py @@ -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 diff --git a/static/js/cases/view_case.js b/static/js/cases/view_case.js index 022eff48..b21dfc0c 100644 --- a/static/js/cases/view_case.js +++ b/static/js/cases/view_case.js @@ -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("
  • " + @@ -22,19 +22,19 @@ $("#comment_form").submit(function (e) { "
  • Edit
  • " + "
  • Remove
  • " + "
    "+data.comment+"
    "+ - "
    "+data.commented_by+"
    "+d.toGMTString()+"
    " + "
    "+data.commented_by+"
    "+data.commented_on.toGMTString()+"
    " ); $("#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('
    ' + data.comment + '
    '); - $('#Comments_Cases_Modal').modal('hide'); + $("#comment_name" + data.comment_id).html("
    " + data.comment + "
    "); + $("#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) { diff --git a/static/js/index.js b/static/js/index.js index 41e0dbf5..63b84472 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -1,6 +1,6 @@ $("body").on("click", "#home", function (e) { e.preventDefault(); - window.location = '/'; + window.location = "/"; }); // // $('body').on('click', '#loadmeetings', function (e) {