From 00376c124f00d64f98eee4528f8a7dcbf912a530 Mon Sep 17 00:00:00 2001 From: anibilag Date: Mon, 3 Mar 2025 23:18:43 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=20=D1=81=D0=BF?= =?UTF-8?q?=D0=B8=D1=81=D0=BA=D0=B0=20=D1=81=D1=82=D0=B0=D1=82=D0=B5=D0=B9?= =?UTF-8?q?=20=D0=BF=D0=BE=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D1=82=D0=B5=D0=BB=D1=8E.=20=D0=90=D0=B4=D0=BC=D0=B8?= =?UTF-8?q?=D0=BD=20=D0=B2=D0=B8=D0=B4=D0=B8=D1=82=20=D0=B2=D1=81=D0=B5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AuthGuard.tsx | 2 +- src/components/TipTapEditor.tsx | 16 ++++++++++++++-- src/hooks/useUserManagement.ts | 4 ++-- src/pages/AdminPage.tsx | 13 ++++++++----- src/pages/UserManagementPage.tsx | 17 ++++++++++++----- 5 files changed, 37 insertions(+), 15 deletions(-) diff --git a/src/components/AuthGuard.tsx b/src/components/AuthGuard.tsx index bb574b0..c2902ea 100644 --- a/src/components/AuthGuard.tsx +++ b/src/components/AuthGuard.tsx @@ -36,7 +36,7 @@ export function AuthGuard({ children, requiredPermissions }: AuthGuardProps) {

Access Denied

- You don't have permission to {action} articles in the {categoryId} category. + У вас нет прав на {action} статьи в {categoryId} категории.

diff --git a/src/components/TipTapEditor.tsx b/src/components/TipTapEditor.tsx index 5b21ce6..c3ec6c6 100644 --- a/src/components/TipTapEditor.tsx +++ b/src/components/TipTapEditor.tsx @@ -16,7 +16,8 @@ import { AlignCenter, Plus, Minus, - SquareUser + SquareUser, + ImagePlus } from 'lucide-react'; import { useEffect, useState } from "react"; @@ -339,6 +340,7 @@ export function TipTapEditor({ initialContent, onContentChange }: TipTapEditorPr className={`p-1 rounded hover:bg-gray-200 ${ editor?.isActive('bold') ? 'bg-gray-200' : '' }`} + title="Выделение слов жирным шрифтом" > @@ -346,6 +348,7 @@ export function TipTapEditor({ initialContent, onContentChange }: TipTapEditorPr type="button" onClick={handleClick} className="p-1 rounded hover:bg-gray-200" + title="Автоматическое выделение жирным имен" > @@ -355,6 +358,7 @@ export function TipTapEditor({ initialContent, onContentChange }: TipTapEditorPr className={`p-1 rounded hover:bg-gray-200 ${ editor?.isActive('italic') ? 'bg-gray-200' : '' }`} + title="Выделение слов наклонным шрифтом" > @@ -362,6 +366,7 @@ export function TipTapEditor({ initialContent, onContentChange }: TipTapEditorPr type="button" onClick={() => editor?.chain().focus().setParagraph().run()} className={`p-1 rounded hover:bg-gray-200 ${editor?.isActive('paragraph') ? 'bg-gray-200' : ''}`} + title="Выравнивание по левому краю" > @@ -370,6 +375,7 @@ export function TipTapEditor({ initialContent, onContentChange }: TipTapEditorPr onClick={() => editor?.chain().focus().undo().run()} disabled={!editor?.can().chain().focus().undo().run()} className="p-1 rounded hover:bg-gray-200 disabled:opacity-50" + title="Отменить действие" > @@ -378,6 +384,7 @@ export function TipTapEditor({ initialContent, onContentChange }: TipTapEditorPr onClick={() => editor?.chain().focus().redo().run()} disabled={!editor?.can().chain().focus().redo().run()} className="p-1 rounded hover:bg-gray-200 disabled:opacity-50" + title="Вернуть действие" > @@ -387,6 +394,7 @@ export function TipTapEditor({ initialContent, onContentChange }: TipTapEditorPr className={`p-1 rounded hover:bg-gray-200 ${ editor?.isActive('bulletList') ? 'bg-gray-200' : '' }`} + title="Создать список" > @@ -396,6 +404,7 @@ export function TipTapEditor({ initialContent, onContentChange }: TipTapEditorPr className={`p-1 rounded hover:bg-gray-200 ${ editor?.isActive('orderedList') ? 'bg-gray-200' : '' }`} + title="Создать упорядоченный список" > @@ -406,6 +415,7 @@ export function TipTapEditor({ initialContent, onContentChange }: TipTapEditorPr className={`p-1 rounded hover:bg-gray-200 ${ editor?.isActive('blockquote') ? 'bg-gray-200' : '' }`} + title="Цитирование (параграф)" > @@ -416,6 +426,7 @@ export function TipTapEditor({ initialContent, onContentChange }: TipTapEditorPr className={`p-1 rounded hover:bg-gray-200 ${ editor?.getAttributes('textAlign')?.textAlign === 'center' ? 'bg-gray-200' : '' }`} + title="Выравнивание по центру" > @@ -427,8 +438,9 @@ export function TipTapEditor({ initialContent, onContentChange }: TipTapEditorPr editor?.chain().focus().setImage({ src: url }).run(); } }} + title="Вставить изображение" > - 🖼️ Фото + @@ -240,7 +246,7 @@ export function UserManagementPage() { {/* Create/Edit User Modal */} - {(showCreateModal || showEditModal) && ( + {((showCreateModal || showEditModal) && user?.permissions.isAdmin) && (
@@ -318,12 +324,13 @@ export function UserManagementPage() {
setFormData(prev => ({ ...prev, password: e.target.value }))} + placeholder={showEditModal ? 'Оставьте пустым, чтобы не менять' : ''} className="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500" required={!showEditModal} />