representative_detail.html 5.61 KB
Newer Older
1
2
{% extends 'base.html' %}

3
{% load fontawesome %}
4
5
6
{% load i18n %}
{% load humanize %}
{% load memopol_tags %}
Nicolas Joyard's avatar
Nicolas Joyard committed
7
{% load staticfiles %}
8

Nicolas Joyard's avatar
Nicolas Joyard committed
9
{% with representative=object %}
10

Nicolas Joyard's avatar
Nicolas Joyard committed
11
  {% block title %}{{ representative.full_name }}{% endblock %}
12

Nicolas Joyard's avatar
Nicolas Joyard committed
13
  {% block content %}
14
  <div class="row" id="representative-detail">
15
    <div class="col-sm-3" id="representative-photo" style="background-image:url({{ representative.photo }});">
Nicolas Joyard's avatar
Nicolas Joyard committed
16
    </div>
17

18
    <div class="col-sm-9" id="representative-info">
Nicolas Joyard's avatar
Nicolas Joyard committed
19
20
21
22
23
24
      <h1 class="text-center">{{ representative.full_name }}</h1>

      <div class="col-sm-9">
        <dl class="dl-horizontal">
          <dt>{% trans "Score" %}</dt>
          <dd>
Nicolas Joyard's avatar
Nicolas Joyard committed
25
26
            {% trans "Total score is the sum of score contributions for each of this representatives votes" as tooltip%}
            {{ representative.score.score|score_badge:tooltip }}
Nicolas Joyard's avatar
Nicolas Joyard committed
27
28
29
30
          </dd>

          <dt>{% trans "Country" %}</dt>
          <dd>
31
            {{ representative.country|country_flag }} {{ representative.country.name }}
Nicolas Joyard's avatar
Nicolas Joyard committed
32
          </dd>
33

34
35
36
37
38
39
40
41
42
43
44
45
46
47
          {% with mandate=representative.main_mandate %}

            <dt>{% trans "Chamber" %}</dt>
            <dd>
              {{ mandate.group.chamber|chamber_icon }} {{ mandate.group.chamber.name }}
            </dd>

            <dt>{% trans "Party" %}</dt>
            <dd>
              {{ mandate.group|group_icon }} {{ mandate.group.name }}
              {% if mandate.group.abbreviation %}({{ mandate.group.abbreviation }}){% endif %}
            </dd>

          {% endwith %}
48

Nicolas Joyard's avatar
Nicolas Joyard committed
49
          <dt>{% trans "Biography" %}</dt>
50
          <dd>{% blocktrans with birth_place=representative.birth_place birth_date=representative.birth_date|naturalday:'d/m/Y' %}Born on {{ birth_date }} in {{ birth_place }}{% endblocktrans %}
Nicolas Joyard's avatar
Nicolas Joyard committed
51
          </dd>
52

53
54
55
56
57
          {% if representative.social_websites|length or representative.chamber_websites|length or representative.other_websites|length %}
            <dt>{% trans "Links" %}</dt>
            <dd>
              {% for site in representative.social_websites %}
                <a class="label label-primary" href="{{ site.url }}" target="_blank">
Nicolas Joyard's avatar
Nicolas Joyard committed
58
                  {% fontawesome_icon site.kind %}
59
60
61
62
63
64
65
                  {% with kind=site.kind|capfirst %}
                    {% trans kind %}
                  {% endwith %}
                </a>
              {% endfor %}
              {% for site in representative.chamber_websites %}
                <a class="label label-primary" href="{{ site.url }}" target="_blank">
66
                  {% fontawesome_icon "institution" %}
67
68
69
70
71
                  {% trans "Parliament page" %}
                </a>
              {% endfor %}
              {% for site in representative.other_websites %}
                <a class="label label-primary" href="{{ site.url }}" target="_blank">
72
                  {% fontawesome_icon "link" %}
73
74
75
76
77
78
                  {% trans "Website" %}
                </a>
              {% endfor %}

              {% for email in representative.email_set.all %}
                <a class="label label-primary" href="mailto:{{ email.email }}">
79
                  {% fontawesome_icon "at" %}
80
81
82
83
84
85
86
87
88
89
90
91
92
                  {% trans "E-mail" %}
                </a>
              {% endfor %}
            </dd>
          {% endif %}

          {% if representative.address_set.all|length or representative.phone_set.all|length %}
            <dt>{% trans "Contact" %}</dt>
            <dd>
              {% trans "Other address" as default_label %}

              {% for address in representative.address_set.all %}
                <span class="label label-primary" data-toggle="tooltip" data-placement="bottom" title="{% if address.floor and address.office_number %}Floor {{ address.floor }} &ndash; office {{ address.office_number }} &ndash; {% endif %}{{ address.number }} {{ address.street }} &ndash; {{ address.city }} {{ address.postcode }}, {{ address.country.name }}">
93
                  {% fontawesome_icon "envelope" %}
94
95
96
97
98
                  {{ address.name|default:default_label }}
                </span>

                {% for phone in address.phones.all %}
                  <span class="label label-primary" data-toggle="tooltip" data-placement="bottom" title="{{ phone.number }}">
99
                    {% fontawesome_icon "phone" %}
100
101
102
103
104
105
106
107
                    {{ address.name }}
                  </span>

                {% endfor %}
              {% endfor %}

              {% for phone in representative.phone_set.all %}
                <span class="label label-primary">
108
                  {% fontawesome_icon "phone" %}
109
110
111
112
113
114
                  {{ phone.number }}
                </span>

              {% endfor %}
            </dd>
          {% endif %}
Nicolas Joyard's avatar
Nicolas Joyard committed
115
116
        </dl>
      </div>
117
    </div>
robin Tissot's avatar
robin Tissot committed
118
  </div>
119

Nicolas Joyard's avatar
Nicolas Joyard committed
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
  <div class="row">
    <div class="col-xs-12">
      <ul class="nav nav-tabs nav-justified" role="tablist">
        <li role="presentation" {% if tab == 'votes' %}class="active"{% endif %}>
          <a href="{% url 'representative-votes' slug=representative.slug %}" role="tab">
            <h3>{% trans "Votes" %}</h3>
          </a>
        </li>
        <li role="presentation" {% if tab == 'mandates' %}class="active"{% endif %}>
          <a href="{% url 'representative-mandates' slug=representative.slug %}" role="tab">
            <h3>{% trans "Mandates" %}</h3>
          </a>
        </li>
        <li role="presentation" {% if tab == 'positions' %}class="active"{% endif %}>
          <a href="{% url 'representative-positions' slug=representative.slug %}" role="tab">
            <h3>{% trans "Public positions" %}</h3>
          </a>
        </li>
      </ul>
139

Nicolas Joyard's avatar
Nicolas Joyard committed
140
141
142
      <div class="tab-content">
        {% block representative_content %}{% endblock %}
      </div>
143
144
    </div>
  </div>
Nicolas Joyard's avatar
Nicolas Joyard committed
145
  {% endblock %}
146

Nicolas Joyard's avatar
Nicolas Joyard committed
147
{% endwith %}