diff --git a/VKAPI/Handlers/Groups.php b/VKAPI/Handlers/Groups.php index 5a5487da..ce243221 100644 --- a/VKAPI/Handlers/Groups.php +++ b/VKAPI/Handlers/Groups.php @@ -91,11 +91,8 @@ final class Groups extends VKAPIRequestHandler $rClubs[$i]->suggested_count = NULL; break; } - - if($usr->canBeModifiedBy($this->getUser())) - $rClubs[$i]->suggested_count = $usr->getSuggestedPostsCount(); - else - $rClubs[$i]->suggested_count = (new PostsRepo)->getSuggestedPostsCountByUser($usr->getId(), $this->getUser()->getId()); + + $rClubs[$i]->suggested_count = $usr->getSuggestedPostsCount($this->getUser()); break; } @@ -215,11 +212,7 @@ final class Groups extends VKAPIRequestHandler break; } - if($clb->canBeModifiedBy($this->getUser())) - $response[$i]->suggested_count = $clb->getSuggestedPostsCount(); - else - $response[$i]->suggested_count = (new PostsRepo)->getSuggestedPostsCountByUser($clb->getId(), $this->getUser()->getId()); - + $response[$i]->suggested_count = $clb->getSuggestedPostsCount($this->getUser()); break; case "contacts": $contacts; diff --git a/VKAPI/Handlers/Wall.php b/VKAPI/Handlers/Wall.php index 4242d46e..0762f730 100644 --- a/VKAPI/Handlers/Wall.php +++ b/VKAPI/Handlers/Wall.php @@ -49,13 +49,13 @@ final class Wall extends VKAPIRequestHandler $cnt = $posts->getPostCountOnUserWall($owner_id); break; case "owner": - $this->fail(66666, "Not implemented"); + $this->fail(42, "Not implemented"); break; case "others": - $this->fail(66666, "Not implemented"); + $this->fail(42, "Not implemented"); break; case "postponed": - $this->fail(66666, "Postponed posts are not implemented."); + $this->fail(42, "Postponed posts are not implemented."); break; case "suggests": if($owner_id < 0) { diff --git a/Web/Models/Entities/Club.php b/Web/Models/Entities/Club.php index 751ccb44..88e8e976 100644 --- a/Web/Models/Entities/Club.php +++ b/Web/Models/Entities/Club.php @@ -194,7 +194,7 @@ class Club extends RowModel function setWall(int $type) { - if($type > 3 || $type < 0) + if($type > 2 || $type < 0) throw new \LogicException("Invalid wall"); $this->stateChanges("wall", $type); @@ -309,9 +309,19 @@ class Club extends RowModel } } - function getSuggestedPostsCount() + function getSuggestedPostsCount(User $user = NULL) { - $count = (new Posts)->getSuggestedPostsCount($this->getId()); + $count = 0; + + if(is_null($user)) { + return NULL; + } + + if($this->canBeModifiedBy($user)) { + $count = (new Posts)->getSuggestedPostsCount($this->getId()); + } else { + $count = (new Posts)->getSuggestedPostsCountByUser($this->getId(), $user->getId()); + } return $count; } diff --git a/Web/Presenters/GroupPresenter.php b/Web/Presenters/GroupPresenter.php index 4dd79c11..12f6ce80 100644 --- a/Web/Presenters/GroupPresenter.php +++ b/Web/Presenters/GroupPresenter.php @@ -225,7 +225,7 @@ final class GroupPresenter extends OpenVKPresenter try { $club->setWall(empty($this->postParam("wall")) ? 0 : (int)$this->postParam("wall")); } catch(\Exception $e) { - $this->flashFail("err", "Fuck you", ""); + $this->flashFail("err", tr("error"), tr("error_invalid_wall_value")); } $club->setAdministrators_List_Display(empty($this->postParam("administrators_list_display")) ? 0 : $this->postParam("administrators_list_display")); diff --git a/Web/Presenters/templates/@layout.xml b/Web/Presenters/templates/@layout.xml index 389415bb..d962253d 100644 --- a/Web/Presenters/templates/@layout.xml +++ b/Web/Presenters/templates/@layout.xml @@ -233,9 +233,9 @@ {$club->getName()} - + - ({$club->getSuggestedPostsCount()}) + ({$club->getSuggestedPostsCount($thisUser)}) diff --git a/locales/en.strings b/locales/en.strings index f4a2fb56..9d6cfd51 100644 --- a/locales/en.strings +++ b/locales/en.strings @@ -1181,6 +1181,7 @@ "post_is_empty_or_too_big" = "The post is empty or too big."; "post_is_too_big" = "The post is too big."; "error_deleting_suggested" = "You can't delete your accepted post"; +"error_invalid_wall_value" = "Invalid wall value"; /* Admin actions */ diff --git a/locales/ru.strings b/locales/ru.strings index 87c966e4..fd464deb 100644 --- a/locales/ru.strings +++ b/locales/ru.strings @@ -1081,6 +1081,7 @@ "post_is_empty_or_too_big" = "Пост пустой или слишком большой."; "post_is_too_big" = "Пост слишком большой."; "error_deleting_suggested" = "Вы не можете удалить ваш принятый пост"; +"error_invalid_wall_value" = "Некорректное значение стены"; /* Admin actions */ diff --git a/themepacks/midnight/stylesheet.css b/themepacks/midnight/stylesheet.css index 634917c6..dde8442c 100644 --- a/themepacks/midnight/stylesheet.css +++ b/themepacks/midnight/stylesheet.css @@ -241,4 +241,17 @@ input[type="radio"] { #backdropEditor { background-image: url("/themepack/midnight/0.0.2.8/resource/backdrop-editor.gif") !important; border-color: #473e66 !important; -} \ No newline at end of file +} + +.sugglist { + background-color: #231e33; + border-color: #2c2640 !important; +} + +.sugglist a { + color: #7c94c5; +} + +.button.loaded { + background: #383052 url("/assets/packages/static/openvk/img/loading_mini.gif") no-repeat 50% 50% !important; +} diff --git a/themepacks/openvk_modern/stylesheet.css b/themepacks/openvk_modern/stylesheet.css index 178e8094..9a280cec 100644 --- a/themepacks/openvk_modern/stylesheet.css +++ b/themepacks/openvk_modern/stylesheet.css @@ -47,13 +47,13 @@ body { .content_title_expanded { cursor: pointer; - background-image: unset; + background-image: unset !important; padding: 3px 10px; border-top: #e6e6e6 solid 1px; } .content_title_unexpanded { - background-image: unset; + background-image: unset !important; padding: 3px 10px; border-top: #eee solid 1px; } @@ -337,3 +337,8 @@ input[type=checkbox] { { border-top: 1px solid #2f2f2f; } + +.sugglist { + border-top: unset; + border-bottom: 1px solid gray; +}