Skip to content

Commit

Permalink
added share on X button to posts
Browse files Browse the repository at this point in the history
  • Loading branch information
DogukanUrker committed Jan 20, 2024
1 parent c85983c commit ca35bec
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
1 change: 1 addition & 0 deletions helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from requests import post as requestsPost
from constants import (
LOG_IN,
APP_NAME,
BREAKER_TEXT,
REGISTRATION,
LOG_FILE_ROOT,
Expand Down
2 changes: 2 additions & 0 deletions routes/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
request,
message,
url_for,
APP_NAME,
redirect,
addPoints,
Blueprint,
Expand Down Expand Up @@ -93,6 +94,7 @@ def post(postID):
time=post[6],
form=form,
comments=comments,
appName=APP_NAME,
)
case False:
return render_template("404.html")
23 changes: 13 additions & 10 deletions templates/tailwindUI/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,29 @@ <h1 class="text-3xl mb-6 text-rose-500 w-full text-center select-none font-bold"
</h1>
<p>
{{content|safe}} <br />
<div class="flex items-center"><i class="ti ti-tags mr-1 text-2xl"></i>
{{tags.replace(",",", ")}} </div>
</p>
<div class="flex place-content-between my-4">
<div class="text-left">
<h5 class="m-2"><div class="flex items-center"><i class="ti ti-eye mr-1 text-2xl"></i>
<div>
<div class="flex w-full justify-between my-1">
<div class="flex items-center"><i class="ti ti-tags mr-1 text-2xl"></i>
{{tags.replace(",",", ")}} </div>
<a target="_blank" href="https://x.com/intent/tweet?text={{title}} by {{author}} on {{appName}} {{ request.url }}"><i class="hover:text-rose-500 duration-150 ti ti-brand-x text-2xl"></i></a>
</div>
<div class="flex w-full justify-between my-1">
<h5 ><div class="flex items-center"><i class="ti ti-eye mr-1 text-2xl"></i>
{{views}}</div></h5>
<h5 >{{time}}</h5>
</div>
<div class="flex w-full justify-between my-1">
<a href="/user/{{author|lower}}">
<h5 class="m-2 flex items-baseline">
<h5 class="m-1 flex">
<img
class="w-6 mr-2 select-none"
src="{{ getProfilePicture(author) }}"
alt="{{author}}"
/>{{author}}
</h5></a
>
</div>
<div class="text-right">
<h5 class="m-2">{{time}}</h5>
<h5 class="m-2">{{date}}</h5>
<h5 >{{date}}</h5>
</div>
</div>
{% if author == session["userName"] %}
Expand Down

0 comments on commit ca35bec

Please sign in to comment.