changeset 140:b1e22caab8bc

ticket (item), merge-request (item): added "edit" button when url_ticket_edit is defined
author Goffi <goffi@goffi.org>
date Fri, 01 Jun 2018 12:47:54 +0200
parents 909361c96a58
children 7f8b948bddfe
files default/merge-request/item.html default/static/styles.css default/ticket/create.html default/ticket/item.html
diffstat 4 files changed, 37 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/default/merge-request/item.html	Fri Jun 01 12:46:08 2018 +0200
+++ b/default/merge-request/item.html	Fri Jun 01 12:47:54 2018 +0200
@@ -20,6 +20,7 @@
 {% endblock confirm_message %}
 
 {% block body %}
+{{ icon_defs('pencil') }}
 <div class="tab_container">
     <div class="tab_header">
         <ul>
@@ -29,6 +30,14 @@
     </div>
     <div class="tab_page clicked" id="tab_description">
         <div id="{{ item.widget_value['id'] }}" class="view single ticket box">
+            {% if url_ticket_edit is defined %}
+                <p class="box__tools">
+                    <a href="{{url_ticket_edit}}">
+                    {{ icon('pencil', cls='icon--small') }}
+                    edit
+                    </a>
+                </p>
+            {% endif %}
             {{ xmlui.generate(item,
                 form=false,
                 filters={'created': {'filters': ['date_fmt'], 'filters_args':[{'fmt': 'short'}]},
--- a/default/static/styles.css	Fri Jun 01 12:46:08 2018 +0200
+++ b/default/static/styles.css	Fri Jun 01 12:47:54 2018 +0200
@@ -49,6 +49,22 @@
     border-color: silver;
 }
 
+.box__tools {
+    margin: 0;
+    padding: 0;
+}
+
+.box__tools a {
+    text-decoration: none;
+    color: inherit;
+    padding: 0.2em;
+    border-radius: 0.4em;
+}
+
+.box__tools a:hover {
+    background-color: var(--select-bg-color);
+}
+
 .title {
     font-weight: bold;
     text-align: center;
--- a/default/ticket/create.html	Fri Jun 01 12:46:08 2018 +0200
+++ b/default/ticket/create.html	Fri Jun 01 12:47:54 2018 +0200
@@ -1,4 +1,4 @@
-{# creata a new ticket #}
+{# create a new ticket #}
 
 {% set category_menu = [('tickets_list', url_tickets_list)] %}
 {% extends 'base/base.html' %}
--- a/default/ticket/item.html	Fri Jun 01 12:46:08 2018 +0200
+++ b/default/ticket/item.html	Fri Jun 01 12:47:54 2018 +0200
@@ -7,7 +7,8 @@
 #}
 
 {% set category_menu = [('tickets', url_tickets_list),
-                         ('ticket_new', url_tickets_new)] %}
+                        ('ticket_new', url_tickets_new),
+                        ] %}
 {% if not embedded %}{% extends 'base/base.html' %}{% endif %}
 {% import 'input/xmlui.html' as xmlui with context %}
 {% import 'blog/macros.html' as blog with context %}
@@ -20,7 +21,16 @@
 {% endblock confirm_message %}
 
 {% block body %}
+{{ icon_defs('pencil') }}
 <div id="{{ item.widget_value['id'] }}" class="view single ticket box">
+    {% if url_ticket_edit is defined %}
+        <p class="box__tools">
+            <a href="{{url_ticket_edit}}">
+            {{ icon('pencil', cls='icon--small') }}
+            edit
+            </a>
+        </p>
+    {% endif %}
     {{ xmlui.generate(item,
         form=false,
         filters={'created': {'filters': ['date_fmt'], 'filters_args':[{'fmt': 'short'}]},