Refresh status and user activities container
parent
88cb393922
commit
7299a5cad3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,13 @@
|
|||||||
|
function refreshStatusContainer() {
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: '/getupdatedlaststatus/',
|
||||||
|
method: 'GET',
|
||||||
|
dataType: 'html',
|
||||||
|
success: function(data) {
|
||||||
|
$('#statusContainer').html(data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
setInterval(refreshStatusContainer, 60000);
|
@ -0,0 +1,13 @@
|
|||||||
|
function refreshUserActivityContainer() {
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: '/getupdatedactivities/',
|
||||||
|
method: 'GET',
|
||||||
|
dataType: 'html',
|
||||||
|
success: function(data) {
|
||||||
|
$('#activitiesContainer').html(data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
setInterval(refreshUserActivityContainer, 60000);
|
@ -1,17 +0,0 @@
|
|||||||
function autoRefreshDiv() {
|
|
||||||
var statusContainer = document.getElementById('statusContainer');
|
|
||||||
var divs = document.querySelectorAll('.userActivityContainer');
|
|
||||||
|
|
||||||
divs.forEach(function (div) {
|
|
||||||
setInterval(function () {
|
|
||||||
div.innerHTML = div.innerHTML;
|
|
||||||
}, 15000);
|
|
||||||
});
|
|
||||||
|
|
||||||
// setInterval(function () {
|
|
||||||
|
|
||||||
// statusContainer.innerHTML = statusContainer.innerHTML;
|
|
||||||
// }, 60000);
|
|
||||||
}
|
|
||||||
|
|
||||||
window.onload = autoRefreshDiv;
|
|
@ -0,0 +1,41 @@
|
|||||||
|
{% for latest in latest_statuses_time_ago %}
|
||||||
|
<div class="w-full flex flex-col py-3">
|
||||||
|
<div class="w-full flex flex-col justify-center items-start gap-2">
|
||||||
|
<div class="w-full flex justify-between items-center gap-2">
|
||||||
|
<div class="flex justify-start gap-2">
|
||||||
|
<div class="w-[45px] h-[45px] rounded-full">
|
||||||
|
<img src='{{latest.status.staff.image.url}}' alt="user profile"
|
||||||
|
class="w-full h-full object-cover rounded-full">
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<h1 class="text-sm text-slate-700 font-semibold">{{latest.status.staff.first_name}}
|
||||||
|
{{latest.status.staff.last_name}}</h1>
|
||||||
|
{% if latest.time_ago == '0min ago' %}
|
||||||
|
<p class="text-sm text-gray-500">Just Now</p>
|
||||||
|
{%else %}
|
||||||
|
<p class="text-sm text-gray-500">{{ latest.time_ago}}</p>
|
||||||
|
{%endif%}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="cursor-pointer">
|
||||||
|
<i class="fa fa-thumbs-up" style="color: rgb(184, 184, 184); font-size: 15px;"></i>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Status -->
|
||||||
|
<div class="w-full">
|
||||||
|
<p class="text-sm text-gray-500">{{latest.status.text}}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Add comment section -->
|
||||||
|
<div class="w-full h-fit flex justify-between items-center border border-gray-200 mt-2 rounded-md">
|
||||||
|
<input type="text" placeholder="Add Comment..."
|
||||||
|
class="outline-none text-gray-500 p-2 w-[100%] text-sm h-[40px] rounded-tl-md rounded-bl-md">
|
||||||
|
<button class="w-fit px-3 py-2 bg-slate-800 rounded-tr-md rounded-br-md">
|
||||||
|
<i class="fa fa-send" style="color: white; font-size: 15px;"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endfor %}
|
@ -0,0 +1,15 @@
|
|||||||
|
<div>
|
||||||
|
<p class="text-sm text-gray-500">Recent Status: <span
|
||||||
|
class="text-slate-700 font-semibold">{{last_status.text}}</span></p>
|
||||||
|
<p class="text-sm text-gray-500">Last update:
|
||||||
|
{% if last_status.date == current_date %}
|
||||||
|
Today | {{last_status.time}},
|
||||||
|
{% if minutes_ago == 0 %}
|
||||||
|
Just Now
|
||||||
|
{%else%}
|
||||||
|
{{hours_minutes_ago}}
|
||||||
|
{%endif%}
|
||||||
|
{% else %}
|
||||||
|
{{last_status.date}} | {{last_status.time}}
|
||||||
|
{%endif %}</p>
|
||||||
|
</div>
|
Loading…
Reference in New Issue