+
+
+
+
Estimation Session For Card #12345
+
+
blargh
+
+
+
+{% endblock %}
diff --git a/estimation/app/templates/select_issue.html b/estimation/app/templates/select_issue.html
index e69de29..f811371 100644
--- a/estimation/app/templates/select_issue.html
+++ b/estimation/app/templates/select_issue.html
@@ -0,0 +1,30 @@
+{% extends "base.html" %}
+
+{% block title %} Select Isuse {% endblock %}
+
+
+{% block content %}
+
+
+
+
+
Select issue to estimate
+
+
+
+
+
+{% endblock %}
diff --git a/estimation/app/urls.py b/estimation/app/urls.py
index 119b50d..7d0e81f 100644
--- a/estimation/app/urls.py
+++ b/estimation/app/urls.py
@@ -8,4 +8,7 @@
path("github/callback/", views.github_callback, name="github_callback"),
path("dashboard/", views.dashboard, name="dashboard"),
path("logout", views.logout, name="logout"),
+ path("select_issue", views.select_issue, name="select_issue"),
+ path("confirm_issue", views.confirm_issue, name="confirm_issue"),
+ path("estimation_session", views.estimation_session, name="estimation_session"),
]
diff --git a/estimation/app/view_models/__init__.py b/estimation/app/view_models/__init__.py
index 2738c5b..b83f6c0 100644
--- a/estimation/app/view_models/__init__.py
+++ b/estimation/app/view_models/__init__.py
@@ -1,3 +1,5 @@
from .base_view_model import *
from .dashboard_view_model import *
from .index_view_model import *
+from .select_issue_view_model import *
+from .confirm_issue_view_model import *
diff --git a/estimation/app/view_models/confirm_issue_view_model.py b/estimation/app/view_models/confirm_issue_view_model.py
new file mode 100644
index 0000000..18a8775
--- /dev/null
+++ b/estimation/app/view_models/confirm_issue_view_model.py
@@ -0,0 +1,7 @@
+from ..models import GithubIssue
+from ..view_models.base_view_model import BaseViewModel
+
+
+class ConfirmIssueViewModel(BaseViewModel):
+ issue: GithubIssue
+ issue_url: str
diff --git a/estimation/app/view_models/select_issue_view_model.py b/estimation/app/view_models/select_issue_view_model.py
new file mode 100644
index 0000000..7e3d763
--- /dev/null
+++ b/estimation/app/view_models/select_issue_view_model.py
@@ -0,0 +1,5 @@
+from ..view_models.base_view_model import BaseViewModel
+
+
+class SelectIssueViewModel(BaseViewModel):
+ issue_url: str
diff --git a/estimation/app/views/__init__.py b/estimation/app/views/__init__.py
index 1581478..caf4f99 100644
--- a/estimation/app/views/__init__.py
+++ b/estimation/app/views/__init__.py
@@ -1,2 +1,5 @@
from .base import *
from .logout import *
+from .select_issue import *
+from .confirm_issue import *
+from .estimation_session import *
diff --git a/estimation/app/views/confirm_issue.py b/estimation/app/views/confirm_issue.py
new file mode 100644
index 0000000..4c5316b
--- /dev/null
+++ b/estimation/app/views/confirm_issue.py
@@ -0,0 +1,19 @@
+from django.http import HttpRequest, HttpResponseRedirect
+from django.shortcuts import render
+
+from ..models import GithubIssue
+from ..view_models.confirm_issue_view_model import ConfirmIssueViewModel
+
+
+def confirm_issue(request: HttpRequest):
+
+ if request.method == "POST":
+ # Here we'll create the database stuff
+ return HttpResponseRedirect("estimation_session")
+
+ issue = GithubIssue(org="bcgov", repo="repo", issue_id=12345)
+ return render(
+ request,
+ "confirm_issue.html",
+ ConfirmIssueViewModel(issue=issue, issue_url=issue.url()),
+ )
diff --git a/estimation/app/views/estimation_session.py b/estimation/app/views/estimation_session.py
new file mode 100644
index 0000000..92b4b6e
--- /dev/null
+++ b/estimation/app/views/estimation_session.py
@@ -0,0 +1,6 @@
+from django.http import HttpRequest
+from django.shortcuts import render
+
+
+def estimation_session(request: HttpRequest):
+ return render(request, "estimation_session.html", {})
diff --git a/estimation/app/views/select_issue.py b/estimation/app/views/select_issue.py
new file mode 100644
index 0000000..1a490f5
--- /dev/null
+++ b/estimation/app/views/select_issue.py
@@ -0,0 +1,24 @@
+from django.http import HttpRequest
+from django.shortcuts import render
+
+from ..models import GithubIssue
+from ..view_models.confirm_issue_view_model import ConfirmIssueViewModel
+
+from ..view_models.select_issue_view_model import SelectIssueViewModel
+
+
+def select_issue(request: HttpRequest):
+
+ if request.method == "POST":
+ issue_url = request.POST.get("issue_url")
+ # Here goes the Github API request
+
+ gh_issue = GithubIssue(org="bcgov", repo="cas-estimation-tool", issue_id="1234")
+
+ return render(
+ request,
+ "confirm_issue.html",
+ ConfirmIssueViewModel(issue=gh_issue, issue_url=issue_url),
+ )
+ else:
+ return render(request, "select_issue.html", SelectIssueViewModel())