fixed wrong time in comments and attachments

This commit is contained in:
Ashwin 2019-02-02 15:22:12 +05:30
parent 918c196ba0
commit aeac36c410
7 changed files with 28 additions and 21 deletions

View file

@ -163,7 +163,7 @@
<div class="stream-post-container" id="attachment_name{{attachemnt.id}}"><pre><a href="{{ attachemnt.attachment.url }}">{{ attachemnt.file_name }}</a></pre></div>
<div class="stream-container">
<pre class="float-left">{{ attachemnt.created_by }}</pre>
<pre class="float-right">{{ attachemnt.created_on }}</pre>
<pre class="float-right">{{ attachemnt.created_on|date:'m/d/Y, H:i:s A' }}</pre>
</div>
</li>
{% endfor %}
@ -211,7 +211,7 @@
<div class="stream-post-container" id="comment_name{{comment.id}}"><pre>{{ comment.comment }}</pre></div>
<div class="stream-container">
<pre class="float-left">{{ comment.commented_by }}</pre>
<pre class="float-right">{{ comment.commented_on }}</pre>
<pre class="float-right">{{ comment.commented_on|date:'m/d/Y, H:i:s A' }}</pre>
</div>
</li>
{% endfor %}
@ -2059,7 +2059,7 @@
"<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'>"+d.toLocaleString('en-US', { hour12: true })+"</pre></div>"
)
$("#id_comments").val("")
alert("Comment Submitted")
@ -2168,11 +2168,12 @@ $("#attachment_form").submit(function (e) {
if (data.error) {
$("#AttachmentError").html(data.error).show()
} else {
d = new Date(data.created_on)
$("#attachment_div").prepend(
"<li class='list-group-item list-row' id='attachment" + data.attachment_id + "'>" +
"<div class='float-right right-container'><div class='list-row-buttons btn-group float-right'><button class='action btn btn-danger' onclick='remove_attachment("+data.attachment_id+")''>Remove</button></div></div>" +
"<div class='stream-post-container' id='comment_name"+data.attachment_id+"'><pre><a href='"+data.attachment_url+"'>"+data.attachment+"</a></pre></div>"+
"<div class='stream-container'><pre class='float-left'>"+data.created_by+"</pre><pre class='float-right'>"+data.created_on+"</pre></div>" +
"<div class='stream-container'><pre class='float-left'>"+data.created_by+"</pre><pre class='float-right'>"+d.toLocaleString('en-US', { hour12: true })+"</pre></div>" +
"</li>"
)

View file

@ -129,7 +129,7 @@
<div class="stream-post-container" id="attachment_name{{attachment.id}}"><pre><a href="{{ attachment.attachment.url }}">{{ attachment.file_name }}</a></pre></div>
<div class="stream-container">
<pre class="float-left">{{ attachment.created_by }}</pre>
<pre class="float-right">{{ attachment.created_on }}</pre>
<pre class="float-right">{{ attachment.created_on|date:'m/d/Y, H:i:s A' }}</pre>
</div>
</li>
{% endfor %}
@ -174,7 +174,7 @@
<div class="stream-post-container" id="comment_name{{comment.id}}"><pre>{{ comment.comment }}</pre></div>
<div class="stream-container">
<pre class="float-left">{{ comment.commented_by }}</pre>
<pre class="float-right">{{ comment.commented_on }}</pre>
<pre class="float-right">{{ comment.commented_on|date:'m/d/Y, H:i:s A' }}</pre>
</div>
</li>
{% endfor %}
@ -423,14 +423,16 @@ $("#attachment_form").submit(function (e) {
if (data.error) {
$("#AttachmentError").html(data.errors).show()
} else {
d = new Date(data.created_on)
$("#attachment_div").prepend(
"<li class='list-group-item list-row' id='attachment" + data.attachment_id + "'>" +
"<div class='float-right right-container'><div class='list-row-buttons btn-group float-right'><button class='action btn btn-danger' onclick='remove_attachment("+data.attachment_id+")''>Remove</button></div></div>" +
"<div class='stream-post-container' id='comment_name"+data.attachment_id+"'><pre><a href='"+data.attachment_url+"'>"+data.attachment+"</a></pre></div>"+
"<div class='stream-container'><pre class='float-left'>"+data.created_by+"</pre><pre class='float-right'>"+data.created_on+"</pre></div>" +
"<div class='stream-container'><pre class='float-left'>"+data.created_by+"</pre><pre class='float-right'>"+d.toLocaleString('en-US', { hour12: true})+"</pre></div>" +
"</li>"
)
$("#AttachmentError").html("")
alert("Attachment Saved")
$("#id_attachments").val("")
}
}

View file

@ -25,3 +25,4 @@ class Contact(models.Model):
class Meta:
unique_together = (("email", ),)
ordering = ['-created_on']

View file

@ -118,7 +118,7 @@
<div class="stream-post-container" id="attachment_name{{attachemnt.id}}"><pre><a href="{{ attachemnt.attachment.url }}">{{ attachemnt.file_name }}</a></pre></div>
<div class="stream-container">
<pre class="float-left">{{ attachemnt.created_by }}</pre>
<pre class="float-right">{{ attachemnt.created_on }}</pre>
<pre class="float-right">{{ attachemnt.created_on|date:'m/d/Y, H:i:s A' }}</pre>
</div>
</li>
{% endfor %}
@ -165,7 +165,7 @@
<div class="stream-post-container" id="comment_name{{comment.id}}"><pre>{{ comment.comment }}</pre></div>
<div class="stream-container">
<pre class="float-left">{{ comment.commented_by }}</pre>
<pre class="float-right">{{ comment.commented_on }}</pre>
<pre class="float-right">{{ comment.commented_on|date:'m/d/Y, H:i:s A' }}</pre>
</div>
</li>
{% endfor %}
@ -244,7 +244,7 @@ $("#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'>"+d.toLocaleString('en-US', { hour12: true })+"</pre></div>"
)
$("#id_comments").val("")
alert("Comment Submitted")
@ -320,11 +320,12 @@ $("#attachment_form").submit(function (e) {
if (data.error) {
$("#AttachmentError").html(data.error).show()
} else {
d = new Date(data.created_on)
$("#attachment_div").prepend(
"<li class='list-group-item list-row' id='attachment" + data.attachment_id + "'>" +
"<div class='float-right right-container'><div class='list-row-buttons btn-group float-right'><button class='action btn btn-danger' onclick='remove_attachment("+data.attachment_id+")''>Remove</button></div></div>" +
"<div class='stream-post-container' id='comment_name"+data.attachment_id+"'><pre><a href='"+data.attachment_url+"'>"+data.attachment+"</a></pre></div>"+
"<div class='stream-container'><pre class='float-left'>"+data.created_by+"</pre><pre class='float-right'>"+data.created_on+"</pre></div>" +
"<div class='stream-container'><pre class='float-left'>"+data.created_by+"</pre><pre class='float-right'>"+d.toLocaleString('en-US', { hour12: true })+"</pre></div>" +
"</li>"
)
$("#id_attachments").val("")

View file

@ -151,7 +151,7 @@
<div class="stream-post-container" id="attachment_name{{attachemnt.id}}"><pre><a href="{{ attachemnt.attachment.url }}">{{ attachemnt.file_name }}</a></pre></div>
<div class="stream-container">
<pre class="float-left">{{ attachemnt.created_by }}</pre>
<pre class="float-right">{{ attachemnt.created_on }}</pre>
<pre class="float-right">{{ attachemnt.created_on|date:'m/d/Y, H:i:s A' }}</pre>
</div>
</li>
{% endfor %}
@ -197,8 +197,8 @@
</div>
<div class="stream-post-container" id="comment_name{{comment.id}}"><pre>{{ comment.comment }}</pre></div>
<div class="stream-container">
<pre class="float-left">{{ comment.commented_by }}</pre>
<pre class="float-right">{{ comment.commented_on }}</pre>
<pre class="float-left">{{ comment.commented_by}}</pre>
<pre class="float-right">{{ comment.commented_on|date:'m/d/Y, H:i:s A' }}</pre>
</div>
</li>
{% endfor %}
@ -280,7 +280,7 @@ $("#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'>"+d.toLocaleString('en-US', { hour12: true })+"</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("")
@ -355,11 +355,12 @@ $("#attachment_form").submit(function (e) {
if (data.error) {
$("#AttachmentError").html(data.error).show()
} else {
d = new Date(data.created_on)
$("#attachment_div").prepend(
"<li class='list-group-item list-row' id='attachment" + data.attachment_id + "'>" +
"<div class='float-right right-container'><div class='list-row-buttons btn-group float-right'><button class='action btn btn-danger' onclick='remove_attachment("+data.attachment_id+")''>Remove</button></div></div>" +
"<div class='stream-post-container' id='comment_name"+data.attachment_id+"'><pre><a href='"+data.attachment_url+"'>"+data.attachment+"</a></pre></div>"+
"<div class='stream-container'><pre class='float-left'>"+data.created_by+"</pre><pre class='float-right'>"+data.created_on+"</pre></div>" +
"<div class='stream-container'><pre class='float-left'>"+data.created_by+"</pre><pre class='float-right'>"+d.toLocaleString('en-US', { hour12: true })+"</pre></div>" +
"</li>"
);
$("#id_attachments").val("")

View file

@ -149,7 +149,7 @@
<div class="stream-post-container" id="attachment_name{{attachemnt.id}}"><pre><a href="{{ attachemnt.attachment.url }}">{{ attachemnt.file_name }}</a></pre></div>
<div class="stream-container">
<pre class="float-left">{{ attachemnt.created_by }}</pre>
<pre class="float-right">{{ attachemnt.created_on }}</pre>
<pre class="float-right">{{ attachemnt.created_on|date:'m/d/Y, H:i:s A' }}</pre>
</div>
</li>
{% endfor %}
@ -195,7 +195,7 @@
<div class="stream-post-container" id="comment_name{{comment.id}}"><pre>{{ comment.comment }}</pre></div>
<div class="stream-container">
<pre class="float-left">{{ comment.commented_by }}</pre>
<pre class="float-right">{{ comment.commented_on }}</pre>
<pre class="float-right">{{ comment.commented_on|date:'m/d/Y, H:i:s A' }}</pre>
</div>
</li>
{% endfor %}
@ -282,7 +282,7 @@ assigned_to_list = JSON.parse(assigned_to_list.replace(/&(l|g|quo)t;/g, function
"<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'>"+d.toLocaleString('en-US', { hour12: true })+"</pre></div>"
)
$("#id_comments").val("")
alert("Comment Submitted")
@ -372,11 +372,12 @@ $("#attachment_form").submit(function (e) {
if (data.error) {
$("#AttachmentError").html(data.error).show()
} else {
d = new Date(data.created_on)
$("#attachment_div").prepend(
"<li class='list-group-item list-row' id='attachment" + data.attachment_id + "'>" +
"<div class='float-right right-container'><div class='list-row-buttons btn-group float-right'><button class='action btn btn-danger' onclick='remove_attachment("+data.attachment_id+")''>Remove</button></div></div>" +
"<div class='stream-post-container' id='comment_name"+data.attachment_id+"'><pre><a href='"+data.attachment_url+"'>"+data.attachment+"</a></pre></div>"+
"<div class='stream-container'><pre class='float-left'>"+data.created_by+"</pre><pre class='float-right'>"+data.created_on+"</pre></div>" +
"<div class='stream-container'><pre class='float-left'>"+data.created_by+"</pre><pre class='float-right'>"+d.toLocaleString('en-US', { hour12: true})+"</pre></div>" +
"</li>"
)
$("#id_attachments").val("")

View file

@ -22,7 +22,7 @@ $("#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'>"+d.toLocaleString('en-US', { hour12: true })+"</pre></div>"
);
$("#id_comments").val("");
alert("Comment Submitted");