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
Roman Karwacik
website
Commits
45b73410
Commit
45b73410
authored
8 years ago
by
Andreas Valder
Browse files
Options
Downloads
Patches
Plain Diff
made video grouping nicer
parent
4b220db7
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
+4
-1
4 additions, 1 deletion
server.py
templates/search.html
+29
-29
29 additions, 29 deletions
templates/search.html
templates/videos.html
+7
-40
7 additions, 40 deletions
templates/videos.html
with
40 additions
and
70 deletions
server.py
+
4
−
1
View file @
45b73410
...
...
@@ -90,7 +90,10 @@ def videos():
for
i
in
c
:
if
i
[
'
semester
'
]
==
''
:
i
[
'
semester
'
]
=
'
zeitlos
'
return
render_template
(
'
videos.html
'
,
courses
=
c
,
groupedby
=
request
.
args
.
get
(
'
groupedby
'
))
groupedby
=
request
.
args
.
get
(
'
groupedby
'
)
if
groupedby
not
in
[
'
title
'
,
'
semester
'
,
'
organizer
'
]:
groupedby
=
'
semester
'
return
render_template
(
'
videos.html
'
,
courses
=
c
,
groupedby
=
groupedby
)
@app.route
(
'
/faq
'
)
def
faq
():
...
...
This diff is collapsed.
Click to expand it.
templates/search.html
+
29
−
29
View file @
45b73410
{% from 'macros.html' import preview %}
{% extends "base.html" %}
{% block content %}
<div
class=
"container"
>
<div
class=
"container-fluid"
>
<div
class=
"col-xs-offset-1 col-xs-10"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<h1>
Veranstaltungen
</h1>
</div>
<div
class=
"panel-body"
>
{% if courses == [] %}
Nichts gefunden!
<div
class=
"panel-body"
>
Nichts gefunden!
</div>
{% else %}
<ul
class=
"list-group courselist"
>
{% for course in courses %}
...
...
@@ -17,7 +17,6 @@
</ul>
{% endif %}
</div>
</div>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<h1>
Videos
</h1>
...
...
@@ -35,4 +34,5 @@
</div>
</div>
</div>
</div>
{% endblock %}
This diff is collapsed.
Click to expand it.
templates/videos.html
+
7
−
40
View file @
45b73410
{% from 'macros.html' import course_list_item %}
{% set active_page = 'videos' -%}
{% set groupedby = groupedby|default('semester', true) -%}
{% extends "base.html" %}
{% block content %}
...
...
@@ -11,14 +10,13 @@
<span
class=
"caret"
></span></button>
<ul
class=
"dropdown-menu"
>
<li><a
href=
"?groupedby=semester"
>
Semester
</a></li>
<li><a
href=
"?groupedby=
courses
"
>
Veranstaltungen
</a></li>
<li><a
href=
"?groupedby=
title
"
>
Veranstaltungen
</a></li>
<li><a
href=
"?groupedby=organizer"
>
Dozenten
</a></li>
</ul>
</div>
</div>
<div
class=
"row"
><div
class=
"col-xs-offset-1 col-xs-10"
>
{% if groupedby == 'semester' %}
{% for g in courses|groupby('semester')|reverse %}
{% for g in courses|groupby(groupedby)|reverse %}
<div
class=
"row panel-group"
>
<div
class=
"col-xs-12"
><div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
...
...
@@ -26,47 +24,16 @@
</div>
<ul
class=
"courses-list list-group"
>
{% for i in g.list %}
{% if groupedby == semester %}
{{ course_list_item(i) }}
{% endfor %}
</ul>
</div></div>
</div>
{% endfor %}
{% endif %}
{% if groupedby == 'courses' %}
{% for g in courses|groupby('title')|reverse %}
<div
class=
"row panel-group"
>
<div
class=
"col-xs-12"
><div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<h1
class=
"panel-title"
>
{{g.grouper}}
</h1>
</div>
<ul
class=
"courses-list list-group"
>
{% for i in g.list|sort(attribute='semester') %}
{% else %}
{{ course_list_item(i,true) }}
{% endfor %}
</ul>
</div></div>
</div>
{% endfor %}
{% endif %}
{% if groupedby == 'organizer' %}
{% for g in courses|groupby('organizer')|reverse %}
<div
class=
"row panel-group"
>
<div
class=
"col-xs-12"
><div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<h1
class=
"panel-title"
>
{{g.grouper}}
</h1>
</div>
<ul
class=
"courses-list list-group"
>
{% for i in g.list|sort(attribute='semester') %}
{{ course_list_item(i,true) }}
{% endfor %}
</ul>
</div></div>
</div>
{% endfor %}
{% endif %}
</div></div>
</div>
...
...
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