-
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.
- Loading branch information
Showing
13 changed files
with
161 additions
and
5 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
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,40 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block title %} Select Isuse {% endblock %} | ||
|
||
|
||
{% block content %} | ||
<div class="w3-row w3-padding-32"> | ||
<div class="w3-col"> | ||
<div class="w3-card-4"> | ||
<div class="w3-container w3-theme"> | ||
<h2>Confirm issue to estimate</h2> | ||
</div> | ||
<form action="confirm_issue" method="post" class="w3-container"> | ||
{% csrf_token %} | ||
<div class="w3-row w3-margin"> | ||
<div class="w3-col"> | ||
<label for="issue_url">Issue URL</label> | ||
<input id="issue_url" name="issue_url" class="w3-input" type="text" placeholder="The github issue URL, i.e. https://github.com/bcgov/cas-estimation-tool/issues/4" value="{{ issue_url }}" disabled/> | ||
</div> | ||
</div> | ||
<div class="w3-row w3-margin"> | ||
<div class="w3-col" style="width: 120px;"> | ||
<p>Issue details</p> | ||
</div> | ||
<div class="w3-rest"> | ||
<p>ID: {{ issue.issue_id }}</p> | ||
<p>Title: The title of the issue goes here</p> | ||
</div> | ||
</div> | ||
<div class="w3-row w3-margin"> | ||
<div class="w3-col"> | ||
<input type="submit" value="Start Estimation Session" class="w3-button w3-theme w3-right w3-margin"/> | ||
<a class="w3-button w3-right w3-margin">Cancel</a> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block title %} Select Isuse {% endblock %} | ||
|
||
|
||
{% block content %} | ||
<div class="w3-row w3-padding-32"> | ||
<div class="w3-col"> | ||
<div class="w3-card-4"> | ||
<div class="w3-container w3-theme"> | ||
<h2>Estimation Session For Card #12345</h2> | ||
</div> | ||
<div>blargh</div> | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block title %} Select Isuse {% endblock %} | ||
|
||
|
||
{% block content %} | ||
<div class="w3-row w3-padding-32"> | ||
<div class="w3-col"> | ||
<div class="w3-card-4"> | ||
<div class="w3-container w3-theme"> | ||
<h2>Select issue to estimate</h2> | ||
</div> | ||
<form action="select_issue" method="post" class="w3-container"> | ||
{% csrf_token %} | ||
<div class="w3-row w3-margin"> | ||
<div class="w3-col"> | ||
<label for="issue_url">Issue URL:</label> | ||
<input id="issue_url" name="issue_url" class="w3-input" type="text" placeholder="The github issue URL, i.e. https://github.com/bcgov/cas-estimation-tool/issues/4" value="{{ issue_url }}"/> | ||
</div> | ||
</div> | ||
<div class="w3-row w3-margin"> | ||
<div class="w3-col"> | ||
<input type="submit" value="Find Issue" class="w3-button w3-theme w3-right"/> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</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,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 * |
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 ..models import GithubIssue | ||
from ..view_models.base_view_model import BaseViewModel | ||
|
||
|
||
class ConfirmIssueViewModel(BaseViewModel): | ||
issue: GithubIssue | ||
issue_url: str |
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 ..view_models.base_view_model import BaseViewModel | ||
|
||
|
||
class SelectIssueViewModel(BaseViewModel): | ||
issue_url: str |
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,2 +1,5 @@ | ||
from .base import * | ||
from .logout import * | ||
from .select_issue import * | ||
from .confirm_issue import * | ||
from .estimation_session import * |
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,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()), | ||
) |
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,6 @@ | ||
from django.http import HttpRequest | ||
from django.shortcuts import render | ||
|
||
|
||
def estimation_session(request: HttpRequest): | ||
return render(request, "estimation_session.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 |
---|---|---|
@@ -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()) |