Fakultas Ilmu Komputer UI

Commit 412bc286 authored by Saul Andre's avatar Saul Andre
Browse files

[REFACTOR] creating timestamp for comments

parent 0874eafa
......@@ -10,7 +10,8 @@
.comment {
border-bottom: 1px solid #d4d4d4;
}
.comment .user .profile {
.comment .headline .profile {
display: inline-block;
height: 25px;
width: 25px;
......@@ -18,7 +19,13 @@
border-radius: 50%;
margin-right: 10px;
}
.headline .timestamp {
font-size: 15px;
}
.comment .text {
padding-left: 20px;
}
.comment .link {
font-size: 15px;
color: #615cfd;
}
{% load static %}
{% load static %} {% load humanize %}
<!DOCTYPE html>
<html lang="en">
<head>
......@@ -193,6 +193,7 @@
<div
class="row comments shadow p-3 mb-3 bg-white rounded d-flex flex-column bd-highlight"
>
{% if comments%}
<p class="h4 mb-3 bd-highlight">Komentar</p>
<div class="comments">
{% for comment in comments %}
......@@ -200,7 +201,7 @@
class="comment shadow-sm p-3 mb-1 bg-white rounded bd-highlight"
>
<div
class="d-flex bd-highlight mb-3 align-items-center user"
class="d-flex bd-highlight mb-3 align-items-center headline"
>
{% if comment.user != Null %}
<img
......@@ -217,20 +218,25 @@
<p class="p-1 bd-highligh m-0">
<b>{{comment.user.name}}</b>
</p>
{% if user.is_admin %}
<p class="p-1 bd-highligh m-0"></p>
<p
class="timestamp p-1 bd-highligh m-0"
>
{{ comment.timestamp|naturaltime }}
</p>
<a
class="ml-auto p-1 bd-highlight close"
href="{% url 'delete-comment' materi_data.id comment.id %}"
class="ml-auto p-1 bd-highlight link"
href="{% url 'detail-materi' comment.materi.id %}"
>Lihat Materi</a
>
<span aria-hidden="true"
>&times;</span
>
</a>
{% endif %}
</div>
<p class="text">{{comment.comment}}</p>
</div>
{% endfor %}
{% endfor %} {% else %}
<p class="h5">
Belum ada komentar
</p>
{% endif %}
</div>
</div>
</div>
......
......@@ -40,6 +40,7 @@ INSTALLED_APPS = [
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
'django.contrib.humanize',
"authentication.apps.AuthenticationConfig",
"app.apps.AppConfig",
"register.apps.RegisterConfig",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment