Repository navigation
Theme Management - #807
Merged
Merged
Theme Management#807
Conversation
Introduces a Theme Manager feature with a new ThemesController and Razor views, allowing admins to view, create, edit, and delete site themes. Registers IThemeManager in DI, refactors ThemesListViewModel, and adds navigation links to the new UI. ThemeManager.cs handles theme operations with protections for built-in and active themes. Adds view models and modal dialogs for confirmation. Enhances workflow and security by validating theme names and restricting file operations to safe extensions and paths.
Added CodeMirror to EditFile.cshtml for enhanced editing with syntax highlighting and theme switching based on file type and site mode. Included necessary CodeMirror assets and language modes. Updated navigation label from "Manage Comments" to "Comments" for clarity.
Theme file editor now saves up to 3 previous versions as backups before overwriting. Users can view, restore, and manage backups via the UI. ThemeManager handles backup creation, listing, pruning, and reversion. UI updates include backup badges, revert actions, and confirmation modals. Success/error messages reflect backup and reversion actions.
Introduce ThemeContentValidator for pre-save .cshtml/.css checks, preventing common syntax errors. Integrate validation into ThemesController and display errors in EditFile. Register validator in DI. Improve EditFile UI with dirty indicator, save shortcut, and unsaved changes warning. Remove obsolete admin theme comment from _Layout.cshtml.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Classification
New feature: Adds a complete admin UI for theme management in DasBlog.
PR Summary
Introduces a full-featured admin interface for managing, editing, and versioning site themes, with integrated code editing and navigation updates.