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
Iterations
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
Video AG Infrastruktur
website
Commits
b7f07bef
Commit
b7f07bef
authored
8 years ago
by
Andreas Valder
Browse files
Options
Downloads
Patches
Plain Diff
now linked courses
parent
60de8f24
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
+9
-0
9 additions, 0 deletions
server.py
templates/course.html
+20
-0
20 additions, 0 deletions
templates/course.html
templates/macros.html
+17
-15
17 additions, 15 deletions
templates/macros.html
with
46 additions
and
15 deletions
server.py
+
9
−
0
View file @
b7f07bef
...
...
@@ -122,5 +122,14 @@ def search():
'
WHERE (? OR (coursevisible AND listed AND visible)) GROUP BY id ORDER BY _score DESC, time DESC LIMIT 30
'
,
False
)
return
render_template
(
'
search.html
'
,
searchtext
=
request
.
args
[
'
q
'
],
courses
=
courses
,
lectures
=
lectures
)
@app.route
(
'
/course
'
)
def
course
():
if
'
courseid
'
in
request
.
args
:
id
=
request
.
args
[
'
courseid
'
]
return
render_template
(
'
course.html
'
,
course
=
query
(
'
SELECT * FROM courses WHERE handle = ?
'
,
id
))
else
:
return
redirect
(
url_for
(
'
index
'
))
if
__name__
==
'
__main__
'
:
app
.
run
()
This diff is collapsed.
Click to expand it.
templates/course.html
0 → 100644
+
20
−
0
View file @
b7f07bef
{% from 'macros.html' import course_list_item %}
{% from 'macros.html' import preview %}
{% extends "base.html" %}
{% block content %}
<div
class=
"container-fluid"
>
<div
class=
"col-xs-offset-1 col-xs-10"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
<h1
class=
"panel-title"
>
Veranstaltungen
</h1>
</div>
{{course|pprint}}
<ul
class=
"list-group courselist"
>
{% for course in courses %}
{{ course_list_item(course,true) }}
{% endfor %}
</ul>
</div>
</div>
</div>
{% endblock %}
This diff is collapsed.
Click to expand it.
templates/macros.html
+
17
−
15
View file @
b7f07bef
...
...
@@ -60,6 +60,7 @@
{% macro course_list_item(course,show_semester=False) %}
<li
class=
"list-group-item"
>
<div
class=
"row"
>
<a
href=
/course?courseid={{course.handle}}
>
{% if show_semester %}
<span
class=
"col-xs-1"
>
{{ course.semester }}
...
...
@@ -76,6 +77,7 @@
<span
class=
"col-xs-2"
>
{{ course.subject }}
</span>
</a>
</div>
</li>
{% endmacro %}
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