Skip to content

Commit d7c1d7b

Browse files
committed
- Add more templates
- Move page-header to a block of its own - Make the status message available to templates
1 parent e8bbf6b commit d7c1d7b

File tree

15 files changed

+223
-65
lines changed

15 files changed

+223
-65
lines changed

roundup/cgi/engine_jinja2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ def __init__(self, template):
8282
def render(self, client, classname, request, **options):
8383
# [ ] limit the information passed to the minimal necessary set
8484
c = context(client, self, classname, request)
85-
'''c.update({'options': options})
85+
c.update({'options': options})
8686

87+
'''
8788
def translate(msgid, domain=None, mapping=None, default=None):
8889
result = client.translator.translate(domain, msgid,
8990
mapping=mapping, default=default)

share/roundup/templates/jinja2/html/_generic.index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{% extends 'layout/page.html' %}
22

3+
{% block page_header %}
4+
{{ context._classname.capitalize() }} editing
5+
{% endblock %}
6+
37
{% block content %}
4-
<div class='page-header'>
5-
<h1>{{ context._classname.capitalize() }} editing</h1>
6-
</div>
78

89
{% include 'layout/permission.html' %}
910

share/roundup/templates/jinja2/html/file.item.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{% extends 'layout/page.html' %}
22

3+
{% block page_header %}
4+
File display
5+
{% endblock %}
6+
37
{% block content %}
4-
<div class='page-header'>
5-
<h1>File display</h1>
6-
</div>
78

89
{% include 'layout/permission.html' %}
910

share/roundup/templates/jinja2/html/home.classlist.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{% extends 'layout/page.html' %}
22

3+
{% block page_header %}
4+
List of classes
5+
{% endblock %}
6+
37
{% block content %}
4-
<div class='page-header'>
5-
<h1>List of classes</h1>
6-
</div>
78

89
<div class='row-fluid'>
910
{% for cl in db.classes() %}

share/roundup/templates/jinja2/html/issue.index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{% extends 'layout/page.html' %}
22

3+
{% block page_header %}
4+
List of issues
5+
{% endblock %}
6+
37
{% block content %}
4-
<div class='page-header'>
5-
<h1>List of issues</h1>
6-
</div>
78

89
{% include 'layout/permission.html' %}
910

share/roundup/templates/jinja2/html/issue.item.html

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,17 @@
88
{% endif %}
99
{% endblock %}
1010

11+
{% block page_header %}
12+
{% if not (context.id or context.is_edit_ok()) %}
13+
New Issue
14+
{% elif not context.id and context.is_edit_ok() %}
15+
New Issue Editing
16+
{% else %}
17+
Issue {{ context.id }}
18+
{% endif %}
19+
{% endblock %}
20+
1121
{% block content %}
12-
<div class='page-header'>
13-
<h1>
14-
{% if not (context.id or context.is_edit_ok()) %}
15-
New Issue
16-
{% elif not context.id and context.is_edit_ok() %}
17-
New Issue Editing
18-
{% else %}
19-
Issue {{ context.id }}
20-
{% endif %}
21-
</h1>
22-
{% if ok_message %}
23-
<p class='alert alert-success'>{{ ok_message }}</p>
24-
{% elif error_message %}
25-
<p class='alert alert-error'>{{ error_message }}</p>
26-
{% endif %}
27-
</div>
2822

2923
{% include 'layout/permission.html' %}
3024

share/roundup/templates/jinja2/html/keyword.item.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{% extends 'layout/page.html' %}
22

3+
{% block page_header %}
4+
Keyword editing
5+
{% endblock %}
6+
37
{% block content %}
4-
<div class='page-header'>
5-
<h1>Keyword editing</h1>
6-
</div>
78

89
<h4>Existing Keywords</h4>
910
<p class='text-warning'>

share/roundup/templates/jinja2/html/layout/page.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,17 @@
2424
</div>
2525

2626
<div class='span8 offset1'>
27-
{% block content %} {% endblock %}
27+
<div class='page-header'>
28+
<h1> {% block page_header %} {% endblock %} </h1>
29+
{% if options.error_message %}
30+
<div class='alert alert-error'>{{ options.error_message }}</div>
31+
{% endif %}
32+
{% if options.ok_message %}
33+
<div class='alert alert-success'>{{ options.ok_message }}</div>
34+
{% endif %}
35+
</div>
36+
{% block content %}
37+
{% endblock %}
2838
</div>
2939
</div>
3040

share/roundup/templates/jinja2/html/msg.index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{% extends 'layout/page.html' %}
22

3+
{% block page_header %}
4+
List of messages
5+
{% endblock %}
6+
37
{% block content %}
4-
<div class='page-header'>
5-
<h1>List of messages</h1>
6-
</div>
78

89
{% for msg in context.list() %}
910
<div class='row-fluid'>

share/roundup/templates/jinja2/html/msg.item.html

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,19 @@
88
{% endif %}
99
{% endblock %}
1010

11+
{% block page_header %}
12+
{% if not (context.id or context.is_edit_ok()) %}
13+
New Message
14+
{% elif not context.id and context.is_edit_ok() %}
15+
New Message Editing
16+
{% elif context.id and not context.is_edit_ok() %}
17+
Message{{ context.id }}
18+
{% elif context.id and context.is_edit_ok() %}
19+
Message{{ context.id }} editing
20+
{% endif %}
21+
{% endblock %}
22+
1123
{% block content %}
12-
<div class='page-header'>
13-
<h1>
14-
{% if not (context.id or context.is_edit_ok()) %}
15-
New Message
16-
{% elif not context.id and context.is_edit_ok() %}
17-
New Message Editing
18-
{% elif context.id and not context.is_edit_ok() %}
19-
Message{{ context.id }}
20-
{% elif context.id and context.is_edit_ok() %}
21-
Message{{ context.id }} editing
22-
{% endif %}
23-
</h1>
24-
</div>
2524

2625
{% include 'layout/permission.html' %}
2726

0 commit comments

Comments
 (0)