mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-02 16:21:32 -08:00
people list
This commit is contained in:
parent
b431a79518
commit
7883ead026
6 changed files with 59 additions and 7 deletions
|
@ -50,7 +50,7 @@ def index():
|
|||
|
||||
active_communities = Community.query.filter_by(banned=False).order_by(desc(Community.last_active)).limit(5).all()
|
||||
|
||||
return render_template('index.html', posts=posts, active_communities=active_communities,
|
||||
return render_template('index.html', posts=posts, active_communities=active_communities, show_post_community=True,
|
||||
POST_TYPE_IMAGE=POST_TYPE_IMAGE, POST_TYPE_LINK=POST_TYPE_LINK,
|
||||
SUBSCRIPTION_PENDING=SUBSCRIPTION_PENDING, SUBSCRIPTION_MEMBER=SUBSCRIPTION_MEMBER,
|
||||
etag=f"home_{hash(str(g.site.last_active))}", next_url=next_url, prev_url=prev_url,
|
||||
|
@ -86,7 +86,7 @@ def new_posts():
|
|||
active_communities = Community.query.filter_by(banned=False).order_by(desc(Community.last_active)).limit(5).all()
|
||||
|
||||
return render_template('new_posts.html', posts=posts, active_communities=active_communities,
|
||||
POST_TYPE_IMAGE=POST_TYPE_IMAGE, POST_TYPE_LINK=POST_TYPE_LINK,
|
||||
POST_TYPE_IMAGE=POST_TYPE_IMAGE, POST_TYPE_LINK=POST_TYPE_LINK, show_post_community=True,
|
||||
SUBSCRIPTION_PENDING=SUBSCRIPTION_PENDING, SUBSCRIPTION_MEMBER=SUBSCRIPTION_MEMBER,
|
||||
etag=f"home_{hash(str(g.site.last_active))}", next_url=next_url, prev_url=prev_url,
|
||||
rss_feed=f"https://{current_app.config['SERVER_NAME']}/feed",
|
||||
|
@ -122,7 +122,7 @@ def top_posts():
|
|||
active_communities = Community.query.filter_by(banned=False).order_by(desc(Community.last_active)).limit(5).all()
|
||||
|
||||
return render_template('top_posts.html', posts=posts, active_communities=active_communities,
|
||||
POST_TYPE_IMAGE=POST_TYPE_IMAGE, POST_TYPE_LINK=POST_TYPE_LINK,
|
||||
POST_TYPE_IMAGE=POST_TYPE_IMAGE, POST_TYPE_LINK=POST_TYPE_LINK, show_post_community=True,
|
||||
SUBSCRIPTION_PENDING=SUBSCRIPTION_PENDING, SUBSCRIPTION_MEMBER=SUBSCRIPTION_MEMBER,
|
||||
etag=f"home_{hash(str(g.site.last_active))}", next_url=next_url, prev_url=prev_url,
|
||||
rss_feed=f"https://{current_app.config['SERVER_NAME']}/feed",
|
||||
|
|
|
@ -33,7 +33,8 @@
|
|||
<span class="red fe fe-report" title="{{ _('Reported. Check post for issues.') }}"></span>
|
||||
{% endif %}
|
||||
</h3>
|
||||
<span class="small">{{ render_username(post.author) }} · {{ moment(post.posted_at).fromNow() }}</span>
|
||||
<span class="small">{% if show_post_community %}<strong><a href="/c/{{ post.community.link() }}">c/{{ post.community.name }}</a></strong>{% endif %}
|
||||
by {{ render_username(post.author) }} {{ moment(post.posted_at).fromNow() }}</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="/users">{{ _('People') }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="/people">{{ _('People') }}</a></li>
|
||||
<li class="breadcrumb-item active">{{ user.user_name|shorten }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
|
44
app/templates/user/people.html
Normal file
44
app/templates/user/people.html
Normal file
|
@ -0,0 +1,44 @@
|
|||
{% extends "base.html" %}
|
||||
{% from 'bootstrap/form.html' import render_form %}
|
||||
|
||||
{% block app_content %}
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-8 position-relative main_pane">
|
||||
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
|
||||
<li class="breadcrumb-item active">{{ _('People') }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
<h1 class="mt-2">{{ _('People') }}</h1>
|
||||
{% if people %}
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>About</th>
|
||||
</tr>
|
||||
{% for person in people %}
|
||||
<tr>
|
||||
<td>{{ render_username(person) }}</td>
|
||||
<td>{{ person.about_html | safe if person.about_html }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<p>{{ _('No people to show') }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-4">
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<h2> </h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -9,7 +9,7 @@
|
|||
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="/users">{{ _('People') }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="/people">{{ _('People') }}</a></li>
|
||||
<li class="breadcrumb-item active">{{ user.display_name()|shorten }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
@ -29,7 +29,7 @@
|
|||
<nav aria-label="breadcrumb" id="breadcrumb_nav" title="Navigation">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="/">{{ _('Home') }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="/users">{{ _('People') }}</a></li>
|
||||
<li class="breadcrumb-item"><a href="/people">{{ _('People') }}</a></li>
|
||||
<li class="breadcrumb-item active">{{ user.user_name|shorten }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
|
|
@ -18,6 +18,13 @@ from app.utils import get_setting, render_template, markdown_to_html, user_acces
|
|||
from sqlalchemy import desc, or_, text
|
||||
|
||||
|
||||
@bp.route('/people', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def show_people():
|
||||
people = User.query.filter_by(ap_id=None, deleted=False, banned=False).all()
|
||||
return render_template('user/people.html', people=people)
|
||||
|
||||
|
||||
def show_profile(user):
|
||||
if user.deleted or user.banned and current_user.is_anonymous():
|
||||
abort(404)
|
||||
|
|
Loading…
Add table
Reference in a new issue