rebuild moderation page with filter and sorting functions, CRUD operations, map preview function and shared categories

This commit is contained in:
2026-04-22 14:39:38 +02:00
parent 27d41c0847
commit adf863934e
2 changed files with 807 additions and 387 deletions

View File

@@ -1,7 +1,12 @@
/* =====================================================================
Moderation Page Styles
Moderation Page Styles
Separate Stylesheet for the Admin Moderation Interface.
===================================================================== */
/* -----------------------------------------------------------------
Base
----------------------------------------------------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
@@ -11,44 +16,52 @@ body {
font-size: 15px;
}
/* -----------------------------------------------------------------
Header
----------------------------------------------------------------- */
.admin-header {
background: var(--color-primary);
color: white;
padding: 16px 24px;
padding: 14px 24px;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.admin-header h1 { font-size: 1.2rem; }
.admin-header a {
color: white;
text-decoration: none;
opacity: 0.8;
font-size: 0.85rem;
.admin-header h1 {
font-size: 1.15rem;
font-weight: 600;
}
.admin-header a:hover { opacity: 1; }
.admin-nav {
display: flex;
gap: 16px;
align-items: center;
}
.admin-nav a {
color: white;
text-decoration: none;
opacity: 0.8;
font-size: 0.85rem;
transition: opacity 150ms ease;
}
.admin-nav a:hover { opacity: 1; }
/* -----------------------------------------------------------------
Container
----------------------------------------------------------------- */
.admin-container {
max-width: 900px;
max-width: 960px;
margin: 24px auto;
padding: 0 16px;
}
/* -----------------------------------------------------------------
Statistics Cards
----------------------------------------------------------------- */
@@ -56,7 +69,7 @@ body {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 12px;
margin-bottom: 32px;
margin-bottom: 28px;
}
.stat-card {
@@ -79,17 +92,230 @@ body {
margin-top: 4px;
}
/* -----------------------------------------------------------------
Section Headers
Filter Tabs
----------------------------------------------------------------- */
h2 {
font-size: 1.1rem;
margin-bottom: 16px;
padding-bottom: 8px;
border-bottom: 2px solid var(--color-primary);
.filter-tabs {
display: flex;
gap: 4px;
margin-bottom: 20px;
border-bottom: 2px solid #e0e0e0;
padding-bottom: 0;
}
.section { margin-bottom: 40px; }
.filter-tab {
padding: 8px 16px;
border: none;
background: none;
font-family: inherit;
font-size: 0.85rem;
font-weight: 600;
color: #5a5a7a;
cursor: pointer;
border-bottom: 2px solid transparent;
margin-bottom: -2px;
transition: color 150ms ease, border-color 150ms ease;
}
.filter-tab:hover {
color: var(--color-primary);
}
.filter-tab.active {
color: var(--color-primary);
border-bottom-color: var(--color-primary);
}
.filter-tab .tab-count {
background: #e0e0e0;
color: #5a5a7a;
font-size: 0.7rem;
padding: 1px 6px;
border-radius: 10px;
margin-left: 4px;
}
.filter-tab.active .tab-count {
background: var(--color-primary);
color: white;
}
/* -----------------------------------------------------------------
Sort Controls
----------------------------------------------------------------- */
.sort-controls {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
font-size: 0.85rem;
color: #5a5a7a;
}
.sort-controls select {
padding: 4px 8px;
border: 1px solid #e0e0e0;
border-radius: 4px;
font-family: inherit;
font-size: 0.85rem;
cursor: pointer;
}
/* -----------------------------------------------------------------
Collapsible Contribution Rows
----------------------------------------------------------------- */
.contribution-row {
background: white;
border: 1px solid #e0e0e0;
border-radius: 8px;
margin-bottom: 10px;
overflow: hidden;
transition: border-color 150ms ease;
}
.contribution-row:hover {
border-color: #bbb;
}
.contribution-row-header {
padding: 12px 16px;
display: flex;
justify-content: space-between;
align-items: center;
cursor: pointer;
transition: background 150ms ease;
}
.contribution-row-header:hover {
background: #f8f9fa;
}
.contribution-row-summary {
display: flex;
align-items: center;
gap: 10px;
flex: 1;
min-width: 0;
}
.contribution-row-summary .title {
font-weight: 600;
font-size: 0.95rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.collapse-icon {
color: #999;
font-size: 0.75rem;
flex-shrink: 0;
transition: transform 200ms ease;
}
.contribution-row.open .collapse-icon {
transform: rotate(180deg);
}
/* -----------------------------------------------------------------
Contribution Detail View (expanded)
----------------------------------------------------------------- */
.contribution-row-detail {
padding: 0 16px 16px 16px;
border-top: 1px solid #f0f0f0;
display: none;
}
.contribution-row.open .contribution-row-detail {
display: block;
}
.detail-layout {
display: flex;
gap: 16px;
margin-top: 12px;
margin-bottom: 12px;
}
.detail-map {
width: 220px;
height: 170px;
border-radius: 6px;
border: 1px solid #e0e0e0;
flex-shrink: 0;
background: #f0f0f0;
}
.detail-content {
flex: 1;
min-width: 0;
}
.detail-content .description {
font-size: 0.85rem;
line-height: 1.5;
color: #5a5a7a;
margin-bottom: 10px;
}
.detail-content .description.empty {
color: #bbb;
font-style: italic;
}
.detail-meta {
font-size: 0.8rem;
color: #999;
display: flex;
flex-direction: column;
gap: 4px;
}
.detail-meta span {
display: flex;
align-items: center;
gap: 6px;
}
/* -----------------------------------------------------------------
Action Buttons
----------------------------------------------------------------- */
.action-buttons {
display: flex;
gap: 8px;
flex-wrap: wrap;
padding-top: 12px;
border-top: 1px solid #f0f0f0;
}
.btn {
padding: 7px 14px;
border: none;
border-radius: 6px;
font-size: 0.82rem;
font-weight: 600;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 5px;
font-family: inherit;
transition: filter 150ms ease;
text-decoration: none;
}
.btn:hover { filter: brightness(1.1); }
.btn-approve { background: #2e7d32; color: white; }
.btn-reject { background: #c62828; color: white; }
.btn-edit { background: #1565C0; color: white; }
.btn-delete { background: #424242; color: white; }
.btn-map { background: #546E7A; color: white; }
/* -----------------------------------------------------------------
Badges
@@ -102,41 +328,13 @@ h2 {
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
flex-shrink: 0;
}
.badge-pending { background: #fff3cd; color: #856404; }
.badge-approved { background: #d4edda; color: #155724; }
.badge-rejected { background: #f8d7da; color: #721c24; }
.badge-point { background: #e3f2fd; color: #1565c0; }
.badge-line { background: #f3e5f5; color: #6a1b9a; }
.badge-polygon { background: #e8f5e9; color: #2e7d32; }
/* -----------------------------------------------------------------
Action Buttons
----------------------------------------------------------------- */
.action-buttons {
display: flex;
gap: 8px;
flex-shrink: 0;
}
.btn {
padding: 8px 16px;
border: none;
border-radius: 6px;
font-size: 0.85rem;
font-weight: 600;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 4px;
}
.btn-approve { background: #2e7d32; color: white; }
.btn-approve:hover { background: #1b5e20; }
.btn-reject { background: #c62828; color: white; }
.btn-reject:hover { background: #b71c1c; }
/* -----------------------------------------------------------------
Empty State
@@ -148,6 +346,70 @@ h2 {
font-size: 0.9rem;
}
/* -----------------------------------------------------------------
Section Spacing
----------------------------------------------------------------- */
.section { margin-bottom: 32px; }
/* -----------------------------------------------------------------
Placeholder Tabs (future Features)
----------------------------------------------------------------- */
.placeholder-content {
text-align: center;
padding: 60px 20px;
color: #bbb;
}
.placeholder-content i {
font-size: 2.5rem;
margin-bottom: 12px;
display: block;
}
.placeholder-content p {
font-size: 0.9rem;
}
/* -----------------------------------------------------------------
Navigation Tabs (Page Sections)
----------------------------------------------------------------- */
.page-tabs {
display: flex;
gap: 4px;
margin-bottom: 24px;
background: white;
padding: 4px;
border-radius: 8px;
border: 1px solid #e0e0e0;
}
.page-tab {
padding: 8px 16px;
border: none;
background: none;
font-family: inherit;
font-size: 0.85rem;
font-weight: 600;
color: #5a5a7a;
cursor: pointer;
border-radius: 6px;
transition: all 150ms ease;
display: flex;
align-items: center;
gap: 6px;
}
.page-tab:hover { background: #f0f0f0; }
.page-tab.active {
background: var(--color-primary);
color: white;
}
/* -----------------------------------------------------------------
Login Page
----------------------------------------------------------------- */
@@ -186,7 +448,7 @@ h2 {
border-radius: 6px;
font-size: 0.9rem;
margin-bottom: 12px;
font-family: 'Segoe UI', system-ui, sans-serif;
font-family: inherit;
}
.login-box input:focus {
@@ -205,12 +467,12 @@ h2 {
font-size: 0.9rem;
font-weight: 600;
cursor: pointer;
font-family: 'Segoe UI', system-ui, sans-serif;
font-family: inherit;
}
.login-box button:hover { filter: brightness(1.15); }
.error {
.login-error {
color: #c62828;
font-size: 0.85rem;
margin-bottom: 12px;
@@ -223,127 +485,19 @@ h2 {
.back-link a { color: #5a5a7a; }
/* -----------------------------------------------------------------
Mobile Responsive
----------------------------------------------------------------- */
.action-buttons {
width: 100%;
}
.action-buttons form {
flex: 1;
}
.action-buttons .btn {
width: 100%;
justify-content: center;
}
/* -----------------------------------------------------------------
Collapsible Contribution Rows
----------------------------------------------------------------- */
.contribution-row-collapsible {
background: white;
border: 1px solid #e0e0e0;
border-radius: 8px;
margin-bottom: 12px;
overflow: hidden;
}
.contribution-row-header {
padding: 12px 16px;
display: flex;
justify-content: space-between;
align-items: center;
cursor: pointer;
transition: background 150ms ease;
}
.contribution-row-header:hover {
background: #f8f9fa;
}
.contribution-row-summary {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
flex: 1;
}
.contribution-row-summary .title {
font-weight: 600;
font-size: 0.95rem;
}
.meta-inline {
font-size: 0.8rem;
color: #5a5a7a;
}
.collapse-icon {
color: #999;
font-size: 0.8rem;
flex-shrink: 0;
transition: transform 200ms ease;
}
/* -----------------------------------------------------------------
Contribution Detail View (expanded)
----------------------------------------------------------------- */
.contribution-row-detail {
padding: 0 16px 16px 16px;
border-top: 1px solid #f0f0f0;
}
.detail-layout {
display: flex;
gap: 16px;
margin-bottom: 12px;
margin-top: 12px;
}
.detail-map {
width: 200px;
height: 160px;
border-radius: 6px;
border: 1px solid #e0e0e0;
flex-shrink: 0;
background: #f0f0f0;
}
.detail-content {
flex: 1;
min-width: 0;
}
.detail-content .description {
font-size: 0.85rem;
line-height: 1.5;
color: #5a5a7a;
margin-bottom: 8px;
}
.detail-content .meta {
font-size: 0.8rem;
color: #999;
}
.btn-map {
background: #1565C0;
color: white;
text-decoration: none;
}
.btn-map:hover {
background: #0d47a1;
}
/* -----------------------------------------------------------------
Mobile: Detail Layout stacked
----------------------------------------------------------------- */
@media (max-width: 768px) {
.admin-header {
flex-direction: column;
gap: 8px;
padding: 12px 16px;
}
.admin-header h1 { font-size: 1rem; }
.detail-layout {
flex-direction: column;
}
@@ -353,9 +507,23 @@ h2 {
height: 180px;
}
.contribution-row-summary {
.contribution-row-summary .title {
max-width: 200px;
}
.action-buttons {
flex-direction: column;
align-items: flex-start;
gap: 4px;
}
.action-buttons .btn {
justify-content: center;
}
.filter-tabs {
overflow-x: auto;
}
.page-tabs {
overflow-x: auto;
}
}