From da7488eaca84dca823fac31551f7e41474cd0323 Mon Sep 17 00:00:00 2001 From: Pomog Date: Sun, 7 Jan 2024 20:06:43 +0200 Subject: [PATCH] moderator --- README.md | 22 +++-- internal/handler/moderPanelHanlder.go | 51 ++++++++--- internal/handler/themeHandler.go | 3 + mainDB.db | Bin 327680 -> 327680 bytes ...0\275\320\260\321\201\321\216\320\272.jpe" | Bin 0 -> 4497 bytes static/post_images/yog.jpeg | Bin 0 -> 9398 bytes template/home.page.html | 7 +- template/moderMain.page.html | 63 ++++++++++++- template/theme.page.html | 86 ++++++++++-------- 9 files changed, 169 insertions(+), 63 deletions(-) create mode 100644 "static/ava/\320\256\321\200\320\270\320\271 \320\237\320\260\320\275\320\260\321\201\321\216\320\272.jpe" create mode 100644 static/post_images/yog.jpeg diff --git a/README.md b/README.md index 074e476..f1a9abf 100644 --- a/README.md +++ b/README.md @@ -18,15 +18,23 @@ This is a Web Application written in Golang, utilizing only standard [Go librari - [How to use Docker](docs/howToUsewDocker.md) ### User Management: -- User Registration: Users can create new accounts. -- Guest Registration: Allow guest users to access limited features or explore the platform without registration. -- Login System: Users can log in using their email and password credentials. +- **User Registration:** Users can create new accounts. +- **Guest Registration:** Allows guest users to access limited features or explore the platform without registration. +- **Login System:** Users can log in using their email and password credentials. +- The registered user can have types: user, moderator. +- To change the user type, registered users should use a Special Code in their personal cabinet. +#### User Types +- **Moderator:** Has special rights, including the ability to see all messages and change the classification for messages. ### Content Creation: -- Topic Creation: Users can create new discussion topics. - - Topic Creation with Image: Option to include images when creating topics. -- Post Creation: Users can contribute to discussions by creating posts. - - Post Creation with Image: Ability to attach images to posts. +- **Topic Creation:** Users can create new discussion topics. + - **Topic Creation with Image:** Option to include images when creating topics. +- **Post Creation:** Users can contribute to discussions by creating posts. + - **Post Creation with Image:** Ability to attach images to posts. +- Forum messages have classifications: unsorted, obscene, illegal, insulting, approved. +- Users without moderator rights can create unsorted messages. +- Users without moderator rights can see all their own messages and approved messages from other users. + ### Interaction Features: - Like/Dislike System: Users can like or dislike posts. diff --git a/internal/handler/moderPanelHanlder.go b/internal/handler/moderPanelHanlder.go index befc4e6..52f1110 100644 --- a/internal/handler/moderPanelHanlder.go +++ b/internal/handler/moderPanelHanlder.go @@ -39,22 +39,45 @@ func handlePostRequestModerPage(w http.ResponseWriter, r *http.Request, m *Repos } selectedCategory := r.FormValue("btnradio") - topicID, err := strconv.Atoi(r.FormValue("topicID")) - if err != nil { - setErrorAndRedirect(w, r, "Could not convert string into int "+err.Error(), "/error-page") - return - } - topic, err := m.DB.GetThreadByID(topicID) - if err != nil { - setErrorAndRedirect(w, r, "Could not get topic by id "+err.Error(), "/error-page") - return + + if r.FormValue("postID") != "" { + postID, err := strconv.Atoi(r.FormValue("postID")) + if err != nil { + setErrorAndRedirect(w, r, "Could not convert string into int "+err.Error(), "/error-page") + return + } + post, err := m.DB.GetPostByID(postID) + if err != nil { + setErrorAndRedirect(w, r, "Could not get post by id "+err.Error(), "/error-page") + return + } + cat := models.TextClassification(selectedCategory) + + err = m.DB.EditPostClassification(post, cat) + if err != nil { + setErrorAndRedirect(w, r, "Could not edit post classification "+err.Error(), "/error-page") + return + } } - cat := models.TextClassification(selectedCategory) - err = m.DB.EditTopicClassification(topic, cat) - if err != nil { - setErrorAndRedirect(w, r, "Could not edit topic classification "+err.Error(), "/error-page") - return + if r.FormValue("topicID") != "" { + topicID, err := strconv.Atoi(r.FormValue("topicID")) + if err != nil { + setErrorAndRedirect(w, r, "Could not convert string into int "+err.Error(), "/error-page") + return + } + topic, err := m.DB.GetThreadByID(topicID) + if err != nil { + setErrorAndRedirect(w, r, "Could not get topic by id "+err.Error(), "/error-page") + return + } + cat := models.TextClassification(selectedCategory) + + err = m.DB.EditTopicClassification(topic, cat) + if err != nil { + setErrorAndRedirect(w, r, "Could not edit topic classification "+err.Error(), "/error-page") + return + } } // Redirect back to the previous page (referer) diff --git a/internal/handler/themeHandler.go b/internal/handler/themeHandler.go index 365a6e0..16f0865 100644 --- a/internal/handler/themeHandler.go +++ b/internal/handler/themeHandler.go @@ -59,6 +59,8 @@ func (m *Repository) ThemeHandler(w http.ResponseWriter, r *http.Request) { return } + data["loggedAsID"] = visitorID + renderer.RendererTemplate(w, "theme.page.html", &models.TemplateData{ Data: data, }) @@ -250,6 +252,7 @@ func getPostsInfo(m *Repository, w http.ResponseWriter, r *http.Request, threadI info.UserPostsAmmount = userPostsAmount info.Likes = likes info.Dislikes = dislikes + info.Classification = post.Classification postsInfo = append(postsInfo, info) } diff --git a/mainDB.db b/mainDB.db index 738ec7374dec486503aee7ff499c34c5eacca8f1..1829a0eec29782e4b41751ac911408bb0e4ee9f2 100644 GIT binary patch delta 630 zcmX|;J#W)c6o&2CY2x(5RTPP#EnEZ$RjP{WrWyMKPWp4;~)O$!b+lzp5u{Ppw9akM5~^tFkPJyXm4; zGxP$sw4!P2THXXxD_MrFnGOas3&olV)~fVJYUFJvR|Cy*vbL6Ya<{coHmhrTUf0cn zT>{IoqmyS(7c&zj?Wc+77Y9_@|7j4M26=1VkJMLdv@cUNZ2h+Xhto=b>H7pt**y=aJ475_q^fl{11Y z;!_s3EXKWE)|hskkTel>d(FTDL>u6-zgqBcjf9v1a!ANRpcLr(|1=j=9syY#=VA|q zg!^3|+0X`$ACjXxfCD~ojZY>Xf2P|I)_@RAVLqGMT%MJ#=k#oM^=;x`tm}F}TR!E9z&@xP4=cwauNW_BQaP3<&Tm&0%3J^d delta 982 zcmYk4%}*0S7{+%?DU`3pz)g)Wk;Is=rQO|rdeDl|G=U%}7!wUncV~A8wmW5KmfBNW zi7{Lh(s1Cc2SbcTd+?5TZ~hnl0Un)gk$9M7^3FT+yuas}c6+wno;|!QA0J&=l8?W> z_^>!NEN#W)_tMsQY5daA;ZbL0=2ba1CUwgDS9MvQd`#=aEOmdVYpql&RpuP~oKPQ- z=fTR#>iWY6AS!Oi2x6Sg!7}DI7+7Qv1MxWp?qcu|$BcuI8w`+dL0Gq<3N#3JiQjK= zP>uKwG-%*iDR|-{4)~=>cvQ6T9`FJW5krVsdas>YRmH;mgz?X@Sk%K{7 zfbLKAe&oSjM8X;n@i5eB0|$2KL4b$_Rmzxv{>OtC`mh$ZG3s-;q<@Xt!b5S{bcKi5 zcOt~d6-FGN*u+FW2V|PGR`&>VBWSQ`0Cf*FaVuaT_D)DVi>09ApJ%|pBRd%WoAzQN zLEJwZj2+p-n<7%7-2}uKHHpZ=>SqBiaa`4l>;{wiQPc|%;N6e}(U6P>Ez#=`Q=HPk zBEH~?zCtuS52$G27}Z3EJ0Oy0p=n~qggruO;6lHZRyh(b?IABjRSye+1_~mYi%hbR zDVB_MDPzd7MaG4Sxmc%+Z;|d>o=9X;+jZ>pHVdaCGY3mUQDlctMPwW2fAu+A>;2ZN z@sUYMk|vc-Z{*IdlAKCN$x&GzpXqj1_a|b?sigc;PL-B&vp4B}Ynt^ln&7rs?ZzQy$ZRQG@v?>D5t47u;s0F)VsJfwN zjY3v4a_M64bnDsl?3pyVJN7OHqn}2##Gm2q_^fnx)cM$3V_zo5Ur!8=N(VP|xqPjs y%%fO$o?ZXej!#d-la<)mdh&D9PgZ*6JB6e?zh60dQ#p~viitJ!y>b%&ZvO=lJv^ZR diff --git "a/static/ava/\320\256\321\200\320\270\320\271 \320\237\320\260\320\275\320\260\321\201\321\216\320\272.jpe" "b/static/ava/\320\256\321\200\320\270\320\271 \320\237\320\260\320\275\320\260\321\201\321\216\320\272.jpe" new file mode 100644 index 0000000000000000000000000000000000000000..ec78b48bf7ee2575e012872a6c68f597dbb598af GIT binary patch literal 4497 zcmY*UcOctc+x{gnqp>}9YeXBw9!1rt5fKCt#I8}a_9|)1qgo|)>?k#2ml`#z)nT`4 zkE*KLqqMeC_3HP1?;qcN&biNZU-xycbI$4H=`6r%sE^hMKp+4Boekjh8z7+<>UjeI z&}a#O0r*SHfxrO$8R9!ze*@*~>+a=tru_^&03cv6lo`qdg|R?cn4wSxCg@qPLZK{Y zkm-zO_&<*2OaS|-~>29Kx_b*4Fq8Wopu0%XAh@={QcH{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zeTM3bsvjlP{K&0$FZu!=*%*Ha6g^+9!Nhu4SKhg2ckTQhbo9g1q^_wWIm@F$)I6{! z%wW_w3NTZgJiK03bFvCD1Yt?&q(u-D#N~T#mOpr>_!-=PF3KS5LRo$gv|xC;4#RId z*bo;b`oy*K+uVhHfB9toB`I$W6pPMa;TzZ-Wp4ja!T1J}&BrLajA-3T%-EL_WV`?T EU$YxToB#j- literal 0 HcmV?d00001 diff --git a/template/home.page.html b/template/home.page.html index 7439f9d..87e4fe3 100644 --- a/template/home.page.html +++ b/template/home.page.html @@ -1,6 +1,7 @@ {{template "body" .}} {{define "centralPart"}} +{{$loggedID := index .Data "loggedAsID"}}
@@ -8,7 +9,9 @@ {{$threadinfo := index .Data "threads"}} - {{$loggedID := index .Data "loggedAsID"}} + {{ range $threadinfo }} {{ if or (eq .UserID $loggedID) (eq .Classification "approved") }} @@ -83,7 +86,7 @@

