Nik97 commited on
Commit
2db0bd6
1 Parent(s): 2e11420

Upload 4 files

Browse files
templates/LanguageTranslationUI.html ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- jinja2 template engine coding style for flask framework -->
2
+ <!-- To Debug: css and form -->
3
+ <!DOCTYPE html>
4
+ <head>
5
+ <title>LanguageTranslationUI</title>
6
+ <link rel="stylesheet" href="{{ url_for('static', filename='Translation.css') }}">
7
+ <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">
8
+ </head>
9
+ <body>
10
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
11
+
12
+ <div class="k">
13
+ <img src="{{ url_for('static', filename='Images/Refineverse logo.png') }}" alt="Refineverse Logo">
14
+
15
+ <div class="kk">
16
+ <h1>Language Translation</h1>
17
+ <h5>Machine Translation for your desired choice of language.</h5>
18
+
19
+ </div>
20
+ </div>
21
+ <form action="#" method="POST">
22
+ <!-- Drop-down box for source language. -->
23
+ <label for="source_language" id="source">Choose your source language:</label>
24
+ <select id="language" name="source_language">
25
+ <option value="en" selected>English</option>
26
+ <option value="zh">Chinese</option>
27
+ <option value="ms">Malay</option>
28
+ <option value="ta">Tamil</option>
29
+ <option value="th">Thai</option>
30
+ </select>
31
+
32
+ <!-- Drop-down box for target language. -->
33
+ <label for="target_language" id="target">Choose your target language:</label>
34
+ <select id="language" name="target_language">
35
+ <option value="en">English</option>
36
+ <option value="zh" selected>Chinese</option>
37
+ <option value="ms">Malay</option>
38
+ <option value="ta">Tamil</option>
39
+ <option value="th">Thai</option>
40
+ </select>
41
+
42
+ <!-- div container for input & translation textareas -->
43
+ <div class="kkk">
44
+ <textarea id="type" name="input" placeholder="Please enter your User Story in 'As a _ , I want to _ so that _'/'作为__ , 我想要__以便__。'/'Sebagai__, saya mahu__supaya__.'/'என__, எனக்கு வேண்டும்__அதனால்__.'/'ในฐานะ__, ฉันต้องการ__เพื่อที่ฉัน__.' format.">{{ input_text }}</textarea>
45
+ <textarea id="out" name="out" placeholder="Your translated user story will appear here!" readonly>{{ translatedStory }}</textarea>
46
+ </div>
47
+
48
+ <!--
49
+ Jinja template for displaying flash messages. Gets all flash messages to be displayed on page.
50
+ To note: Pay attention to the category name. It MUST match the category name given on flask-end (Refineverse.py)!
51
+ -->
52
+ {% with messages = get_flashed_messages(with_categories=true) %}
53
+ {% for category, message in messages %}
54
+ {% if category == 'error' %}
55
+ <div class="alert alert-danger alert-dismissible fade show" role="alert">
56
+ {{ message }}
57
+ <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
58
+ </div>
59
+ {% else %}
60
+ <div class="alert alert-success alert-dismissible fade show" role="alert">
61
+ {{ message }}
62
+ <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
63
+ </div>
64
+ {% endif %}
65
+ {% endfor %}
66
+ {% endwith %}
67
+
68
+ <div class="kkkk">
69
+ <button id="clear" onclick="clearContent()" type="button">Clear</button>
70
+ <button id="translate" type="submit">Translate</button>
71
+ </div>
72
+ </form>
73
+
74
+ <!-- need debug this part for css as button all the way to the right -->
75
+ <div class="back">
76
+ <a href="{{ url_for('index') }}"><button class="backb">Back</button></a>
77
+ </div>
78
+
79
+ <script>
80
+ function clearContent()
81
+ {
82
+ const type = document.getElementById('type');
83
+ const out = document.getElementById('out');
84
+ type.value = '';
85
+ out.value = '';
86
+ }
87
+ </script>
88
+
89
+ </body>
90
+ </html>
templates/ProjectBreakdownUI.html ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- jinja2 template engine coding style for flask framework -->
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <title>Project Task Breakdown</title>
6
+ <link rel="stylesheet" href="{{ url_for('static', filename='ProjectBreakdown.css') }}">
7
+ <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">
8
+ </head>
9
+ <body>
10
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
11
+ <header>
12
+ <img src="{{ url_for('static', filename='Images/Refineverse logo.png') }}" alt="Refineverse Logo">
13
+ <h1>Project Task Breakdown</h1>
14
+ </header>
15
+
16
+ <!-- User input textarea box; breakdown & clear button functionality; display output functionality -->
17
+ <main>
18
+ <form action="#" method="POST">
19
+ <div class="user-story">
20
+ <h2>User Story</h2>
21
+ <textarea id="user-story-text" name='user-story-text' placeholder="Enter your user story"></textarea>
22
+ <button id="clear-btn" formmethod="GET" formaction="#" onclick="clearTextArea()">Clear</button>
23
+
24
+ <!-- When using flash, it is necessary to always use a for-loop to grab all messages -->
25
+ {% with messages = get_flashed_messages(with_categories=true) %} <!-- This is to use flash with pre-set categories -->
26
+ {% for category, message in messages %}
27
+ {% if category == 'error' %} <!-- If it is a flash message with the error, message, we display our exception message -->
28
+ <div class="alert alert-danger alert-dismissible fade show" role="alert">
29
+ {{ message }}
30
+ <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
31
+ </div>
32
+ {% else %} <!-- Otherwise, proceed as usual -->
33
+ <div class="alert alert-success alert-dismissible fade show" role="alert">
34
+ {{ message }}
35
+ <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
36
+ </div>
37
+ {% endif %}
38
+ {% endfor %}
39
+ {% endwith %}
40
+
41
+ <button id="breakdown-btn" name="breakdown-btn" type="submit">Breakdown</button>
42
+ </div>
43
+ </form>
44
+
45
+ <div class="user-story-list">
46
+ <h2>Breakdown Summary</h2>
47
+
48
+ <!-- Output Table -->
49
+ <table id="breakdown-table">
50
+ <thead>
51
+ <tr>
52
+ <th onclick="sortTable(0)">User Story</th>
53
+ <th onclick="sortTable(1)">Project Task</th>
54
+ </tr>
55
+ </thead>
56
+
57
+ <!-- will need to Use For Loop to link sqlite3 database -->
58
+ <tbody id="breakdown-body">
59
+ {% for row in rows %}
60
+ <tr>
61
+ <!-- Return and display output from Refineverse.py based on routing from ZeroshotFeature.py -->
62
+ <td>{{ row[0] }}</td>
63
+ <td>{{ row[1] }}</td>
64
+ </tr>
65
+ {% endfor %}
66
+ </tbody>
67
+ </table>
68
+ </div>
69
+ </main>
70
+
71
+ <div class="back-Btn-Container">
72
+ <div class="buttons-container">
73
+ <a href="{{ url_for('index') }}"><button class="back-btn">Back</button></a>
74
+ </div>
75
+ </div>
76
+
77
+ <script>
78
+ function clearTextArea() {
79
+ document.getElementById("user-story-text").value = "";
80
+ }
81
+
82
+ // Function to sort table in ascending/descending order
83
+ function sortTable(columnIndex) {
84
+ // Initialize variables
85
+ var table, rows, switching, i, x, y, shouldSwitch, dir, switchcount = 0;
86
+ table = document.getElementById("breakdown-table");
87
+ switching = true;
88
+
89
+ // Set the sorting direction to ascending:
90
+ dir = "asc";
91
+ /* Make a loop that will continue until
92
+ no switching has been done: */
93
+ while (switching) {
94
+ // Start by saying: no switching is done:
95
+ switching = false;
96
+ rows = table.rows;
97
+ /* Loop through all table rows (except the
98
+ first, which contains table headers): */
99
+ for (i = 1; i < (rows.length - 1); i++) {
100
+ // Start by saying there should be no switching:
101
+ shouldSwitch = false;
102
+ /* Get the two elements you want to compare,
103
+ one from current row and one from the next: */
104
+ x = rows[i].getElementsByTagName("TD")[columnIndex];
105
+ y = rows[i + 1].getElementsByTagName("TD")[columnIndex];
106
+ /* Check if the two rows should switch place,
107
+ based on the direction, asc or desc: */
108
+ if (dir == "asc") {
109
+ if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase()) {
110
+ // If so, mark as a switch and break the loop:
111
+ shouldSwitch = true;
112
+ break;
113
+ }
114
+ } else if (dir == "desc") {
115
+ if (x.innerHTML.toLowerCase() < y.innerHTML.toLowerCase()) {
116
+ // If so, mark as a switch and break the loop:
117
+ shouldSwitch = true;
118
+ break;
119
+ }
120
+ }
121
+ }
122
+ if (shouldSwitch) {
123
+ /* If a switch has been marked, make the switch
124
+ and mark that a switch has been done: */
125
+ rows[i].parentNode.insertBefore(rows[i + 1], rows[i]);
126
+ switching = true;
127
+ // Each time a switch is done, increase this count by 1:
128
+ switchcount ++;
129
+ } else {
130
+ /* If no switching has been done AND the direction is "asc",
131
+ set the direction to "desc" and run the while loop again. */
132
+ if (switchcount == 0 && dir == "asc") {
133
+ dir = "desc";
134
+ switching = true;
135
+ }
136
+ }
137
+ }
138
+
139
+ // Add arrow icons to the header cells to indicate the sort direction:
140
+ var headers = table.getElementsByTagName("TH");
141
+ for (i = 0; i < headers.length; i++) {
142
+ headers[i].innerHTML = headers[i].innerHTML.replace(/ ▲| ▼/g, "");
143
+ }
144
+ var arrow = document.createElement("span");
145
+ arrow.className = "arrow";
146
+ if (dir == "asc") {
147
+ arrow.innerHTML = " ▲";
148
+ } else {
149
+ arrow.innerHTML = " ▼";
150
+ }
151
+ headers[columnIndex].appendChild(arrow);
152
+ }
153
+ </script>
154
+ </body>
155
+ </html>
templates/RefineverseDashboardUI.html ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- jinja2 template engine coding style for flask framework -->
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <title>DashboardUI</title>
6
+ <link rel="stylesheet" href="{{url_for('static', filename='Dashboard.css')}}">
7
+ </head>
8
+ <body>
9
+ <div class="title">
10
+ <img src="{{url_for('static', filename='Images/Refineverse logo.png')}}" alt="cant find picture">
11
+ <h1>User Story Refinement</h1>
12
+ </div>
13
+ <div class="pic">
14
+ <img src="{{url_for('static', filename='Images/Text Summarization.png')}}" alt="cant find picture" class="p1">
15
+ <img src="{{url_for('static', filename='Images/Project Breakdown.png')}}" alt="cant find picture" class="p2">
16
+ <img src="{{url_for('static', filename='Images/Language Translation.jpg')}}" alt="cant find picture" class="p3">
17
+ </div>
18
+ <div class="trdl">
19
+ <div class="texts1">
20
+ <h2>Text Summarization</h2>
21
+ <p id="f">With our plugin's natural language processing capabilities, you can now generate a concise summary of your user story with just a few clicks. No more sifting through lengthy descriptions or struggling to communicate the essence of your user story to team members. Our plugin does the heavy lifting for you!</p>
22
+
23
+ </div>
24
+ <div class="texts2">
25
+ <h2>Project Task Breakdown</h2>
26
+ <p id="s">With our plugin's natural language processing capabilities, our project task breakdown feature allows you to reduce a user story into multiple project tasks, for easier allocation of tasks to project members within a team. No more having to think of project tasks for team allocation.</p>
27
+
28
+ </div>
29
+ <div class="texts3">
30
+ <h2>Language Translation</h2>
31
+ <p id="t">With our plugin's advanced natural language processing capabilities, our language translation feature provides customizable translation options, allowing you to choose which languages you want to translate your user stories into. Allowing team members who speak different languages to collaborate more effectively and improving productivity.</p>
32
+
33
+ </div>
34
+ </div>
35
+ <div class="buttonc">
36
+ <a href="{{url_for('text_summarization')}}" class="button1">Text Summarization</a>
37
+ <a href="{{url_for('project_breakdown')}}" class="button1">Project Task Breakdown</a>
38
+ <a href="{{url_for('language_translation')}}" class="button1">Language Translation</a>
39
+
40
+
41
+ </div>
42
+
43
+ </body>
44
+ </html>
templates/TextSummarizationUI.html ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- jinja2 template engine coding style for flask framework -->
2
+ <!DOCTYPE html>
3
+ <html>
4
+ <head>
5
+ <title>TextSummarizationUI</title>
6
+ <link rel="stylesheet" href="{{ url_for('static', filename='TextSummarization.css') }}">
7
+ <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">
8
+ </head>
9
+ <body>
10
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
11
+
12
+ <div class="container">
13
+
14
+ <div class="logo">
15
+ <img id="refineverseLogo" alt="RefineverseLogo" src="{{ url_for('static', filename='Images/Refineverse logo.png') }}" class="home-image"/>
16
+ </div>
17
+
18
+ <div>
19
+ <label class="title">Text Summarization</label>
20
+ <p class="message">
21
+ Splitting large user stories into smaller user stories.
22
+ </p>
23
+ </div>
24
+
25
+ </div>
26
+
27
+ <div class="container">
28
+ <form method="POST" action="#">
29
+ <div class="box">
30
+ <textarea class="textarea" name="input_text" id="input_textarea" placeholder="Please describe your User Story in 'As a _ , I want to _ so that _' format."></textarea>
31
+ </div>
32
+ <div class="box1">
33
+ <textarea class="textarea1" name="output_text" id="output_textarea" placeholder="Your summarized output goes here!" readonly>{{ summarizedStory }}</textarea>
34
+ </div>
35
+ <div class="buttons-container">
36
+ <button class="ClearBtn" type="button" onclick="clearTextareas()">Clear</button>
37
+ <button class="SummarizeBtn" type="submit">Summarize</button>
38
+ </div>
39
+ </form>
40
+ </div>
41
+
42
+ <div class="messages-container">
43
+ {% with messages = get_flashed_messages(with_categories=true) %}
44
+ {% for category, message in messages %}
45
+ {% if category == 'error' %}
46
+ <div class="alert alert-danger alert-dismissible fade show" role="alert">
47
+ {{ message }}
48
+ <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
49
+ </div>
50
+ {% else %}
51
+ <div class="alert alert-success alert-dismissible fade show" role="alert">
52
+ {{ message }}
53
+ <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
54
+ </div>
55
+ {% endif %}
56
+ {% endfor %}
57
+ {% endwith %}
58
+ </div>
59
+ </div>
60
+
61
+ <div class="BackBtnContainer">
62
+ <div class="buttons-container">
63
+ <a href="{{ url_for('index') }}"><button class="BackBtn">Back</button></a>
64
+ </div>
65
+ </div>
66
+
67
+ <script>
68
+ function clearTextareas()
69
+ {
70
+ document.getElementById('input_textarea').value = '';
71
+ document.getElementById('output_textarea').value = '';
72
+ }
73
+ </script>
74
+ </body>
75
+ </html>