Fakultas Ilmu Komputer UI

user_favorite_materi.html 2.18 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{% extends 'app/base_dashboard.html' %}
{% load static %}

{% block title %}
<title>Materi Favorite | Digipus</title>
{% endblock %}

{% block stylesheets %}
<link rel="stylesheet" type="text/css" href="{% static 'app/css/user_uploaded_posts.css' %}"/>
{% endblock %}

{% block content %}

<div style="padding: 1rem 0" id="like">
	{% if materi %}
		{% for _, mat in materi.items %}
		<div id="mat-{{ mat.data.id }}">
			<div class="posts-space-between-container bg-white rounded shadow" style="margin: 0.5rem 2rem; padding: 1rem;">
				<div id="posts-user-profile">
					{% if mat.data.cover %}
					<img id="posts-img" src="{{ post.data.cover.url }}" alt="profile-picture"/>
					{% else %}
					</div style="background-color: grey; width: 100px; height: 100px;">
					{% endif %}
					<div id="posts-info">
						<span><a class="ml-auto p-1 link" style="text-align: left; font-size: 2rem;" href="{% url 'detail-materi' post.data.id %}">
							{{ mat.data.title }}
						</a></span>
						<span style="font-size: 0.75rem; padding-left: 0.3rem;">{{ mat.data.date_created }}</span>
					</div>
				</div>
				<div class="posts-vertically-centered ml-auto pr-4">
					<span id="post-like-count-{{post.data.id}}">{{ mat.data.like_count }}</span>
					<span>Like</span>
				</div>
				<div class="posts-vertically-centered">
					<span>{{ mat.comments|length }}</span>
					<span>Komentar</span>
				</div>
			</div>
            {% for comment in mat.comments %}
			<div id="post-{{ post.data.id }}-comment-{{ comment.id }}">
				<div id="posts-comment-info" class="bg-white rounded shadow" >
					<img id="posts-profile-picture" src="{{ comment.user.profile_picture.url }}" alt="profile-picture" width="40px" height="40px" style="margin: 18px"/>
					<div style="display: flex; align-items: center;">
						<div style="display: flex; flex-direction: column;">
							<span style="font-size: 0.9rem;"><strong>{{ comment.user.name }}</strong> - {{ comment.timestamp }}</span>
							{{ comment.comment }}
						</div>
					</div>
				</div>
			</div>
            {% endfor %}
		</div>
		{% endfor %}
	{% else %}
		<div class="text-center h5">
			Anda belum memiliki materi yang disukai
		</div>
	{% endif %}

</div>

{% endblock %}