Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions flask_setup/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,41 @@ def _register_auth_routes(app: Flask, adapters: dict) -> None:
endpoint="auth.remove_profile_photo",
)

app.add_url_rule(
"/profile/email",
view_func=acc.update_email,
methods=["POST"],
endpoint="auth.update_email",
)

app.add_url_rule(
"/profile/password",
view_func=acc.update_password,
methods=["POST"],
endpoint="auth.update_password",
)

app.add_url_rule(
"/admin/users",
view_func=acc.list_all_users,
methods=["GET"],
endpoint="auth.list_all_users",
)

app.add_url_rule(
"/account/delete",
view_func=acc.delete_account,
methods=["POST"],
endpoint="auth.delete_account",
)

app.add_url_rule(
"/admin/users/<int:account_id>/role",
view_func=acc.change_role,
methods=["POST"],
endpoint="auth.change_role",
)


def _register_file_routes(app: Flask, adapters: dict) -> None:
fad = adapters["file_adapter"]
Expand Down
53 changes: 2 additions & 51 deletions frontend/static/css/article.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
margin-right: var(--spacing-xs);
}

.meta-author:hover {
a.meta-author:hover {
color: var(--primary);
text-decoration: underline;
}
Expand Down Expand Up @@ -295,47 +295,6 @@ input[type=number] {
appearance: textfield;
}

/* Shared dialog (modal) styles */
.dialog {
border: 1px solid var(--outline-variant);
border-radius: var(--radius-lg);
background: var(--surface-container-high);
color: var(--on-surface);
padding: var(--spacing-xl);
width: 90%;
max-width: 25rem;
box-shadow: 0 20px 40px color-mix(in srgb, var(--on-surface) 10%, transparent);
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: var(--z-modal);
}

.dialog-sm {
max-width: 20rem;
}

.dialog::backdrop {
background: color-mix(in srgb, var(--surface-container-lowest) 80%, transparent);
backdrop-filter: blur(8px);
}

.dialog .modal-footer {
margin-top: var(--spacing-xl);
}

.modal-header {
margin-bottom: var(--spacing-md);
}

.modal-title {
font-family: var(--font-primary);
font-size: var(--font-headline-md);
font-weight: 700;
margin: 0;
}

.modal-body {
margin-bottom: var(--spacing-xl);
}
Expand Down Expand Up @@ -561,10 +520,6 @@ input[type=number] {
display: block;
}

.comment-depth-3 > .comment-content > .comment-replies {
display: block;
}

.comment-actions {
display: flex;
gap: var(--spacing-sm);
Expand Down Expand Up @@ -592,7 +547,7 @@ input[type=number] {
text-decoration: none;
}

.comment-author:hover {
a.comment-author:hover {
color: var(--primary);
text-decoration: underline;
}
Expand Down Expand Up @@ -675,10 +630,6 @@ input[type=number] {
margin-top: var(--spacing-sm);
}

.comment-depth-3 .comment-replies > .comment-depth-3 > .comment-avatar {
display: none;
}

@media (max-width: 30em) {
.comment-avatar {
width: 2rem;
Expand Down
47 changes: 47 additions & 0 deletions frontend/static/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,53 @@ button:hover,
filter: brightness(1.15);
}

#confirm-message {
text-align: justify;
}

.dialog {
border: 1px solid var(--outline-variant);
border-radius: var(--radius-lg);
background: var(--surface-container-high);
color: var(--on-surface);
padding: var(--spacing-xl);
width: 90%;
max-width: 25rem;
box-shadow: 0 20px 40px color-mix(in srgb, var(--on-surface) 10%, transparent);
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: var(--z-modal);
}

.dialog-sm {
max-width: 20rem;
}

.dialog::backdrop {
background: color-mix(in srgb, var(--surface-container-lowest) 80%, transparent);
backdrop-filter: blur(8px);
}

.dialog .modal-footer {
display: flex;
justify-content: flex-end;
gap: var(--spacing-md);
margin-top: var(--spacing-xl);
}

.modal-header {
margin-bottom: var(--spacing-md);
}

.modal-title {
font-family: var(--font-primary);
font-size: var(--font-headline-md);
font-weight: 700;
margin: 0;
}

button:focus-visible,
.btn:focus-visible,
a:focus-visible {
Expand Down
145 changes: 144 additions & 1 deletion frontend/static/css/profile.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,89 @@
margin-top: var(--spacing-lg);
}

.profile-actions .btn-secondary,
.profile-actions .btn-danger {
padding: var(--spacing-xs) var(--spacing-md);
font-size: var(--font-body-base);
}


.info-right-group {
display: flex;
align-items: center;
gap: var(--spacing-sm);
flex-wrap: wrap;
justify-content: flex-end;
}

.email-edit-btn {
background: none;
border: none;
color: var(--primary);
cursor: pointer;
font-size: var(--font-body-xs);
font-family: var(--font-mono);
text-transform: uppercase;
padding: 0;
}

.email-edit-btn:hover {
background: color-mix(in srgb, var(--primary) 10%, transparent);
border-radius: var(--radius-xs);
filter: brightness(1.1);
}

@media (max-width: 22.5em) {
.profile-card {
padding: var(--spacing-md);
}

.info-row {
gap: var(--spacing-xs);
}

.info-right-group {
flex-wrap: nowrap;
min-width: 0;
}

.info-value {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
min-width: 0;
max-width: 50%;
}

.email-edit-btn {
flex-shrink: 0;
}

.profile-actions {
flex-direction: column;
}
.profile-actions .btn-secondary {
.profile-actions .btn-secondary,
.profile-actions .btn-danger {
width: 100%;
}
}

.modal-body {
margin-bottom: var(--spacing-xl);
}

.modal-input-group {
display: flex;
flex-direction: column;
gap: var(--spacing-sm);
}

.modal-input-group label {
font-size: var(--font-body-base);
color: var(--on-surface-variant);
font-family: var(--font-mono);
}

.back-link {
display: flex;
align-items: center;
Expand Down Expand Up @@ -130,3 +204,72 @@
.back-link span:last-child {
transform: translateY(1.5px);
}

.password-wrapper {
position: relative;
}

.password-toggle {
position: absolute;
right: 0.5rem;
top: 50%;
transform: translateY(-50%);
background: none;
border: none;
cursor: pointer;
color: var(--on-surface-variant);
display: flex;
align-items: center;
justify-content: center;
padding: var(--spacing-xs);
line-height: 1;
}

.password-toggle .icon {
font-size: 1.5rem;
}

.password-toggle:hover {
color: var(--on-surface);
}

.password-toggle:focus-visible {
outline: 2px solid var(--primary);
outline-offset: 2px;
}

.role-row {
display: flex;
flex-direction: column;
align-items: center;
gap: var(--spacing-sm);
}

.role-inline-form {
display: inline-flex;
align-items: center;
gap: var(--spacing-sm);
}

.role-inline-form select {
font-family: var(--font-mono);
font-size: var(--font-body-sm);
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
padding: var(--spacing-xs) var(--spacing-sm);
border: 1px solid var(--outline-variant);
border-radius: var(--radius-default);
background: var(--surface);
color: var(--on-surface);
cursor: pointer;
}

.role-inline-form select:hover {
border-color: var(--outline);
}

.role-inline-form .btn-sm {
font-size: var(--font-body-sm);
padding: var(--spacing-xs) var(--spacing-sm);
}
Loading
Loading