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
4a3fdf61
Commit
4a3fdf61
authored
8 years ago
by
Julian Rother
Browse files
Options
Downloads
Patches
Plain Diff
Restructured featured template
parent
68d58456
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
templates/index.html
+2
-27
2 additions, 27 deletions
templates/index.html
templates/macros.html
+43
-0
43 additions, 0 deletions
templates/macros.html
with
45 additions
and
27 deletions
templates/index.html
+
2
−
27
View file @
4a3fdf61
{% from 'macros.html' import preview,
course_list_item
%}
{% from 'macros.html' import preview,
featured_content
%}
{% extends "base.html" %}
{% extends "base.html" %}
{% set page_border = 0 %}
{% set page_border = 0 %}
{% if ismod() %}
{% if ismod() %}
...
@@ -98,32 +98,7 @@
...
@@ -98,32 +98,7 @@
{% endif %}
{% endif %}
</h1>
</h1>
</div>
</div>
{% if item.type == 'image' %}
{{ featured_content(item) }}
<!-- Putting image tag here makes it borderless. This should be replaced by a bootstrap-compatible solution. -->
<img
src=
"{{item.param}}"
style=
"width: 100%;"
/>
{% if ismod() %}
<p>
{{moderator_editor(('featured',item.id,'param'), item.param)}}
</p>
{% endif %}
{% endif %}
{% if item.text or ismod() %}
<div
class=
"panel-body"
>
{{ moderator_editor(('featured',item.id,'text'), item.text) }}
</div>
{% endif %}
{% if item.type == 'courses' %}
<ul
class=
"courses-list list-group"
>
{% for i in item.courses %}
{{ course_list_item(i) }}
{% endfor %}
</ul>
<div
class=
"panel-footer"
>
{% if ismod() %}
<p>
Kategorie: {{ moderator_editor(('featured',item.id,'param'), item.param) }}
</p>
<p>
Parameter: {{ moderator_editor(('featured',item.id,'param2'), item.param2) }}
</p>
{% endif %}
Die vollständige Liste findest du
<a
href=
"{{ url_for('courses') }}"
>
hier
</a>
.
</div>
{% endif %}
</div>
</div>
{% endfor %}
{% endfor %}
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
templates/macros.html
+
43
−
0
View file @
4a3fdf61
...
@@ -306,3 +306,46 @@ $('#embedcodebtn').popover(
...
@@ -306,3 +306,46 @@ $('#embedcodebtn').popover(
});
});
</script>
</script>
{% endmacro %}
{% endmacro %}
{% macro featured_content(item) %} {# This macro is used in a panel div after the panel header #}
{% if item.type == 'image' %}
<!-- Putting image tag here makes it borderless. This should be replaced by a bootstrap-compatible solution. -->
<img
src=
"{{item.param}}"
style=
"width: 100%;"
/>
{% if ismod() %}
<p>
{{moderator_editor(('featured',item.id,'param'), item.param)}}
</p>
{% endif %}
{% if item.text or ismod() %}
<div
class=
"panel-body"
>
{{ moderator_editor(('featured',item.id,'text'), item.text) }}
</div>
{% endif %}
{% elif item.type == 'courses' %}
{% if item.text or ismod() %}
<div
class=
"panel-body"
>
{{ moderator_editor(('featured',item.id,'text'), item.text) }}
</div>
{% endif %}
<ul
class=
"courses-list list-group"
>
{% for i in item.courses %}
{{ course_list_item(i) }}
{% endfor %}
</ul>
<div
class=
"panel-footer"
>
{% if ismod() %}
<ul
class=
"list-inline"
>
<li><div
class=
"dropdown"
>
{% set params = {'semester': 'Semester', 'title': 'Veranstaltung', 'organizer': 'Dozent', 'subject': 'Kategorie'} %}
<button
class=
"btn btn-default dropdown-toggle"
type=
"button"
data-toggle=
"dropdown"
>
{{params[item.param]}}:
<span
class=
"caret"
></span></button>
<ul
class=
"dropdown-menu"
>
{% for key, name in params.items() %}
<li><a
href=
"{{url_for('edit', **{'featured.'+item.id|string+'.param': key, 'ref': request.url})}}"
>
{{name}}
</a></li>
{% endfor %}
</ul>
</div></li>
<li>
{{ moderator_editor(('featured',item.id,'param2'), item.param2) }}
</li>
</ul>
{% endif %}
Die vollständige Liste findest du
<a
href=
"{{ url_for('courses') }}"
>
hier
</a>
.
</div>
{% else %}
{% if item.text or ismod() %}
<div
class=
"panel-body"
>
{{ moderator_editor(('featured',item.id,'text'), item.text) }}
</div>
{% endif %}
{% endif %}
{% 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