Skip to content

Commit 201ed66

Browse files
committed
add content reading mode
1 parent 0dfb4b5 commit 201ed66

5 files changed

Lines changed: 49 additions & 30 deletions

File tree

frontend/locale/de_DE/LC_MESSAGES/django.po

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -35,38 +35,40 @@ msgstr "Soll der folgende Kommentar wirklich gelöscht werden?"
3535

3636
#: frontend/templates/frontend/content/addcontent.html:23
3737
#: frontend/templates/frontend/course/create.html:29
38+
#: frontend/templates/frontend/course/edit.html:29
3839
msgid "Create"
3940
msgstr "Erzeugen"
4041

4142
#: frontend/templates/frontend/content/addcontent.html:24
4243
#: frontend/templates/frontend/content/detail.html:80
4344
#: frontend/templates/frontend/course/create.html:30
45+
#: frontend/templates/frontend/course/edit.html:30
4446
#: frontend/templates/frontend/profile/profile_edit.html:19
4547
msgid "Cancel"
4648
msgstr "Abbrechen"
4749

4850
#: frontend/templates/frontend/content/detail.html:18
49-
#: frontend/templates/frontend/course/view.html:25
51+
#: frontend/templates/frontend/course/view.html:24
5052
msgid "Actions"
5153
msgstr "Aktionen"
5254

53-
#: frontend/templates/frontend/content/detail.html:46
55+
#: frontend/templates/frontend/content/detail.html:43
5456
msgid "Back to course "
5557
msgstr "Zurück zum Kurs "
5658

57-
#: frontend/templates/frontend/content/detail.html:52
59+
#: frontend/templates/frontend/content/detail.html:49
5860
msgid "By"
5961
msgstr "Von"
6062

61-
#: frontend/templates/frontend/content/detail.html:62
63+
#: frontend/templates/frontend/content/detail.html:59
6264
msgid "Created at"
6365
msgstr "Erstellt am"
6466

65-
#: frontend/templates/frontend/content/detail.html:70
67+
#: frontend/templates/frontend/content/detail.html:67
6668
msgid "Delete"
6769
msgstr "Löschen"
6870

69-
#: frontend/templates/frontend/content/detail.html:74
71+
#: frontend/templates/frontend/content/detail.html:71
7072
#, python-format
7173
msgid ""
7274
"\n"
@@ -80,38 +82,38 @@ msgstr ""
8082
" "
8183

8284
#: frontend/templates/frontend/content/detail.html:83
83-
#: frontend/templates/frontend/course/create.html:30
84-
#: frontend/templates/frontend/course/edit.html:30
85-
#: frontend/templates/frontend/profile/profile_edit.html:19
86-
msgid "Cancel"
87-
msgstr "Abbrechen"
88-
89-
#: frontend/templates/frontend/content/detail.html:86
9085
msgid "Confirm"
9186
msgstr "Bestätigen"
9287

93-
#: frontend/templates/frontend/content/detail.html:102
88+
#: frontend/templates/frontend/content/detail.html:99
9489
#: frontend/templates/frontend/course/topic_contents.html:29
9590
msgid "Rating"
9691
msgstr "Bewertung"
9792

98-
#: frontend/templates/frontend/content/detail.html:112
93+
#: frontend/templates/frontend/content/detail.html:109
9994
msgid "Comments"
10095
msgstr "Kommentare"
10196

102-
#: frontend/templates/frontend/content/detail.html:118
97+
#: frontend/templates/frontend/content/detail.html:115
10398
msgid "Add comment"
10499
msgstr "Kommentar hinzufügen"
105100

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+
106113
#: frontend/templates/frontend/course/create.html:11
107114
msgid "Create a new course"
108115
msgstr "Neuen Kurs anlegen"
109116

110-
#: frontend/templates/frontend/course/create.html:29
111-
#: frontend/templates/frontend/course/edit.html:29
112-
msgid "Create"
113-
msgstr "Erzeugen"
114-
115117
#: frontend/templates/frontend/course/dropdown_topic.html:10
116118
msgid "Add Content"
117119
msgstr "Inhalte hinzufügen"
@@ -120,16 +122,15 @@ msgstr "Inhalte hinzufügen"
120122
msgid "Edit course"
121123
msgstr "Kurs bearbeiten"
122124

123-
#: frontend/templates/frontend/course/view.html:26
125+
#: frontend/templates/frontend/course/view.html:35
124126
msgid "Edit Course"
125127
msgstr "Kurs hinzufügen"
126128

127-
#: frontend/templates/frontend/course/view.html:27
129+
#: frontend/templates/frontend/course/view.html:36
128130
msgid "Delete Course"
129131
msgstr "Kurs löschen"
130132

131-
#: frontend/templates/frontend/course/view.html:63
132-
#: frontend/templates/frontend/course/view.html:78
133+
#: frontend/templates/frontend/course/view.html:76
133134
msgid "No topics yet"
134135
msgstr "Bisher keine Themen"
135136

@@ -268,6 +269,3 @@ msgstr "Kurs '{cleaned_data['title']}' erfolgreich bearbeitet"
268269
#: frontend/views/profile.py:25
269270
msgid "Profile updated"
270271
msgstr "Profil aktualisiert"
271-
272-
#~ msgid "Delete Course"
273-
#~ msgstr "Kurs löschen"

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
@@ -26,6 +26,7 @@
2626
path('<int:content_id>/comment/<int:pk>/delete/', views.DeleteComment.as_view(), name='comment-delete'),
2727
path('<int:content_id>/comment/<int:pk>/edit/', views.EditComment.as_view(), name='comment-edit'),
2828
path('<pk>/', views.ContentView.as_view(), name='content'),
29+
path('<pk>/read/', views.content.ContentReadingModeView.as_view(), name='content-reading-mode'),
2930
])),
3031
path('add/', views.AddCourseView.as_view(), name='add-course'),
3132
])),

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)