Skip to content
Snippets Groups Projects
Commit e66b3b48 authored by Saravanan, Mukesh (PG/T - Comp Sci & Elec Eng)'s avatar Saravanan, Mukesh (PG/T - Comp Sci & Elec Eng)
Browse files

Replace post.html

parent 3788bd76
No related branches found
No related tags found
1 merge request!36Updates frontend
...@@ -21,91 +21,7 @@ ...@@ -21,91 +21,7 @@
.tile__author { .tile__author {
font-size: 16px; font-size: 16px;
} }
</style> .latest {
<title>POST PAGE</title>
<a class="home-btn" href="{{ url_for('frontend.get_posts') }}">Home</a>
{% from 'macros.html' import displayField %}
{% include '_messages.html' %}
<br>
<!-- START posts -->
<div class="col-md-8">
<div class="post-container" style="height: 400px; width: 100%; overflow: auto;
word-wrap: break-word; white-space: normal">
<div class="tile__author">
<img class="profile-image" src="images/users/{{ owner_image }}">
<h2 ><a href="{{ url_for('frontend.display_user', user_id=post.user_id) }}">{{ post['user_name'] }}</a></h2>
</div>
<div class="tile__header">
{{ post['title'] }}
</div>
<div class="tile__text">
<p>{{ post['content'] | safe }}</p>
</div>
{% if post['image_url'] != '' %}
<img class="post-image" src="images/{{ post['image_url'] }}">
{% endif %}
<p class="tile__date">{{ post['date_added'] }}</p>
{% if current_user_id == post['user_id'] %}
<div class="tile__buttons">
<a class="tile__btn" href="{{ url_for('frontend.delete_post', post_id=post.id) }}">Delete Post</a>
</div>
{% endif %}
</div>
</div>
<!-- END posts -->
<!-- START comments -->
<div class="comment-container" style="overflow-y: auto; height: 600px; width: 100%">
<h3 class="comment__title">COMMENTS</h3>
{% if comments %}
{% for comment, image in comments %}
<div class="comment__box{% if current_user_id == comment['user_id'] %} comment__box--self{% else %} comment__box--other{% endif %}">
<div class="comment__author">
<div class="comment__bubble{% if current_user_id == comment['user_id'] %} comment__bubble--self{% endif %}">
<div class="comment__avatar{% if current_user_id == comment['user_id'] %} comment__avatar--self{% endif %}">
{% if current_user_id != comment['user_id'] %}
<img class="user-image" src="images/users/{{ image }}">
{% endif %}
</div>
{% if current_user_id != comment['user_id'] %}
<p class="comment__name">{{ comment['user_name']}}</p>
{% endif %}
<p class="comment__text">{{ comment['content'] | safe }}</p>
<div class="comment__date">
<span>{{ comment['date_added'] }}</span>
{% if current_user_id == comment['user_id'] %}
<a class="comment__btn" href="{{ url_for('frontend.delete_comment', post_id=post.id, comment_id=comment.id) }}">Delete Comment</a>
{% endif %}
</div>
</div>
</div>
</div>
{% endfor %}
{% endif %}
<div class="comment__form-container">
<form class="comment__form" action="" method="POST">
{{ form.csrf_token }}
{{ displayField(form.content, 'Type comment here...') }}
<button class="btn btn--solid post-btn" type="submit">SUBMIT</button>
</form>
{{ ckeditor.load(pkg_type="basic") }}
{{ ckeditor.config(name='content') }}
</div>
</div>
</div>
</div>
<!-- END comments -->
</div>
<style>
.latest {
padding: 40px 0; padding: 40px 0;
} }
...@@ -230,3 +146,84 @@ ...@@ -230,3 +146,84 @@
font-size: 16px; font-size: 16px;
cursor: pointer; cursor: pointer;
margin-bottom: 20px; margin-bottom: 20px;
}
</style>
<title>POST PAGE</title>
<a class="home-btn" href="{{ url_for('frontend.get_posts') }}">Home</a>
{% from 'macros.html' import displayField %}
{% include '_messages.html' %}
<br>
<!-- START posts -->
<div class="col-md-8">
<div class="post-container" style="height: 400px; width: 100%; overflow: auto;
word-wrap: break-word; white-space: normal">
<div class="tile__author">
<img class="profile-image" src="images/users/{{ owner_image }}">
<h2 ><a href="{{ url_for('frontend.display_user', user_id=post.user_id) }}">{{ post['user_name'] }}</a></h2>
</div>
<div class="tile__header">
{{ post['title'] }}
</div>
<div class="tile__text">
<p>{{ post['content'] | safe }}</p>
</div>
{% if post['image_url'] != '' %}
<img class="post-image" src="images/{{ post['image_url'] }}">
{% endif %}
<p class="tile__date">{{ post['date_added'] }}</p>
{% if current_user_id == post['user_id'] %}
<div class="tile__buttons">
<a class="tile__btn" href="{{ url_for('frontend.delete_post', post_id=post.id) }}">Delete Post</a>
</div>
{% endif %}
</div>
</div>
<!-- END posts -->
<!-- START comments -->
<div class="comment-container" style="overflow-y: auto; height: 600px; width: 100%">
<h3 class="comment__title">COMMENTS</h3>
{% if comments %}
{% for comment, image in comments %}
<div class="comment__box{% if current_user_id == comment['user_id'] %} comment__box--self{% else %} comment__box--other{% endif %}">
<div class="comment__author">
<div class="comment__bubble{% if current_user_id == comment['user_id'] %} comment__bubble--self{% endif %}">
<div class="comment__avatar{% if current_user_id == comment['user_id'] %} comment__avatar--self{% endif %}">
{% if current_user_id != comment['user_id'] %}
<img class="user-image" src="images/users/{{ image }}">
{% endif %}
</div>
{% if current_user_id != comment['user_id'] %}
<p class="comment__name">{{ comment['user_name']}}</p>
{% endif %}
<p class="comment__text">{{ comment['content'] | safe }}</p>
<div class="comment__date">
<span>{{ comment['date_added'] }}</span>
{% if current_user_id == comment['user_id'] %}
<a class="comment__btn" href="{{ url_for('frontend.delete_comment', post_id=post.id, comment_id=comment.id) }}">Delete Comment</a>
{% endif %}
</div>
</div>
</div>
</div>
{% endfor %}
{% endif %}
<div class="comment__form-container">
<form class="comment__form" action="" method="POST">
{{ form.csrf_token }}
{{ displayField(form.content, 'Type comment here...') }}
<button class="btn btn--solid post-btn" type="submit">SUBMIT</button>
</form>
{{ ckeditor.load(pkg_type="basic") }}
{{ ckeditor.config(name='content') }}
</div>
</div>
</div>
</div>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment