Skip to content

Improve the admin mechanics #725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 22, 2025
Merged

Improve the admin mechanics #725

merged 8 commits into from
Jun 22, 2025

Conversation

poppastring
Copy link
Owner

PR Classification

New feature and user interface improvements.

PR Summary

This pull request introduces new configuration options and enhances the user interface across several files for better usability and functionality. Key changes include:

  • site.Development.config and site.config: Added settings for PostPinnedToHomePage and AlwaysIncludeContentInRSS.
  • CategoryListViewModel.cs: Introduced a new class for managing categories with an initialization method.
  • Login.cshtml: Improved layout and added validation feedback.
  • _Admin_FrontPage.cshtml: Replaced text box for front page category selection with a dropdown list.
  • _Admin_BlogEditing.cshtml and _Admin_Comments.cshtml: Added scripts to manage form element states based on user interactions.

Close #720

These changes improve the layout and usability of the form.
The script initializes the input state on page load and updates it on checkbox state changes.
Added JavaScript to dynamically enable or disable form fields based on the state of related checkboxes across multiple admin views:
- `_Admin_BlogEditing.cshtml`: Toggle "Preferred Blogging API" dropdown based on "Enable Blogger API" checkbox.
- `_Admin_Comments.cshtml`: Toggle reCAPTCHA fields and "Days Comments Allowed" textbox based on respective checkboxes.
- `_Admin_Internal.cshtml`: Toggle "Display Time Zone Index" dropdown based on "Adjust Display Time Zone" checkbox.

Improves user experience by ensuring only relevant fields are interactive, reducing potential errors.
Implemented a new script that manages form field states based on the "EnableComments" checkbox. The script ensures fields are re-enabled when the checkbox is checked and integrates with other scripts for toggling logic, such as captcha and comment days.
Improved handling of enabling/disabling form fields based on the state of comments, captcha, and comment days checkboxes. The logic now ensures that reCAPTCHA and comment days fields are only enabled if the comments checkbox is checked. Added event listeners for dynamic toggling of fields, streamlining the overall structure and reducing redundancy in the event handling logic.
Implemented functionality to enable or disable the TinyMCE API key textbox depending on the selected entry edit control option. Added a new dropdown for entry editing control and an event listener to manage the textbox state accordingly.
- Added `<PostPinnedToHomePage />` and `<AlwaysIncludeContentInRSS>` settings to `site.Development.config` and `site.config`.
- Replaced `TextBoxFor` with `DropDownListFor` in `_Admin_FrontPage.cshtml` for category selection, dynamically populated using `CategoryListViewModel`.
- Introduced `CategoryListViewModel` to manage category dropdown data, including a default option.
- Updated `BlogPostListViewModel.cs` to use LINQ by adding `using System.Linq;`.
- Improved admin UI for managing categories and added support for pinning posts and RSS content inclusion.
@poppastring poppastring merged commit 3d4a3b6 into main Jun 22, 2025
3 checks passed
@poppastring poppastring deleted the design-mechanics branch June 22, 2025 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update the admin pages to enable and disable related sections
1 participant