-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from Anas-mhameed/view-article
Adding read article feature, adding a new view, new template, new route
- Loading branch information
Showing
8 changed files
with
285 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
article{ | ||
max-width: 70%; | ||
margin: 0 auto; | ||
|
||
} | ||
header{ | ||
min-height: 40vh; | ||
} | ||
.footer { | ||
|
||
display: flex; | ||
justify-content: flex-end; | ||
align-items: flex-end; | ||
gap: 1rem; | ||
} | ||
.footer > *{ | ||
margin : 0px 0px 0px; | ||
} | ||
hr { | ||
border: 0; | ||
height: 3px; | ||
background-image: -webkit-linear-gradient(left, #5b5b5b, #3c3326, #f0f0f0); | ||
background-image: -moz-linear-gradient(left, #5b5b5b, #3c3326, #f0f0f0); | ||
background-image: -ms-linear-gradient(left, #5b5b5b, #3c3326, #f0f0f0); | ||
background-image: -o-linear-gradient(left, #5b5b5b, #3c3326, #f0f0f0); | ||
} | ||
.nickname{ | ||
justify-self: flex-start; | ||
} | ||
.Green{ | ||
background-color: rgb(54, 169, 38); | ||
} | ||
.Red{ | ||
background-color: rgb(186, 80, 80); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{% extends "base.html" %} | ||
{% load static %} | ||
{% block content %} | ||
<head> | ||
<link rel="stylesheet" type="text/css" href="{% static 'css/read_article.css' %}"> | ||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" /> | ||
<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Anton&family=Zilla+Slab:wght@400;700&display=swap" rel="stylesheet"> | ||
|
||
</head> | ||
<main> | ||
<article> | ||
<header> | ||
<h2>{{article.title}}</h2> | ||
<div class="footer"> | ||
<p class="nickname"> 👤 {{article.user_id.nickname}} | ⌛ {{article.date}} </p> | ||
<p id="category"> | ||
<strong>Category</strong>: | ||
{% if article.subject_id == null %} | ||
Other | ||
{% else %} | ||
{{article.subject_id}} | ||
{% endif %} | ||
</p> | ||
<span class="material-symbols-outlined"> | ||
reviews | ||
</span> | ||
<p><strong> | ||
Views: {{ article.num_of_views }} | ||
</strong></p> | ||
</div> | ||
<hr> | ||
<p>{{article.content}}</p> | ||
</header> | ||
<footer> | ||
<hr> | ||
<form method="POST"> | ||
<div class="footer"> | ||
{% csrf_token %} | ||
|
||
{% if liked == False %} | ||
<button class="Green" type="submit" > | ||
Like | ||
</button> | ||
<input name='like_method' value='Add' hidden> | ||
{% else %} | ||
<button class="Red" type="submit" > | ||
Unlike | ||
</button> | ||
<input name='like_method' value='Remove' hidden> | ||
{% endif %} | ||
<p><strong> | ||
Likes: {{ article.num_of_likes }} | ||
</strong></p> | ||
</div> | ||
</form> | ||
</footer> | ||
</article> | ||
</main> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.