forked from retoor/devplacepy
Update
This commit is contained in:
@@ -4,13 +4,14 @@
|
||||
<link rel="stylesheet" href="{{ static_url('/static/css/profile.css') }}">
|
||||
<link rel="stylesheet" href="{{ static_url('/static/css/projects.css') }}">
|
||||
<link rel="stylesheet" href="{{ static_url('/static/css/gists.css') }}">
|
||||
<link rel="stylesheet" href="{{ static_url('/static/css/awards.css') }}">
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<div class="profile-layout">
|
||||
<aside class="profile-sidebar">
|
||||
<div class="profile-card">
|
||||
<div class="profile-avatar-wrap">
|
||||
<span class="avatar-badge"><img src="{{ avatar_url('multiavatar', avatar_seed(profile_user), 80) }}" class="avatar-img avatar-lg" alt="{{ profile_user['username'] }}" id="profile-avatar-preview" loading="lazy">{% set _user = profile_user %}{% include "_presence_dot.html" %}</span>
|
||||
<span class="avatar-badge"><img src="{{ avatar_url('multiavatar', avatar_seed(profile_user), 80) }}" class="avatar-img avatar-lg" alt="{{ profile_user['username'] }}" id="profile-avatar-preview" loading="lazy">{% set _user = profile_user %}{% include "_presence_dot.html" %}{% include "_award_badge.html" %}</span>
|
||||
{% if is_owner or viewer_is_admin %}
|
||||
<button type="button" class="btn btn-sm avatar-regen-btn" data-regenerate-avatar data-username="{{ profile_user['username'] }}">Regenerate avatar</button>
|
||||
{% endif %}
|
||||
@@ -89,6 +90,9 @@
|
||||
<button type="submit" class="btn btn-secondary btn-sm full-width" data-confirm="Mute {{ profile_user['username'] }}? They will no longer create notifications for you." data-confirm-danger{{ guest_disabled(user) }}><span class="icon">🔇</span>Mute</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% if can_give_award %}
|
||||
<button type="button" class="btn btn-primary btn-sm full-width" data-award-give data-username="{{ profile_user['username'] }}" data-modal="award-give-modal"{{ guest_disabled(user) }}><span class="icon">🏆</span>Give Award</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -473,18 +477,51 @@
|
||||
{% endfor %}
|
||||
</details>
|
||||
|
||||
<div class="profile-tabs" id="profile-tabs" data-profile-tabs>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=posts#profile-tabs" class="profile-tab {% if current_tab == 'posts' %}active{% endif %}" data-menu-icon="📝" data-menu-label="Posts"><span class="icon">📝</span> Posts</a>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=projects#profile-tabs" class="profile-tab {% if current_tab == 'projects' %}active{% endif %}" data-menu-icon="🚀" data-menu-label="Projects"><span class="icon">🚀</span> Projects</a>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=gists#profile-tabs" class="profile-tab {% if current_tab == 'gists' %}active{% endif %}" data-menu-icon="📝" data-menu-label="Gists"><span class="icon">📝</span> Gists</a>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=media#profile-tabs" class="profile-tab {% if current_tab == 'media' %}active{% endif %}" data-menu-icon="🖼️" data-menu-label="Media"><span class="icon">🖼️</span> Media</a>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=activity#profile-tabs" class="profile-tab {% if current_tab == 'activity' %}active{% endif %}" data-menu-icon="📊" data-menu-label="Activity"><span class="icon">📊</span> Activity</a>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=followers#profile-tabs" class="profile-tab {% if current_tab == 'followers' %}active{% endif %}" data-menu-icon="👥" data-menu-label="Followers ({{ followers_count }})"><span class="icon">👥</span> Followers ({{ followers_count }})</a>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=following#profile-tabs" class="profile-tab {% if current_tab == 'following' %}active{% endif %}" data-menu-icon="👤" data-menu-label="Following ({{ following_count }})"><span class="icon">👤</span> Following ({{ following_count }})</a>
|
||||
{% if is_owner or viewer_is_admin %}
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=notifications#profile-tabs" class="profile-tab {% if current_tab == 'notifications' %}active{% endif %}" data-menu-icon="🔔" data-menu-label="Notifications"><span class="icon">🔔</span> Notifications</a>
|
||||
{% if prominent_award %}
|
||||
<section class="award-prominent" aria-label="Latest award">
|
||||
<img src="{{ prominent_award['image_url'] }}" alt="{{ prominent_award['description'] }}" title="{{ prominent_award['description'] }}" class="award-prominent-image" loading="lazy">
|
||||
<div class="award-prominent-desc rendered-content">{{ render_content(prominent_award['description']) }}</div>
|
||||
<div class="award-prominent-meta">
|
||||
{% if prominent_award.get('giver') %}
|
||||
<a href="/profile/{{ prominent_award['giver']['username'] }}" class="award-prominent-giver">
|
||||
<img src="{{ avatar_url('multiavatar', avatar_seed(prominent_award['giver']), 24) }}" class="avatar-img avatar-xs" alt="{{ prominent_award['giver']['username'] }}" loading="lazy">
|
||||
<span>Given by @{{ prominent_award['giver']['username'] }}</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if prominent_award.get('generated_at') %}
|
||||
<span>{{ award_date(prominent_award['generated_at']) }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if viewer_is_admin %}
|
||||
<form method="POST" action="/admin/awards/{{ prominent_award['uid'] }}/revoke" class="award-revoke-form">
|
||||
<button type="submit"
|
||||
class="award-revoke-btn btn btn-secondary btn-sm"
|
||||
data-confirm="Revoke this award from @{{ profile_user['username'] }}? It will disappear from their profile, media gallery, and avatar badge."
|
||||
data-confirm-danger
|
||||
data-confirm-title="Revoke award"
|
||||
aria-label="Revoke award">Revoke award</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
<button type="button" class="profile-tab profile-tabs-more" aria-haspopup="menu" aria-label="More tabs" hidden><span class="icon">⋯</span> More</button>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
<div class="profile-tabs" id="profile-tabs" data-overflow-tabs>
|
||||
<div class="overflow-tabs-strip">
|
||||
{% if awards_count > 0 %}
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=awards#profile-tabs" class="profile-tab {% if current_tab == 'awards' %}active{% endif %}" data-menu-icon="🏆" data-menu-label="Awards ({{ awards_count }})"><span class="icon">🏆</span> Awards ({{ awards_count }})</a>
|
||||
{% endif %}
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=posts#profile-tabs" class="profile-tab {% if current_tab == 'posts' %}active{% endif %}" data-menu-icon="📝" data-menu-label="Posts"><span class="icon">📝</span> Posts</a>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=projects#profile-tabs" class="profile-tab {% if current_tab == 'projects' %}active{% endif %}" data-menu-icon="🚀" data-menu-label="Projects"><span class="icon">🚀</span> Projects</a>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=gists#profile-tabs" class="profile-tab {% if current_tab == 'gists' %}active{% endif %}" data-menu-icon="📝" data-menu-label="Gists"><span class="icon">📝</span> Gists</a>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=media#profile-tabs" class="profile-tab {% if current_tab == 'media' %}active{% endif %}" data-menu-icon="🖼️" data-menu-label="Media"><span class="icon">🖼️</span> Media</a>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=activity#profile-tabs" class="profile-tab {% if current_tab == 'activity' %}active{% endif %}" data-menu-icon="📊" data-menu-label="Activity"><span class="icon">📊</span> Activity</a>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=followers#profile-tabs" class="profile-tab {% if current_tab == 'followers' %}active{% endif %}" data-menu-icon="👥" data-menu-label="Followers ({{ followers_count }})"><span class="icon">👥</span> Followers ({{ followers_count }})</a>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=following#profile-tabs" class="profile-tab {% if current_tab == 'following' %}active{% endif %}" data-menu-icon="👤" data-menu-label="Following ({{ following_count }})"><span class="icon">👤</span> Following ({{ following_count }})</a>
|
||||
{% if is_owner or viewer_is_admin %}
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=notifications#profile-tabs" class="profile-tab {% if current_tab == 'notifications' %}active{% endif %}" data-menu-icon="🔔" data-menu-label="Notifications"><span class="icon">🔔</span> Notifications</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<button type="button" class="profile-tab overflow-tabs-more" aria-haspopup="menu" aria-label="More tabs" hidden><span class="icon">⋯</span> More</button>
|
||||
</div>
|
||||
|
||||
<div class="profile-posts">
|
||||
@@ -544,6 +581,11 @@
|
||||
{% set pagination = media_pagination %}
|
||||
{% set pagination_query = "tab=media&" %}
|
||||
{% include "_pagination.html" %}
|
||||
{% elif current_tab == 'awards' %}
|
||||
{% include "_awards_gallery.html" %}
|
||||
{% set pagination = awards_pagination %}
|
||||
{% set pagination_query = "tab=awards&" %}
|
||||
{% include "_pagination.html" %}
|
||||
{% elif current_tab == 'followers' or current_tab == 'following' %}
|
||||
{% if people %}
|
||||
<div class="profile-panel">
|
||||
@@ -551,7 +593,7 @@
|
||||
{% for person in people %}
|
||||
<div class="follow-row">
|
||||
<a href="/profile/{{ person['username'] }}" class="follow-user">
|
||||
<span class="avatar-badge"><img src="{{ avatar_url('multiavatar', avatar_seed(person), 40) }}" class="avatar-img avatar-md" alt="{{ person['username'] }}" loading="lazy">{% set _user = person %}{% include "_presence_dot.html" %}</span>
|
||||
<span class="avatar-badge"><img src="{{ avatar_url('multiavatar', avatar_seed(person), 40) }}" class="avatar-img avatar-md" alt="{{ person['username'] }}" loading="lazy">{% set _user = person %}{% include "_presence_dot.html" %}{% include "_award_badge.html" %}</span>
|
||||
<div class="follow-user-info">
|
||||
<span class="follow-user-name">{{ person['username'] }}</span>
|
||||
{% if person['bio'] %}<span class="follow-user-bio rendered-title">{{ render_title(person['bio']) }}</span>{% endif %}
|
||||
@@ -663,13 +705,24 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if can_give_award %}
|
||||
{% from "_macros.html" import modal %}
|
||||
{% call modal('award-give-modal', 'Give award') %}
|
||||
<form id="award-give-form">
|
||||
<div class="auth-field auth-field-gap">
|
||||
<label for="award-description">Message for @{{ profile_user['username'] }}</label>
|
||||
<textarea id="award-description" name="description" maxlength="125" rows="3" required placeholder="What did they do well?"></textarea>
|
||||
<small class="award-char-count" data-award-char-count>0/125</small>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary full-width">Submit award</button>
|
||||
</form>
|
||||
{% endcall %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block extra_js %}
|
||||
<script type="module">
|
||||
import { ProfileTabs } from "{{ static_url('/static/js/ProfileTabs.js') }}";
|
||||
const tabs = document.querySelector("[data-profile-tabs]");
|
||||
if (tabs) {
|
||||
new ProfileTabs(tabs);
|
||||
}
|
||||
import { AwardGiver } from "{{ static_url('/static/js/AwardGiver.js') }}";
|
||||
new AwardGiver();
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user