Skip to content

Commit

Permalink
Merge pull request #6 from bcgov/chore/dashboard
Browse files Browse the repository at this point in the history
chore: dashboard view
  • Loading branch information
pbastia authored Sep 18, 2024
2 parents de134f0 + 61d843d commit 925cd35
Show file tree
Hide file tree
Showing 10 changed files with 208 additions and 98 deletions.
77 changes: 48 additions & 29 deletions estimation/app/templates/base.html
Original file line number Diff line number Diff line change
@@ -1,43 +1,62 @@
<!DOCTYPE html>
<html>
{% load static %}
<head>
{% load static %}
<head>
<!-- <link rel="icon" href="{% static 'img/favicon.ico' %}"> -->
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="{% static 'styles/w3.css' %}" type="text/css" />
<link
rel="stylesheet"
href="{% static 'styles/w3.css' %}"
type="text/css"
/>
<link
rel="stylesheet"
href="{% static 'styles/w3-bcgov-theme.css' %}"
type="text/css"
/>
<link rel="stylesheet" href="{% static 'styles/BCSans.css' %}" type="text/css" />
<link rel="stylesheet" href="{% static 'styles/style.css' %}" type="text/css" />
<link
rel="stylesheet"
href="{% static 'styles/BCSans.css' %}"
type="text/css"
/>
<link
rel="stylesheet"
href="{% static 'styles/style.css' %}"
type="text/css"
/>
<title>{% block title %} {{ title }} {% endblock title %}</title>
</head>
<body>
<!-- Top Navigation -->
<div class="w3-top">
<div class="w3-bar w3-theme-light w3-border">
{% if user.is_authenticated %}
<a
href="{% url 'logout' %}"
class="w3-bar-item w3-border-right w3-button"
>Logout
</a>
<button class="w3-button">Welcome, {{ user.username }}!</button>
{% else %}
<a
href="{% url 'github_login' %}"
class="w3-bar-item w3-border-right w3-button"
>Login with GitHub</a>
</head>
<body>
<!-- Top Navigation -->
<div class="w3-top">
<div class="w3-bar w3-row" style="height: 50px">
<img src={% static 'img/bc_logo.png' %} style="height: 48px" class="w3-left"/>
<div class="w3-left w3-margin-left"><h4 style="font-weight: bold">GitHub Async Estimation Tool</h4></div>
{% if user.handle %}
<a
href="{% url 'logout' %}"
class="w3-bar-item w3-border-right w3-button w3-right"
>Logout
</a>
<span>{{ user.handle }}@github<span>
{% endif %}
</div>
<div class="w3-bar w3-theme w3-border" style="height: 5px">
</div>
<div class="w3-main">
<!-- Body -->
<div class="w3-container w3-responsive w3-text-theme">
{% block content %}
{% endblock content %}
</div>
</div>
</div>
<div class="w3-main">
<!-- Body -->
<div class="w3-container w3-responsive w3-text-theme">
{% block content %} {% endblock content %}
<div class="w3-bottom">
<div
class="w3-bar w3-row w3-theme w3-border w3-white"
style="height: 55px"
>
<div class="w3-left">DDS Hackathon 2024</div>
</div>
</div>
</div>
</body>
</body>
</html>
51 changes: 46 additions & 5 deletions estimation/app/templates/dashboard.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
<!-- dashboard.html -->
<div class="w3-bar-item">
<img src="{{ avatar_url }}" alt="Profile Picture" class="w3-circle" style="width: 50px; height: 50px; border-radius:50% ">
<label class="w3-button">Welcome, {{ github_handle }}!</label>
</div>
{% extends "base.html" %}

{% load static %}

{% block title %} GitHub Async Estimation Tool {% endblock %}


{% block content %}
<div class="w3-display-container" style="min-height: 400px">
<div class="w3-row">
<div class="w3-col">
<img
src="{{ avatar_url }}"
alt="Profile Picture"
class="w3-circle"
style="width: 50px; height: 50px; border-radius: 50%"
/>
<h3>Issues awaiting votes for {{ user.handle }}@github:</h3>
</div>
</div>
<div class="w3-row">
<div class="w3-col">
<button class="w3-button w3-display-left">
+ Add Issue For Estimation
</button>
</div>
</div>
<div class="w3-row-padding">
{% for estimation_session in estimation_sessions %}
<div class="w3-col s6 m4 l3">
<div
class="w3-card-2 {% if estimation_session.is_open %} w3-green{% else %} w3-red{% endif %}"
>
<div class="w3-container w3-center">
<p>
Issue
{{estimation_session.issue.repo}}/#{{estimation_session.issue.issue_id}}
</p>
<p>this is a title</p>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% endblock %}
4 changes: 2 additions & 2 deletions estimation/app/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

{% block content %}
<div class="w3-display-container" style="min-height: 400px">
<button class="w3-display-middle">
<a class="w3-button w3-display-middle" href="{% url 'github_login' %}">
<img src={% static 'img/github-mark.png' %} style="height: 15px; margin-bottom: 2px" />
Login with Github
</button>
</a>
</div>
{% endblock %}

12 changes: 7 additions & 5 deletions estimation/app/urls.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from django.urls import path
from . import views

urlpatterns = [path("", views.index, name="index"),
path('github/login/', views.github_login, name='github_login'),
path('github/callback/', views.github_callback, name='github_callback'),
path('dashboard/', views.dashboard, name='dashboard'),
]

urlpatterns = [
path("", views.index, name="index"),
path("github/login/", views.github_login, name="github_login"),
path("github/callback/", views.github_callback, name="github_callback"),
path("dashboard/", views.dashboard, name="dashboard"),
]
Empty file.
7 changes: 7 additions & 0 deletions estimation/app/view_models/base_view_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from typing import TypedDict

from ..models import GithubUser


class BaseViewModel(TypedDict):
user: GithubUser
8 changes: 8 additions & 0 deletions estimation/app/view_models/dashboard_view_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from typing import List

from ..models import EstimationSession
from ..view_models.base_view_model import BaseViewModel


class DashboardViewModel(BaseViewModel):
estimation_sessions: List[EstimationSession]
5 changes: 5 additions & 0 deletions estimation/app/view_models/index_view_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import TypedDict


class IndexViewModel(TypedDict):
pass
Loading

0 comments on commit 925cd35

Please sign in to comment.