Skip to content

Commit 1b301de

Browse files
committed
polished jinja2 template
1 parent 7ccf026 commit 1b301de

File tree

7 files changed

+42
-28
lines changed

7 files changed

+42
-28
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
{% include 'layout/permission.html' %}
1414

1515
{% if context.is_view_ok() %}
16-
{% if request.batch() %}
16+
{% set batch = request.batch() %}
17+
{% if batch %}
1718
<table class='table'>
1819
<tr class='info'>
1920
{% if request.show.priority %}
@@ -44,7 +45,7 @@
4445
<td>{% trans %}Assigned To{% endtrans %}</td>
4546
{% endif %}
4647
</tr>
47-
{% for issue in request.batch() %}
48+
{% for issue in batch %}
4849
<tr>
4950
{% if request.show.priority %}
5051
<td>{{ issue.priority.plain()|u }}</td>
@@ -79,8 +80,8 @@
7980
{% endfor %}
8081
</table>
8182
{% include 'layout/pagination.html' %}
82-
<div>
83-
<a class='btn btn-secondary'
83+
<div class="d-flex justify-content-end">
84+
<a class='btn btn-sm btn-secondary'
8485
href="{{ request.indexargs_url('issue', {'@action':'export_csv'}) }}">
8586
{% trans %}Download as CSV{% endtrans %}
8687
</a>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ <h4>Messages</h4>
5454
Author: {{ msg.author.plain()|u }}, Date: {{ msg.date.plain()|u }}
5555
</div>
5656
<div class="col col-lg-auto">
57-
{% if context.is_edit_ok %}
57+
{% if context.is_edit_ok() %}
5858
<form method="POST" action='issue{{ context.id }}' class='form-inline'>
5959
<input type="hidden" name="@remove@messages" value='{{ msg.id }}'>
6060
<input name="@csrf" type="hidden"
6161
value="{{ utils.anti_csrf_nonce() }}">
6262
<input type="hidden" name="@action" value="edit">
63-
<input type="submit" value="remove">
63+
<input class="btn btn-danger btn-sm" type="submit" value="{% trans %}Remove{% endtrans %}">
6464
</form>
6565
{% endif %}
6666
</div>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{% set dd_class_full = 'col col-8 col-md-9 col-lg-10' -%}
33
{% set dt_class_half = 'col col-4 col-md-3 col-lg-4' -%}
44
{% set dd_class_half = 'col col-8 col-md-9 col-lg-8' -%}
5-
<dl class="row row-cols-1 row-cols-lg-2">
5+
<dl class="row row-cols-1 row-cols-lg-2 no-gutters">
66
<div class="col col-lg-12 row">
77
<dt class="{{ dt_class_full }}">{% trans %}Title{% endtrans %}</dt>
88
<dd class="{{ dd_class_full }}">{{ context.title.plain()|u }}</dd>
@@ -15,10 +15,12 @@
1515
<dt class="{{ dt_class_half }}">{% trans %}Status{% endtrans %}</dt>
1616
<dd class="{{ dd_class_half }}">{{ context.status.plain()|u }}</dd>
1717
</div>
18+
{% if context.superseder %}
1819
<div class="col col-lg-12 row">
1920
<dt class="{{ dt_class_full }}">{% trans %}Superseder{% endtrans %}</dt>
2021
<dd class="{{ dd_class_full }}">{{ context.superseder.plain()|u }}</dd>
2122
</div>
23+
{% endif %}
2224
<div class="col col-lg-12 row">
2325
<dt class="{{ dt_class_full }}">{% trans %}Nosy list{% endtrans %}</dt>
2426
<dd class="{{ dd_class_full }}">{{ context.nosy.plain()|u }}</dd>
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<div class="navbar navbar-light bg-light">
22
<a href="/" class='navbar-brand'>
3-
<i class='icon-home'></i> {% trans %}Roundup Demo Tracker{% endtrans %}
3+
<i class='icon-home'></i> {{ config.TRACKER_NAME|u }}
44
</a>
5-
<form name="searchform" method="get" action="issue" class='form-inline my-2 my-lg-0 navbar-search pull-right'>
5+
<form name="searchform" method="get" action="issue" class='form-inline my-2 my-lg-0 navbar-search'>
66
<input type="hidden" name="@columns" value="{{ bug_columns_showall }}"/>
77
<input type="hidden" name="@sort" value="-activity">
88
<input type="hidden" name="@group" value="priority">
99
<input type="hidden" name="@filter" value="status">
1010
<input type="hidden" name="status" value="{{ bug_status_notclosed }}"/>
11-
<input class="form-control mr-sm-2 input-medium search-query" id="search-text" type="search" name="@search_text">
12-
<input class="form-control my-2 my-sm-0" type="submit" value="{% trans %}search in open bugs{% endtrans %}" name="submit" class='btn'>
11+
<input class="form-control form-control-sm mr-sm-2 search-query" id="search-text" type="search" name="@search_text">
12+
<input class="btn btn-sm btn-outline-success my-2 my-sm-0" type="submit" value="{% trans %}Search{% endtrans %}" name="submit">
1313
</form>
14-
</div> <!-- navbar -->
14+
</div>

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
'@search_text': '',
2828
'status': status_notresolved,
2929
'assignedto': '-1',
30-
'@dispname': i18n.gettext('Show Unassigned')|u,
31-
}) }}">{% trans %}Show Unassigned{% endtrans %}</a>
30+
'@dispname': i18n.gettext('Show Unassigned'),
31+
})|u|safe }}">{% trans %}Show Unassigned{% endtrans %}</a>
3232
</li>
3333
<li class="nav-item">
3434
<a href="{{ request.indexargs_url('issue', {
@@ -38,8 +38,8 @@
3838
'@columns': columns_showall,
3939
'@search_text': '',
4040
'status': status_notresolved,
41-
'@dispname': i18n.gettext('Show All')|u,
42-
}) }}">{% trans %}Show All{% endtrans %}</a>
41+
'@dispname': i18n.gettext('Show All'),
42+
})|u|safe }}">{% trans %}Show All{% endtrans %}</a>
4343
</li>
4444
<li>
4545
<a href="issue?@template=search">{% trans %}Search{% endtrans %}</a>
@@ -50,7 +50,7 @@
5050
<input type="hidden" name="@type" value="issue">
5151
<input type="hidden" name="@action" value="show">
5252
<input class="form-control form-control-sm col-2" type="text" name="@number">
53-
<input class="form-control form-control-sm btn btn-outline-secondary" type="submit" value="{% trans %}Show issue{% endtrans %}">
53+
<input class="btn btn-sm btn-outline-secondary" type="submit" value="{% trans %}Show issue{% endtrans %}">
5454
</div>
5555
</form>
5656
</li>
@@ -110,7 +110,7 @@
110110
<hr>
111111
{% endif %}
112112

