Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_group17
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
Vaughn Nephi Fajardo
widget_group17
Commits
3699ce39
Commit
3699ce39
authored
May 21, 2022
by
Neal Berones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed new functionfrom views.py in announcements app
parent
aba83414
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
8 deletions
+25
-8
urls.cpython-310.pyc
...t_group_17/announcements/__pycache__/urls.cpython-310.pyc
+0
-0
views.cpython-310.pyc
..._group_17/announcements/__pycache__/views.cpython-310.pyc
+0
-0
add.html
...t_group_17/announcements/templates/announcements/add.html
+25
-0
urls.py
widget_group_17/announcements/urls.py
+0
-1
views.py
widget_group_17/announcements/views.py
+0
-7
No files found.
widget_group_17/announcements/__pycache__/urls.cpython-310.pyc
View file @
3699ce39
No preview for this file type
widget_group_17/announcements/__pycache__/views.cpython-310.pyc
View file @
3699ce39
No preview for this file type
widget_group_17/announcements/templates/announcements/
new
.html
→
widget_group_17/announcements/templates/announcements/
add
.html
View file @
3699ce39
...
...
@@ -3,8 +3,23 @@
{% block page-title %}Add New Announcement{% endblock %}
{% block content %}
<script>
function
createUserOptions
(){
var
useroptions
=
"<option value = "
0
">Select</option>"
;
for
(
user
in
user_list
){
useroptions
+=
"<option value="
+
user
.
first_name
+
">"
+
user
.
first_name
+
" "
+
user
.
last_name
+
"</option>"
}
document
.
getElementById
(
'author'
).
innerHTML
=
useroptions
;
}
</script>
<h1>
New Announcement
</h1>
<form
action=
"announcements/add"
method=
"POST"
>
<h2>
Announcement Title:
</h2><input
type=
"text"
name=
"announcement_title"
>
<h2>
Announcement Body:
</h2><input
type=
"text"
name=
"announcement_body"
>
<h2>
<label
for=
"author"
>
Author
</label>
<select
id=
"author"
></select>
</h2>
</form>
{% endblock %}
widget_group_17/announcements/urls.py
View file @
3699ce39
...
...
@@ -4,7 +4,6 @@ from . import views
app_name
=
"announcements"
urlpatterns
=
[
path
(
''
,
views
.
index
,
name
=
'index'
),
path
(
'announcements/new/'
,
views
.
new
,
name
=
'new'
),
path
(
'announcements/add/'
,
views
.
add
,
name
=
'add'
),
path
(
'<int:announcement_id>/details'
,
views
.
detail
,
name
=
"detail"
)
#path('welcome', views.welcome, name='welcome')
...
...
widget_group_17/announcements/views.py
View file @
3699ce39
...
...
@@ -39,13 +39,6 @@ def detail(request, announcement_id):
}
return
render
(
request
,
"announcements/details.html"
,
context
)
def
new
(
request
):
user_list
=
WidgetUser
.
objects
.
all
()
context
=
{
"user_list"
:
user_list
}
return
render
(
request
,
"announcements/new.html"
,
context
)
def
add
(
request
):
if
request
.
method
==
"POST"
:
announcement_title
=
request
.
POST
.
get
(
"announcement_title"
)
...
...
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