mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 11:26:56 -08:00
remote profiles
This commit is contained in:
parent
021c527147
commit
d73eb55d72
3 changed files with 9 additions and 5 deletions
|
@ -137,7 +137,11 @@ def user_profile(actor):
|
|||
""" Requests to this endpoint can be for a JSON representation of the user, or a HTML rendering of their profile.
|
||||
The two types of requests are differentiated by the header """
|
||||
actor = actor.strip()
|
||||
user = User.query.filter_by(user_name=actor, deleted=False, banned=False, ap_id=None).first()
|
||||
if '@' in actor:
|
||||
user = User.query.filter_by(ap_id=actor, deleted=False, banned=False).first()
|
||||
else:
|
||||
user = User.query.filter_by(user_name=actor, deleted=False, banned=False, ap_id=None).first()
|
||||
|
||||
if user is not None:
|
||||
if 'application/ld+json' in request.headers.get('Accept', ''):
|
||||
server = current_app.config['SERVER_NAME']
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{% if user.deleted %}
|
||||
[deleted]
|
||||
{% else %}
|
||||
<a href="{{ url_for('activitypub.user_profile', actor=user.user_name) }}">{{ user.user_name }}</a>
|
||||
<a href="/u/{{ user.link() }}">{{ user.user_name if user.ap_id == none else user.ap_id }}</a>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
<!doctype html>
|
||||
|
|
|
@ -15,14 +15,14 @@
|
|||
</nav>
|
||||
</div>
|
||||
<img class="community_icon_big bump_up rounded-circle" src="{{ user.avatar_image() }}" />
|
||||
<h1 class="mt-2">{{ user.user_name }}</h1>
|
||||
<h1 class="mt-2">{{ user.user_name if user.ap_id == none else user.ap_id }}</h1>
|
||||
{% elif user.avatar_image() != '' %}
|
||||
<div class="row">
|
||||
<div class="col-2">
|
||||
<img class="community_icon_big rounded-circle" src="{{ user.avatar_image() }}" />
|
||||
</div>
|
||||
<div class="col-10">
|
||||
<h1 class="mt-3">{{ user.user_name }}</h1>
|
||||
<h1 class="mt-3">{{ user.user_name if user.ap_id == none else user.ap_id }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
|
@ -33,7 +33,7 @@
|
|||
<li class="breadcrumb-item active">{{ user.user_name|shorten }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
<h1 class="mt-2">{{ user.user_name }}</h1>
|
||||
<h1 class="mt-2">{{ user.user_name if user.ap_id == none else user.ap_id }}</h1>
|
||||
{{ user.about_html|safe }}
|
||||
{% endif %}
|
||||
|
||||
|
|
Loading…
Reference in a new issue