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
a5b5a6de
Commit
a5b5a6de
authored
8 years ago
by
Julian Rother
Browse files
Options
Downloads
Patches
Plain Diff
Move psa editing from base to index template
parent
9b87d1ff
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/base.html
+3
-33
3 additions, 33 deletions
templates/base.html
templates/index.html
+46
-6
46 additions, 6 deletions
templates/index.html
with
49 additions
and
39 deletions
templates/base.html
+
3
−
33
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>
{{ msg.text|safe }}
</div>
{% endfor %}
{% block content %}
...
...
This diff is collapsed.
Click to expand it.
templates/index.html
+
46
−
6
View file @
a5b5a6de
{% from 'macros.html' import preview %}
{% extends "base.html" %}
{% set page_border = 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"
>
{% 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>
<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"
>
{% 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>
</li>
{% endif %}
</ul>
</div>
</div>
{% endif %}
<div
class=
"row"
>
<div
class=
"col-md-6 panel-group"
>
<div
class=
"panel panel-default"
>
...
...
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