Skip to content
Snippets Groups Projects
Commit 72729883 authored by Robin Sonnabend's avatar Robin Sonnabend
Browse files

Show TOP-description

On hovering and (with JS) in an element that opens on click.
/close #43
parent e5044ab3
No related branches found
No related tags found
No related merge requests found
...@@ -44,3 +44,7 @@ input[type="file"] { ...@@ -44,3 +44,7 @@ input[type="file"] {
pre.error-description { pre.error-description {
white-space: pre-wrap; white-space: pre-wrap;
} }
.expansion-text {
display: none;
}
function toggle_expansion() {
var description_element = document.getElementById(this.id + "-description");
var current_state = document.defaultView.getComputedStyle(description_element, "").getPropertyValue("display");
var new_state = current_state == "none" ? "block" : "none";
description_element.style.display = new_state;
};
window.onload=function() {
var buttons = document.getElementsByClassName("expansion-button");
for (var i = 0; i < buttons.length; i++) {
var button = buttons[i];
console.log(button);
button.onclick = toggle_expansion;
}
};
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<link rel="stylesheet" href="{{url_for("static", filename="css/style.css")}}" /> <link rel="stylesheet" href="{{url_for("static", filename="css/style.css")}}" />
{% block additional_js %} {% block additional_js %}
{% endblock %} {% endblock %}
<script src="{{url_for("static", filename="js/script.js")}}" async></script>
<title>{% block title %}Unbenannte Seite{% endblock %} - Protokollsystem</title> <title>{% block title %}Unbenannte Seite{% endblock %} - Protokollsystem</title>
{% endblock %} {% endblock %}
</head> </head>
......
...@@ -7,9 +7,9 @@ ...@@ -7,9 +7,9 @@
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% for top in protocol.tops %} {% for top in protocol.tops %}
<li> <li{% if has_private_view_right %} class="expansion-button" id="top-{{top.id}}" title="{{top.description}}"{% endif %}>
{{top.name}} {{top.name}}
{% if not protocol.is_done() and has_public_type_view_right %} {% if not protocol.is_done() and has_modify_right %}
({{top.number}}) ({{top.number}})
{% endif %} {% endif %}
{% if not protocol.is_done() and has_modify_right %} {% if not protocol.is_done() and has_modify_right %}
...@@ -18,6 +18,12 @@ ...@@ -18,6 +18,12 @@
<a href="{{url_for('move_top', top_id=top.id, diff=-1)}}">Hoch</a> <a href="{{url_for('move_top', top_id=top.id, diff=-1)}}">Hoch</a>
<a href="{{url_for('delete_top', top_id=top.id)}}" onclick="return confirm('Bist du dir sicher, dass du den TOP {{top.name}} löschen möchtest?');">Löschen</a> <a href="{{url_for('delete_top', top_id=top.id)}}" onclick="return confirm('Bist du dir sicher, dass du den TOP {{top.name}} löschen möchtest?');">Löschen</a>
{% endif %} {% endif %}
{% if has_private_view_right and top.description|length > 0 %}
<span class="glyphicon glyphicon-info-sign"></span>
<pre id="top-{{top.id}}-description" class="expansion-text">
{{-top.description-}}
</pre>
{% endif %}
</li> </li>
{% endfor %} {% endfor %}
{% if not protocol.has_nonplanned_tops() %} {% if not protocol.has_nonplanned_tops() %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment