Skip to content

Admin panel: Add/Edit mode, optional PYQ branch, and contributor visibility control#1

Draft
Lav-developer wants to merge 2 commits into
mainfrom
codex/fix-admin-panel-editing-issues
Draft

Admin panel: Add/Edit mode, optional PYQ branch, and contributor visibility control#1
Lav-developer wants to merge 2 commits into
mainfrom
codex/fix-admin-panel-editing-issues

Conversation

@Lav-developer
Copy link
Copy Markdown
Owner

Motivation

  • Enable full admin edit workflows because the previous UI made editing PYQs, contributors and users awkward or effectively read-only by not exposing a focused edit flow.
  • Allow some PYQs to include an optional branch in their canonical title because some papers require course+branch in the display string.
  • Add explicit contributor visibility control so only approved contributors appear on the public site (no dummy entries).

Description

  • Added an Action Mode selector (Add New / Edit Current) and entity chooser (PYQ / Contributor / User) to the admin quick-create area and a mode switcher that shows/hides forms and loads data when edit mode is selected (admin.html, admin.js).
  • Added an optional Branch input to the PYQ add form and updated title generation to include branch when provided via buildPyqTitle(course, branch, semester, subject, session) and persist branch to Firestore when creating PYQs (admin.html, admin.js).
  • Added a showOnWebsite field for contributors in the admin add/edit flows, persisted it to Firestore, and extended contributor edit prompts to allow toggling visibility (admin.html, admin.js).
  • Updated public-site contributor loading to only query contributors where showOnWebsite == true and removed the placeholder "join" card so only real contributors are rendered (script.js).

Testing

  • Automated JavaScript syntax checks using node -c admin.js and node -c script.js completed successfully.
  • Verified the modified admin UI elements and JS functions are present and callable by inspecting the updated files (syntax checks passed).
  • No automated unit tests exist for these UI flows; changes were validated with the above static checks.

Codex Task

@netlify
Copy link
Copy Markdown

netlify Bot commented May 6, 2026

Deploy Preview for dsmnru-pyq ready!

Name Link
🔨 Latest commit cae151f
🔍 Latest deploy log https://app.netlify.com/projects/dsmnru-pyq/deploys/69fb6969f13b3d00079f7504
😎 Deploy Preview https://deploy-preview-1--dsmnru-pyq.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 28
Accessibility: 89
Best Practices: 67
SEO: 100
PWA: 60
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant