Skip to content

Sort Questions by Date #27

@ishan-xy

Description

@ishan-xy

Admin Dashboard Question Sorting Issue

Description

The questions displayed on the admin dashboard are currently not sorted by date, making it difficult for admins to manage questions.

Steps to Reproduce:

  1. Create a superuser or a staff user in the database.
  2. Go to http://localhost:4881/api/admin/dashboard.
  3. Add a few questions and observe their display order.

Expected Behavior:

Questions should be displayed in a sorted order, ideally by date, to improve readability and organization.
You can also separate the questions into different tables, based on their date.

Current Behavior:

Questions are displayed in an unsorted order, which can be confusing when viewing recent updates.

Suggested Fix:

In the dashboard.html file, located at admin_dash/templates/admin_dash, modify the template logic to sort questions by their question.questionDate. This field is populated from the database and is referenced in the admin_dashboard() function in views.py.

Additional Notes:

  • Ensure the sorting order is in descending order, so the most recent questions appear first.
  • Implementing this change will improve the user experience by displaying the latest questions at the top of the list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions