Commit 3699ce39 authored by Neal Berones's avatar Neal Berones

removed new functionfrom views.py in announcements app

parent aba83414
......@@ -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 %}
......@@ -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')
......
......@@ -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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment