user_detail.jinja 3.14 KB
Newer Older
1
{% extends "core/user_base.jinja" %}
Skia's avatar
Skia committed
2
3

{% block title %}
Skia's avatar
Skia committed
4
{% trans user_name=profile.get_display_name() %}{{ user_name }}'s profile{% endtrans %}
Skia's avatar
Skia committed
5
6
{% endblock %}

7
{% block infos %}
8

9
10
<div id="user_profile_container">
    <div id="user_profile">
Skia's avatar
Skia committed
11
12
13
        <div id="right_column">
            <div id="pictures">
                {% if profile.profile_pict %}
14
15
16
                <img src="{{ profile.profile_pict.get_download_url() }}" alt="{% trans %}Profile{% endtrans %}" id="picture" />
                {% else %}
                <img src="{{ static('core/img/unknown.jpg') }}" alt="{% trans %}Profile{% endtrans %}" id="picture" />
Skia's avatar
Skia committed
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
                {% endif %}
            </div>
            <p id="quote"><em>{{ profile.quote }}</em></p>
        </div>
        <div id="left_column">
            <h4>{{ profile.get_full_name() }}</h4>
            {% if profile.nick_name %}
            <p id="nickname">&laquo; {{ profile.nick_name }} &raquo;</p>
            {% endif %}
            {% if profile.date_of_birth %}
            <p>{% trans %}Born: {% endtrans %}{{ profile.date_of_birth|date("d/m/Y") }}</p>
            {% endif %}
            {% if profile.department != "NA" %}
            <p>{{ profile.department }}{{ profile.semester }}
            {% endif %}
            {% if profile.dpt_option %}
            <br>{% trans %}Option: {% endtrans %}{{ profile.dpt_option }}
            {% endif %}
Skia's avatar
Skia committed
35
36
37
38
39
            {% if profile.phone %}
            <p>
            {{ profile.phone }}
            </p>
            {% endif %}
Skia's avatar
Skia committed
40
41
42
43
            </p>
            {% if profile.promo %}
            <p><img src="{{ static('core/img/promo_%02d.png' % profile.promo) }}" alt="Promo {{ profile.promo }}" class="promo_pict" />
            {% trans %}Promo: {% endtrans %}{{ profile.promo }}</p>
44
45
            {% endif %}
        </div>
46
    </div>
47
</div>
Skia's avatar
Skia committed
48

49
{% if user.membership.filter(end_date=None).exists() or user.is_in_group(settings.SITH_MAIN_BOARD_GROUP) or user == profile %}
50
{# if the user is member of a club, he can view the subscription state #}
Skia's avatar
Skia committed
51
52
<p>
{% if get_subscriber(profile).is_subscribed() %}
Skia's avatar
Skia committed
53
{% trans subscription_end=get_subscriber(profile).subscriptions.last().subscription_end %}Subscribed until {{ subscription_end }}{% endtrans %}<br/>
Skia's avatar
Skia committed
54
55
56
57
58
59
60
61
{% trans %}Account number: {% endtrans %}{{ profile.customer.account_id }}<br/>
{% if get_subscriber(profile).tokens.exists() %}
<ul>
{% for i in get_subscriber(profile).tokens.all() %}
    <li>{{ i }}</li>
{% endfor %}
</ul>
{% endif %}
Skia's avatar
Skia committed
62
{% else %}
63
{% trans %}Not subscribed{% endtrans %}
Skia's avatar
Skia committed
64
{% if user.is_in_group(settings.SITH_MAIN_BOARD_GROUP) %}
Skia's avatar
Skia committed
65
<a href="{{ url('subscription:subscription') }}?member={{ profile.id }}">{% trans %}New subscription{% endtrans %}</a>
Skia's avatar
Skia committed
66
{% endif %}
Skia's avatar
Skia committed
67
{% endif %}
Skia's avatar
Skia committed
68
</p>
69
{% endif %}
Skia's avatar
Skia committed
70

Skia's avatar
Skia committed
71
72
{% endblock %}

73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{% block script %}
{{ super() }}
<script>
$( function() {
    var keys = [];
    var pattern = "71,85,89,71,85,89";
    $(document).keydown(function (e) {
        keys.push(e.keyCode);
        if (keys.toString()==pattern) {
                keys = [];
                $("#right_column img").attr("src", "{{ static('core/img/yug.jpg') }}");
        }
        if (keys.length==6) {
            keys.shift();
        }
    });
} );
</script>
{% endblock %}
Skia's avatar
Skia committed
92