You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
228 lines
9.6 KiB
HTML
228 lines
9.6 KiB
HTML
{% load static %}
|
|
|
|
<link rel="stylesheet" type="text/css" href='{% static "dist/output.css" %}'>
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
|
|
|
|
|
|
|
|
<!-- EMOJI PICKER POPUP CONTAINER -->
|
|
<div class="w-full h-full fixed bg-black bg-opacity-50 inset-0 flex justify-center items-center p-5 z-20 hidden" id="emojiPickerContainer">
|
|
<div class="w-[500px] bg-gray-100 rounded-md shadow-md p-5 relative">
|
|
<div
|
|
class="w-[28px] h-[28px] rounded-full bg-white border border-gray-100 shadow-md flex justify-center items-center p-2 absolute top-5 right-5 text-secondosiblue cursor-pointer hover:bg-secondosiblue hover:text-white duration-300" id="closeEmojiPicker">
|
|
<i class="fa fa-close"></i>
|
|
</div>
|
|
|
|
<p class="text-xl text-secondosiblue text-center mt-3">Add Reaction</p>
|
|
{% csrf_token %}
|
|
<!-- EMOJIS CATEGORIES BAR -->
|
|
<div class="w-full px-3 py-1 bg-gray-200 rounded-md flex gap-2 items-center mt-5">
|
|
<div class="w-[30px] rounded-full selectedEmojiCategory p-1 emoji-category" data-category="smiley">
|
|
<img src="{% static 'images/emojis/smiley.png' %}" class="w-full">
|
|
</div>
|
|
|
|
<div class="w-[30px] rounded-full p-1 emoji-category" data-category="nature">
|
|
<img src="{% static 'images/emojis/animal.png' %}" class="w-full">
|
|
</div>
|
|
|
|
<div class="w-[30px] rounded-full p-1 emoji-category" data-category="food">
|
|
<img src="{% static 'images/emojis/food.png' %}" class="w-full">
|
|
</div>
|
|
|
|
<div class="w-[30px] rounded-full p-1 emoji-category" data-category="activities">
|
|
<img src="{% static 'images/emojis/activities.png' %}" class="w-full">
|
|
</div>
|
|
|
|
<div class="w-[30px] rounded-full p-1 emoji-category" data-category="travel">
|
|
<img src="{% static 'images/emojis/travel.png' %}" class="w-full">
|
|
</div>
|
|
|
|
<div class="w-[30px] rounded-full p-1 emoji-category" data-category="flags">
|
|
<img src="{% static 'images/emojis/flags.png' %}" class="w-full">
|
|
</div>
|
|
</div>
|
|
|
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('.emoji-category-container p').click(function() {
|
|
var statusId = $('#emojiPicker').data('statusId');
|
|
var emoji = $(this).text();
|
|
var csrftoken = $("[name=csrfmiddlewaretoken]").val(); // Fetch CSRF token from the page
|
|
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: '/add_reaction/' + statusId + '/' + emoji + '/',
|
|
beforeSend: function(xhr, settings) {
|
|
xhr.setRequestHeader("X-CSRFToken", csrftoken); // Set CSRF token in request headers
|
|
},
|
|
success: function(response) {
|
|
location.reload();
|
|
},
|
|
error: function(xhr, errmsg, err) {
|
|
console.log(xhr.status + ": " + xhr.responseText);
|
|
}
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
|
|
<!-- EMOJIS CONTAINER -->
|
|
<div class="mt-5 emoji-container">
|
|
|
|
<!-- SMILEYS -->
|
|
<div class="emoji-category-container" id="smileyContainer">
|
|
<p class="uppercase text-secondosiblue">Smileys & People</p>
|
|
|
|
<div class="flex flex-wrap items-center gap-1 mt-2">
|
|
<p>😄</p>
|
|
<p>😅</p>
|
|
<p>😁</p>
|
|
<p>🤣</p>
|
|
<p>😂</p>
|
|
<p>😊</p>
|
|
<p>😇</p>
|
|
<p>😉</p>
|
|
<p>🥰</p>
|
|
<p>😭</p>
|
|
<p>😍</p>
|
|
<p>🤪</p>
|
|
<p>🤔</p>
|
|
<p>😏</p>
|
|
<p>😒</p>
|
|
<p>🙄</p>
|
|
<p>😴</p>
|
|
<p>🥳</p>
|
|
<p>😎</p>
|
|
<p>🙁</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- NATURE -->
|
|
<div class="emoji-category-container hidden" id="natureContainer">
|
|
<p class="uppercase text-secondosiblue">Animals & Nature</p>
|
|
|
|
<div class="flex flex-wrap items-center gap-1 mt-2">
|
|
<p>🌹</p>
|
|
<p>🌷</p>
|
|
<p>💐</p>
|
|
<p>🌸</p>
|
|
<p>🍀</p>
|
|
<p>🥀</p>
|
|
<p>🌼</p>
|
|
<p>🌺</p>
|
|
|
|
<p>🦋</p>
|
|
<p>🐌</p>
|
|
<p>🐎</p>
|
|
<p>🐆</p>
|
|
<p>🦁</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- FOOD -->
|
|
<div class="emoji-category-container hidden" id="foodContainer">
|
|
</div>
|
|
|
|
<!-- ACTIVITIES -->
|
|
<div class="emoji-category-container hidden" id="activitiesContainer">
|
|
</div>
|
|
|
|
<!-- TRAVEL -->
|
|
<div class="emoji-category-container hidden" id="travelContainer">
|
|
</div>
|
|
|
|
<!-- FLAGS -->
|
|
<div class="emoji-category-container hidden" id="flagsContainer">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
{% if latest_statuses_time_ago %}
|
|
{% 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-3 bg-gray-50 pt-2 px-2 pb-6 rounded-md relative">
|
|
<div class="w-full flex justify-between items-center gap-2">
|
|
<div class="flex justify-start gap-2 cursor-pointer userRecentActivitiesButton"
|
|
data-modal-url="{% url 'userrecentativities' latest.status.staff.user.id %}">
|
|
<div class="relative w-fit rounded-full">
|
|
<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>
|
|
|
|
{% if latest.status.staff in online_staff_profiles %}
|
|
<div
|
|
class="w-[12px] h-[12px] absolute rounded-full bg-green-600 bottom-0 right-0 border-2 border-white">
|
|
</div>
|
|
{% else %}
|
|
<div
|
|
class="w-[12px] h-[12px] absolute rounded-full bg-red-500 bottom-0 right-0 border-2 border-white">
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="flex flex-col">
|
|
<h1 class="text-sm text-slate-700 font-semibold">{{latest.status.staff.user.first_name}}
|
|
{{latest.status.staff.user.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="relative">
|
|
<div class="cursor-pointer hover:scale-105 duration-500 transition-transform" id="emojiPicker" data-status-id="{{latest.status.id}}">
|
|
<img src="{% static 'images/icons/reactionicon.png' %}" class="w-[30px]">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Status -->
|
|
<div class="w-full">
|
|
{% if "Completed" in latest.status.text %}
|
|
<p class="text-sm text-green-700">{{latest.status.text}}</p>
|
|
{% else %}
|
|
<p class="text-sm text-secondosiblue">{{latest.status.text}}</p>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<!-- Add comment section -->
|
|
<div class="w-full h-fit flex justify-between items-center border border-gray-200 rounded-md relative">
|
|
<input type="text" placeholder="Add Comment..."
|
|
class="outline-none text-gray-500 px-3 w-full text-sm h-[40px] rounded-tl-md rounded-bl-md">
|
|
<button
|
|
class="w-fit absolute right-0 h-full px-3 py-2 bg-osiblue border border-osiblue hover:bg-white hover:text-osiblue duration-300 rounded-tr-md rounded-br-md text-white text-[12px]">
|
|
<i class="fa fa-send"></i>
|
|
</button>
|
|
</div>
|
|
|
|
{% if latest.status.reaction_set.all %}
|
|
<div class="w-fit h-[30px] text-[16px] rounded-full bg-white p-2 shadow-md absolute -bottom-4 right-2 flex justify-center items-center border gap-1 border-gray-100">
|
|
{% for reaction in latest.status.reaction_set.all %}
|
|
<p class="mt-1">{{reaction.emoji}}</p>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
{% else %}
|
|
|
|
<div class="w-full h-[210px] flex justify-center items-center">
|
|
<p class="text-base text-gray-500 text-center">No statuses at the moment.</p>
|
|
</div>
|
|
|
|
|
|
<!---------------------- JS SCRIPTS -------------------->
|
|
|
|
<!-- TO RELOAD THE USERS ACTIVITY CONTAINER -->
|
|
<script type="text/javascript" src='{% static "js/get-updated-user-activity.js" %}'></script>
|
|
|
|
|
|
{% endif %} |