Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
final_quintupoltrobol
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
Matthew Karl David P. Arpas
final_quintupoltrobol
Commits
f0c42122
Commit
f0c42122
authored
May 14, 2023
by
Michael Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tried fixing the announcement-edit and announcement-add.html
parent
b6995a3c
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
21 additions
and
25 deletions
+21
-25
urls.cpython-39.pyc
...tupoltrobol/announcements/__pycache__/urls.cpython-39.pyc
+0
-0
views.cpython-39.pyc
...upoltrobol/announcements/__pycache__/views.cpython-39.pyc
+0
-0
announcement-add.html
...nouncements/templates/announcements/announcement-add.html
+3
-3
announcement-detail.html
...ncements/templates/announcements/announcement-detail.html
+2
-3
announcement-edit.html
...ouncements/templates/announcements/announcement-edit.html
+6
-7
announcements.html
.../announcements/templates/announcements/announcements.html
+1
-1
urls.py
widget_quintupoltrobol/announcements/urls.py
+1
-1
views.py
widget_quintupoltrobol/announcements/views.py
+8
-10
db.sqlite3
widget_quintupoltrobol/db.sqlite3
+0
-0
No files found.
widget_quintupoltrobol/announcements/__pycache__/urls.cpython-39.pyc
View file @
f0c42122
No preview for this file type
widget_quintupoltrobol/announcements/__pycache__/views.cpython-39.pyc
View file @
f0c42122
No preview for this file type
widget_quintupoltrobol/announcements/templates/announcements/announcement-add.html
View file @
f0c42122
{% extends "base.html" %}
{% extends "base.html" %}
{% load static %}
{% block title %}
{% block title %}
Add Announcement
Add Announcement
{% endblock %}
{% endblock %}
...
@@ -8,7 +8,7 @@ Add Announcement
...
@@ -8,7 +8,7 @@ Add Announcement
<h2>
Add a new announcement:
</h2>
<h2>
Add a new announcement:
</h2>
<p>
<p>
<form
action=
''
method=
"POST
"
>
<form
action=
"{% url 'announcements:announcement_details' %}"
method=
"post
"
>
{% csrf_token %}
{% csrf_token %}
<p>
Title: {{form.title}}
</p><br>
<p>
Title: {{form.title}}
</p><br>
<p>
Body:
<br>
{{form.body}}
</p><br>
<p>
Body:
<br>
{{form.body}}
</p><br>
...
@@ -17,4 +17,4 @@ Add Announcement
...
@@ -17,4 +17,4 @@ Add Announcement
</form>
</form>
</p>
</p>
{% endblock %}
{% endblock %}
\ No newline at end of file
widget_quintupoltrobol/announcements/templates/announcements/announcement-detail.html
View file @
f0c42122
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
Love: {{love_count}}
<br><br>
Love: {{love_count}}
<br><br>
Angry: {{angry_count}}
</p>
Angry: {{angry_count}}
</p>
<br>
<br>
<form
method=
"get"
action=
"{% url 'announcements:announcement_edit' pk=object.pk %}"
>
<button>
<a
href=
"{% url 'announcements:announcement_edit' object.pk %}"
>
Edit Announcement
</a></button>
<button
type=
"submit"
>
Edit Announcement
</button>
</form>
{% endblock %}
{% endblock %}
\ No newline at end of file
widget_quintupoltrobol/announcements/templates/announcements/announcement-edit.html
View file @
f0c42122
...
@@ -2,14 +2,13 @@
...
@@ -2,14 +2,13 @@
{% load static %}
{% load static %}
{% block title %} Edit Announcement {% endblock %}
{% block title %} Edit Announcement {% endblock %}
{% block content %}
{% block content %}
<h2>
Edit announcement:
</h2>
<form
method=
"post"
action=
""
>
<p>
<form
action=
''
method=
"POST"
>
{% csrf_token %}
{% csrf_token %}
<p>
Title: {{form.title}}
</p><br>
<p>
Title: {{form.title}}
</p><br>
<p>
Body:
<br>
{{form.body}}
</p><br>
<p>
Body:
<br>
{{form.body}}
</p><br>
<p>
Author: {{form.author}}
</p><br>
<p>
Author: {{form.author}}
</p><br>
<input
type=
"submit"
value=
"Save Changes to Announcement"
>
<input
type=
"submit"
value=
"Save Changes to Announcements"
>
</form>
</form>
</p>
{% endblock %}
{% endblock %}
\ No newline at end of file
widget_quintupoltrobol/announcements/templates/announcements/announcements.html
View file @
f0c42122
{% extends "base.html" %}
{% extends "base.html" %}
{% load static %}
{% block title %}
{% block title %}
Widget's Announcement Board
Widget's Announcement Board
{% endblock %}
{% endblock %}
...
...
widget_quintupoltrobol/announcements/urls.py
View file @
f0c42122
from
django.urls
import
path
from
django.urls
import
path
from
.views
import
*
from
.views
import
pageview
,
AnnouncementDetailView
,
AnnouncementCreateView
,
AnnouncementEditView
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
pageview
,
name
=
'pageview'
),
path
(
''
,
pageview
,
name
=
'pageview'
),
...
...
widget_quintupoltrobol/announcements/views.py
View file @
f0c42122
from
.forms
import
*
from
.forms
import
AddAnnouncement
from
.models
import
Announcement
,
Reaction
from
.models
import
Announcement
,
Reaction
from
django.views.generic
import
ListView
,
DetailView
,
CreateView
,
UpdateView
from
django.views.generic
import
ListView
,
DetailView
,
CreateView
,
UpdateView
from
django.db.models
import
Sum
from
django.db.models
import
Sum
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.urls
import
reverse
from
django.urls
import
reverse
from
.models
import
Announcement
def
pageview
(
request
):
def
pageview
(
request
):
model_object
=
Announcement
.
objects
.
order_by
(
"-pub_datetime"
)
model_object
=
Announcement
.
objects
.
order_by
(
"-pub_datetime"
)
...
@@ -31,10 +32,7 @@ class AnnouncementCreateView(CreateView):
...
@@ -31,10 +32,7 @@ class AnnouncementCreateView(CreateView):
model
=
Announcement
model
=
Announcement
form_class
=
AddAnnouncement
form_class
=
AddAnnouncement
template_name
=
"announcements/announcement-add.html"
template_name
=
"announcements/announcement-add.html"
def
form_valid
(
self
,
form
):
response
=
super
()
.
form_valid
(
form
)
form
.
save
()
return
response
def
get_success_url
(
self
):
def
get_success_url
(
self
):
return
reverse
(
"announcements:announcement_details"
,
args
=
(
self
.
object
.
pk
,))
return
reverse
(
"announcements:announcement_details"
,
args
=
(
self
.
object
.
pk
,))
...
@@ -42,10 +40,10 @@ class AnnouncementEditView(UpdateView):
...
@@ -42,10 +40,10 @@ class AnnouncementEditView(UpdateView):
model
=
Announcement
model
=
Announcement
form_class
=
AddAnnouncement
form_class
=
AddAnnouncement
template_name
=
"announcements/announcement-edit.html"
template_name
=
"announcements/announcement-edit.html"
def
form_valid
(
self
,
form
):
response
=
super
()
.
form_valid
(
form
)
form
.
save
()
return
response
def
get_success_url
(
self
):
def
get_success_url
(
self
):
return
reverse
(
"announcements:announcement_details"
,
args
=
(
self
.
object
.
pk
,))
return
reverse
(
"announcements:announcement_details"
,
kwargs
=
{
"pk"
:
self
.
object
.
pk
})
widget_quintupoltrobol/db.sqlite3
View file @
f0c42122
No preview for this file type
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