stats_show.html 3.76 KB
Newer Older
1
{% load i18n stats_extras %}
2 3

{% for dname, stat in stats.items %}
4
    {% with stat|first as pot_stat %}
5

6
    <div class="stats_show">
7

8
    <h3>{% trans pot_stat.domain.get_description %}
9

10
        {% if pot_stat.get_type == "mallard" %}
11
            <span style="padding-top: 8px;" class="btn btn-action"><img src="{{ STATIC_URL }}img/mallard.png" title="{% trans "This document is written in Mallard documentation format" %}" alt="mallard icon"/></span>
12
        {% endif %}
13

14
        {% if pot_stat.full_po %}
15
            <a href="{{ pot_stat.po_url }}" class="btn btn-action" title="{% trans 'Download POT file' %}"><img src="{{ STATIC_URL }}img/download.png" alt="{% trans 'Download POT file' %}" /></a>
16
        {% endif %}
17

18
    </h3>
19

20 21
    {% if not pot_stat.domain.has_standard_location %}
    <p class="path">{{ pot_stat.domain.base_dir }}</p>
22 23 24 25 26
    {% endif %}

    <p class="pot_information">{{ pot_stat.pot_text }}</p>

    <!-- This is the title of the section that lists notices about a module -->
27 28
    {% with informations=pot_stat.information_set.all %}
    {% if informations %}
29 30
        <div class="notices">
            <h4>{% trans "Notices" %}</h4>
31
            {% for msg in informations %}
32 33
                <div class="item">
                    {{ msg.get_description|safe }}
34

35 36 37 38
                    {% if user.is_authenticated %}
                        {% if msg.type == 'error' or msg.type == 'error-ext' %}
                        <div class="actions">
                            <a href="{{ module|browse_bugs:'error+pot+file' }}" target="_blank">
Claude Paroz's avatar
Claude Paroz committed
39
                                <img src="{{ STATIC_URL }}img/search.png" alt="{% trans 'Search for similar bugs before reporting it' %}" title="{% trans 'Search for similar bugs before reporting it' %}"/>
40 41
                            </a>
                            <a href="{{ msg.report_bug_url }}" target="_blank">
Claude Paroz's avatar
Claude Paroz committed
42
                                <img src="{{ STATIC_URL }}img/bug.png" alt="{% trans 'Report this bug' %}" title="{% trans 'Report this bug' %}" />
43 44 45 46 47 48 49 50
                            </a>
                        </div>
                        {% endif %}
                    {% endif %}
                </div>
            {% endfor %}
        </div>
    {% endif %}
51
    {% endwith %}
52

53 54
    <div class="table-responsive">
    <table class="stats table">
55 56
    <thead><tr>
        <th>{% trans "Language" %}</th><th>{% trans "Translated" %}</th>
57
        {% if pot_stat.full_po.fig_count %}
58 59 60 61 62
        <th></th>
        {% endif %}
        <th>{% trans "Graph" %}</th>
    </tr></thead>
    <!-- FIXME line / stat / stats naming -->
63
    {% for line in stat %}
64 65
    {% if not forloop.first %}
    <tr>
66
      <td class="leftcell">
67
        {% if not module.archived %}<a href="{% url 'vertimus_by_names' module.name branch.name pot_stat.domain.name line.language.locale %}">{% endif %}
68 69 70 71 72
          {% if user_language.locale == line.language.locale %}
            <b>{{ line.get_lang }}</b>
          {% else %}
            {{ line.get_lang }}
          {% endif %}
73
        {% if not module.archived %}</a>{% endif %}
74
        {% with line.most_important_message as msg %}
75 76 77 78
        {% if msg %}
        <img src="{{ msg.get_icon }}" title="{{ msg.get_description }}" alt="{{ msg.type }}" />
        {% endif %}
        {% endwith %}
79
      </td>
80
      <td>{{ line|num_stats }}</td>
81
      {% if pot_stat.full_po.fig_count %}
Claude Paroz's avatar
Claude Paroz committed
82
      <td><a href="{% url 'docimages' module.name pot_stat.domain.name branch.name line.language.locale %}">
Claude Paroz's avatar
Claude Paroz committed
83
          <img src="{{ STATIC_URL }}img/figure.png" alt="{% trans "Display document figures" %}"></a>
84
      </td>
85
      {% endif %}
86
      <td style="width: 108px; text-align: center;">
87
        <div class="graph">{{ line|vis_stats }}</div>
88
      </td>
89 90
    </tr>
    {% endif %}
91
    {% endfor %}
92
    </table>
93
    </div>
94
    </div>
95

96
    {% endwith %}
97
{% endfor %}