Edit css properites
This commit is contained in:
parent
d23cdff3af
commit
4bba2f5b75
@ -6,6 +6,7 @@ class PostForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Post
|
||||
fields = ["title", "content"]
|
||||
labels = {"content": "Body"}
|
||||
|
||||
|
||||
class CommentForm(forms.ModelForm):
|
||||
|
@ -8,9 +8,6 @@ from .models import Post, Comment
|
||||
from .froms import PostForm, CommentForm
|
||||
|
||||
|
||||
# Create your views here.
|
||||
|
||||
|
||||
class ListPosts(ListView):
|
||||
model = Post
|
||||
template_name = "list_posts.html"
|
||||
@ -26,9 +23,6 @@ class PostDetails(DetailView, FormMixin):
|
||||
template_name = "post_details.html"
|
||||
form_class = CommentForm
|
||||
|
||||
# def get_queryset(self) -> QuerySet[Any]:
|
||||
# queryset = Post.objects.get(pk=self.request.GET.get("pk"))
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
self.object = self.get_object()
|
||||
form = self.get_form()
|
||||
|
@ -40,6 +40,7 @@ INSTALLED_APPS = [
|
||||
"django.contrib.staticfiles",
|
||||
"DetectionApp",
|
||||
"Community",
|
||||
"ckeditor",
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
|
Binary file not shown.
@ -0,0 +1,25 @@
|
||||
#add_post{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#add_post p{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
#submit{
|
||||
background-color: chartreuse;
|
||||
border-radius: 25px;
|
||||
border: 2px solid black;
|
||||
font-size: 20px;
|
||||
text-decoration: none;
|
||||
color:black;
|
||||
font-family: Arial;
|
||||
text-align: center;
|
||||
}
|
@ -3,7 +3,6 @@
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
h2{
|
||||
|
@ -1,7 +1,3 @@
|
||||
body, html{
|
||||
height: unset;
|
||||
}
|
||||
|
||||
.page-container{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
@ -1,7 +1,6 @@
|
||||
body, html{
|
||||
height:100%;
|
||||
min-height: 100%;
|
||||
margin: 35px 0px 0px 0px;
|
||||
body{
|
||||
min-height: 100vh;
|
||||
margin:0;
|
||||
display:flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
@ -33,8 +32,6 @@ body, html{
|
||||
|
||||
.footer{
|
||||
display:flex;
|
||||
position:relative;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
flex-direction: row;
|
||||
background-color: lightgray;
|
||||
@ -43,3 +40,11 @@ body, html{
|
||||
justify-content: space-evenly;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.root{
|
||||
padding:60px 0px 20px 0px;
|
||||
flex:1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: stretch;
|
||||
}
|
@ -3,7 +3,6 @@
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
h2{
|
||||
|
@ -1,5 +1,4 @@
|
||||
.form_div{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
@ -1,10 +1,8 @@
|
||||
|
||||
form{
|
||||
height:100%;
|
||||
width:100%;
|
||||
display:flex;
|
||||
flex-direction:row;
|
||||
margin:auto;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,8 @@
|
||||
|
||||
form{
|
||||
height:100%;
|
||||
width:100%;
|
||||
display:flex;
|
||||
flex-direction:row;
|
||||
margin:auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
<link rel="stylesheet" href="{% static 'Community/css/add_post.css' %}">
|
||||
{%endblock extracss%}
|
||||
{%block content%}
|
||||
<form method="post">
|
||||
<form method="POST" id="add_post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" value="Add post">
|
||||
<input type="submit" value="Add post" id="submit">
|
||||
</form>
|
||||
{%endblock content%}
|
@ -23,7 +23,9 @@
|
||||
<a href="{% url 'login' %}?next={{request.path}}">Login</a>
|
||||
{%endif%}
|
||||
</div>
|
||||
<div class="root">
|
||||
{%block content%}{%endblock content%}
|
||||
</div>
|
||||
<footer class="footer">
|
||||
<p>Footer</p>
|
||||
</footer>
|
||||
|
@ -14,14 +14,14 @@
|
||||
<p id="author">{{object.author}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="add_comment">
|
||||
<p id="comment-label">Comments:</p>
|
||||
<div id="add_comment">
|
||||
<form method="POST" id="comment_form">
|
||||
{%csrf_token%}
|
||||
{{form}}
|
||||
<input type="submit" id="submit" value="Add comment">
|
||||
</form>
|
||||
</div>
|
||||
<p id="comment-label">Comments:</p>
|
||||
<div class="comments">
|
||||
{%for comment in object.sorted_comments%}
|
||||
<div class="single-comment">
|
||||
|
Loading…
Reference in New Issue
Block a user