forked from MarseyWorld/MarseyWorld
show follow time
parent
de46a6e519
commit
c15e0f6fad
|
@ -879,10 +879,12 @@ def redditor_moment_redirect(username, v):
|
|||
@auth_required
|
||||
def followers(username, v):
|
||||
u = get_user(username, v=v)
|
||||
if u.id == CARP_ID: abort(403)
|
||||
|
||||
if not (v.id == u.id or v.admin_level >= PERMS['USER_FOLLOWS_VISIBLE']):
|
||||
abort(403)
|
||||
|
||||
users = g.db.query(User).join(Follow, Follow.target_id == u.id) \
|
||||
users = g.db.query(Follow, User).join(Follow, Follow.target_id == u.id) \
|
||||
.filter(Follow.user_id == User.id) \
|
||||
.order_by(Follow.created_utc).all()
|
||||
return render_template("followers.html", v=v, u=u, users=users)
|
||||
|
|
|
@ -11,16 +11,18 @@
|
|||
<tr>
|
||||
<th>#</th>
|
||||
<th>Name</th>
|
||||
<td>Following Since</td>
|
||||
{% if v.id == u.id %}
|
||||
<th></th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="followers-table">
|
||||
{% for user in users %}
|
||||
{% for follow, user in users %}
|
||||
<tr>
|
||||
<td>{{loop.index}}</td>
|
||||
<td>{% include "user_in_table.html" %}</td>
|
||||
<td data-time="{{follow.created_utc}}"></td>
|
||||
{% if v.id == u.id %}
|
||||
<td><div class="btn btn-danger pr-2" onclick="removeFollower(event, '{{user.username}}')">Remove follow</div></td>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue