mirror of
https://github.com/Xevion/runnerspace.git
synced 2025-12-17 04:13:14 -06:00
Add new users list to index
This commit is contained in:
@@ -8,7 +8,8 @@ blueprint = Blueprint('main', __name__)
|
||||
|
||||
@blueprint.route('/')
|
||||
def index(): # put application's code here
|
||||
return render_template('layouts/index.html')
|
||||
users = User.query.order_by(User.time_registered).limit(10).all()
|
||||
return render_template('layouts/index.html', new_users=users)
|
||||
|
||||
|
||||
@blueprint.route('/about')
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
{% extends 'layouts/base.html' %}
|
||||
|
||||
{% block content %}
|
||||
<h4>New Users</h4>
|
||||
<h2>New Users</h2>
|
||||
<div style="border: 1px solid grey; padding: 0.2em; width: fit-content; padding-right: 1.2em;">
|
||||
<ul>
|
||||
{% for new_user in new_users %}
|
||||
<li><a href="{{ url_for('main.user', username=new_user.username) }}" style="text-decoration: none">{{ new_user.username }}</a> as of {{ new_user.get_registration_delta() }} ago</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user