This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
/
profilebar.html
169 lines (150 loc) · 5.24 KB
/
profilebar.html
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
## The contents of this file are subject to the Common Public Attribution
## License Version 1.0. (the "License"); you may not use this file except in
## compliance with the License. You may obtain a copy of the License at
## http://code.reddit.com/LICENSE. The License is based on the Mozilla Public
## License Version 1.1, but Sections 14 and 15 have been added to cover use of
## software over a computer network and provide for limited attribution for the
## Original Developer. In addition, Exhibit A has been modified to be
## consistent with Exhibit B.
##
## Software distributed under the License is distributed on an "AS IS" basis,
## WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
## the specific language governing rights and limitations under the License.
##
## The Original Code is reddit.
##
## The Original Developer is the Initial Developer. The Initial Developer of
## the Original Code is reddit Inc.
##
## All portions of the code written by reddit are Copyright (c) 2006-2014
## reddit Inc. All Rights Reserved.
###############################################################################
<%!
from r2.lib.filters import unsafe, safemarkdown
from r2.lib.template_helpers import static, format_number
%>
<%namespace file="utils.html" import="submit_form, plain_link, thing_timestamp"/>
<%namespace file="printablebuttons.html" import="toggle_button"/>
<div class="titlebox">
<h1>
${thing.user.name}
%if c.user_is_admin:
<span class="account-notes">
#${thing.user._id}
%if thing.user._deleted:
<span class="unusual">(deleted)</span>
%endif
%if thing.user._spam or thing.user._banned:
<span class="unusual">(banned)</span>
%endif
</span>
%endif
</h1>
%if c.user_is_loggedin and not thing.viewing_self:
<div>
${toggle_button("fancy-toggle-button", _("+ friends"), _("- friends"),
"friend('%s', '%s', 'friend')" % (thing.user.name, c.user._fullname),
"unfriend('%s', '%s', 'friend')" % (thing.user.name, c.user._fullname),
css_class = "add", alt_css_class = "remove",
reverse = thing.is_friend, login_required=True)}
</div>
%endif
<span class="karma">${format_number(thing.user.safe_karma)}</span>
 
${_("link karma")}
<br/>
<span class="karma comment-karma">${format_number(thing.user.comment_karma)}</span>
 
${_("comment karma")}
%if thing.show_private_info:
<table id="per-sr-karma"${" class='more-karmas'" if not c.user_is_admin else ""}>
<thead>
<tr>
<th id="sr-karma-header">subreddit</th>
<th>link</th>
<th>comment</th>
</tr>
</thead>
<tbody>
%for i, (sr_name, (link_karma, comment_karma)) in enumerate(thing.all_karmas.iteritems()):
%if c.user_is_admin and i >= 5:
<tr class="more-karmas">
%else:
<tr>
%endif
% if sr_name == "ancient history":
<th class="helpful" title="${_('really obscure karma from before it was cool to track per-subreddit')}"><span>${_(sr_name)}</span></th>
% else:
<th>${sr_name}</th>
% endif
<td>${link_karma}</td>
<td>${comment_karma}</td>
</tr>
%endfor
</tbody>
</table>
% if not c.user_is_admin or len(thing.all_karmas) > 5:
<div class="karma-breakdown">
<a href="javascript:void(0)"
onclick="$('.more-karmas').show();$(this).hide();return false">
show karma breakdown by subreddit
</a>
</div>
% endif
%endif
%if thing.show_private_info and thing.user.gold:
<div class="rounded gold-accent gold-expiration-info">
%if hasattr(thing, "gold_remaining"):
<div class="gold-remaining" title="${thing.user.gold_expiration.strftime('%Y-%m-%d')}">
<span class="karma">
${thing.gold_remaining}
</span>
<br>
${_("of reddit gold remaining")}
</div>
%if hasattr(thing, "paypal_subscr_id"):
<%
paypal_link = ("https://www.paypal.com/cgi-bin/webscr?cmd=_subscr-find&alias=%s" % g.goldthanks_email)
%>
<div>
<a href=${paypal_link}>
${_("Recurring Paypal subscription")}
</a>
 
${thing.paypal_subscr_id}
</div>
%endif
%if hasattr(thing, "stripe_customer_id"):
<div>
<a href="/gold/subscription">
${_("manage recurring subscription")}
</a>
</div>
%endif
%endif
%if hasattr(thing, "gold_creddit_message"):
<div class="gold-creddits-remaining">
${plain_link(thing.gold_creddit_message, "/gold?goldtype=gift")}
</div>
%endif
</div>
%endif
%if hasattr(thing, "goldlink"):
<div class="giftgold">
<a href="${thing.goldlink}">
${thing.giftmsg}
</a>
</div>
%endif
<div class="bottom">
%if not thing.viewing_self:
<img src="${static('mailgray.png')}"/>
 
${plain_link(_("send message"), "/message/compose/?to=%s" % thing.user.name)}
%endif
<span class="age">
${_("redditor for")} ${thing_timestamp(thing.user)}
</span>
</div>
<div class="clear"> </div>
</div>