Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_casanatics
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
John Aidan Vincent M. Ng
midterm_casanatics
Commits
be1a2373
Commit
be1a2373
authored
May 06, 2023
by
Javi Ng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
created announcement-add template, NOTE: post-merge change announcement's body field into textfield
parent
72f9c57e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
views.cpython-310.pyc
...tics/announcement_board/__pycache__/views.cpython-310.pyc
+0
-0
announcement-add.html
..._board/templates/announcement_board/announcement-add.html
+18
-0
views.py
widget_casanatics/announcement_board/views.py
+2
-0
No files found.
widget_casanatics/announcement_board/__pycache__/views.cpython-310.pyc
View file @
be1a2373
No preview for this file type
widget_casanatics/announcement_board/templates/announcement_board/announcement-add.html
0 → 100644
View file @
be1a2373
{% extends 'base.html' %}
{% load static %}
{% block title %} Add Announcement {% endblock %}
{% block content %}
<h1>
Add a new announcement:
</h1>
<form
method=
"POST"
>
{% csrf_token %}
{% for field in form%}
<b>
{{ field.label }}:
</b>
{{ field }}
<br>
{% endfor %}
<button
type=
"submit"
>
Add Announcement
</button>
</form>
{% endblock %}
\ No newline at end of file
widget_casanatics/announcement_board/views.py
View file @
be1a2373
...
@@ -7,6 +7,8 @@ from django.views.generic.edit import CreateView, UpdateView
...
@@ -7,6 +7,8 @@ from django.views.generic.edit import CreateView, UpdateView
from
django.shortcuts
import
render
from
django.shortcuts
import
render
def
announcements
(
request
):
def
announcements
(
request
):
# use context to pass announcements sorted by pubdate
context
=
{
context
=
{
"announcement_list"
:
Announcement
.
objects
.
all
()
.
order_by
(
'pub_datetime'
),
"announcement_list"
:
Announcement
.
objects
.
all
()
.
order_by
(
'pub_datetime'
),
}
}
...
...
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