What this topic will {{ $lastPostShorten := shortenPost .Posts}}
{{ $lastPostShorten}} {{ else }} - Be the first one to add post here... +

Be the first one to add post here...
{{end}} {{ $numOfPosts := numberOfPosts .Posts }} diff --git a/template/moderMain.page.html b/template/moderMain.page.html index 424500e..0eb13c0 100644 --- a/template/moderMain.page.html +++ b/template/moderMain.page.html @@ -1,6 +1,8 @@ {{template "body" .}} {{define "centralPart"}} + {{$posts := index .Data "posts"}} + {{$topics := index .Data "topics"}}
Moderator Main page
+ {{ range $posts }} + {{$postsCategory := .Classification}} + {{$postID := .ID}} + + + + + + + + +
+ + {{ end }} + + + {{ end }} + + {{if $topics}}
@@ -39,7 +97,6 @@

Select Thread Category:


Category: {{ .Category}}
{{ .Subject }} - diff --git a/template/theme.page.html b/template/theme.page.html index 9d052b9..4204bf2 100644 --- a/template/theme.page.html +++ b/template/theme.page.html @@ -5,6 +5,7 @@ {{end}} {{define "centralPart"}} {{$threadID :=index .Data "mainThreadID"}} +{{$loggedID := index .Data "loggedAsID"}}
@@ -13,7 +14,9 @@ {{ if $threadID}}
+ {{ if ne 1 $loggedID}} + {{end}}
{{ end }}
@@ -73,12 +76,13 @@

Topic:

{{ end }}

{{index .Data "mainThreadName"}}
- + {{ if and (ne $loggedID 1) (eq $creatorID $loggedID) }}
+ {{end}}
Created: {{index .Data "mainThreadCreatedTime"}}
@@ -94,44 +98,52 @@

Topic:

{{$postinfo := index .Data "posts"}} {{ range $postinfo }} - - - - + + + - + {{ if .Image }} + post_img + {{ end }}

+ + {{ .Content }}  + {{ if and (ne $loggedID 1) (eq $postCreatorID $loggedID) }} + + + + + {{end}} +
+ Posted: {{ .Created }}
+
+ {{ if ne 1 $loggedID}} +
+ + + +    +
+ + + + {{ end }} +
+
+ + + {{ end }} {{ end }}