diff --git a/template/posts_partial.html b/template/posts_partial.html new file mode 100644 index 0000000..45dfcb3 --- /dev/null +++ b/template/posts_partial.html @@ -0,0 +1,45 @@ +{% for post in posts %} +
+
+

{{ post.content|safe }}

+ {% if post.image_url %} + Post image + {% endif %} +
+ {% if post.author %} + {% if post.author.profile_picture %} + Profile Picture + {% else %} +
+ {{ post.author.username[0].upper() }} +
+ {% endif %} + + {{ post.author.username }} + + {% else %} + {{ post.anonymous_username }} + {% endif %} +
+

{{ post.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}

+ + + + Open in new tab + + + {% if (current_user.is_authenticated and post.author and current_user.id == post.author.id) or (not current_user.is_authenticated and post.user_id == session['user_id']) %} + + Edit + + {% endif %} +
+ +
+{% endfor %} \ No newline at end of file diff --git a/template/profile.html b/template/profile.html new file mode 100644 index 0000000..eeb0958 --- /dev/null +++ b/template/profile.html @@ -0,0 +1,245 @@ +{% extends "base.html" %} + +{% block title %}{{ user.username }}'s Profile{% endblock %} + +{% block content %} +
+
+
+
+
+

{{ user.username }}'s Profile

+ {% if user.profile_picture %} + Profile Picture + {% else %} +
+ {{ user.username[0].upper() }} +
+ {% endif %} +

Bio:

+
{{ user.rendered_bio|safe or "No bio available." }}
+
Stats
+

Posts: {{ post_count }}

+

Total Likes: {{ like_count }}

+

Total Comments: {{ comment_count }}

+ {% if current_user.is_authenticated and current_user.id == user.id %} + + {% endif %} +
+
+
+
+

Posts

+ {% for post in posts %} +
+
+

{{ post.content|safe }}

+ {% if post.image_url %} + Post image + {% endif %} +
+ {% if post.author.profile_picture %} + Profile Picture + {% else %} +
+ {{ post.author.username[0].upper() }} +
+ {% endif %} + + {{ post.author.username }} + +
+

{{ post.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}

+ + + {% if current_user.is_authenticated and current_user.id == post.author.id %} + + Edit + + {% endif %} +
+ +
+ {% endfor %} +
+
+
+ + +{% if current_user.is_authenticated and current_user.id == user.id %} + +{% endif %} +{% endblock %} + +{% block scripts %} +{{ super() }} + + + + +{% endblock %} + +{% block styles %} +{{ super() }} + + +{% endblock %} \ No newline at end of file diff --git a/template/register.html b/template/register.html new file mode 100644 index 0000000..4e525e0 --- /dev/null +++ b/template/register.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} + +{% block title %}Register{% endblock %} + +{% block content %} +

Register

+
+
+ + +
+
+ + +
+ +
+{% endblock %} \ No newline at end of file