Fakultas Ilmu Komputer UI

Commit 12182cfa authored by Ken Reinhart's avatar Ken Reinhart
Browse files

Flagged material

parent 2221a24c
......@@ -185,6 +185,10 @@ div.review {
class="btn btn-link btn-book shadow-sm p-2 mr-2 bg-white rounded">Baca</a>
<a href="{% url 'download-materi' materi_data.id %}"
class="btn btn-link btn-book shadow-sm p-2 mr-2 bg-white rounded">Unduh</a>
<a href="{% url 'download-materi' materi_data.id %}"
class="btn btn-link btn-book shadow-sm p-2 mr-2 bg-white rounded">Flag!</a>
<div class="dropdown">
<button class="btn dropdown-toggle btn-book shadow-sm p-2 mr-2 bg-white rounded" type="button"
id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
......@@ -77,11 +77,11 @@
<a href="/download-history/" class="btn-history">Riwayat Unduh</a><br><br>
<div id="container-materi-ordering">
<a href="?random=1" class="btn-materi-ordering">Acak Materi</a><br><br>
<a href="?recommendation=1" class="btn-materi-ordering">Rekomendasi</a><br><br>
<a href="/download-history/" class="btn-history">Riwayat Unduh</a><br><br>
<a href="/flagged-book/" class="btn-history">Flagged Book</a><br><br>
<div class="container">
......@@ -171,6 +171,7 @@
<a href="{% url 'view-materi' item.id %}" class="btn btn-book">Baca</a>
<a href="{% url 'detail-materi' item.id %}" class="btn btn-book">Detail</a>
<a href="{% url 'detail-materi' item.id %}" class="btn btn-book">Flag!</a>
{% endfor %}
{% extends 'base.html' %}
{% load static %}
{% block title %}
<title>Flagged Book | Digipus</title>
{% endblock %}
{% block header %}
<link rel="icon" type="image/png" href="{% static 'images/icons/logo.ico' %}" />
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
<link href="{% static 'css/sb-admin-2.min.css' %}" rel="stylesheet">
<link rel="stylesheet" href="{% static 'css/button.css' %}">
<link href="{% static 'vendor/datatables/dataTables.bootstrap4.min.css' %}" rel="stylesheet">
{% endblock %}
{% block content %}
<h1 id="flagged_book" class="h3 mb-2 text-gray-800">Flagged Book | {{ user_name }}</h1>
{% if riwayat_list %}
<p class="mb-4">Tekan tombol detail untuk informasi lebih lanjut tentang materi</p>
<div class="card shadow mb-4">
<div class="card-body">
<div class="table-responsive">
<table aria-describedby="flagged_book" class="table table-bordered" id="dataTable">
<th id="judul_materi">Judul Materi</th>
<th id="author">Pembuat Materi</th>
<th id="detail_buttons">Detail</th>
{% for riwayat in riwayat_list %}
<td>{{riwayat.timestamp|date:"d F Y H:i:s"}}</td>
<td class="verif-buttons">
<a href="/materi/{{riwayat.materi.id}}/" class="accept-button button-decoration"
{% endfor %}
{% else %}
<p class="mb-4">Tidak ada buku yang ditandai untuk dilaporkan. Silahkan tandai materi yang isinya tidak sesuai dengan judulnya.</p>
{% endif %}
<a href="/" class="btn btn-primary main-content" style="background-color:#4e73df; right: 0px;">Back to Katalog</a>
{% endblock %}
\ No newline at end of file
......@@ -684,6 +684,22 @@ class DownloadHistoryView(TemplateView):
DownloadHistoryService.init_data_guest_user(context, request)
return self.render_to_response(context)
class FlaggedBookView(TemplateView):
template_name = "flagged_book.html"
def get_context_data(self, **kwargs):
context = super(FlaggedBookView, self).get_context_data(**kwargs)
return context
def get(self, request, *args, **kwargs):
context = self.get_context_data(**kwargs)
if request.user.is_authenticated:
current_user = self.request.user
DownloadHistoryService.init_data_authenticated_user(context, current_user)
DownloadHistoryService.init_data_guest_user(context, request)
return self.render_to_response(context)
def save_to_gdrive(request, pk):
materi = get_object_or_404(Materi, pk=pk)
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