summaryrefslogtreecommitdiff
path: root/template/macros.html
blob: b2858d7c8d31878bf0eb2ecced32a41b9cac939d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{% macro separator(cols) %}
<tr>
  <td class="e" colspan="{{cols}}">&nbsp;</td>
</tr>
{% endmacro %}

{% macro previous_rounds(segments, segment_limit, prefix, per_round) %}
<tr>
  <td class="bdnl12" colspan="{{segment_limit+5}}">
    {{"HEADER_PREV_ROUNDS"|translate}}
    {% for segment in segments[0:-segment_limit] %}
    |
    {% if 'link' in segment %}
    <a href="{{segment['link']}}">
    {% else %}
    <a href="{{prefix}}normbutler{{segment['round']}}-{{segment['segment']}}.htm">
    {% endif %}
      {% if 'label' in segment %}
      {{segment['label']}}
      {% else %}
        {% if per_round > 1 %}
        {{segment['round']}}-{{segment['segment']}}
        {% else %}
        {{segment['round']}}
        {% endif %}
      {% endif %}
    </a>
    {% endfor %}
    |
  </td>
</tr>
<tr>
  <td class="e" colspan="{{segment_limit+5}}">&nbsp;</td>
</tr>
{% endmacro %}

{% macro table_header(segments, segment_limit, prefix, per_round) %}
<tr>
  <td class="bdcc12">{{"HEADER_PLACE"|translate}}</td>
  <td class="bdcc2">&nbsp;</td>
  <td class="bdcc2">{{"HEADER_TEAM"|translate}}</td>
  <td class="bdcc2">{{"HEADER_IMPBRD"|translate}}</td>
  <td class="bdcc2">{{"HEADER_BOARDS"|translate}}</td>
  {% for segment in segments[-segment_limit:] %}
  <td class="bdcc2">
    {% if 'link' in segment %}
    <a href="{{segment['link']}}">
    {% else %}
    <a href="{{prefix}}normbutler{{segment['round']}}-{{segment['segment']}}.htm">
    {% endif %}
      {% if 'label' in segment %}
      {{segment['label']}}
      {% else %}
        {% if per_round > 1 %}
        {{segment['round']}}-{{segment['segment']}}
        {% else %}
        {{segment['round']}}
        {% endif %}
      {% endif %}
    </a>
  </td>
  {% endfor %}
</tr>
{% endmacro %}

{% 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>
  {% for result in player['results'][-segment_limit:] %}
  {% if result != '' %}
  <td class="bdc">{{'%+.2f' % result}}</td>
  {% else %}
  <td class="bdc">&nbsp;</td>
  {% endif %}
  {% endfor %}
</tr>
{% endmacro %}

{% macro footer(date, time) %}
<p class="vs"></p>
<p class="f">
  {{"FOOTER_ANALYSIS"|translate}}, &copy;William Bailey&#39;1999<br />
  &nbsp;Admin&nbsp;&copy;Jan Romański&#39;2005,&nbsp;jfrteamy-ausbutler&nbsp;&copy;Michał Klichowicz&#39;2017{{"FOOTER_GENERATED"|translate}}
  {{date}}{{"FOOTER_AT"|translate}}{{time}}{{"FOOTER_OPTIMIZED"|translate}}
</p>
{% endmacro %}