Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Class Project
DIGIPUS
Commits
12182cfa
Commit
12182cfa
authored
Oct 31, 2020
by
Ken Reinhart
Browse files
Flagged material
parent
2221a24c
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/templates/app/detail_materi.html
View file @
12182cfa
...
...
@@ -185,7 +185,11 @@ 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>
<div
class=
"dropdown"
>
<!--
<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"
>
Bagikan
...
...
app/templates/app/katalog_materi.html
View file @
12182cfa
...
...
@@ -77,11 +77,11 @@
</div>
</header>
<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>
<div
class=
"container"
>
...
...
@@ -171,6 +171,7 @@
</p>
<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>
</div>
</div>
{% endfor %}
...
...
app/templates/flagged_book.html
0 → 100644
View file @
12182cfa
{% 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 %}
<br><br>
<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"
>
<thead>
<tr>
<th
id=
"judul_materi"
>
Judul Materi
</th>
<th
id=
"author"
>
Pembuat Materi
</th>
<th
id=
"detail_buttons"
>
Detail
</th>
</tr>
</thead>
<tbody>
{% for riwayat in riwayat_list %}
<tr>
<td>
{{riwayat.materi.title}}
</td>
<td>
{{riwayat.materi.author}}
</td>
<td>
{{riwayat.timestamp|date:"d F Y H:i:s"}}
</td>
<td
class=
"verif-buttons"
>
<span>
<a
href=
"/materi/{{riwayat.materi.id}}/"
class=
"accept-button button-decoration"
style=
"background-color:#4e73df"
>
Detail
</a>
</span>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% else %}
<p
class=
"mb-4"
>
Tidak ada buku yang ditandai untuk dilaporkan. Silahkan tandai materi yang isinya tidak sesuai dengan judulnya.
</p>
{% endif %}
<span>
<a
href=
"/"
class=
"btn btn-primary main-content"
style=
"background-color:#4e73df; right: 0px;"
>
Back to Katalog
</a>
</span>
<br>
{% endblock %}
\ No newline at end of file
app/views.py
View file @
12182cfa
...
...
@@ -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
)
else
:
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
)
...
...
digipus/__pycache__/settings.cpython-36.pyc
View file @
12182cfa
No preview for this file type
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment