forked from retoor/devplacepy
chore: add overflow-managed profile tabs with JS layout and responsive CSS
This commit is contained in:
@@ -252,18 +252,18 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="profile-tabs">
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=posts" class="profile-tab {% if current_tab == 'posts' %}active{% endif %}"><span class="icon">📝</span> Posts</a>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=projects" class="profile-tab {% if current_tab == 'projects' %}active{% endif %}"><span class="icon">🚀</span> Projects</a>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=gists" class="profile-tab {% if current_tab == 'gists' %}active{% endif %}"><span class="icon">📝</span> Gists</a>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=media" class="profile-tab {% if current_tab == 'media' %}active{% endif %}"><span class="icon">🖼️</span> Media</a>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=activity" class="profile-tab {% if current_tab == 'activity' %}active{% endif %}"><span class="icon">📊</span> Activity</a>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=followers" class="profile-tab {% if current_tab == 'followers' %}active{% endif %}"><span class="icon">👥</span> Followers ({{ followers_count }})</a>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=following" class="profile-tab {% if current_tab == 'following' %}active{% endif %}"><span class="icon">👤</span> Following ({{ following_count }})</a>
|
||||
<div class="profile-tabs" data-profile-tabs>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=posts" 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" 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" 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" 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" 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" 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" 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" class="profile-tab {% if current_tab == 'notifications' %}active{% endif %}"><span class="icon">🔔</span> Notifications</a>
|
||||
<a href="/profile/{{ profile_user['username'] }}?tab=notifications" class="profile-tab {% if current_tab == 'notifications' %}active{% endif %}" data-menu-icon="🔔" data-menu-label="Notifications"><span class="icon">🔔</span> Notifications</a>
|
||||
{% endif %}
|
||||
<button class="btn-ghost btn-icon profile-tab-btn">△</button>
|
||||
<button type="button" class="profile-tab profile-tabs-more" aria-haspopup="menu" aria-label="More tabs" hidden><span class="icon">⋯</span> More</button>
|
||||
</div>
|
||||
|
||||
<div class="profile-posts">
|
||||
@@ -422,3 +422,12 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block extra_js %}
|
||||
<script type="module">
|
||||
import { ProfileTabs } from "/static/js/ProfileTabs.js";
|
||||
const tabs = document.querySelector("[data-profile-tabs]");
|
||||
if (tabs) {
|
||||
new ProfileTabs(tabs);
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user