Skip to content

Commit 64d58f7

Browse files
authored
Merge pull request #38 from DataManagementLab/#16_Frontend_Reading_Mode
#16 frontend reading mode
2 parents 6d02f83 + f6c75bd commit 64d58f7

5 files changed

Lines changed: 35 additions & 2 deletions

File tree

frontend/locale/de_DE/LC_MESSAGES/django.po

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,18 @@ msgstr "Kommentare"
9898
msgid "Add comment"
9999
msgstr "Kommentar hinzufügen"
100100

101+
#: frontend/templates/frontend/content/readingmode.html:9
102+
msgid "Close"
103+
msgstr "Schließen"
104+
105+
#: frontend/templates/frontend/content/readingmode.html:12
106+
msgid "Next"
107+
msgstr "Nächste"
108+
109+
#: frontend/templates/frontend/content/readingmode.html:14
110+
msgid "Previous"
111+
msgstr "Vorherige"
112+
101113
#: frontend/templates/frontend/course/create.html:11
102114
msgid "Create a new course"
103115
msgstr "Neuen Kurs anlegen"

frontend/templates/frontend/content/detail.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuLink">
2222
<a class="dropdown-item" href="
23-
{# url 'readingmode' course.id topic.id content.id #}{% if ending %}{{ ending }}{% endif %}">{% fa5_icon 'eye' 'far' %}
23+
{% url 'frontend:content-reading-mode' course.id topic.id content.id %}{% if ending %}{{ ending }}{% endif %}">{% fa5_icon 'eye' 'far' %}
2424
Reading Mode</a>
2525
{% if user.is_authenticated %}
2626
{% if content.type|is_content_editable %}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{% extends "frontend/base.html" %}
2+
3+
{% load i18n %}
4+
{% load cc_frontend_tags %}
5+
6+
{% block general_content %}
7+
<div class="container-fluid" style="background-color: #0a3d62;padding-top:2em;padding-bottom:2em;color:#ffffff;">
8+
<div class="container" style="border-top: 0.5em solid #ffffff;padding-top:1em;">
9+
<a href="{% url 'frontend:content' course_id topic_id content.id %}" class="btn btn-primary">{% trans 'Close' %}</a>
10+
<h3 class="d-inline-block">{{ content }}</h3>
11+
<a href="{% url 'frontend:content-reading-mode' course_id topic_id next_id %}"
12+
class="btn btn-primary d-inline-block float-right">{% trans 'Next' %}</a>
13+
<a href="{% url 'frontend:content-reading-mode' course_id topic_id previous_id %}"
14+
class="btn btn-primary d-inline-block float-right">{% trans 'Previous' %}</a>
15+
</div>
16+
</div>
17+
18+
{% include content.type|content_view %}
19+
20+
{% endblock %}

frontend/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
path('<int:content_id>/comment/<int:pk>/delete/', views.DeleteComment.as_view(), name='comment-delete'),
2828
path('<int:content_id>/comment/<int:pk>/edit/', views.EditComment.as_view(), name='comment-edit'),
2929
path('<pk>/', views.ContentView.as_view(), name='content'),
30+
path('<pk>/read/', views.content.ContentReadingModeView.as_view(), name='content-reading-mode'),
3031
])),
3132
path('add/', views.AddCourseView.as_view(), name='add-course'),
3233
])),

frontend/views/content.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def get_context_data(self, **kwargs):
200200
return context
201201

202202

203-
class ContentReadingModeView(DetailView): # pylint: disable=too-many-ancestors
203+
class ContentReadingModeView(LoginRequiredMixin, DetailView): # pylint: disable=too-many-ancestors
204204
"""
205205
Displays the content to the user
206206
"""

0 commit comments

Comments
 (0)