summaryrefslogtreecommitdiffstats
path: root/hyperkitty/templates/user_profile.html
blob: e6cb8bd6b6230f43e9ee6a50bd92a8c4db91d8a2 (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
{% extends "base.html" %}
{% load url from future %}
{% load i18n %}
{% load hk_generic %}
{% load gravatar %}


{% block title %}
{% trans 'User Profile' %} - {{ app_name|title }}
{% endblock %}

{% block content %}

<div class="user-profile">

    <h1>User profile <small>for {{ user }}</small></h1>

    <div class="tabbed">
    <ul>
        <li><a href="#account">Account</a></li>
        <li><a href="#favorites">Favorites</a></li>
        <li><a href="#views">Threads you have read</a></li>
        <li><a href="#votes">Votes</a></li>
        <li><a href="#subscriptions">Subscriptions</a></li>
    </ul>

    <div id="account">
        <form method="post" action="{% url 'user_profile' %}">
        {% csrf_token %}
        <table class="table table-bordered table-striped user-data">
            <tbody>
                <tr>
                    <th>{% trans 'User name:' %}</th>
                    <td>{{ user.username}}</td>
                </tr>
                {{ form.as_table }}
                <tr>
                    <th>{% trans 'Email:' %}</th>
                    <td>{{ user.email }}</td>
                </tr>
                {% if emails %}
                <tr>
                    <th>{% trans 'Other emails:' %}</th>
                    <td><ul>
                    {% for email in emails %}
                        <li>{{ email }}</li>
                    {% endfor %}
                    </ul></td>
                </tr>
                {% endif %}
                {% if use_mockups %}
                <tr>
                    <th>{% trans 'Karma:' %}</th>
                    <td>{{ user_profile.karma }}</td>
                </tr>
                {% endif %}
                <tr>
                    <th>{% trans 'Date joined:' %}</th>
                    <td>{{ user.date_joined }}</td>
                </tr>
            </tbody>
        </table>
        <p class="buttons">
            <button type="submit" class="submit btn btn-primary">Update</button>
            or <a href="#" class="cancel" onclick="document.forms[0].reset(); return false;">cancel</a>
        </p>
        </form>

        <div class="gravatar">
            <a href="http://gravatar.com/">{% gravatar user.email 150 %}</a>
            <p><a href="http://gravatar.com/">Edit on gravatar.com</a></p>
        </div>

    <div class="clearfix"></div>
    </div>

    <div id="favorites">
        {% if favorites %}
            <ul>
            {% for fav in favorites %}
                <li>
                    <a href="{% url 'thread' mlist_fqdn=fav.list_address threadid=fav.threadid %}"
                        >{{ fav.thread.starting_email.subject }}</a> by {{ fav.thread.starting_email.sender_name }}
                        ({{ fav.thread|get_date|date:"l, j F Y H:i:s" }})
                </li>
            {% endfor %}
            </ul>
        {% else %}
            <p>No favorite yet.</p>
        {% endif %}
    </div>


    <div id="views">
        <img alt="Loading..." class="ajaxloader" src="{{ STATIC_URL }}hyperkitty/img/ajax-loader.gif" />
        <div class="ajaxcontent" data-load-from="{% url 'user_last_views' %}"></div>
    </div>


    <div id="votes">
        <img alt="Loading..." class="ajaxloader" src="{{ STATIC_URL }}hyperkitty/img/ajax-loader.gif" />
        <div class="ajaxcontent" data-load-from="{% url 'user_votes' %}"></div>
    </div>


    <div id="subscriptions">
        <img alt="Loading..." class="ajaxloader" src="{{ STATIC_URL }}hyperkitty/img/ajax-loader.gif" />
        <div class="ajaxcontent" data-load-from="{% url 'user_subscriptions' %}"></div>
    </div>

    </div>
</div>

{% endblock %}

{% block additionaljs %}

<script type="text/javascript">
    $(document).ready(function() {
        // Load the last views
        $(".tabbed").tabs();
        $("div.ajaxcontent").each(function() {
            update_user_profile_part($(this));
        });
    });
</script>

{% endblock %}