kopia lustrzana https://github.com/snarfed/bridgy-fed
rodzic
1b78e86e6c
commit
afa16d3864
|
@ -472,7 +472,7 @@ class User(StringIdModel, metaclass=ProtocolUserMeta):
|
|||
return f"""\
|
||||
<a class="h-card u-author" href="{self.web_url()}">
|
||||
<img src="{img}" class="profile">
|
||||
<span class="logo">{self.LOGO_HTML}</span>
|
||||
<span class="logo" title="{self.__class__.__name__}">{self.LOGO_HTML}</span>
|
||||
{self.name()}
|
||||
</a>
|
||||
"""
|
||||
|
|
2
pages.py
2
pages.py
|
@ -116,7 +116,7 @@ def user(protocol, id):
|
|||
following = f'{following}{"+" if following == FOLLOWERS_UI_LIMIT else ""}'
|
||||
|
||||
return render_template(
|
||||
'user.html',
|
||||
'profile.html',
|
||||
follow_url=request.values.get('url'),
|
||||
logs=logs,
|
||||
util=util,
|
||||
|
|
|
@ -327,6 +327,26 @@ button[disabled]:hover {
|
|||
margin-top: -.5em;
|
||||
}
|
||||
|
||||
.tabs a {
|
||||
border-bottom: 1px solid;
|
||||
background: linear-gradient(white, #e8e8e8);
|
||||
padding-left: .5em;
|
||||
padding-right: .5em;
|
||||
padding-top: .2em;
|
||||
padding-bottom: .2em;
|
||||
}
|
||||
|
||||
.tabs a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.tabs a.active-tab {
|
||||
border-bottom: none;
|
||||
border-left: 1px solid;
|
||||
border-right: 1px solid;
|
||||
background: inherit;
|
||||
}
|
||||
|
||||
.disable-button, #bad-button {
|
||||
border-color: red;
|
||||
color: red;
|
||||
|
|
|
@ -8,6 +8,20 @@
|
|||
|
||||
<div class="row big">Followers</div>
|
||||
|
||||
<div class="row">
|
||||
<form method="post" action="/remote-follow">
|
||||
<nobr>
|
||||
<label for="follow-address">Follow @{{ id }} with your fediverse address:</label>
|
||||
<input id="follow-address" name="address" type="text" required
|
||||
placeholder="@user@domain.social" alt="fediverse address"
|
||||
value="{{ follow_url or '' }}"></input>
|
||||
<input name="domain" type="hidden" value="{{ id }}"></input>
|
||||
<input name="protocol" type="hidden" value="{{ g.user.LABEL }}"></input>
|
||||
<button type="submit" class="btn btn-default">Follow</button>
|
||||
</nobr>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% with page_name="followers" %}
|
||||
{% include "_followers.html" %}
|
||||
{% endwith %}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
{% extends "user_base.html" %}
|
||||
{% set tab = "profile" %}
|
||||
|
||||
{% block subtabs %}
|
||||
<div class="row">
|
||||
<a href="{{ g.user.user_page_path('followers') }}">{{ followers }} follower{% if followers != '1' %}s{% endif %}</a>
|
||||
·
|
||||
<a href="{{ g.user.user_page_path('following') }}">following {{ following }}</a>
|
||||
·
|
||||
|
||||
{% if g.user.LABEL != 'activitypub' %}
|
||||
Bridged to
|
||||
<nobr title="Fediverse address">
|
||||
<img class="logo" src="/static/fediverse_logo.svg">
|
||||
{{ g.user.ap_address() }}
|
||||
</nobr>
|
||||
<form method="post" action="/webmention-interactive">
|
||||
<input name="source" type="hidden" value="{{ g.user.web_url() }}" />
|
||||
|
||||
<button id="update-profile-button" type="submit"
|
||||
title="Update profile from web site"
|
||||
class="btn btn-default glyphicon glyphicon-refresh"></button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock subtabs %}
|
||||
|
||||
{#
|
||||
{% block feed %}
|
||||
{% endblock feed %}
|
||||
#}
|
|
@ -1,26 +0,0 @@
|
|||
<div class="row">
|
||||
<div class="big" style="display: inline">
|
||||
{{ g.user.user_link()|safe }}
|
||||
·
|
||||
<span title="Fediverse address">
|
||||
<nobr>
|
||||
<img class="logo" src="/static/fediverse_logo.svg">
|
||||
{{ g.user.ap_address() }}
|
||||
</nobr>
|
||||
</span>
|
||||
·
|
||||
|
||||
<nobr>
|
||||
{{ util.pretty_link(g.user.web_url(), text_prefix='🌐', attrs={'title': 'Web site'})|safe }}
|
||||
|
||||
{% if g.user.LABEL != 'activitypub' %}
|
||||
<form method="post" action="/webmention-interactive">
|
||||
<input name="source" type="hidden" value="{{ g.user.web_url() }}" />
|
||||
<button id="update-profile-button" type="submit"
|
||||
title="Update profile from web site"
|
||||
class="btn btn-default glyphicon glyphicon-refresh"></button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</nobr>
|
||||
</div>
|
||||
</div>
|
|
@ -1,6 +1,6 @@
|
|||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ id }} - Bridgy Fed{% endblock %}
|
||||
{% block title %}{{ id }} {{ tab }} - Bridgy Fed{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
|
@ -35,34 +35,37 @@
|
|||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% include "user_addresses.html" %}
|
||||
<div class="row big">
|
||||
{{ g.user.user_link()|safe }}
|
||||
</div>
|
||||
|
||||
<!-- tabs -->
|
||||
<div class="row tabs">
|
||||
<a>
|
||||
<a href="{{ g.user.user_page_path() }}"
|
||||
{% if tab == 'profile' %}class="active-tab"{% endif %}
|
||||
>👤 Profile</a><a
|
||||
href="{{ g.user.user_page_path('home') }}"
|
||||
{% if tab == 'home' %}class="active-tab"{% endif %}
|
||||
>🏠 Feed</a><a
|
||||
href="{{ g.user.user_page_path('notifications') }}"
|
||||
{% if tab == 'notifications' %}class="active-tab"{% endif %}
|
||||
>🔔 Notifications</a>
|
||||
<a>
|
||||
</div>
|
||||
|
||||
{% block subtabs %}
|
||||
<div class="row">
|
||||
<a href="{{ g.user.user_page_path('followers') }}">{{ followers }} follower{% if followers != '1' %}s{% endif %}</a>
|
||||
· <a href="{{ g.user.user_page_path('following') }}">following {{ following }}</a>
|
||||
· <a href="{{ g.user.user_page_path('feed') }}">HTML</a>
|
||||
· <a href="{{ g.user.user_page_path('feed?format=atom') }}">Atom</a>
|
||||
· <a href="{{ g.user.user_page_path('feed?format=rss') }}">RSS</a>
|
||||
· <a href="/.well-known/webfinger?resource=acct:{{ g.user.ap_address() }}">Webfinger</a>
|
||||
· <a href="{{ g.user.ap_actor() }}">ActivityPub</a>
|
||||
</div>
|
||||
{% endblock subtabs %}
|
||||
|
||||
{% if g.user.LABEL != 'activitypub' %}
|
||||
<div class="row">
|
||||
<form method="post" action="/remote-follow">
|
||||
<p>
|
||||
<label for="follow-address">Follow @{{ id }} with your fediverse address:</label>
|
||||
<input id="follow-address" name="address" type="text" required
|
||||
placeholder="@user@domain.social" alt="fediverse address"
|
||||
value="{{ follow_url or '' }}"></input>
|
||||
<input name="domain" type="hidden" value="{{ id }}"></input>
|
||||
<input name="protocol" type="hidden" value="{{ g.user.LABEL }}"></input>
|
||||
<button type="submit" class="btn btn-default">Follow</button>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% block feed %}
|
||||
{% include "activities.html" %}
|
||||
{% endblock feed %}
|
||||
|
||||
{% endblock %}
|
||||
{% endblock content %}
|
|
@ -34,7 +34,7 @@ class CommonTest(TestCase):
|
|||
self.assert_multiline_equals("""\
|
||||
<a class="h-card u-author" href="https://user.com/">
|
||||
<img src="" class="profile">
|
||||
<span class="logo">🕸️</span>
|
||||
<span class="logo" title="{self.__class__.__name__}">🕸️</span>
|
||||
user.com
|
||||
</a>""", common.pretty_link('https://user.com/'))
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ class UserTest(TestCase):
|
|||
self.assert_multiline_equals("""\
|
||||
<a class="h-card u-author" href="https://y.z/">
|
||||
<img src="" class="profile">
|
||||
<span class="logo">🕸️</span>
|
||||
<span class="logo" title="Web">🕸️</span>
|
||||
y.z
|
||||
</a>""", g.user.user_link())
|
||||
|
||||
|
@ -147,7 +147,7 @@ class UserTest(TestCase):
|
|||
self.assert_multiline_equals("""\
|
||||
<a class="h-card u-author" href="https://y.z/">
|
||||
<img src="https://user.com/me.jpg" class="profile">
|
||||
<span class="logo">🕸️</span>
|
||||
<span class="logo" title="Web">🕸️</span>
|
||||
Mrs. ☕ Foo
|
||||
</a>""", g.user.user_link())
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue