view MoinMoin/templates/utils.html @ 1117:f2d8c602dbb6

Improved table style to be more consistent. Fixes #13.
author Julian Brost <julian.brost@googlemail.com>
date Sun, 04 Dec 2011 00:42:48 +0100
parents 9a7889c04a25
children 8f73b05a21c1
line wrap: on
line source
{% macro show_editor_info(info) %}
  {%- if info.uri -%}
      <a href="{{ info.uri }}" class="{{ info.css }}" title="{{ info.title }}">
  {%- elif info.email -%}
      <a href="mailto:{{ info.email }}" class="{{ info.css }}" title="{{ info.title }}">
  {%- else -%}
      <span class="{{ info.css }}" title="{{ info.title }}">
  {%- endif -%}
  {{ info.text }}
  {%- if info.uri or info.email -%}
    </a>
  {%- else -%}
    </span>
  {%- endif -%}
{% endmacro %}


{% macro editor_info(meta) %}
  {%- set info = get_editor_info(meta) -%}
  {{ show_editor_info(info) }}
{% endmacro %}


{% macro table(headings, rows) %}
<table class="zebra">
<thead>
    <tr>
        {% for heading in headings %}
        <th>{{ heading }}</th>
        {% endfor %}
    </tr>
</thead>
<tbody>
{% for row in rows %}
    <tr>
        {% for col in row %}
        <td>{{ col }}</td>
        {% endfor %}
    </tr>
{% endfor %}
</tbody>
</table>
{% endmacro %}