|
|
|
<!DOCTYPE html> |
|
<html> |
|
<head> |
|
<title>Project Task Breakdown</title> |
|
<link rel="stylesheet" href="{{ url_for('static', filename='ProjectBreakdown.css') }}"> |
|
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous"> |
|
</head> |
|
<body> |
|
|
|
|
|
<nav class="navbar navbar-expand-lg bg-body-tertiary"> |
|
<div class="container-fluid"> |
|
<a class="navbar-brand" href="{{ url_for('index') }}">Home</a> |
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation"> |
|
<span class="navbar-toggler-icon"></span> |
|
</button> |
|
<div class="collapse navbar-collapse" id="navbarNavAltMarkup"> |
|
<div class="navbar-nav"> |
|
<a class="nav-link active" href="{{ url_for('text_summarization') }}">Summarization</a> |
|
<a class="nav-link" aria-current="page" href="{{ url_for('project_breakdown') }}">Task Breakdown</a> |
|
<a class="nav-link" href="{{ url_for('language_translation') }}">Translation</a> |
|
<a class="nav-link" href="{{ url_for('text_generation') }}">Generation</a> |
|
</div> |
|
</div> |
|
</div> |
|
</nav> |
|
|
|
<header> |
|
<img src="{{ url_for('static', filename='Images/Refineverse logo.png') }}" alt="Refineverse Logo"> |
|
<h1>Project Task Breakdown</h1> |
|
</header> |
|
|
|
|
|
<main> |
|
<form action="#" method="POST"> |
|
<div class="user-story"> |
|
<h2>User Story</h2> |
|
<textarea id="user-story-text" name='user-story-text' placeholder="Enter your user story"></textarea> |
|
<button id="clear-btn" formmethod="GET" formaction="#" onclick="clearTextArea()">Clear</button> |
|
|
|
|
|
{% with messages = get_flashed_messages(with_categories=true) %} |
|
{% for category, message in messages %} |
|
{% if category == 'error' %} |
|
<div class="alert alert-danger alert-dismissible fade show" role="alert"> |
|
{{ message }} |
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> |
|
</div> |
|
{% else %} |
|
<div class="alert alert-success alert-dismissible fade show" role="alert"> |
|
{{ message }} |
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> |
|
</div> |
|
{% endif %} |
|
{% endfor %} |
|
{% endwith %} |
|
|
|
<button id="breakdown-btn" name="breakdown-btn" type="submit">Breakdown</button> |
|
</div> |
|
</form> |
|
|
|
<div class="user-story-list"> |
|
<h2>Breakdown Summary</h2> |
|
|
|
|
|
<table id="breakdown-table"> |
|
<thead> |
|
<tr> |
|
<th onclick="sortTable(0)">User Story</th> |
|
<th onclick="sortTable(1)">Project Task</th> |
|
</tr> |
|
</thead> |
|
|
|
|
|
<tbody id="breakdown-body"> |
|
{% for row in rows %} |
|
<tr> |
|
|
|
<td>{{ row[0] }}</td> |
|
<td>{{ row[1] }}</td> |
|
</tr> |
|
{% endfor %} |
|
</tbody> |
|
</table> |
|
</div> |
|
</main> |
|
|
|
<div class="back-Btn-Container"> |
|
<div class="buttons-container"> |
|
<a href="{{ url_for('index') }}"><button class="back-btn">Back</button></a> |
|
</div> |
|
</div> |
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script> |
|
<script> |
|
function clearTextArea() { |
|
document.getElementById("user-story-text").value = ""; |
|
} |
|
|
|
|
|
function sortTable(columnIndex) { |
|
|
|
var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0; |
|
table = document.getElementById("breakdown-table"); |
|
switching = true; |
|
|
|
|
|
dir = "asc"; |
|
|
|
|
|
while (switching) { |
|
|
|
switching = false; |
|
rows = table.rows; |
|
|
|
|
|
for (i = 1; i < (rows.length - 1); i++) { |
|
|
|
shouldSwitch = false; |
|
|
|
|
|
x = rows[i].getElementsByTagName("TD")[columnIndex]; |
|
y = rows[i + 1].getElementsByTagName("TD")[columnIndex]; |
|
|
|
|
|
if (dir == "asc") { |
|
if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase()) { |
|
|
|
shouldSwitch = true; |
|
break; |
|
} |
|
} else if (dir == "desc") { |
|
if (x.innerHTML.toLowerCase() < y.innerHTML.toLowerCase()) { |
|
|
|
shouldSwitch = true; |
|
break; |
|
} |
|
} |
|
} |
|
if (shouldSwitch) { |
|
|
|
|
|
rows[i].parentNode.insertBefore(rows[i + 1], rows[i]); |
|
switching = true; |
|
|
|
switchcount ++; |
|
} else { |
|
|
|
|
|
if (switchcount == 0 && dir == "asc") { |
|
dir = "desc"; |
|
switching = true; |
|
} |
|
} |
|
} |
|
|
|
|
|
var headers = table.getElementsByTagName("TH"); |
|
for (i = 0; i < headers.length; i++) { |
|
headers[i].innerHTML = headers[i].innerHTML.replace(/ ▲| ▼/g, ""); |
|
} |
|
var arrow = document.createElement("span"); |
|
arrow.className = "arrow"; |
|
if (dir == "asc") { |
|
arrow.innerHTML = " ▲"; |
|
} else { |
|
arrow.innerHTML = " ▼"; |
|
} |
|
headers[columnIndex].appendChild(arrow); |
|
} |
|
</script> |
|
</body> |
|
</html> |
|
|