Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widgets_FEKK
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kyla Martin
widgets_FEKK
Commits
6cebb156
Commit
6cebb156
authored
May 04, 2022
by
Emmanuel Linus T. Evangelista
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add template for Forum post details, add static files, linked in urls
parent
9d067069
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
110 additions
and
2 deletions
+110
-2
details.css
WidgetFEKK/Forum/static/Forum/details.css
+34
-0
styles.css
WidgetFEKK/Forum/static/Forum/styles.css
+38
-0
thumbnail.jpg
WidgetFEKK/Forum/static/Forum/thumbnail.jpg
+0
-0
details.html
WidgetFEKK/Forum/templates/Forum/details.html
+26
-0
views.py
WidgetFEKK/Forum/views.py
+10
-2
urls.py
WidgetFEKK/WidgetFEKK/urls.py
+2
-0
No files found.
WidgetFEKK/Forum/static/Forum/details.css
0 → 100644
View file @
6cebb156
body
{
padding
:
64px
160px
;
}
#thumbnail
{
width
:
150px
;
height
:
150px
;
object-fit
:
cover
;
object-position
:
center
;
margin
:
0
0
16px
;
}
#title
{
margin
:
0
0
16px
;
}
#subtitle
{
margin
:
0
0
32px
;
}
.body-text
{
margin
:
0
0
64px
;
width
:
80%
;
}
.replies
{
padding
:
0
;
}
.replies
>
li
{
margin
:
0
0
16px
;
width
:
60%
;
}
\ No newline at end of file
WidgetFEKK/Forum/static/Forum/styles.css
0 → 100644
View file @
6cebb156
@import
url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=Montserrat:ital,wght@0,100;0,200;0,300;0,500;0,700;0,800;0,900;1,400;1,500&display=swap')
;
*
{
font-family
:
'Inter'
,
sans-serif
;
}
html
,
body
{
margin
:
0
;
}
h1
{
font-size
:
61.04px
;
}
h2
{
font-size
:
48.83px
;
}
h3
{
font-size
:
39.06px
;
}
h4
{
font-size
:
31.25px
;
}
h5
{
font-size
:
25.00px
;
}
h6
{
font-size
:
16.00px
;
}
:root
{
font-size
:
16.00px
;
}
\ No newline at end of file
WidgetFEKK/Forum/static/Forum/thumbnail.jpg
0 → 100644
View file @
6cebb156
126 KB
WidgetFEKK/Forum/templates/Forum/details.html
0 → 100644
View file @
6cebb156
{% extends "base.html" %}
{% load static %}
{% block styles %}
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static 'Forum/styles.css' %}"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static 'Forum/details.css' %}"
>
{% endblock %}
{% block title %}
{{ post.post_title }}
{% endblock %}
{% block content %}
<article>
<img
id=
"thumbnail"
src=
"{% static 'Forum/thumbnail.jpg' %}"
alt=
"placeholder image"
/>
<h1
id=
"title"
>
{{ post.post_title }}
</h1>
<h4
id=
"subtitle"
>
by {{ post.author.first_name }} {{ post.author.last_name }}, {{ post.pub_date|date:"m/d/Y" }}
</h4>
<p
class=
"body-text"
>
{{ post.post_body }}
</p>
<ul
class=
"replies"
>
{% for reply in post.reply_set.all %}
<li><strong>
{{ reply.author.first_name }} {{ reply.author.last_name }}, {{ reply.pub_date|date:"m/d/Y" }}:
</strong>
{{ reply.reply_body }}
</li>
{% endfor %}
</ul>
</article>
{% endblock %}
\ No newline at end of file
WidgetFEKK/Forum/views.py
View file @
6cebb156
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
,
Http404
from
django.shortcuts
import
render
from
.models
import
Post
,
Reply
def
get_readable_time
(
timestamp
):
...
...
@@ -21,4 +22,11 @@ def index(request):
out
+=
'<br />'
return
HttpResponse
(
out
)
\ No newline at end of file
return
HttpResponse
(
out
)
def
details
(
request
,
post_id
):
try
:
post
=
Post
.
objects
.
get
(
pk
=
post_id
)
except
Post
.
DoesNotExist
:
raise
Http404
(
'Post does not exist'
)
return
render
(
request
,
'Forum/details.html'
,
{
'post'
:
post
})
\ No newline at end of file
WidgetFEKK/WidgetFEKK/urls.py
View file @
6cebb156
...
...
@@ -15,10 +15,12 @@ Including another URLconf
"""
from
django.contrib
import
admin
from
django.urls
import
path
,
include
import
Forum.views
as
Forum_views
urlpatterns
=
[
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
'forum/'
,
include
(
'Forum.urls'
,
namespace
=
'Forum'
)),
path
(
'posts/<int:post_id>/details/'
,
Forum_views
.
details
,
name
=
'post_details'
),
path
(
'homepage/'
,
include
(
'Homepage.urls'
,
namespace
=
"Homepage"
)),
path
(
'announcements/'
,
include
(
'Announcements.urls'
,
namespace
=
"Announcements"
)),
path
(
'assignments/'
,
include
(
'Assignments.urls'
,
namespace
=
"Assignments"
)),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment