summaryrefslogtreecommitdiffstats
path: root/askbot/skins/default/templates/user_profile/user_inbox.html
blob: f3622bd4365d8a1c3b44e24f2e5a9cb3e2849035 (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
{% extends "user_profile/user.html" %}
{% import "macros.html" as macros %}
<!-- user_responses.html -->
{#
This template accepts a list of response list
they are a generalized form of any response and 

The following properties of response object are used:
timestamp - when it happened
user - user who gave response (database object)
response_type - type of response
response_url - link to the question
response_title - title of the question
response_snippet - abbreviated content of the response
inbox_section - forum|flags
#}
{% block profilesection %}
    {% trans %}inbox{% endtrans %}
{% endblock %}
{% block usercontent %}
    <div style="padding-top:5px;font-size:13px;">
    {% set re_count = request.user.new_response_count +
            request.user.seen_response_count
    %}
    {% if moderation_items %}
        {% set flag_count = moderation_items['new_count'] +
                            moderation_items['seen_count']
        %}
    {% else %}
        {% set flag_count = 0 %}
    {% endif %}
    {% if re_count > 0 and flag_count > 0 %}
    <div id="re_sections">
        {% trans %}Sections:{% endtrans %}
        <a href="{{request.user.get_absolute_url()}}?sort=inbox&section=forum"
            {% if inbox_section == 'forum' %}class="on"{% endif %}
        >
            {% trans %}forum responses ({{re_count}}){% endtrans -%}
        </a> |
        <a href="{{request.user.get_absolute_url()}}?sort=inbox&section=flags"
            {% if inbox_section == 'flags' %}class="on"{% endif %}
        >
            {% trans %}flagged items ({{flag_count}}){% endtrans %}
        </a>
    </div>
    {% endif %}
    {% if inbox_section == 'forum' %}
    <div id="re_tools">
        <strong>{% trans %}select:{% endtrans %}</strong>
        <a id="sel_all">{% trans %}all{% endtrans %}</a> |
        <a id="sel_seen">{% trans %}seen{% endtrans %}</a> |
        <a id="sel_new">{% trans %}new{% endtrans %}</a> |
        <a id="sel_none">{% trans %}none{% endtrans %}</a><br />
        <button id="re_mark_seen">{% trans %}mark as seen{% endtrans %}</button>
        <button id="re_mark_new">{% trans %}mark as new{% endtrans %}</button>
        <button id="re_dismiss">{% trans %}dismiss{% endtrans %}</button>
    </div>
    {% endif %}
    <div id="responses">
    {% for response in responses %}
            <div id="re_{{response.id}}"
                class="re{% if response.is_new %} new highlight{% else %} seen{% endif %}"
            >
                {% if inbox_section == 'forum' %}<input type="checkbox" />{% endif %}
                <div class="face">
                {{ macros.gravatar(response.user, 48) }}
                </div>
                <a style="font-size:12px" href="{{ response.user.get_absolute_url() }}">{{ response.user.username }}</a>
                <a style="text-decoration:none;" href="{{ response.response_url }}">
                    {{ response.response_type }}
                    ({{ response.timestamp|diff_date(3, True) }}):<br/>
                    <strong>"{{ response.response_title|escape}}"</strong>&nbsp;
                    {{ response.response_snippet }}
                </a>
            </div>
    {% endfor %}
    </div>
    </div>
{% endblock %}
{% block userjs %}
    <script type="text/javascript" src="{{'/js/user.js'|media}}"></script>
    <script type="text/javascript">
        var askbot = askbot || {};
        askbot['urls'] = askbot['urls'] || {};
        askbot['urls']['manageInbox'] = '{% url manage_inbox %}';
    </script>
<!-- end user_responses.html -->
{% endblock %}