Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jannik Hellenkamp
website
Commits
bba69c3c
Commit
bba69c3c
authored
8 years ago
by
Andreas Valder
Browse files
Options
Downloads
Patches
Plain Diff
more moderator functions
parent
a86e3bcf
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
server.py
+5
-6
5 additions, 6 deletions
server.py
templates/course.html
+10
-0
10 additions, 0 deletions
templates/course.html
templates/macros.html
+6
-3
6 additions, 3 deletions
templates/macros.html
with
21 additions
and
9 deletions
server.py
+
5
−
6
View file @
bba69c3c
...
...
@@ -198,10 +198,11 @@ def course():
return
app
.
view_functions
[
'
videos
'
](),
404
lectures
=
query
(
'
SELECT * FROM lectures WHERE course_id = ? AND (? OR visible)
'
,
courses
[
0
][
'
id
'
],
ismod
())
videos
=
query
(
'''
SELECT videos.*, formats.description AS format_description
SELECT videos.*,
(videos.downloadable AND courses.downloadable) as downloadable,
formats.description AS format_description
FROM videos
JOIN lectures ON (videos.lecture_id = lectures.id)
JOIN formats ON (videos.video_format = formats.id)
JOIN courses ON (lectures.course_id = courses.id)
WHERE lectures.course_id= ? AND (? OR videos.visible)
ORDER BY formats.prio DESC
'''
,
courses
[
0
][
'
id
'
],
ismod
())
...
...
@@ -234,14 +235,12 @@ def logout():
def
edit
():
tabs
=
{
'
courses
'
:
(
'
courses_data
'
,
'
id
'
,
[
'
visible
'
,
'
listed
'
,
'
title
'
,
'
short
'
,
'
handle
'
,
'
organizer
'
,
'
subject
'
,
'
credits
'
,
'
semester
'
,
'
downloadable
'
,
'
handle
'
,
'
organizer
'
,
'
subject
'
,
'
semester
'
,
'
downloadable
'
,
'
internal
'
,
'
responsible
'
]),
'
lectures
'
:
(
'
lectures_data
'
,
'
id
'
,
[
'
visible
'
,
'
title
'
,
'
comment
'
,
'
internal
'
,
'
speaker
'
,
'
place
'
,
'
time
'
,
'
duration
'
,
'
jumplist
'
,
'
titlefile
'
]),
'
internal
'
,
'
speaker
'
,
'
place
'
,
'
time
'
,
'
duration
'
,
'
jumplist
'
]),
'
site_texts
'
:
(
'
site_texts
'
,
'
key
'
,
[
'
value
'
]),
'
videos
'
:
(
'
videos_data
'
,
'
id
'
,
[
'
visible
'
,
'
downloadable
'
,
'
title
'
,
'
comment
'
,
'
internal
'
])
'
videos
'
:
(
'
videos_data
'
,
'
id
'
,
[
'
visible
'
])
}
query
(
'
BEGIN TRANSACTION
'
)
if
request
.
is_json
:
...
...
This diff is collapsed.
Click to expand it.
templates/course.html
+
10
−
0
View file @
bba69c3c
{% from 'macros.html' import lecture_list_item %}
{% from 'macros.html' import valueeditor %}
{% from 'macros.html' import valuecheckbox %}
{% from 'macros.html' import preview %}
{% extends "base.html" %}
{% block content %}
...
...
@@ -14,6 +15,15 @@
<tr><td>
Semester:
</td><td>
{{ valueeditor(['courses',course.id,'semester'], course.semester) }}
</td></tr>
<tr><td>
Veranstalter:
</td><td>
{{ valueeditor(['courses',course.id,'organizer'], course.organizer) }}
</td></tr>
<tr><td>
Bemerkungen:
</td><td>
{{ valueeditor(['courses',course.id,'description'], course.description) }}
</td></tr>
{% if ismod() %}
<tr><td>
Sichtbar:
</td><td>
{{ valuecheckbox(['courses',course.id,'visible'], course.visible) }}
</td></tr>
<tr><td>
Gelistet:
</td><td>
{{ valuecheckbox(['courses',course.id,'listed'], course.listed) }}
</td></tr>
<tr><td>
Short:
</td><td>
{{ valueeditor(['courses',course.id,'short'], course.short) }}
</td></tr>
<tr><td>
Handle:
</td><td>
{{ valueeditor(['courses',course.id,'handle'], course.handle) }}
</td></tr>
<tr><td>
Downloadable:
</td><td>
{{ valuecheckbox(['courses',course.id,'downloadable'], course.downloadable) }}
</td></tr>
<tr><td>
Thema:
</td><td>
{{ valueeditor(['courses',course.id,'subject'], course.subject) }}
</td></tr>
<tr><td>
Zuständig:
</td><td>
{{ valueeditor(['courses',course.id,'responsible'], course.responsible) }}
</td></tr>
{% endif %}
</tbody>
</table>
</div>
...
...
This diff is collapsed.
Click to expand it.
templates/macros.html
+
6
−
3
View file @
bba69c3c
...
...
@@ -66,7 +66,7 @@
{% endmacro %}
{% macro course_list_item(course,show_semester=False) %}
<li
class=
"list-group-item"
>
<li
class=
"list-group-item
{% if not course.visible %}list-group-item-danger{% endif %}
"
>
<div
class=
"row"
>
<a
href=
/course?courseid={{course.handle}}
>
{% if show_semester %}
...
...
@@ -94,7 +94,7 @@
<button
class=
"btn btn-primary dropdown-toggle {% if videos|length is equalto 0 %}disabled{% endif %}"
type=
"button"
data-toggle=
"dropdown"
>
Download
<span
class=
"caret"
></span></button>
<ul
class=
"dropdown-menu"
>
{% for v in videos %}
<li><a
href=
"{{ videoprefix }}/{{v.path}}"
>
{{ valuecheckbox(['videos',v.id,'visible'], v.visible) }} {{v.format_description}} ({{v.file_size|filesizeformat(true)}})
</a></li>
{% if v.downloadable %}
<li><a
href=
"{{ videoprefix }}/{{v.path}}"
>
{{ valuecheckbox(['videos',v.id,'visible'], v.visible) }} {{v.format_description}} ({{v.file_size|filesizeformat(true)}})
</a></li>
{% endif %}
{% endfor %}
</ul>
<noscript>
...
...
@@ -136,7 +136,10 @@ $('#embedcodebtn').popover(
<span
class=
"col-sm-4 col-xs-12"
>
<ul
class=
"list-unstyled"
>
<li>
{{ valueeditor(['lectures',lecture.id,'comment'], lecture.comment) }}
</li>
{% if ismod() %}
<li>
{{ valueeditor(['lectures',lecture.id,'internal'], lecture.internal) }}
</li>
{% endif %}
{% if ismod() %}
<li>
{{ valueeditor(['lectures',lecture.id,'internal'], lecture.internal) }}
</li>
<li>
Sichtbar: {{ valuecheckbox(['lectures',lecture.id,'visible'], lecture.visible) }}
</li>
{% endif %}
</ul>
</span>
<span
class=
"col-sm-3 col-xs-12"
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment