Use hyperlinks instead of onclick-events

to link to positions.
Disabled color-change and text-decoration to keep a clean and consisten
look.
This commit is contained in:
Thor77 2017-02-27 22:16:16 +01:00
parent a1274a52f4
commit cd01eb433a
2 changed files with 12 additions and 4 deletions

View File

@ -11,6 +11,12 @@
body { body {
padding-top: 50px; padding-top: 50px;
} }
a {
color: inherit;
}
a:hover {
text-decoration: none;
}
@media screen and (max-width: 767px) { @media screen and (max-width: 767px) {
.hint--medium--xs:after { .hint--medium--xs:after {
white-space: normal; white-space: normal;
@ -36,7 +42,9 @@
{% endif %} {% endif %}
</div></nav> </div></nav>
{% for server in servers %} {% for server in servers %}
<h1 class="page-header" onclick="window.location = '#sid{{ server.sid }}'" id="sid{{ server.sid }}">Server {{ server.sid }}</h1> <h1 class="page-header" id="sid{{ server.sid }}">
<a href="#sid{{ server.sid }}">Server {{ server.sid }}</a>
</h1>
{% include 'stats.jinja2' %} {% include 'stats.jinja2' %}
{% endfor %} {% endfor %}
<small>Generated by <a href="https://github.com/Thor77/TeamspeakStats" rel="noopener">TeamspeakStats</a> at {{ creation_time|frmttime }}</small> <small>Generated by <a href="https://github.com/Thor77/TeamspeakStats" rel="noopener">TeamspeakStats</a> at {{ creation_time|frmttime }}</small>

View File

@ -8,12 +8,12 @@
] %} ] %}
{% if clients|length > 0 %} {% if clients|length > 0 %}
{% set headline_id = [server.sid, headline|lower|replace(' ', '_')]|join('.') %} {% set headline_id = [server.sid, headline|lower|replace(' ', '_')]|join('.') %}
<h2 onclick="window.location = '#{{ headline_id }}'">{{ headline }}</h2> <h2><a href="#{{ headline_id }}">{{ headline }}</a></h2>
<ul class="list-group" id="{{ headline_id }}"> <ul class="list-group" id="{{ headline_id }}">
{% for client, value in clients %} {% for client, value in clients %}
{% set id = [headline_id, client.nick|striptags]|join('.') %} {% set id = [headline_id, client.nick|striptags]|join('.') %}
<li id="{{ id }}" onclick="window.location = '#{{ id }}'" class="list-group-item{{ ' list-group-item-success' if client.connected else loop.cycle('" style="background-color: #eee;', '') }}"> <li id="{{ id }}" class="list-group-item{{ ' list-group-item-success' if client.connected else loop.cycle('" style="background-color: #eee;', '') }}">
<span class="hint--right hint--medium--xs" data-hint="{{ client.nick_history|join(', ') }}">{{ client.nick }}{{ " (" + client.identifier + ")" if debug }}</span> <span class="hint--right hint--medium--xs" data-hint="{{ client.nick_history|join(', ') }}"><a href="#{{ id }}">{{ client.nick }}{{ " (" + client.identifier + ")" if debug }}</a></span>
<span class="badge"><div{% if not client.connected and headline == 'Onlinetime' %} class="hint--left" data-hint="{{ client.last_seen|frmttime }}"{% endif %}>{{ value }}</div></span> <span class="badge"><div{% if not client.connected and headline == 'Onlinetime' %} class="hint--left" data-hint="{{ client.last_seen|frmttime }}"{% endif %}>{{ value }}</div></span>
</li> </li>
{% endfor %} {% endfor %}