浏览代码

Update moderation page

Visman 3 年之前
父节点
当前提交
c1180f8699
共有 6 个文件被更改,包括 49 次插入23 次删除
  1. 11 9
      app/Models/Pages/Moderate.php
  2. 2 2
      app/Models/Pages/Topic.php
  3. 3 0
      app/lang/en/common.po
  4. 15 6
      app/lang/en/misc.po
  5. 3 0
      app/lang/ru/common.po
  6. 15 6
      app/lang/ru/misc.po

+ 11 - 9
app/Models/Pages/Moderate.php

@@ -272,6 +272,8 @@ class Moderate extends Page
             );
             );
         }
         }
 
 
+        $this->single = 1 === \count($objects);
+
         return $this->{'action' . \ucfirst($v->action)}($objects, $v);
         return $this->{'action' . \ucfirst($v->action)}($objects, $v);
     }
     }
 
 
@@ -284,8 +286,8 @@ class Moderate extends Page
     {
     {
         switch ($v->step) {
         switch ($v->step) {
             case 1:
             case 1:
-                $this->formTitle   = __('Open topics');
-                $this->buttonValue = __('Open');
+                $this->formTitle   = __($this->single ? 'Open topic title' : 'Open topics title');
+                $this->buttonValue = __($this->single ? 'Open topic btn' : 'Open topics btn');
                 $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->form        = $this->formConfirm($topics, $v);
                 $this->form        = $this->formConfirm($topics, $v);
 
 
@@ -294,7 +296,7 @@ class Moderate extends Page
                 if (1 === $v->confirm) {
                 if (1 === $v->confirm) {
                     $this->c->topics->access(true, ...$topics);
                     $this->c->topics->access(true, ...$topics);
 
 
-                    $message = 1 === \count($topics) ? 'Open topic redirect' : 'Open topics redirect';
+                    $message = $this->single ? 'Open topic redirect' : 'Open topics redirect';
 
 
                     return $this->c->Redirect->url($this->backLink)->message($message);
                     return $this->c->Redirect->url($this->backLink)->message($message);
                 } else {
                 } else {
@@ -309,8 +311,8 @@ class Moderate extends Page
     {
     {
         switch ($v->step) {
         switch ($v->step) {
             case 1:
             case 1:
-                $this->formTitle   = __('Close topics');
-                $this->buttonValue = __('Close');
+                $this->formTitle   = __($this->single ? 'Close topic title' : 'Close topics title');
+                $this->buttonValue = __($this->single ? 'Close topic btn' : 'Close topics btn');
                 $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->crumbs      = $this->crumbs($this->formTitle, __('Moderate'), $v->topic ? $this->curTopic : $this->curForum);
                 $this->form        = $this->formConfirm($topics, $v);
                 $this->form        = $this->formConfirm($topics, $v);
 
 
@@ -319,7 +321,7 @@ class Moderate extends Page
                 if (1 === $v->confirm) {
                 if (1 === $v->confirm) {
                     $this->c->topics->access(false, ...$topics);
                     $this->c->topics->access(false, ...$topics);
 
 
-                    $message = 1 === \count($topics) ? 'Close topic redirect' : 'Close topics redirect';
+                    $message = $this->single ? 'Close topic redirect' : 'Close topics redirect';
 
 
                     return $this->c->Redirect->url($this->backLink)->message($message);
                     return $this->c->Redirect->url($this->backLink)->message($message);
                 } else {
                 } else {
@@ -392,7 +394,7 @@ class Moderate extends Page
                     $forum = $this->c->forums->get($v->destination);
                     $forum = $this->c->forums->get($v->destination);
                     $this->c->topics->move(1 === $v->redirect, $forum, ...$topics);
                     $this->c->topics->move(1 === $v->redirect, $forum, ...$topics);
 
 
-                    $message = 1 === \count($topics) ? 'Move topic redirect' : 'Move topics redirect';
+                    $message = $this->single ? 'Move topic redirect' : 'Move topics redirect';
 
 
                     return $this->c->Redirect->url($this->curForum->link)->message($message);
                     return $this->c->Redirect->url($this->curForum->link)->message($message);
                 } else {
                 } else {
@@ -456,7 +458,7 @@ class Moderate extends Page
                         $this->c->topics->update($topic);
                         $this->c->topics->update($topic);
                     }
                     }
 
 
-                    $message = 1 === \count($topics) ? 'Unstick topic redirect' : 'Unstick topics redirect';
+                    $message = $this->single ? 'Unstick topic redirect' : 'Unstick topics redirect';
 
 
                     return $this->c->Redirect->url($this->backLink)->message($message);
                     return $this->c->Redirect->url($this->backLink)->message($message);
                 } else {
                 } else {
@@ -484,7 +486,7 @@ class Moderate extends Page
                         $this->c->topics->update($topic);
                         $this->c->topics->update($topic);
                     }
                     }
 
 
-                    $message = 1 === \count($topics) ? 'Stick topic redirect' : 'Stick topics redirect';
+                    $message = $this->single ? 'Stick topic redirect' : 'Stick topics redirect';
 
 
                     return $this->c->Redirect->url($this->backLink)->message($message);
                     return $this->c->Redirect->url($this->backLink)->message($message);
                 } else {
                 } else {

+ 2 - 2
app/Models/Pages/Topic.php

@@ -211,13 +211,13 @@ class Topic extends Page
             $form['btns']['open'] = [
             $form['btns']['open'] = [
                 'class'     => ['origin'],
                 'class'     => ['origin'],
                 'type'      => 'submit',
                 'type'      => 'submit',
-                'value'     => __('Open topic'),
+                'value'     => __('Open topic btn'),
             ];
             ];
         } else {
         } else {
             $form['btns']['close'] = [
             $form['btns']['close'] = [
                 'class'     => ['origin'],
                 'class'     => ['origin'],
                 'type'      => 'submit',
                 'type'      => 'submit',
-                'value'     => __('Close topic'),
+                'value'     => __('Close topic btn'),
             ];
             ];
         }
         }
 
 

+ 3 - 0
app/lang/en/common.po

@@ -49,6 +49,9 @@ msgstr "Operation cancelled."
 msgid "No confirm redirect"
 msgid "No confirm redirect"
 msgstr "No confirmation provided. Operation cancelled."
 msgstr "No confirmation provided. Operation cancelled."
 
 
+msgid "Confirm action"
+msgstr "Confirm action"
+
 msgid "Forum rules"
 msgid "Forum rules"
 msgstr "Forum rules"
 msgstr "Forum rules"
 
 

+ 15 - 6
app/lang/en/misc.po

@@ -249,14 +249,17 @@ msgstr "Action not available."
 msgid "No object selected"
 msgid "No object selected"
 msgstr "You must select at least one object for the action."
 msgstr "You must select at least one object for the action."
 
 
-msgid "Open topics"
+msgid "Open topics title"
 msgstr "Open topics"
 msgstr "Open topics"
 
 
-msgid "Close topics"
+msgid "Open topic title"
+msgstr "Open topic"
+
+msgid "Close topics title"
 msgstr "Close topics"
 msgstr "Close topics"
 
 
-msgid "Confirm action"
-msgstr "Confirm action"
+msgid "Close topic title"
+msgstr "Close topic"
 
 
 msgid "Topic links cannot be merged"
 msgid "Topic links cannot be merged"
 msgstr "Topic links cannot be merged."
 msgstr "Topic links cannot be merged."
@@ -279,12 +282,18 @@ msgstr "All"
 msgid "Move topic"
 msgid "Move topic"
 msgstr "Move topic"
 msgstr "Move topic"
 
 
-msgid "Open topic"
+msgid "Open topic btn"
 msgstr "Open topic"
 msgstr "Open topic"
 
 
-msgid "Close topic"
+msgid "Open topics btn"
+msgstr "Open topics"
+
+msgid "Close topic btn"
 msgstr "Close topic"
 msgstr "Close topic"
 
 
+msgid "Close topics btn"
+msgstr "Close topics"
+
 msgid "Unstick topic"
 msgid "Unstick topic"
 msgstr "Unstick topic"
 msgstr "Unstick topic"
 
 

+ 3 - 0
app/lang/ru/common.po

@@ -49,6 +49,9 @@ msgstr "Операция отменена."
 msgid "No confirm redirect"
 msgid "No confirm redirect"
 msgstr "Подтверждение не получено. Операция отменена."
 msgstr "Подтверждение не получено. Операция отменена."
 
 
+msgid "Confirm action"
+msgstr "Подтверждаю действие"
+
 msgid "Forum rules"
 msgid "Forum rules"
 msgstr "Правила форума"
 msgstr "Правила форума"
 
 

+ 15 - 6
app/lang/ru/misc.po

@@ -249,14 +249,17 @@ msgstr "Действие недоступно."
 msgid "No object selected"
 msgid "No object selected"
 msgstr "Вы должны выбрать хотя бы один объект для действия."
 msgstr "Вы должны выбрать хотя бы один объект для действия."
 
 
-msgid "Open topics"
+msgid "Open topics title"
 msgstr "Открытие тем"
 msgstr "Открытие тем"
 
 
-msgid "Close topics"
+msgid "Open topic title"
+msgstr "Открытие темы"
+
+msgid "Close topics title"
 msgstr "Закрытие тем"
 msgstr "Закрытие тем"
 
 
-msgid "Confirm action"
-msgstr "Подтверждаю действие"
+msgid "Close topic title"
+msgstr "Закрытие темы"
 
 
 msgid "Topic links cannot be merged"
 msgid "Topic links cannot be merged"
 msgstr "Ссылки на темы не могут быть объединены."
 msgstr "Ссылки на темы не могут быть объединены."
@@ -279,12 +282,18 @@ msgstr "All"
 msgid "Move topic"
 msgid "Move topic"
 msgstr "Перенести тему"
 msgstr "Перенести тему"
 
 
-msgid "Open topic"
+msgid "Open topic btn"
 msgstr "Открыть тему"
 msgstr "Открыть тему"
 
 
-msgid "Close topic"
+msgid "Open topics btn"
+msgstr "Открыть темы"
+
+msgid "Close topic btn"
 msgstr "Закрыть тему"
 msgstr "Закрыть тему"
 
 
+msgid "Close topics btn"
+msgstr "Закрыть темы"
+
 msgid "Unstick topic"
 msgid "Unstick topic"
 msgstr "Снять выделение темы"
 msgstr "Снять выделение темы"