|
@@ -6,39 +6,26 @@
|
|
|
<f:section name="main">
|
|
<f:section name="main">
|
|
|
<h1>Dashboard</h1>
|
|
<h1>Dashboard</h1>
|
|
|
|
|
|
|
|
- <h2>Add words (semicolon-separated) with a category</h2>
|
|
|
|
|
- <f:flashMessages />
|
|
|
|
|
- <f:form action="create">
|
|
|
|
|
- <div class="form-group" additionalAttributes="{style: 'margin-bottom: 1rem;'}">
|
|
|
|
|
- <label for="termList">Terms:</label>
|
|
|
|
|
- <f:form.textfield name="termList" additionalAttributes="{style: 'width: 100%; height: 30px; display: block;'}" /><br>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label for="categoryTitle">Category:</label>
|
|
|
|
|
- <f:form.textfield name="categoryTitle" additionalAttributes="{style: 'width: 150px; height: 30px; display: block;'}" /><br>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label for="typeTitle">Type:</label>
|
|
|
|
|
- <f:form.textfield name="typeTitle" additionalAttributes="{style: 'width: 150px; height: 30px; display: block;'}" /><br>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label for="urlTitle">URL:</label>
|
|
|
|
|
- <f:form.textfield name="urlTitle" additionalAttributes="{style: 'width: 400px; height: 30px; display: block;'}" /><br>
|
|
|
|
|
- </div>
|
|
|
|
|
- <f:form.submit value="Save" />
|
|
|
|
|
- </f:form>
|
|
|
|
|
|
|
|
|
|
<hr style="width: 100%; border: 1px solid black; margin: 20px 0;">
|
|
<hr style="width: 100%; border: 1px solid black; margin: 20px 0;">
|
|
|
|
|
|
|
|
<h2>List of terms</h2>
|
|
<h2>List of terms</h2>
|
|
|
- <table style="width: 100%;">
|
|
|
|
|
|
|
+ <style>
|
|
|
|
|
+ th {
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ }
|
|
|
|
|
+ th:hover {
|
|
|
|
|
+ background-color: #f1f1f1;
|
|
|
|
|
+ }
|
|
|
|
|
+ </style>
|
|
|
|
|
+ <table id="termsTable" style="width: 100%">
|
|
|
<thead>
|
|
<thead>
|
|
|
<tr>
|
|
<tr>
|
|
|
- <th additionalAttributes="{style: 'width: 10px;'}">ID</th>
|
|
|
|
|
- <th additionalAttributes="{style: 'width: 200px;'}">Term</th>
|
|
|
|
|
- <th additionalAttributes="{style: 'width: 200px;'}">Type</th>
|
|
|
|
|
- <th additionalAttributes="{style: 'width: 200px;'}">Category</th>
|
|
|
|
|
- <th additionalAttributes="{style: 'width: 400px;'}">Url</th>
|
|
|
|
|
|
|
+ <th onclick="sortTable('termsTable',0)" additionalAttributes="{style: 'width: 10px;'}">ID</th>
|
|
|
|
|
+ <th onclick="sortTable('termsTable',1)" additionalAttributes="{style: 'width: 200px;'}">Term</th>
|
|
|
|
|
+ <th onclick="sortTable('termsTable',2)" additionalAttributes="{style: 'width: 200px;'}">Type</th>
|
|
|
|
|
+ <th onclick="sortTable('termsTable',3)" additionalAttributes="{style: 'width: 200px;'}">Category</th>
|
|
|
|
|
+ <th onclick="sortTable('termsTable',4)" additionalAttributes="{style: 'width: 400px;'}">URL</th>
|
|
|
<th additionalAttributes="{style: 'width: 100px;'}">Action</th>
|
|
<th additionalAttributes="{style: 'width: 100px;'}">Action</th>
|
|
|
</tr>
|
|
</tr>
|
|
|
</thead>
|
|
</thead>
|
|
@@ -58,34 +45,15 @@
|
|
|
</tbody>
|
|
</tbody>
|
|
|
</table>
|
|
</table>
|
|
|
|
|
|
|
|
- <hr style="width: 100%; border: 1px solid black; margin: 20px 0;">
|
|
|
|
|
-
|
|
|
|
|
- <h2>List of categories</h2>
|
|
|
|
|
- <table style="width: 210px;">
|
|
|
|
|
- <thead>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <th additionalAttributes="{style: 'width: 10px;'}">ID</th>
|
|
|
|
|
- <th additionalAttributes="{style: 'width: 200px;'}">Title</th>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </thead>
|
|
|
|
|
- <tbody>
|
|
|
|
|
- <f:for each="{categories}" as="category">
|
|
|
|
|
- <tr>
|
|
|
|
|
- <td>{category.uid}</td>
|
|
|
|
|
- <td>{category.title}</td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </f:for>
|
|
|
|
|
- </tbody>
|
|
|
|
|
- </table>
|
|
|
|
|
|
|
|
|
|
<hr style="width: 100%; border: 1px solid black; margin: 20px 0;">
|
|
<hr style="width: 100%; border: 1px solid black; margin: 20px 0;">
|
|
|
|
|
|
|
|
<h2>List of types</h2>
|
|
<h2>List of types</h2>
|
|
|
- <table style="width: 210px;">
|
|
|
|
|
|
|
+ <table id="typesTable" style="width: 210px;">
|
|
|
<thead>
|
|
<thead>
|
|
|
<tr>
|
|
<tr>
|
|
|
- <th additionalAttributes="{style: 'width: 10px;'}">ID</th>
|
|
|
|
|
- <th additionalAttributes="{style: 'width: 200px;'}">Title</th>
|
|
|
|
|
|
|
+ <th onclick="sortTable('typesTable',0)" additionalAttributes="{style: 'width: 10px;'}">ID</th>
|
|
|
|
|
+ <th onclick="sortTable('typesTable',1)" additionalAttributes="{style: 'width: 200px;'}">Title</th>
|
|
|
</tr>
|
|
</tr>
|
|
|
</thead>
|
|
</thead>
|
|
|
<tbody>
|
|
<tbody>
|
|
@@ -99,24 +67,88 @@
|
|
|
</table>
|
|
</table>
|
|
|
|
|
|
|
|
<hr style="width: 100%; border: 1px solid black; margin: 20px 0;">
|
|
<hr style="width: 100%; border: 1px solid black; margin: 20px 0;">
|
|
|
-
|
|
|
|
|
- <h2>List of urls</h2>
|
|
|
|
|
- <table style="width: 410px;">
|
|
|
|
|
|
|
+ <h2>List of categories</h2>
|
|
|
|
|
+ <table id="categoriesTable" style="width: 210px;">
|
|
|
<thead>
|
|
<thead>
|
|
|
<tr>
|
|
<tr>
|
|
|
- <th additionalAttributes="{style: 'width: 10px;'}">ID</th>
|
|
|
|
|
- <th additionalAttributes="{style: 'width: 400px;'}">Title</th>
|
|
|
|
|
|
|
+ <th onclick="sortTable('categoriesTable',0)" additionalAttributes="{style: 'width: 10px;'}">ID</th>
|
|
|
|
|
+ <th onclick="sortTable('categoriesTable',1)" additionalAttributes="{style: 'width: 200px;'}">Title</th>
|
|
|
</tr>
|
|
</tr>
|
|
|
</thead>
|
|
</thead>
|
|
|
<tbody>
|
|
<tbody>
|
|
|
- <f:for each="{urls}" as="url">
|
|
|
|
|
|
|
+ <f:for each="{categories}" as="category">
|
|
|
<tr>
|
|
<tr>
|
|
|
- <td>{url.uid}</td>
|
|
|
|
|
- <td>{url.title}</td>
|
|
|
|
|
|
|
+ <td>{category.uid}</td>
|
|
|
|
|
+ <td>{category.title}</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
</f:for>
|
|
</f:for>
|
|
|
</tbody>
|
|
</tbody>
|
|
|
</table>
|
|
</table>
|
|
|
-</f:section>
|
|
|
|
|
|
|
|
|
|
|
|
+ <hr style="width: 100%; border: 1px solid black; margin: 20px 0;">
|
|
|
|
|
+ <h2>Add words (semicolon-separated) with a type</h2>
|
|
|
|
|
+ <f:flashMessages />
|
|
|
|
|
+ <f:form action="create">
|
|
|
|
|
+ <div class="form-group" additionalAttributes="{style: 'margin-bottom: 1rem;'}">
|
|
|
|
|
+ <label for="termList">Terms:</label>
|
|
|
|
|
+ <f:form.textfield name="termList" additionalAttributes="{style: 'width: 100%; height: 30px; display: block;'}" /><br>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label for="typeTitle">Type:</label>
|
|
|
|
|
+ <f:form.textfield name="typeTitle" additionalAttributes="{style: 'width: 150px; height: 30px; display: block;'}" /><br>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label for="categoryTitle">Category:</label>
|
|
|
|
|
+ <f:form.textfield name="categoryTitle" additionalAttributes="{style: 'width: 150px; height: 30px; display: block;'}" /><br>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label for="urlTitle">URL:</label>
|
|
|
|
|
+ <f:form.textfield name="urlTitle" additionalAttributes="{style: 'width: 400px; height: 30px; display: block;'}" /><br>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <f:form.submit value="Save" />
|
|
|
|
|
+ </f:form>
|
|
|
|
|
+
|
|
|
|
|
+ <script>
|
|
|
|
|
+ function sortTable(tableId, columnIndex) {
|
|
|
|
|
+ var table, rows, switching, i, x, y, shouldSwitch, direction, switchCount = 0;
|
|
|
|
|
+ table = document.getElementById(tableId);
|
|
|
|
|
+ switching = true;
|
|
|
|
|
+ direction = "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 (direction == "asc") {
|
|
|
|
|
+ if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase()) {
|
|
|
|
|
+ shouldSwitch = true;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (direction == "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 && direction == "asc") {
|
|
|
|
|
+ direction = "desc";
|
|
|
|
|
+ switching = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ </script>
|
|
|
|
|
+</f:section>
|
|
|
</html>
|
|
</html>
|