Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
W
website
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
84
Issues
84
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Video AG Infrastruktur
website
Commits
a5b5a6de
Commit
a5b5a6de
authored
Sep 11, 2016
by
Julian Rother
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move psa editing from base to index template
parent
9b87d1ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
39 deletions
+49
-39
templates/base.html
templates/base.html
+3
-33
templates/index.html
templates/index.html
+46
-6
No files found.
templates/base.html
View file @
a5b5a6de
...
...
@@ -100,40 +100,10 @@
{% for msg in get_flashed_messages() %}
<div
class=
"alert alert-danger"
role=
"alert"
>
{{ msg }}
</div>
{% endfor %}
{% for msg in get_announcements(min_announcement_level) if (not request.cookies['alert-info-'+msg.id|string])
or ismod()
%}
{% for msg in get_announcements(min_announcement_level) if (not request.cookies['alert-info-'+msg.id|string]) %}
<div
class=
"alert alert-{{levels.get(msg.level, ('info', ''))[0]}}"
role=
"alert"
>
{% if not ismod() %}
<a
href=
"#"
class=
"close"
data-dismiss=
"alert"
aria-label=
"close"
onclick=
"Cookies.set('alert-info-{{msg.id}}', '1');"
>
×
</a>
{% endif %}
<ul
class=
"list-unstyled"
>
<li>
{{ valueeditor(('announcements',msg.id,'text'), msg.text|safe) }}
</li>
{% if ismod() %}
<li
class=
"pull-right"
>
{{ valuedeletebtn(('announcements',msg.id,'deleted')) }}
</li>
<li
class=
"pull-right"
style=
"padding-right: 5px;"
>
{% if not msg.visible %}
<a
href=
"{{ url_for('edit', ref=request.url) }}&announcements.{{ msg.id }}.visible=1"
class=
"btn btn-primary"
>
Veröffentlichen
</a>
{% elif msg.time_expire and msg.time_expire
<
datetime.now
()
%}
<
a
href=
"#"
class=
"btn btn-danger disabled"
>
Abgelaufen
</a>
{% elif msg.time_publish and msg.time_publish > datetime.now() %}
<a
href=
"#"
class=
"btn btn-default disabled"
>
Geplant
</a>
{% else %}
<a
href=
"#"
class=
"btn btn-success disabled"
>
Öffentlich
</a>
{% endif %}
</li>
<li
class=
"dropdown pull-right"
style=
"padding-right: 5px;"
>
<span
class=
"btn btn-default dropdown-toggle"
type=
"button"
data-toggle=
"dropdown"
>
{{levels.get(msg.level, ('', 'Unbekannt'))[1]}}
<span
class=
"caret"
></span></span>
<ul
class=
"dropdown-menu"
>
{% for level, descr in levels.items() %}
<li><a
href=
"{{ url_for('edit', ref=request.url) }}&announcements.{{ msg.id }}.level={{ level }}"
>
{{ descr[1] }}
</a></li>
{% endfor %}
</ul>
</li>
<li>
Aktiv von {{ valueeditor(('announcements',msg.id,'time_publish'), msg.time_publish) }}
bis {{ valueeditor(('announcements',msg.id,'time_expire'), msg.time_expire) }}
</li>
{% endif %}
</ul>
<a
href=
"#"
class=
"close"
data-dismiss=
"alert"
aria-label=
"close"
onclick=
"Cookies.set('alert-info-{{msg.id}}', '1');"
>
×
</a>
{{ msg.text|safe }}
</div>
{% endfor %}
{% block content %}
...
...
templates/index.html
View file @
a5b5a6de
{% from 'macros.html' import preview %}
{% extends "base.html" %}
{% set page_border = 0 %}
{% set min_announcement_level = 0 %}
{% if ismod() %}
{# Little hack to not show annoucements twice #}
{% set min_announcement_level = 999 %}
{% else %}
{% set min_announcement_level = 0 %}
{% endif %}
{% block content %}
{% if ismod() %}
<div
class=
"row"
>
<div
class=
"col-xs-12"
>
<ul
class=
"list-inline pull-right"
>
{% if ismod() %}
<li
style=
"padding-right: 0px;"
>
<a
class=
"btn btn-default"
href=
"{{ url_for('create', table='announcements', text='Neue Ankündigung', time_publish=datetime.now().replace(hour=0, minute=0, second=0, microsecond=0), time_expire=datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)+timedelta(days=7), ref=request.url) }}"
>
Neue Ankündigung
</a>
{% for msg in get_announcements() %}
<div
class=
"alert alert-{{levels.get(msg.level, ('info', ''))[0]}}"
role=
"alert"
>
<ul
class=
"list-unstyled"
>
<li>
{{ valueeditor(('announcements',msg.id,'text'), msg.text|safe) }}
</li>
<li
class=
"pull-right"
>
{{ valuedeletebtn(('announcements',msg.id,'deleted')) }}
</li>
<li
class=
"pull-right"
style=
"padding-right: 5px;"
>
{% if not msg.visible %}
<a
href=
"{{ url_for('edit', ref=request.url) }}&announcements.{{ msg.id }}.visible=1"
class=
"btn btn-primary"
>
Veröffentlichen
</a>
{% elif msg.time_expire and msg.time_expire
<
datetime.now
()
%}
<
a
href=
"#"
class=
"btn btn-danger disabled"
>
Abgelaufen
</a>
{% elif msg.time_publish and msg.time_publish > datetime.now() %}
<a
href=
"#"
class=
"btn btn-default disabled"
>
Geplant
</a>
{% else %}
<a
href=
"#"
class=
"btn btn-success disabled"
>
Öffentlich
</a>
{% endif %}
</li>
<li
class=
"dropdown pull-right"
style=
"padding-right: 5px;"
>
<span
class=
"btn btn-default dropdown-toggle"
type=
"button"
data-toggle=
"dropdown"
>
{{levels.get(msg.level, ('', 'Unbekannt'))[1]}}
<span
class=
"caret"
></span></span>
<ul
class=
"dropdown-menu"
>
{% for level, descr in levels.items() %}
<li><a
href=
"{{ url_for('edit', ref=request.url) }}&announcements.{{ msg.id }}.level={{ level }}"
>
{{ descr[1] }}
</a></li>
{% endfor %}
</ul>
</li>
{% endif %}
<li>
Aktiv von {{ valueeditor(('announcements',msg.id,'time_publish'), msg.time_publish) }}
bis {{ valueeditor(('announcements',msg.id,'time_expire'), msg.time_expire) }}
</li>
</ul>
</div>
{% endfor %}
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-xs-12"
>
<ul
class=
"list-inline pull-right"
>
<li
style=
"padding-right: 0px;"
>
<a
class=
"btn btn-default"
href=
"{{ url_for('create', table='announcements', text='Neue Ankündigung', time_publish=datetime.now().replace(hour=0, minute=0, second=0, microsecond=0), time_expire=datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)+timedelta(days=7), ref=request.url) }}"
>
Neue Ankündigung
</a>
</li>
</ul>
</div>
</div>
{% endif %}
<div
class=
"row"
>
<div
class=
"col-md-6 panel-group"
>
<div
class=
"panel panel-default"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment