Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_Alipins
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
Angelico Ruiz T. Teaño
widget_Alipins
Commits
917803c2
Commit
917803c2
authored
May 25, 2022
by
Christian Sarabia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated visual elements and CSS
parent
e4182b16
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
38 additions
and
36 deletions
+38
-36
db.sqlite3
widget_alipins/db.sqlite3
+0
-0
forms.py
widget_alipins/forum/forms.py
+1
-9
models.py
widget_alipins/forum/models.py
+3
-0
index.html
widget_alipins/forum/templates/forum/index.html
+1
-1
views.py
widget_alipins/forum/views.py
+7
-3
forms.py
widget_alipins/homepage/forms.py
+0
-9
widgetuser_detail.html
...lipins/homepage/templates/homepage/widgetuser_detail.html
+0
-6
widgetuser_form.html
..._alipins/homepage/templates/homepage/widgetuser_form.html
+1
-8
style.css
widget_alipins/static/forum/style.css
+25
-0
No files found.
widget_alipins/db.sqlite3
View file @
917803c2
No preview for this file type
widget_alipins/forum/forms.py
View file @
917803c2
from
django
import
forms
from
homepage.models
import
WidgetUser
from
.models
import
Post
class
AddForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
Post
fields
=
"__all__"
# post_title = forms.CharField(label='Title', max_length=50)
# post_body = forms.CharField(label='Body', max_length=1500, widget=forms.Textarea)
# # pub_date = models.DateTimeField("date published")
# author = forms.ModelChoiceField(label='Author', queryset=WidgetUser.objects.all())
# post_image = forms.ImageField(required=False)
\ No newline at end of file
fields
=
"__all__"
\ No newline at end of file
widget_alipins/forum/models.py
View file @
917803c2
...
...
@@ -12,6 +12,9 @@ class Post(models.Model):
def
__str__
(
self
):
return
self
.
post_title
def
get_absolute_url
(
self
):
return
u'
%
d/details'
%
self
.
pk
class
Reply
(
models
.
Model
):
post
=
models
.
ForeignKey
(
Post
,
on_delete
=
models
.
CASCADE
)
...
...
widget_alipins/forum/templates/forum/index.html
View file @
917803c2
...
...
@@ -18,7 +18,7 @@
{% else %}
<p>
There is no post.
</p>
{% endif %}
<
li><a
href=
"/forum/add"
>
Write a new forum post...
</a></li
>
<
button
onclick=
"window.location.href='/forum/add'"
"
>
Write a new forum post
</button
>
</ul>
</div>
{% endblock %}
\ No newline at end of file
widget_alipins/forum/views.py
View file @
917803c2
...
...
@@ -36,8 +36,12 @@ class AddView(View):
if
form
.
is_valid
():
print
(
form
.
cleaned_data
[
'post_title'
])
form
.
save
()
post
=
Post
.
objects
.
latest
(
'id'
)
replies
=
Reply
.
objects
.
filter
(
post
=
post
)
.
order_by
(
"-pub_date"
)
context
=
{
'form'
:
form
}
return
render
(
request
,
'forum/add.html'
,
context
)
context
=
{
"post"
:
post
,
"replies"
:
replies
}
return
render
(
request
,
"forum/detail.html"
,
context
)
widget_alipins/homepage/forms.py
deleted
100644 → 0
View file @
e4182b16
from
statistics
import
mode
from
django
import
forms
from
.models
import
WidgetUser
class
WidgetUserForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
WidgetUser
fields
=
[
'last_name'
,
'first_name'
,
'middle_name'
,
'id_num'
,
'email'
,
'department'
,
'image'
]
\ No newline at end of file
widget_alipins/homepage/templates/homepage/widgetuser_detail.html
View file @
917803c2
...
...
@@ -7,12 +7,6 @@
{% block title %}{{object.pk}}{% endblock %}
{% block content %}
<nav
class=
"topnav"
>
<a
href=
"{% url 'homepage:indexHomepage' %}"
>
Homepage
</a>
<a
href=
"{% url 'announcements:indexAnnouncements' %}"
>
Announcements
</a>
<a
href=
"{% url 'forum:indexForum' %}"
>
Forum
</a>
<a
href=
"{% url 'assignments:indexAssignments' %}"
>
Assignments
</a>
</nav>
<div
class=
"flex-container"
>
<div
class=
"user-card"
>
...
...
widget_alipins/homepage/templates/homepage/widgetuser_form.html
View file @
917803c2
...
...
@@ -5,15 +5,8 @@
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static 'homepage/style.css' %}"
>
{% endblock %}
{% block title %}
{{object.pk}}
{% endblock %}
{% block title %}
New Widget User
{% endblock %}
{% block content %}
<nav
class=
"topnav"
>
<a
href=
"{% url 'homepage:indexHomepage' %}"
>
Homepage
</a>
<a
href=
"{% url 'announcements:indexAnnouncements' %}"
>
Announcements
</a>
<a
href=
"{% url 'forum:indexForum' %}"
>
Forum
</a>
<a
href=
"{% url 'assignments:indexAssignments' %}"
>
Assignments
</a>
</nav>
<div
class=
"flex-container"
>
<form
method=
"POST"
enctype=
"multipart/form-data"
>
{% csrf_token %}
...
...
widget_alipins/static/forum/style.css
View file @
917803c2
...
...
@@ -2,12 +2,14 @@ body {
font-family
:
sans-serif
,
Arial
,
Helvetica
;
color
:
#035700
;
line-height
:
2
;
background-color
:
rgb
(
230
,
253
,
228
);
}
div
{
margin
:
auto
;
width
:
50%
;
border
:
3px
solid
rgb
(
194
,
7
,
169
);
border-radius
:
10px
;
padding
:
30px
40px
40px
40px
;
}
...
...
@@ -50,4 +52,27 @@ img {
a
{
color
:
#891fa3
;
}
input
[
type
=
submit
],
button
{
width
:
40%
;
background-color
:
#ff91f0
;
padding
:
5px
;
margin
:
25px
0px
0px
0px
;
border
:
none
;
border-radius
:
18px
;
cursor
:
pointer
;
font-family
:
sans-serif
,
Arial
,
Helvetica
;
font-size
:
18px
;
color
:
#2d384e
;
line-height
:
2
;
float
:
right
;
}
input
[
type
=
submit
]
:hover
,
button
:hover
{
background-color
:
#fcaef1
;
}
textarea
,
input
{
border-radius
:
5px
;
}
\ No newline at end of file
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