113-
{% if request.user.username == 'anonymous' %}
113+
{% if request.user.username == 'anonymous' %}
114114
<form method="POST" action='{{ request.base }}'>
115115
<ul class='nav flex-column'>
116116
<li class='nav-header'>
@@ -128,7 +128,7 @@
128128
</label>
129129
</li>
130130
<li class="nav-item">
131-
<input class="btn btn-secondary form-control-sm" type="submit" value="{% trans %}Login{% endtrans %}">
131+
<input class="btn btn-sm btn-secondary" type="submit" value="{% trans %}Login{% endtrans %}">
132132
</li>
133133
<li class='vspace-one'>
134134
{% if request.user.hasPermission('Register', 'user') %}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
{% block page_content %}
2020
<div class='container-fluid'>
2121
<div class='row'>
22-
<div class='col-2 navigation'>
22+
<div class='col-3 col-lg-2 navigation'>
2323
{% block leftnav %}
2424
{% include 'layout/navigation.html' %}
2525
{% endblock %}
2626
</div>
2727

28-
<div class='col-10'>
29-
<div class='pb-2 mt-4 mb-2 border-bottom'>
28+
<div class='col-9 col-lg-10'>
29+
<div class='pb-2 mb-2 border-bottom'>
3030
<h3>{% block page_header %} {% endblock %}</h3>
3131
{% if options.error_message %}
3232
<div class='alert alert-danger alert-dismissible fade show'>

share/roundup/templates/jinja2/static/style.css

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,31 @@ h1 {
1616
line-height: 24px;
1717
}
1818

19-
.navbar {
20-
margin: 20px 0;
19+
.navbar-light {
20+
border-radius: 4px;
21+
border: 1px solid #d4d4d4;
22+
background-image: linear-gradient(to bottom,#ffffff,#e8e8e8);
23+
background-repeat: repeat-x;
24+
margin: 20px 15px;
25+
padding: .3rem 1rem;
2126
}
2227

23-
.navbar form {
28+
.navbar-light form {
2429
margin: 8px;
2530
}
2631

27-
.navbar .btn {
32+
.navbar-light .btn {
2833
margin-top: 0;
2934
}
3035

31-
.navbar .brand {
32-
color: #B31B1B;
36+
tr.info {
37+
background-color: #d9edf7;
38+
}
39+
40+
pre {
41+
background-color: #f0f0f0;
42+
border: 1pt solid gray;
43+
padding: 6pt;
3344
}
3445

3546
footer {

0 commit comments

Comments
 (0)