-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from bcgov/chore/dashboard
chore: dashboard view
- Loading branch information
Showing
10 changed files
with
208 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from typing import TypedDict | ||
|
||
|
||
class IndexViewModel(TypedDict): | ||
pass |
Oops, something went wrong.