simpler-parent-select

This commit is contained in:
2025-07-01 01:20:48 +03:00
parent 2683982180
commit bb41c02d62
18 changed files with 3281 additions and 49 deletions

View File

@@ -439,3 +439,736 @@
flex-direction: column-reverse;
}
}
/* Стили для модального окна слияния топиков */
.checkboxList {
max-height: 300px;
overflow-y: auto;
border: 1px solid #e9ecef;
border-radius: 6px;
padding: 8px;
background: #fafafa;
}
.checkboxItem {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 10px;
margin-bottom: 8px;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.2s ease;
}
.checkboxItem:hover {
background-color: #f0f0f0;
}
.checkboxItem:last-child {
margin-bottom: 0;
}
.checkboxContent {
flex: 1;
}
.topicTitle {
font-weight: 600;
color: #333;
margin-bottom: 4px;
}
.topicInfo {
font-size: 13px;
color: #666;
line-height: 1.4;
}
.optionTitle {
font-weight: 500;
color: #333;
margin-bottom: 2px;
}
.optionDescription {
font-size: 13px;
color: #666;
line-height: 1.4;
}
.summary {
background: #f8f9fa;
border: 1px solid #e9ecef;
border-radius: 6px;
padding: 16px;
margin: 16px 0;
}
.summary h4 {
margin: 0 0 12px 0;
color: #333;
font-size: 14px;
font-weight: 600;
}
.summary ul {
margin: 0;
padding-left: 20px;
}
.summary li {
margin-bottom: 8px;
font-size: 13px;
line-height: 1.4;
}
.summary ul ul {
margin-top: 4px;
}
.summary ul ul li {
margin-bottom: 4px;
color: #666;
}
.section {
margin-bottom: 24px;
}
.sectionTitle {
font-size: 16px;
font-weight: 600;
color: #333;
margin: 0 0 8px 0;
}
.description {
font-size: 14px;
color: #666;
margin: 0 0 12px 0;
line-height: 1.4;
}
/* Стили для управления иерархией топиков */
.hierarchyContainer {
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
.instructions {
background: #f8f9fa;
border: 1px solid #e9ecef;
border-radius: 6px;
padding: 16px;
margin-bottom: 20px;
}
.instructions h4 {
margin: 0 0 12px 0;
color: #495057;
font-size: 14px;
font-weight: 600;
}
.instructions ul {
margin: 0;
padding-left: 20px;
}
.instructions li {
margin-bottom: 4px;
font-size: 13px;
color: #6c757d;
}
.hierarchyTree {
border: 1px solid #e9ecef;
border-radius: 6px;
background: white;
max-height: 400px;
overflow-y: auto;
padding: 8px;
}
.treeNode {
margin-bottom: 2px;
}
.treeItem {
padding: 8px 12px;
border-radius: 4px;
cursor: grab;
transition: all 0.2s ease;
user-select: none;
}
.treeItem:hover {
background-color: #f8f9fa;
}
.treeItem:active {
cursor: grabbing;
}
.dropTarget {
background-color: #e3f2fd !important;
border: 2px dashed #2196f3 !important;
}
.dragHandle {
color: #999;
font-weight: bold;
cursor: grab;
padding: 0 4px;
}
.dragHandle:hover {
color: #666;
}
.topicTitle {
font-weight: 500;
color: #333;
flex: 1;
}
.topicId {
font-size: 12px;
color: #999;
background: #f8f9fa;
padding: 2px 6px;
border-radius: 3px;
}
.treeChildren {
margin-left: 0;
}
.changesSummary {
background: #fff3cd;
border: 1px solid #ffeaa7;
border-radius: 6px;
padding: 16px;
margin: 20px 0;
}
.changesSummary h4 {
margin: 0 0 12px 0;
color: #856404;
font-size: 14px;
}
.changeItem {
padding: 6px 0;
border-bottom: 1px solid #ffeaa7;
font-size: 13px;
color: #856404;
}
.changeItem:last-child {
border-bottom: none;
}
.dropZone {
margin: 20px 0;
}
.rootDropZone {
border: 2px dashed #6c757d;
border-radius: 8px;
padding: 20px;
text-align: center;
color: #6c757d;
background: #f8f9fa;
transition: all 0.2s ease;
cursor: pointer;
}
.rootDropZone:hover {
border-color: #007bff;
color: #007bff;
background: #e3f2fd;
}
/* Дополнительные стили для режима большой модалки */
.modal.large {
max-width: 900px;
width: 90vw;
}
.modal.large .modalContent {
min-height: 600px;
}
/* Адаптивность для мобильных */
@media (max-width: 768px) {
.hierarchyContainer {
padding: 12px;
}
.treeItem {
padding: 6px 8px;
font-size: 14px;
}
.dragHandle {
display: none;
}
.topicTitle {
font-size: 14px;
}
.rootDropZone {
padding: 16px;
font-size: 14px;
}
}
/* Стили для выбора родительской темы */
.parentSelectorContainer {
max-width: 600px;
margin: 0 auto;
padding: 20px;
}
.searchSection {
margin-bottom: 20px;
}
.searchInput {
width: 100%;
padding: 8px 12px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 14px;
}
.currentSelection {
background: #f8f9fa;
border: 1px solid #e9ecef;
border-radius: 6px;
padding: 16px;
margin-bottom: 20px;
}
.currentParent {
margin-top: 8px;
}
.noParent {
color: #6c757d;
font-style: italic;
}
.parentPath {
font-weight: 500;
color: #495057;
}
.parentOptions {
margin-bottom: 20px;
}
.parentsList {
max-height: 300px;
overflow-y: auto;
border: 1px solid #e9ecef;
border-radius: 6px;
background: white;
}
.parentOption {
display: flex;
align-items: flex-start;
padding: 12px;
border-bottom: 1px solid #f1f3f4;
transition: background-color 0.2s ease;
}
.parentOption:last-child {
border-bottom: none;
}
.parentOption:hover {
background-color: #f8f9fa;
}
.parentOption input[type="radio"] {
margin-right: 12px;
margin-top: 4px;
}
.parentOptionLabel {
flex: 1;
cursor: pointer;
display: block;
}
.parentDescription {
margin-top: 4px;
font-size: 12px;
color: #6c757d;
display: flex;
gap: 12px;
align-items: center;
}
.topicId {
background: #e9ecef;
padding: 2px 6px;
border-radius: 3px;
font-weight: 500;
}
.topicSlug {
font-family: monospace;
background: #f8f9fa;
padding: 2px 6px;
border-radius: 3px;
}
.noResults {
padding: 20px;
text-align: center;
color: #6c757d;
font-style: italic;
}
/* Мобильная адаптивность */
@media (max-width: 768px) {
.parentSelectorContainer {
padding: 12px;
}
.parentOption {
padding: 8px;
}
.parentDescription {
flex-direction: column;
align-items: flex-start;
gap: 4px;
}
}
/* Стили для массового редактирования родителей */
.bulkParentContainer {
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
.errorMessage {
background: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
border-radius: 6px;
padding: 12px;
margin-bottom: 20px;
font-size: 14px;
}
.selectedTopicsPreview {
background: #f8f9fa;
border: 1px solid #e9ecef;
border-radius: 6px;
padding: 16px;
margin-bottom: 20px;
}
.selectedTopicsPreview h4 {
margin: 0 0 12px 0;
color: #495057;
font-size: 14px;
}
.topicsList {
max-height: 150px;
overflow-y: auto;
}
.topicPreviewItem {
padding: 8px 12px;
border: 1px solid #e9ecef;
border-radius: 4px;
margin-bottom: 8px;
background: white;
display: flex;
align-items: center;
gap: 12px;
}
.topicPreviewItem:last-child {
margin-bottom: 0;
}
.currentPath {
font-size: 12px;
color: #6c757d;
margin-top: 4px;
width: 100%;
}
.actionSelection {
margin-bottom: 20px;
}
.actionSelection h4 {
margin: 0 0 12px 0;
color: #495057;
font-size: 14px;
}
.actionOptions {
display: flex;
flex-direction: column;
gap: 12px;
}
.actionOption {
display: flex;
align-items: flex-start;
padding: 12px;
border: 1px solid #e9ecef;
border-radius: 6px;
background: white;
transition: background-color 0.2s ease;
}
.actionOption:hover {
background-color: #f8f9fa;
}
.actionOption input[type="radio"] {
margin-right: 12px;
margin-top: 4px;
}
.actionLabel {
flex: 1;
cursor: pointer;
display: block;
}
.actionDescription {
margin-top: 4px;
font-size: 13px;
color: #6c757d;
}
.parentSelection {
margin-bottom: 20px;
}
.parentSelection h4 {
margin: 0 0 12px 0;
color: #495057;
font-size: 14px;
}
.previewSection {
background: #fff3cd;
border: 1px solid #ffeaa7;
border-radius: 6px;
padding: 16px;
margin-bottom: 20px;
}
.previewSection h4 {
margin: 0 0 12px 0;
color: #856404;
font-size: 14px;
}
.previewChanges {
max-height: 200px;
overflow-y: auto;
}
.previewItem {
padding: 8px 0;
border-bottom: 1px solid #ffeaa7;
}
.previewItem:last-child {
border-bottom: none;
}
.previewChange {
margin-top: 4px;
font-size: 13px;
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}
.beforeState {
color: #6c757d;
}
.arrow {
color: #007bff;
font-weight: bold;
}
.afterState {
color: #28a745;
font-weight: 500;
}
/* Адаптивность для мобильных */
@media (max-width: 768px) {
.bulkParentContainer {
padding: 12px;
}
.actionOptions {
gap: 8px;
}
.actionOption {
padding: 8px;
}
.topicPreviewItem {
flex-direction: column;
align-items: flex-start;
gap: 4px;
}
.previewChange {
flex-direction: column;
align-items: flex-start;
gap: 4px;
}
}
/* Новые стили для кликабельного интерфейса */
.selectedForMove {
border-color: #007bff !important;
background-color: #e3f2fd !important;
box-shadow: 0 0 8px rgba(0, 123, 255, 0.3);
}
.moveTarget {
border-color: #28a745 !important;
background-color: #d4edda !important;
}
.selectedIcon, .targetIcon, .clickIcon {
font-size: 16px;
margin-right: 4px;
}
.selectedIcon {
animation: pulse 1s infinite;
}
.targetIcon {
animation: bounce 0.8s infinite;
}
.clickIcon {
opacity: 0.6;
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
@keyframes bounce {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-2px); }
}
.searchSection {
margin: 20px 0;
padding: 15px;
background: #f8f9fa;
border-radius: 8px;
border: 1px solid #ddd;
}
.searchInput {
width: 100%;
padding: 8px 12px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 14px;
margin-bottom: 8px;
}
.searchResult {
color: #28a745;
font-size: 14px;
padding: 4px 0;
}
.searchNoResult {
color: #dc3545;
font-size: 14px;
padding: 4px 0;
}
.actionZone {
margin: 20px 0;
padding: 20px;
background: #e3f2fd;
border: 2px solid #007bff;
border-radius: 8px;
}
.selectedTopicInfo h4 {
margin: 0 0 10px 0;
color: #007bff;
font-size: 16px;
}
.selectedTopicDisplay {
background: white;
padding: 10px;
border-radius: 4px;
margin-bottom: 15px;
font-weight: 500;
}
.actionButtons {
display: flex;
gap: 10px;
flex-wrap: wrap;
}
.rootButton {
background: #28a745;
color: white;
border: none;
padding: 8px 16px;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
transition: background 0.2s ease;
}
.rootButton:hover {
background: #218838;
}
.cancelButton {
background: #6c757d;
color: white;
border: none;
padding: 8px 16px;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
transition: background 0.2s ease;
}
.cancelButton:hover {
background: #5a6268;
}