set comment & new reason for decline

This commit is contained in:
themohooks 2025-02-11 14:20:32 +03:00
parent 1caedf698b
commit a57d779caf
4 changed files with 19 additions and 0 deletions

View file

@ -18,6 +18,9 @@ class SetVisibility
if (!array_key_exists('declineReason', $data)) {
$data['declineReason'] = null;
}
if ($_POST['comment'] != null) {
$data['declineComment'] = $_POST['comment'];
}
$data['declineReason'] = $_GET['decline_reason'];
$updatedJsonString = json_encode($data);

View file

@ -37,6 +37,9 @@ class Photo {
case 5:
return 'Расчленёнка';
break;
case 6:
return 'Файл сломан';
break;
default:
return 'Не подходит для сайта';
break;

View file

@ -123,7 +123,17 @@ use \App\Models\User;
Расчленёнка
</label>
</div>
<div class="form-check">
<input name="decline'.$p['id'].'" value="6" class="form-check-input" type="radio" name="flexRadioDefault" id="declineReason6">
<label class="form-check-label" for="declineReason6">
Файл сломан
</label>
</div>
<div class="mb-3">
<label for="exampleFormControlTextarea1" class="form-label">Дополнительный комментарий</label>
<textarea class="form-control" id="exampleFormControlTextarea1" name="comment" rows="3"></textarea>
</div>
</div>
<div class="modal-footer">
<a type="button" class="btn btn-secondary" data-bs-dismiss="modal">Отмена</a>'; ?>

View file

@ -69,6 +69,9 @@ use \App\Models\{User, Photo};
if ($p['moderated'] === 2) {
echo '<p class="sm"><b>Причина отклонения: '.$photo->declineReason((int)$photo->content('declineReason')).'</b></p>';
}
if ($photo->content('declineComment') != null) {
echo '<p class="sm"><b>Комментарий: </b> '.$photo->content('declineComment').'</p>';
}
echo '
</td>