1
|
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml"><head>
|
2
|
<meta charset="utf-8">
|
3
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
4
|
<meta name="description" content="">
|
5
|
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
|
6
|
<meta name="generator" content="Jekyll v3.8.6">
|
7
|
<title>Album example · Bootstrap</title>
|
8
|
|
9
|
<link rel="canonical" href="https://getbootstrap.com/docs/4.4/examples/album/">
|
10
|
|
11
|
<!-- Bootstrap core CSS -->
|
12
|
<link href="css/bootstrap.min.css" rel="stylesheet">
|
13
|
<link href="css/fontawesome.min.css" rel="stylesheet">
|
14
|
<link href="css/style.css" rel="stylesheet">
|
15
|
|
16
|
<link href="//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css" rel="stylesheet">
|
17
|
|
18
|
<script type="text/javascript" src="js/jquery.js"></script>
|
19
|
<script src="//code.jquery.com/jquery-1.11.1.js"></script>
|
20
|
<script src="//code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
|
21
|
</head>
|
22
|
<body>
|
23
|
<meta id="_csrf" name="_csrf" th:content="${_csrf.token}"/>
|
24
|
<meta id="_csrf_header" name="_csrf_header" th:content="${_csrf.headerName}"/>
|
25
|
|
26
|
<div id="test"></div>
|
27
|
<main role="main">
|
28
|
|
29
|
<div class="container">
|
30
|
<h1>
|
31
|
Výběr sestavy
|
32
|
</h1>
|
33
|
</div>
|
34
|
<div class="container">
|
35
|
<div class="col-md-4 box">
|
36
|
<div class="box-header">
|
37
|
<h3 class="box-title">Rychle k ...</h3>
|
38
|
</div>
|
39
|
<table class="table table-bordered table-striped">
|
40
|
<tbody>
|
41
|
<tr th:each="iconfiguration : ${configurations}">
|
42
|
<td><a th:href="@{/configuration(configurationID=${iconfiguration.id})}"><span th:text="${iconfiguration.name}"></span></a></td>
|
43
|
<td class="center-cell">
|
44
|
<span class="action-button">
|
45
|
<a href=# class="action-link far fa-trash-alt"></a>
|
46
|
</span>
|
47
|
</td>
|
48
|
</tr>
|
49
|
</tbody>
|
50
|
</table>
|
51
|
</div>
|
52
|
</div>
|
53
|
|
54
|
<div class="container box">
|
55
|
<div class="box-header">
|
56
|
<h3 class="box-title">Seznam sestav</h3>
|
57
|
</div>
|
58
|
<div class="button-container">
|
59
|
|
60
|
<a th:href="@{/assembly_new}" class="btn btn-success mb-2"><i class="fas fa-plus"></i> Přidat novou sestavu</a>
|
61
|
<button type="button" class="btn btn-success align-right"><i class="fas fa-sort"></i> Upravit řazení</button>
|
62
|
</div>
|
63
|
|
64
|
<table class="table table-bordered table-striped">
|
65
|
<thead>
|
66
|
<tr>
|
67
|
<th scope="col">Sestava</th>
|
68
|
<th scope="col">Seznam atributů</th>
|
69
|
<th scope="col">Akce</th>
|
70
|
</tr>
|
71
|
</thead>
|
72
|
<tbody class="sort">
|
73
|
<tr th:each="iassembly, itemStat : ${assemblies}">
|
74
|
<div>
|
75
|
<td><a th:href="@{/assembly(assemblyID=${iassembly.id})}"><span th:text="${iassembly.name}"></span></a></td>
|
76
|
<td th:text="${attributes[__${itemStat.index}__]}"></td>
|
77
|
<td>
|
78
|
<div class="action-wrapper">
|
79
|
<span class="action-button">
|
80
|
<a th:href="@{/assembly_edit(assemblyID=${iassembly.id})}" class="action-link far fa-edit"></a>
|
81
|
</span>
|
82
|
<span class="action-button">
|
83
|
<a href=# class="action-link far fa-trash-alt"></a>
|
84
|
</span>
|
85
|
|
86
|
<i class="fas fa-sort"></i>
|
87
|
</div>
|
88
|
</td>
|
89
|
</div>
|
90
|
</tr>
|
91
|
<tr >
|
92
|
<div>
|
93
|
<td><a href="@{/assembly(assemblyID=${iassembly.id})}"><span text="${iassembly.name}"></span></a></td>
|
94
|
<td>Akademický rok, Fakulta, Typ strudia, Ročník, ...</td>
|
95
|
<td>
|
96
|
<div class="action-wrapper">
|
97
|
<span class="action-button">
|
98
|
<a href="@{/assembly_edit(assemblyID=${iassembly.id})}" class="action-link far fa-edit"></a>
|
99
|
</span>
|
100
|
<span class="action-button">
|
101
|
<a href=# class="action-link far fa-trash-alt"></a>
|
102
|
</span>
|
103
|
</div>
|
104
|
</td>
|
105
|
</div>
|
106
|
</tr>
|
107
|
</tbody>
|
108
|
</tbody>
|
109
|
</table>
|
110
|
</div>
|
111
|
</main>
|
112
|
|
113
|
<footer class="text-muted">
|
114
|
<div class="container">
|
115
|
|
116
|
</div>
|
117
|
</footer>
|
118
|
|
119
|
<script type="text/javascript" src="js/app.js"></script>
|
120
|
</body>
|
121
|
</html>
|
122
|
<script>
|
123
|
$('tbody').sortable();
|
124
|
</script>
|
125
|
|
126
|
<script th:inline="javascript">
|
127
|
|
128
|
var token = $('#_csrf').attr('content');
|
129
|
var header = $('#_csrf_header').attr('content');
|
130
|
|
131
|
$(document).ready(function(){
|
132
|
$(".sort").sortable().disableSelection();
|
133
|
|
134
|
$('#saveSort').on('click', function () {
|
135
|
var orderArray = $('.sort').sortable('toArray');
|
136
|
|
137
|
if (orderArray.length > 0)
|
138
|
{
|
139
|
$.ajax({
|
140
|
type: "POST",
|
141
|
url: /*[[@{/saveOrder}]]*/"",
|
142
|
data: orderArray.toString(),
|
143
|
dataType: "text",
|
144
|
contentType: "text/plain;charset=UTF-8",
|
145
|
beforeSend: function(xhr) {
|
146
|
xhr.setRequestHeader(header, token);
|
147
|
},
|
148
|
success: function (data) {
|
149
|
alert(data);
|
150
|
}
|
151
|
});
|
152
|
}
|
153
|
|
154
|
})
|
155
|
});
|
156
|
|
157
|
</script>
|