Commit c131634b authored by Washington99's avatar Washington99

Final Touch ups

Added More css to the webpages. Removed unnecessary comments in code.
parent 4c57678c
body{
background-color: red
background-color: orange
}
#additional{
padding: 10px;
background-color: whitesmoke;
font-family: Verdana, Geneva, Tahoma, sans-serif;
box-shadow: 0px 2px 10px 0px rgb(80, 37, 21);
margin-left: 10%;
margin-right: 10%;
text-align: center;
border-style: double;
border-radius: 5px;
border-color: rgb(117, 54, 31);
border-width: 10px;
}
div.content{
padding: 10px;
background-color: whitesmoke;
font-family: Verdana, Geneva, Tahoma, sans-serif;
box-shadow: 50px;
margin-left: 20%;
margin-right: 20%;
text-align: center;
border-style: solid;
border-radius: 5px;
border-color: rgb(117, 54, 31);
border-width: 2px;
padding-bottom: 20px;
}
a.navBtn{
padding: 10px;
border-radius: 5px;
border-color: rgb(117, 54, 31);
border-width: 2px;
border-style: groove;
a{
font-color: red;
}
input[type=submit]{
background-color: rgb(58, 24, 2);
background-color: yellow;
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Add New Author</title>
</head>
<body>
{% extends 'base.html' %}
{% load static %}
{% block title %}Add New Author{% endblock %}
{% block content %}
{{ form.non_field_errors }}
{% for field in form %}
{% if field.errors %}
......@@ -18,8 +20,8 @@
{% endfor %}
<form method="post">
{% csrf_token %}
{{ form }}
{{ form.as_p }}
<input type="submit" value="Add Author">
</form>
</body>
</html>
\ No newline at end of file
{% endblock %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Add New Book</title>
</head>
<body>
{% extends 'base.html' %}
{% load static %}
{% block title %}Add New Book{% endblock %}
{% block content %}
{{ form.non_field_errors }}
{% for field in form %}
{% if field.errors %}
......@@ -18,8 +19,7 @@
{% endfor %}
<form method="post">
{% csrf_token %}
{{ form }}
{{ form.as_p }}
<input type="submit" value="Add Book">
</form>
</body>
</html>
\ No newline at end of file
{% endblock %}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Edit Author</title>
</head>
<body>
{% extends 'base.html' %}
{% load static %}
{% block title %}Edit Author{% endblock %}
{% block content %}
{{ form.non_field_errors }}
{% for field in form %}
{% if field.errors %}
......@@ -18,8 +19,7 @@
{% endfor %}
<form method="post">
{% csrf_token %}
{{ form }}
{{ form.as_p }}
<input type="submit" value="Save Changes">
</form>
</body>
</html>
\ No newline at end of file
{% endblock %}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Edit Book</title>
</head>
<body>
{% extends 'base.html' %}
{% load static %}
{% block title %}Edit Author{% endblock %}
{% block content %}
{{ form.non_field_errors }}
{% for field in form %}
{% if field.errors %}
......@@ -18,8 +19,17 @@
{% endfor %}
<form method="post">
{% csrf_token %}
{{ form }}
{{ form.as_p }}
<input type="submit" value="Save Changes">
</form>
{% endblock %}
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Edit Book</title>
</head>
<body>
</body>
</html>
\ No newline at end of file
......@@ -30,17 +30,16 @@ class BookView(DetailView):
class AuthorCreateView(CreateView):
model = Author
form = AuthorForm # Can be removed?
form = AuthorForm
fields = '__all__'
template_name = 'bookshelf/add-author.html'
def post(self, request, *args, **kwargs):
form = AuthorForm(request.POST) # Create a Form object from the POST values
form = AuthorForm(request.POST)
if form.is_valid():
new_author = form.save()
redirect_link = "../" + new_author.get_absolute_url() + "/details/"
return HttpResponseRedirect(redirect_link)
# return self.get(request, *args, **kwargs)
else:
return render(request, self.template_name, {'form': form})
......@@ -53,17 +52,16 @@ class AuthorEditView(UpdateView):
class BooksCreateView(CreateView):
model = Books
form = BookForm # Can be removed?
form = BookForm
fields = '__all__'
template_name = 'bookshelf/add-book.html'
def post(self, request, *args, **kwargs):
form = BookForm(request.POST) # Create a Form object from the POST values
form = BookForm(request.POST)
if form.is_valid():
new_book = form.save()
redirect_link = "../" + new_book.get_absolute_url() + "/details/"
return HttpResponseRedirect(redirect_link)
# return self.get(request, *args, **kwargs)
else:
return render(request, self.template_name, {'form': form})
......@@ -73,9 +71,4 @@ class BooksEditView(UpdateView):
template_name = 'bookshelf/edit-book.html'
success_url = "../details/"
# def update(self, request, *args, **kwargs):
# form = BookForm(request.POST)
# if form.is_valid():
# self.model.get_absolute_url()
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