From 4bba2f5b755447da419873c3f8cb8fbc4fa84a9e Mon Sep 17 00:00:00 2001 From: Piotr Szkudlarek Date: Sun, 7 Jan 2024 00:24:35 +0100 Subject: [PATCH] Edit css properites --- PlanktonDetector/Community/froms.py | 1 + PlanktonDetector/Community/views.py | 6 ----- PlanktonDetector/PlanktonDetector/settings.py | 1 + PlanktonDetector/db.sqlite3 | Bin 479232 -> 479232 bytes .../static/Community/css/add_post.css | 25 ++++++++++++++++++ .../static/Community/css/list_posts.css | 1 - .../static/Community/css/post_details.css | 4 --- .../static/DetectionApp/css/base.css | 17 +++++++----- .../static/DetectionApp/css/history.css | 1 - .../static/DetectionApp/css/login_signup.css | 1 - .../static/DetectionApp/css/results.css | 2 -- .../static/DetectionApp/css/upload.css | 2 -- PlanktonDetector/templates/add_post.html | 4 +-- PlanktonDetector/templates/base.html | 2 ++ PlanktonDetector/templates/post_details.html | 4 +-- 15 files changed, 44 insertions(+), 27 deletions(-) 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 30fa830db9f8ab8baf1ffb705c26af8a4a1167b7..d4ec1d5f11e24a2377aa8cb78181c9554acd220b 100644 GIT binary patch delta 1045 zcmah{U2GIp6yEzYbGNgzGc3tUDNtrB3GQw>%wKnR`r<;R{saUK&J5M2EeWXu^vzNN>vqlIH{ndK8B$H$JGoIE!5`o!pH&KNW%hU~IEl^d(RbK%PK z`=2Sj+&O&I95Dv^Chb9csyt|$?WOMWq3**&d(Go}cJJ#tX?o*&sc)*MeY{|3hSjd= z?S}T)Qp+;(^~sBK+(!9H`9pbFeop#cdLReV2hx>#Vrg7T??C&(|LGALP1Wg(%9+*0 zV097vc_6WFOK|rA*a}cqsC`7>OPp{^_*|gA0=L(T$_}BwHH#y=oBr0QJvJ}8$ejzww~#`Pt8pK5^_21pY$gaogrOHAf^LWqI>F_e z@Uid?SYd$a;;KaT_u11n4XRcUap6 zN=ESl7oU&U;z6n(of4}>rIh3m1WalOt{Z~m1dFG!bA!3N%iM7bocOzVUknl&WbTNE zBLFgc#BC5}k2np&?7fG2xd8R@;7dg!Rz!YPT9Fd*H^l2=TkN#3Dws`YqifMO$xp;$ zayJm{@0`VS?kc|tazUoFNW+7d?6sA)@^E+9ZL6RDFle>O}Hg&z%xA+hx(W_hX11zA{cy!NerM<@aHjEtM5^tU+(nkpEY zTNxT!nV9HV7+V+{nQeZUU#+QNnpRkuYG9mNm0wX=SeRLsYFJTTkZ4()ZCa3Io?2lv zxn|}TPoKQ3P^%no%hbxEA|KO|O!LT);-G+{0JE?tkF?6DGIKK{%RD339E-#>^TNa^ zS0e)>6I}yCT|-MGOHIs74L4WLn#d}|*UzuaKZ!q=--GWa-#`BCd|NgPZYbu{RAKgI zB;+10kfO;AvlN`2;y1J63bM~?9IAjJNpHu=}bT|F6QYIt}?N1Uwf4)Jc?O^-*P(p2F5_3 z+aB_5x3p(I?Z6z$$2^^V0VBwOK;G@leawuHfQGJ{&R)O*68pomeO)a}*d?GCP+b5k zSRGG0b1dt2=2$ky!&2NFFB$lw`L^*1^5*ay=TYLW<+{OT%-P5B5~%w$2TP-38{_mw zZFa-y{^so5+ch=WZ?g%ou}d)UweWIq_izbtOktM*DrI43X{u-moxVVn-FQ1t=|%|v DAm5@# 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%} +

Footer

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%}