finish invites i think
This commit is contained in:
@@ -220,11 +220,12 @@ def sign_up_post():
|
||||
'username': username_pair[0],
|
||||
'password_hash': password_hash,
|
||||
'permission': PermissionLevel.GUEST.value,
|
||||
'created_at': int(time.time()),
|
||||
'created_at': time_now(),
|
||||
}
|
||||
if invite:
|
||||
user_data['invited_by'] = invite.created_by
|
||||
user_data['permission'] = PermissionLevel.USER.value
|
||||
user_data['confirmed_on'] = time_now()
|
||||
invite.delete()
|
||||
|
||||
user = Users.create(user_data)
|
||||
@@ -251,7 +252,9 @@ def user_page(username):
|
||||
target_user = Users.find({'username': username})
|
||||
if not target_user:
|
||||
abort(404)
|
||||
return render_template('users/user_page.html', target_user=target_user)
|
||||
if current_app.config['DISABLE_SIGNUP'] and target_user.invited_by:
|
||||
invited_by = Users.find({'id': target_user.invited_by})
|
||||
return render_template('users/user_page.html', target_user=target_user, invited_by=invited_by)
|
||||
|
||||
@bp.get('/<username>/posts/')
|
||||
def posts(username):
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
<li><a class="linkbutton" href="{{url_for('users.settings', username=user.username)}}">Settings</a></li>
|
||||
<li><a class="linkbutton" href="{{url_for('users.inbox', username=user.username)}}">Inbox{{' (%s)' % uc if uc else ''}}</a></li>
|
||||
<li><a class="linkbutton" href="{{url_for('users.bookmarks', username=user.username)}}">Bookmarks</a></li>
|
||||
{%- if user.can_invite() -%}
|
||||
<a href="{{url_for('users.settings', username=user.username, _anchor='invite')}}" class="linkbutton alt">Invite</a>
|
||||
{%- endif %}
|
||||
{% if user.is_mod() -%}
|
||||
<li><a class="linkbutton" href="{{url_for('mod.index')}}">Moderation</a></li>
|
||||
{%- endif %}
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
{%- for bt in collection.get_threads() -%}
|
||||
{%- set thread = bt.get_thread() -%}
|
||||
<tr>
|
||||
<td class="plank even no-shadow minimal secondary-bg"><a href="{{url_for('threads.thread_by_id', thread_id=thread.id)}}">{{thread.title}}</a></td>
|
||||
<td class="plank even no-shadow minimal secondary-bg">{{bt.note}}</td>
|
||||
<td class="plank even no-shadow minimal secondary-bg">{{bookmark_button('thread', id=thread.id, text='Manage')}}</td>
|
||||
<td class="center plank even no-shadow minimal secondary-bg"><a href="{{url_for('threads.thread_by_id', thread_id=thread.id)}}">{{thread.title}}</a></td>
|
||||
<td class="center plank even no-shadow minimal secondary-bg">{{bt.note}}</td>
|
||||
<td class="center plank even no-shadow minimal secondary-bg">{{bookmark_button('thread', id=thread.id, text='Manage')}}</td>
|
||||
</tr>
|
||||
{%- endfor -%}
|
||||
</tbody>
|
||||
|
||||
@@ -50,11 +50,12 @@
|
||||
<span>Mention: @{{target_user.username}}</span>
|
||||
<span>Status: <em>{{target_user.status}}</em></span>
|
||||
<span>Rank: {{target_user.permission | permission_string}}</span>
|
||||
{%- set time = target_user.created_at -%}
|
||||
{%- if target_user.approved_at -%}
|
||||
{%- set time = target_user.approved_at -%}
|
||||
{%- if target_user.confirmed_on -%}
|
||||
<span>Joined: {{timestamp(target_user.confirmed_on)}}</span>
|
||||
{%- endif -%}
|
||||
{%- if invited_by -%}
|
||||
<span>Invited by: <a href="{{url_for('users.user_page', username=invited_by.username)}}">{{invited_by.get_readable_name()}}</a></span>
|
||||
{%- endif -%}
|
||||
<span>Joined: {{timestamp(target_user.created_at)}}</span>
|
||||
{%- if not target_user.is_guest() -%}
|
||||
<span>Posts: <a href="{{url_for('users.posts', username=target_user.username)}}">{{stats.post_count}}</a></span>
|
||||
<span>Threads started: <a href="{{url_for('users.threads', username=target_user.username)}}">{{stats.thread_count}}</a></span>
|
||||
|
||||
Reference in New Issue
Block a user