Artberry-web/templates/profile.html
2025-02-16 16:38:57 +02:00

132 lines
4.9 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/css2?family=Comfortaa:wght@300&display=swap" rel="stylesheet">
<link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
<link rel="icon" href="{{ url_for('static', filename='artberry.ico') }}" type="image/x-icon">
<title>🫐{{ user.username }} profile - artberry🫐</title>
<style>
.hidden {
display: none;
}
</style>
</head>
<body>
<div class="banner">
<img src="{{ url_for('static', filename='banners/' + (user.banner_file if user.banner_file else 'default-banner.png')) }}"
alt="User Banner">
<div class="avatar-container">
<img class="avatar"
src="{{ url_for('static', filename='avatars/' + (user.avatar_file if user.avatar_file else 'default-avatar.png')) }}"
alt="User Avatar">
{% if current_item %}
<img id="currentItem" src="{{ url_for('static', filename=current_item.item_path) }}" alt="Current Item"
class="current-item-image">
{% endif %}
</div>
</div>
<div class="bio">
<p class="biotext">{{ user.username }}</p>
<p class="biotext">{{ user.bio }}</p>
</div>
<a href="{{ url_for('index') }}" class="button">Mainpage</a>
<a href="{{ url_for('user_posts', username=user.username) }}" class="button">Posts</a>
{% if is_current_user %}
<a href="{{ url_for('profile_edit') }}" class="button">Edit Profile</a>
<a href="{{ url_for('upload_post') }}" class="button">Upload Post</a>
{% endif %}
{% if current_user.is_authenticated and current_user.username != user.username %}
{% if not subscribed %}
<form action="{{ url_for('subscribe', author_id=user.id) }}" method="post">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="button">Subscribe</button>
</form>
{% else %}
<form action="{{ url_for('unsubscribe', author_id=user.id) }}" method="post">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="button">Unsubscribe</button>
</form>
{% endif %}
{% endif %}
<h2>Latest Popular Arts</h2>
{% if arts %}
<a href="{{ url_for('user_pubs', pub_type='arts', username=user.username) }}" class="button">
View All Arts ({{ total_arts }})
</a>
{% endif %}
<section class="profile-gallery">
{% if arts %}
{% for art in arts %}
<div class="card profile-art-card">
<a href="{{ url_for('view', content_type='art', id=art.id) }}">
<img src="{{ url_for('static', filename='arts/' + art.image_file) }}" alt="User Art">
<div class="card-title">{{ art.name }}</div>
<div class="cookie-votes">Cookies: {{ art.cookie_votes }}</div>
</a>
</div>
{% endfor %}
{% else %}
<p>No published arts.</p>
{% endif %}
</section>
<h2>Latest Popular Videos</h2>
{% if videos %}
<a href="{{ url_for('user_pubs', pub_type='videos', username=user.username) }}" class="button">
View All Videos ({{ total_videos }})
</a>
{% endif %}
<section class="profile-gallery">
{% if videos %}
{% for video in videos %}
<div class="card profile-video-card">
<a href="{{ url_for('view', content_type='video', id=video.id) }}">
<img src="{{ url_for('static', filename='thumbnails/' + video.video_thumbnail_file) }}"
alt="Video Thumbnail">
<div class="card-title">{{ video.video_name }}</div>
<div class="cookie-votes">Cookies: {{ video.cookie_votes }}</div>
</a>
</div>
{% endfor %}
{% else %}
<p>No published videos.</p>
{% endif %}
</section>
<h2>Latest Popular Comics</h2>
{% if comics %}
<a href="{{ url_for('user_pubs', pub_type='comics', username=user.username) }}" class="button">
View All Comics ({{ total_comics }})
</a>
{% endif %}
<section class="profile-gallery">
{% if comics %}
{% for comic in comics %}
<div class="card profile-comic-card">
<a href="{{ url_for('view', content_type='comic', id=comic.id) }}">
<img src="{{ url_for('static', filename='comicthumbs/' + comic.comic_thumbnail_file) }}"
alt="Comic Thumbnail">
<div class="card-title">{{ comic.name }}</div>
<div class="cookie-votes">Cookies: {{ comic.cookie_votes }}</div>
</a>
</div>
{% endfor %}
{% else %}
<p>No published comics.</p>
{% endif %}
</section>
</body>
</html>