# HG changeset patch # User Goffi # Date 1509915874 -3600 # Node ID ea67eba3199dd80f504ba00ca67e65652ef5d1c8 # Parent d58fdd57df496228d1ba66d2c0c3dcc9a7d348e2 ticket: first draft: those templates are the first implementations to: - show a list of tickets - create a new ticket - display a ticket an its comments diff -r d58fdd57df49 -r ea67eba3199d default/static/ticket.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/default/static/ticket.css Sun Nov 05 22:04:34 2017 +0100 @@ -0,0 +1,128 @@ +@import 'blog.css'; /* needed as blog/articles.html is included */ + +.instructions { + font-style: italic; + text-align: center; +} + +.instructions span { + padding: 0.3em; +} + +.tickets table { + margin: 0 auto; +} + +.tickets tr:nth-child(even) { + background: #CCC9; +} + +.tickets tr:nth-child(odd) { + background: #FFF; +} + +.tickets tbody tr:hover { + background: yellow; +} + +.tickets tbody tr.severity_major .td_title a::before { + content: '⚠ '; + color: red; +} + +.tickets tbody tr.status_closed { + text-decoration: line-through; + color: grey; +} + +/* single ticket */ + +.ticket { + padding: 20px; + max-width: 500px; + margin: 0 auto; +} + +.view .xmlui_widget { + width: auto; +} + +.view #label_wid_title, +.view #label_wid_body, +.view #label_wid_id, +.view #label_wid_comments_uri, +.view #wid_comments_uri { + display: none +} + +.view .xmlui_widget { + text-align: right; +} + +.view #wid_id { + margin: 0; + font-style: italic; +} + +.view .xmlui_label { + font-weight: bold; + float: left; + color: #808080cc; +} + +.view #wid_title { + font-weight: bold; + display: block; + text-align: center; +} +.view #wid_title:first-letter { + text-transform: uppercase; +} + +.view #wid_labels span { + font-size: 0.8em; + background: #eae3e3; + font-variant: small-caps; + border: 1px solid black; + border-radius: 0.5em; + padding: 0 2px; + white-space: nowrap; +} + +.view #wid_labels span.value_work_in_progress { + background: yellow; +} + +.view #wid_type { + font-weight: bold; +} + +.view #wid_type span.value_bug::after { + content: ' 🐛'; + color: red; +} + +.view #wid_severity span.value_major { + font-weight: bold; + color: red; +} + +.view #wid_severity span.value_major::after { + content: '⚠ '; +} + +.view #wid_body { + white-space: pre-wrap; + max-height: 500px; + overflow: auto; + resize: both; + background-color: white; + padding: 5px; + text-align: justify; + border: 1px solid black; + border-radius: 5px; +} + +.comment_post { + margin-top: 3em; +} diff -r d58fdd57df49 -r ea67eba3199d default/ticket/create.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/default/ticket/create.html Sun Nov 05 22:04:34 2017 +0100 @@ -0,0 +1,16 @@ +{% extends 'base/base.html' %} +{% import 'input/form.html' as form with context %} +{% import 'input/field.html' as field with context %} +{% import 'input/xmlui.html' as xmlui with context %} + +{% block body %} +
+

{% trans app_name=C.APP_NAME%}This page allows you to report an issue or ask/suggest a new feature for {{app_name}}{% endtrans %}

+
+
+{% call form.form() %} + {{ xmlui.generate(new_ticket_xmlui) }} + {{ field.submit(_("Create ticket")) }} +{% endcall %} +
+{% endblock body %} diff -r d58fdd57df49 -r ea67eba3199d default/ticket/item.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/default/ticket/item.html Sun Nov 05 22:04:34 2017 +0100 @@ -0,0 +1,38 @@ +{# display a single ticket + + @variable item(xmlui_item): ticket to display + @variable comments(data_object.BlogItems): comments of the ticket + @variable comments_service(unicode): service for adding comments + @variable comments_node(unicode): node for adding comments +#} + +{% if not embedded %}{% extends 'base/base.html' %}{% endif %} +{% import 'input/xmlui.html' as xmlui with context %} +{% import 'blog/macros.html' as blog with context %} +{% import 'input/comment.html' as comment with context %} + +{% block title %}{{item|adv_format('[{value.widget_value.id}] {value.widget_value.title}') }}{% endblock %} + +{% block confirm_message %} + {% trans %}Your comment has been sent{% endtrans %} +{% endblock confirm_message %} + +{% block body %} +
+ {{ xmlui.generate(item, + form=false, + filters={'created': {'filters': ['date_fmt'], filters_args:[{'fmt': 'short'}]}, + 'updated': {'filters': ['date_fmt'], filters_args:[{'fmt': 'short'}]}}, + )}} +
+{% if comments is defined %} +
+ {{ blog.show_items(comments|reverse, expanded=true) }} +
+{% endif %} +{% if comments_node is defined %} +
+ {{- comment.comment_or_login(service=comments_service, node=comments_node) -}} +
+{% endif %} +{% endblock body %} diff -r d58fdd57df49 -r ea67eba3199d default/ticket/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/default/ticket/overview.html Sun Nov 05 22:04:34 2017 +0100 @@ -0,0 +1,11 @@ +{% extends 'base/base.html' %} +{% import 'input/xmlui.html' as xmlui with context %} + +{% block body %} +
+ {{ xmlui.generate_table(tickets, (('id', _('Id')), + ('title', _('Title'))), + tr_class_fields=['status', 'priority', 'severity'], + on_click=on_ticket_click) }} +
+{% endblock body %} diff -r d58fdd57df49 -r ea67eba3199d default/ticket/tickets.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/default/ticket/tickets.html Sun Nov 05 22:04:34 2017 +0100 @@ -0,0 +1,12 @@ +{% extends 'base/base.html' %} +{% import 'input/xmlui.html' as xmlui with context %} + +{% block body %} +
+ {% for ticket in tickets %} +
+ {{ xmlui.generate(ticket) }} +
+ {% endfor %} +
+{% endblock body %}