Skip to content

Conversation

@RileyChampion
Copy link
Collaborator

@RileyChampion RileyChampion commented Apr 9, 2025

Todo

  • Create admin route /admin
    • /dashboard/overview
    • /dashboard/users
    • /dashboard/events -> redirects to /events (as of right now)
    • /dashboard/posts -> redirects to /events (as of right now)
  • Create admin template
  • Add protection on admin routes to only "ADMIN" role
  • Add view of users
    • Pagination on total viewer list
    • Change role check boxes with confirmation dialogue boxes
    • Delete user buttons

Future Implementation

  • Analytics API for admin dashboard
  • Admin invite page
  • Admin cancel membership
  • Admin ban user
  • Admin promote users

@RileyChampion RileyChampion marked this pull request as ready for review June 6, 2025 06:02
@RileyChampion RileyChampion changed the title WIP: Admin Dashboard Admin Dashboard Jun 6, 2025
(() => {
const counters = document.querySelectorAll(".counter");
for (const counter of counters) {
createNewCounter(counter, 0, parseInt(counter.innerText), 4500);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This animation is cool but it feels too slow. I want to see this information pretty immediately when I open the dashboard. Functionally the admin tools don't need any fancy animations at all but I do kind of like it for flavor. Reduce to 1 second maybe?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would also be nice if the animation didn't replay when switching between the admin views (overview/users on the left)

tooltipElement.classList.add("show");

// Position tooltip near the point
const rect = this.getBoundingClientRect();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now it feels like you need to be very precise when hovering over a dot to view the tooltip. It would be nice to make the dot a little bigger maybe? Or include the entire vertical slice of the chart when considering when to show the mouseover tooltip (and also highlight the slice as you move left and right).

textAnchor: "middle",
},
axisY: {
axisTitle: "Revenue ($)",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sideways text is kind of hard to read, not sure the best way of improving it though. Maybe set text-orientation to upright or just sacrifice some horizontal real estate to display it horizontally?

<input
_="on click
{% if user.is_writer %}
if(confirm('Are you sure you want to promote user to a
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clicking "cancel" here still changes the user role.

{% endblock styles %}
{% block content %}
<div id="admin/">
<aside id="sidebar">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to extend the sidebar to /events and /posts, but that would be dependent on the role I guess? Maybe more trouble than it's worth.

{% block panel %}
<div id="admin/dashboard/overview">
<div class="widget-container" id="widget-users">
<a href="dashboard/users">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ends up linking to "/admin/dashboard/dashboard/users"

</div>
</div>
<div class="widget-container" id="widget-newsletters">
<a>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the "Events" box both link to nothing but have the "open in new tab icon" still.

@swlody
Copy link
Collaborator

swlody commented Jun 6, 2025

It would be nice if the dashboard were linked-to somewhere from the main page when the user role is admin.

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.

3 participants