summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-07-25 15:18:24 +0200
committeremkael <emkael@tlen.pl>2019-07-25 15:18:24 +0200
commit941bf6bb283d8ef1189ee6c10113aa72e204ae1c (patch)
treec06e9481784ec5e5f7ad5bba06f7df97bbc4f6a8
parentd0a8f6951d2d35aa0301b607e17866adc01f1cd8 (diff)
Linking to players' profiles
Fixes #7
-rw-r--r--ausbutler/interface.py1
-rw-r--r--template/macros.html4
2 files changed, 5 insertions, 0 deletions
diff --git a/ausbutler/interface.py b/ausbutler/interface.py
index 2f5ee8e..b3d7c21 100644
--- a/ausbutler/interface.py
+++ b/ausbutler/interface.py
@@ -243,6 +243,7 @@ class Interface(object):
players[butler.id] = {
'name': str(butler.player).decode('utf8'),
'team': str(butler.player.team_).decode('utf8') if butler.player else None,
+ 'link': Constants.plink.replace(':LINK:', butler.player.link) if butler.player is not None and Constants.plink else None,
'sum': 0,
'count': 0,
'results': copy(result_template)
diff --git a/template/macros.html b/template/macros.html
index 1cbb1b0..b2858d7 100644
--- a/template/macros.html
+++ b/template/macros.html
@@ -66,7 +66,11 @@
{% macro table_player(player, segment_limit) %}
<tr>
<td class="bdc1">{{player['place']}}</td>
+ {% if player['link'] %}
+ <td class="bd">{{player['link']}}{{player['name']}}</a></td>
+ {% else %}
<td class="bd">{{player['name']}}</td>
+ {% endif %}
<td class="bd">{{player['team']}}</td>
<td class="bdc">{{'%.2f' % player['sum']}}</td>
<td class="bdc">{{player['count']}}</td>