diff --git a/PlanktonDetector/Community/froms.py b/PlanktonDetector/Community/froms.py index 5cc041d..81b2950 100644 --- a/PlanktonDetector/Community/froms.py +++ b/PlanktonDetector/Community/froms.py @@ -6,6 +6,7 @@ class PostForm(forms.ModelForm): class Meta: model = Post fields = ["title", "content"] + labels = {"content": "Body"} class CommentForm(forms.ModelForm): diff --git a/PlanktonDetector/Community/views.py b/PlanktonDetector/Community/views.py index 2bfd4a6..d3f1bf4 100644 --- a/PlanktonDetector/Community/views.py +++ b/PlanktonDetector/Community/views.py @@ -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() diff --git a/PlanktonDetector/PlanktonDetector/settings.py b/PlanktonDetector/PlanktonDetector/settings.py index 37a3d56..7ec7a6f 100644 --- a/PlanktonDetector/PlanktonDetector/settings.py +++ b/PlanktonDetector/PlanktonDetector/settings.py @@ -40,6 +40,7 @@ INSTALLED_APPS = [ "django.contrib.staticfiles", "DetectionApp", "Community", + "ckeditor", ] MIDDLEWARE = [ diff --git a/PlanktonDetector/db.sqlite3 b/PlanktonDetector/db.sqlite3 index 30fa830..d4ec1d5 100644 Binary files a/PlanktonDetector/db.sqlite3 and b/PlanktonDetector/db.sqlite3 differ diff --git a/PlanktonDetector/static/Community/css/add_post.css b/PlanktonDetector/static/Community/css/add_post.css index e69de29..ce7c4bb 100644 --- a/PlanktonDetector/static/Community/css/add_post.css +++ b/PlanktonDetector/static/Community/css/add_post.css @@ -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; +} \ No newline at end of file diff --git a/PlanktonDetector/static/Community/css/list_posts.css b/PlanktonDetector/static/Community/css/list_posts.css index 274e4e6..2b5e61b 100644 --- a/PlanktonDetector/static/Community/css/list_posts.css +++ b/PlanktonDetector/static/Community/css/list_posts.css @@ -3,7 +3,6 @@ flex-direction: column; align-items: center; width: 100%; - height: 100%; } h2{ diff --git a/PlanktonDetector/static/Community/css/post_details.css b/PlanktonDetector/static/Community/css/post_details.css index 3a95ff6..b0a8d19 100644 --- a/PlanktonDetector/static/Community/css/post_details.css +++ b/PlanktonDetector/static/Community/css/post_details.css @@ -1,7 +1,3 @@ -body, html{ - height: unset; -} - .page-container{ display: flex; flex-direction: column; diff --git a/PlanktonDetector/static/DetectionApp/css/base.css b/PlanktonDetector/static/DetectionApp/css/base.css index d8b57bf..e1af334 100644 --- a/PlanktonDetector/static/DetectionApp/css/base.css +++ b/PlanktonDetector/static/DetectionApp/css/base.css @@ -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; +} \ No newline at end of file diff --git a/PlanktonDetector/static/DetectionApp/css/history.css b/PlanktonDetector/static/DetectionApp/css/history.css index 5fd10a0..e3ec088 100644 --- a/PlanktonDetector/static/DetectionApp/css/history.css +++ b/PlanktonDetector/static/DetectionApp/css/history.css @@ -3,7 +3,6 @@ flex-direction: column; align-items: center; width: 100%; - height: 100%; } h2{ diff --git a/PlanktonDetector/static/DetectionApp/css/login_signup.css b/PlanktonDetector/static/DetectionApp/css/login_signup.css index 934c4c5..a69dc1f 100644 --- a/PlanktonDetector/static/DetectionApp/css/login_signup.css +++ b/PlanktonDetector/static/DetectionApp/css/login_signup.css @@ -1,5 +1,4 @@ .form_div{ - height: 100%; width: 100%; display: flex; flex-direction: column; diff --git a/PlanktonDetector/static/DetectionApp/css/results.css b/PlanktonDetector/static/DetectionApp/css/results.css index 6511018..9692087 100644 --- a/PlanktonDetector/static/DetectionApp/css/results.css +++ b/PlanktonDetector/static/DetectionApp/css/results.css @@ -1,10 +1,8 @@ form{ - height:100%; width:100%; display:flex; flex-direction:row; - margin:auto; overflow:hidden; } diff --git a/PlanktonDetector/static/DetectionApp/css/upload.css b/PlanktonDetector/static/DetectionApp/css/upload.css index 55ef641..9cf58c9 100644 --- a/PlanktonDetector/static/DetectionApp/css/upload.css +++ b/PlanktonDetector/static/DetectionApp/css/upload.css @@ -1,10 +1,8 @@ form{ - height:100%; width:100%; display:flex; flex-direction:row; - margin:auto; overflow: hidden; } diff --git a/PlanktonDetector/templates/add_post.html b/PlanktonDetector/templates/add_post.html index 69e7ac2..7b8f77a 100644 --- a/PlanktonDetector/templates/add_post.html +++ b/PlanktonDetector/templates/add_post.html @@ -4,9 +4,9 @@ {%endblock extracss%} {%block content%} -
+ {% csrf_token %} {{ form.as_p }} - +
{%endblock content%} \ No newline at end of file diff --git a/PlanktonDetector/templates/base.html b/PlanktonDetector/templates/base.html index 42ece1c..ba03401 100644 --- a/PlanktonDetector/templates/base.html +++ b/PlanktonDetector/templates/base.html @@ -23,7 +23,9 @@ Login {%endif%} +
{%block content%}{%endblock content%} +
diff --git a/PlanktonDetector/templates/post_details.html b/PlanktonDetector/templates/post_details.html index e1a02af..b085729 100644 --- a/PlanktonDetector/templates/post_details.html +++ b/PlanktonDetector/templates/post_details.html @@ -14,14 +14,14 @@

{{object.author}}

-
+

Comments:

+
{%csrf_token%} {{form}}
-

Comments:

{%for comment in object.sorted_comments%}