Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions apps/dashboard/apps.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
"""Dashboard application configuration."""
"""Application configuration for the dashboard app."""

from __future__ import annotations

from django.apps import AppConfig


class DashboardConfig(AppConfig):
"""Configure the dashboard application."""
"""Configure the StudyBuddy dashboard app."""

default_auto_field = "django.db.models.BigAutoField"
name = "apps.dashboard"
label = "dashboard"
2 changes: 1 addition & 1 deletion apps/dashboard/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Dashboard URL routes."""
"""URL routes for the authenticated dashboard."""

from __future__ import annotations

Expand Down
17 changes: 13 additions & 4 deletions apps/dashboard/views.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
"""Dashboard views."""
"""Views for authenticated StudyBuddy dashboard pages."""

from __future__ import annotations

from django.contrib.auth.decorators import login_required
from django.http import HttpRequest, HttpResponse
from django.shortcuts import render


@login_required
def index(request):
"""Render the authenticated dashboard shell."""
return render(request, "dashboard/index.html")
def index(request: HttpRequest) -> HttpResponse:
"""Render the authenticated StudyBuddy dashboard shell."""
roles = request.user.studybuddy_roles.order_by("display_name")

return render(
request,
"dashboard/index.html",
{
"roles": roles,
},
)
11 changes: 11 additions & 0 deletions static/css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,17 @@ p {
padding-left: var(--space-xl);
}

.message-stack {
display: grid;
gap: var(--space-sm);
padding-top: var(--space-lg);
}

.message-stack .alert {
margin: 0;
border-radius: var(--radius-md);
}

.hero {
padding: var(--space-xxl) 0 var(--space-xxxl);
text-align: center;
Expand Down
25 changes: 18 additions & 7 deletions templates/base.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
{% load static %}
<!-- File: /templates/base.html -->
<!DOCTYPE html>
<html lang="en">
<!doctype html>
<html lang="en-gb">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}StudyBuddy{% endblock %}</title>

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="{% static 'css/theme.css' %}?v=20260507-footer">
<script src="https://unpkg.com/htmx.org@1.9.12"></script>
<link rel="stylesheet" href="{% static 'css/theme.css' %}?v=20260507-base">
</head>
<body>
<div class="site-shell">
Expand Down Expand Up @@ -47,6 +45,18 @@
</header>

<main class="site-main">
{% if messages %}
<div class="container-ui">
<div class="message-stack" aria-live="polite">
{% for message in messages %}
<div class="alert alert-{{ message.tags|default:'info' }}" role="alert">
{{ message }}
</div>
{% endfor %}
</div>
</div>
{% endif %}

{% block content %}{% endblock %}
</main>

Expand Down Expand Up @@ -96,5 +106,6 @@
</div>
</footer>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
66 changes: 41 additions & 25 deletions templates/dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@
<div class="page-stack">
<header class="page-header">
<div>
<span class="eyebrow">Studytracking 2026</span>
<h1 class="page-title">Dashboard</h1>
<p class="page-subtitle">A motivating snapshot of study time, goals, streaks, and the next session to start.</p>
<span class="eyebrow">Dashboard</span>
<h1 class="page-title">Your study dashboard</h1>
<p class="page-subtitle">
This is your protected StudyBuddy workspace. Sprint 2 will add study sessions,
notes, and personal progress metrics here.
</p>
</div>
<div class="card-actions">
<a class="btn-ui btn-ui-primary" href="#">+ Session</a>
<span class="mock-pill dark">Authenticated</span>
</div>
</header>

Expand All @@ -36,6 +39,40 @@ <h1 class="page-title">Dashboard</h1>
</div>
</section>

<section class="section-tight">
<div class="card-grid card-grid-2">
<article class="card-ui feature-card">
<span class="feature-icon">01</span>
<h2 class="card-title-ui">No study sessions yet</h2>
<p>
Your dashboard is ready. Once the core study workflow is added,
this page will show recent sessions, notes, study totals, and
AI/NLP insight summaries.
</p>
</article>

<article class="card-ui feature-card">
<span class="feature-icon">02</span>
<h2 class="card-title-ui">Account access</h2>
{% if roles %}
<div class="mock-pill-row">
{% for role in roles %}
<span class="mock-pill">{{ role.display_name }}</span>
{% endfor %}
</div>
{% else %}
<p>
No product roles have been assigned yet. Role-aware access is
available for future product surfaces.
</p>
{% endif %}
<div class="card-actions">
<a class="btn-ui" href="{% url 'users:profile' %}">Open Profile</a>
</div>
</article>
</div>
</section>

<section class="section-tight">
<div class="mock-grid">
<article class="mock-panel tall">
Expand Down Expand Up @@ -82,27 +119,6 @@ <h1 class="page-title">Dashboard</h1>
</article>
</div>
</section>

<section class="section-tight">
<div class="card-grid card-grid-2">
<article class="card-ui feature-card">
<span class="feature-icon">01</span>
<h2 class="card-title-ui">Build your first study plan</h2>
<p>Add a subject, target study time, and the first session you want to complete.</p>
<div class="card-actions">
<a class="btn-ui btn-ui-blue" href="#">Add Session</a>
</div>
</article>
<article class="card-ui feature-card">
<span class="feature-icon">02</span>
<h2 class="card-title-ui">Review account settings</h2>
<p>Confirm your StudyBuddy profile before personal planning preferences are added.</p>
<div class="card-actions">
<a class="btn-ui" href="{% url 'users:profile' %}">Open Profile</a>
</div>
</article>
</div>
</section>
</div>
</div>
{% endblock %}
Loading