|
8 | 8 | <script src="/js/Scripts.js"></script> |
9 | 9 | <link rel="icon" type="image/png" href="/fileIcons/database.png"> |
10 | 10 | <script> |
11 | | - function enableEditFolder(name){ |
| 11 | + function enableEditFolder(name) { |
12 | 12 |
|
13 | 13 | document.getElementById(name).innerHTML = "" + |
14 | 14 | "" + |
|
18 | 18 |
|
19 | 19 | document.getElementById(name).action = "/changeFolderName"; |
20 | 20 | } |
21 | | - function enableEditFile(name){ |
| 21 | + |
| 22 | + function enableEditFile(name) { |
22 | 23 |
|
23 | 24 | document.getElementById(name).innerHTML = "" + |
24 | 25 | "" + |
|
28 | 29 |
|
29 | 30 | document.getElementById(name).action = "/changeFileName"; |
30 | 31 | } |
| 32 | + |
31 | 33 | </script> |
| 34 | + <script src="/js/jquery.js"></script> |
| 35 | + <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script> |
| 36 | + <script src="/bootstrap/js/bootstrap.bundle.js"></script> |
32 | 37 | </head> |
33 | 38 | <body class="bg-light"> |
34 | 39 | <div class="container"> |
|
57 | 62 | <div class="col-md-10 text-left"> |
58 | 63 | <p th:text="'Ścieżka: ' + ${session.path} "></p> |
59 | 64 | </div> |
| 65 | + <div class="col-md-2"> |
| 66 | + <div class="dropdown"> |
| 67 | + <button class="btn btn-primary btn-sm dropdown-toggle" type="button" id="optionsDropdown" |
| 68 | + data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
| 69 | + Opcje |
| 70 | + </button> |
| 71 | + <div class="dropdown-menu" aria-labelledby="optionsDropdown"> |
| 72 | + <form method="post" action="/moveFile"> |
| 73 | + <input class="dropdown-item" type="submit" value="Wklej"/> |
| 74 | + </form> |
| 75 | + </div> |
| 76 | + </div> |
| 77 | + </div> |
60 | 78 | </div> |
61 | 79 | <hr> |
62 | 80 | <div class="row mt-3"> |
|
65 | 83 | <thead class="thead-light"> |
66 | 84 | <tr> |
67 | 85 | <th style="width: 10%">Typ</th> |
68 | | - <th onclick="sortTable(1,'filesListTable')" style="width: 40%;">Nazwa</th> |
| 86 | + <th onclick="sortTable(1,'filesListTable')" style="width: 60%;">Nazwa</th> |
69 | 87 | <th onclick="sortTable(2,'filesListTable')" style="width: 10%;">Rozmiar</th> |
70 | 88 | <th onclick="sortTable(3,'filesListTable')" style="width: 10%;">Replikacja</th> |
71 | | - <th style="width: 20%">Akcja</th> |
72 | | - <th style="width: 10%;">Usuń</th> |
| 89 | + <th style="width: 10%">Akcja</th> |
73 | 90 | </tr> |
74 | 91 | </thead> |
75 | 92 | <tr th:each="singleObject: ${objectsOnTheList}" th:object="${singleObject}"> |
|
78 | 95 | <td th:if="${singleObject.type}=='file'"> |
79 | 96 | <form method="post" action="/downloadFile" th:id="${singleObject.name}"> |
80 | 97 | <input type="hidden" th:name="filename" th:value="${singleObject.name}"/> |
81 | | - <input class="buttonLink" type="submit" draggable="true" th:id="${singleObject.name}" ondragstart="drag(event)" th:value="${singleObject.name}"/> |
| 98 | + <input class="buttonLink" type="submit" draggable="true" th:id="${singleObject.name}" |
| 99 | + ondragstart="drag(event)" th:value="${singleObject.name}"/> |
82 | 100 | </form> |
83 | 101 | </td> |
84 | 102 | <td th:if="${singleObject.type}=='folder'"> |
85 | 103 | <form method="post" action="/enterFolder" th:id="${singleObject.name}"> |
86 | 104 | <input type="hidden" th:name="foldername" th:value="${singleObject.name}"/> |
87 | | - <input class="buttonLink" type="submit" ondragover="allowDrop(event)" th:id="${singleObject.name}" ondrop="drop(event)" th:value="${singleObject.name}"/> |
| 105 | + <input class="buttonLink" type="submit" ondragover="allowDrop(event)" |
| 106 | + th:id="${singleObject.name}" ondrop="drop(event)" th:value="${singleObject.name}"/> |
88 | 107 | </form> |
89 | 108 | </td> |
90 | 109 | <td th:text="*{size}"></td> |
91 | 110 | <td th:text="*{replication}"></td> |
| 111 | + <td th:if="${singleObject.type}=='file' or (${singleObject.type}=='folder'and ${singleObject.name}!='..')"> |
| 112 | + <div class="dropdown"> |
| 113 | + <button class="btn btn-primary btn-sm dropdown-toggle" type="button" id="dropdownMenuButton" |
| 114 | + data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
| 115 | + Opcje |
| 116 | + </button> |
| 117 | + <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> |
92 | 118 |
|
| 119 | + <form th:if="${singleObject.type}=='file'" method="post" action="/savePathToMove"> |
| 120 | + <input type="hidden" th:name="filename" th:value="${singleObject.name}"/> |
| 121 | + <input class="dropdown-item" type="submit" value="Wytnij"/> |
| 122 | + </form> |
93 | 123 |
|
94 | | - <td th:if="${singleObject.type}=='file'"> |
95 | | - <button name="changeName" id="changeNameFile" th:onclick="'enableEditFile(\'' + ${singleObject.name} + '\');'">Zmień nazwę</button> |
96 | | - </td> |
97 | | - <td th:if="${singleObject.type}=='folder'and ${singleObject.name}!='..'"> |
98 | | - <button name="changeName" id="changeNameFolder" th:onclick="'enableEditFolder(\'' + ${singleObject.name} + '\');'">Zmień nazwę</button> |
99 | | - </td> |
100 | | - <td th:if="${singleObject.type}=='folder'and ${singleObject.name}=='..'"> |
101 | | - - |
102 | | - </td> |
| 124 | + <a class="dropdown-item" href="#" th:onclick="'enableEditFile(\'' + ${singleObject.name} + '\');'" th:if="${singleObject.type}=='file'">Zmień nazwę |
| 125 | + </a> |
| 126 | + <a class="dropdown-item" href="#" th:onclick="'enableEditFolder(\'' + ${singleObject.name} + '\');'" th:if="${singleObject.type}=='folder'and ${singleObject.name}!='..'">Zmień nazwę</a> |
103 | 127 |
|
104 | | - <td th:if="${singleObject.type}=='file'"> |
105 | | - <form method="post" action="/deleteFile"> |
106 | | - <input type="hidden" th:name="filename" th:value="${singleObject.name}"/> |
107 | | - <input type="submit" value="usuń"/> |
108 | | - </form> |
109 | | - </td> |
110 | | - <td th:if="${singleObject.type}=='folder'and ${singleObject.name}!='..'"> |
111 | | - <form method="post" action="/deleteFolder"> |
112 | | - <input type="hidden" th:name="foldername" th:value="${singleObject.name}"/> |
113 | | - <input type="submit" value="usuń"/> |
114 | | - </form> |
| 128 | + <div class="dropdown-divider"></div> |
| 129 | + |
| 130 | + <form th:if="${singleObject.type}=='file'" method="post" action="/deleteFile"> |
| 131 | + <input type="hidden" th:name="filename" th:value="${singleObject.name}"/> |
| 132 | + <input class="dropdown-item" type="submit" value="Usuń"/> |
| 133 | + </form> |
| 134 | + |
| 135 | + <form th:if="${singleObject.type}=='folder'and ${singleObject.name}!='..'" method="post" action="/deleteFolder"> |
| 136 | + <input type="hidden" th:name="foldername" th:value="${singleObject.name}"/> |
| 137 | + <input class="dropdown-item" type="submit" value="Usuń"/> |
| 138 | + </form> |
| 139 | + |
| 140 | + </div> |
| 141 | + </div> |
115 | 142 | </td> |
116 | 143 | <td th:if="${singleObject.type}=='folder'and ${singleObject.name}=='..'"> |
117 | 144 | - |
118 | 145 | </td> |
119 | | - |
120 | 146 | </tr> |
121 | 147 | </table> |
122 | 148 | </div> |
|
133 | 159 | <p id="errorField4" class="text-danger" th:if="${error}=='noFileToSend'">Nie wybrano pliko do |
134 | 160 | wysłania.</p> |
135 | 161 | <p id="errorField5" class="text-danger" th:if="${error}=='notEnoughSpace'">Za mało miejsca w |
136 | | - systemie aby zapisać plik.</p> |
| 162 | + systemie aby zapisać plik.</p> |
137 | 163 | <p id="errorField6" class="text-danger" th:if="${error}=='fileNotExist'">Wystąpił błąd wewnętrzy, |
138 | | - plik nie istnieje w systemie. Sugeruje to zewnętrzą ingerencję w folder przechowujący pliki |
139 | | - w węzłach danych.</p> |
| 164 | + plik nie istnieje w systemie. Sugeruje to zewnętrzą ingerencję w folder przechowujący pliki |
| 165 | + w węzłach danych.</p> |
140 | 166 | <p id="errorField7" class="text-danger" th:if="${error}=='folderNameAlreadyExists'">Nie można było |
141 | 167 | zmienić nazwy folderu. Taka nazwa jest już używana.</p> |
142 | 168 | <p id="errorField8" class="text-danger" th:if="${error}=='fileNameAlreadyExists'">Nie można było |
143 | 169 | zmienić nazwy pliku. Taka nazwa jest już używana. Każdy plik w systemie musi mieć unikatową nazwę.</p> |
| 170 | + <p id="errorField9" class="text-danger" th:if="${error}=='moveFileFromCutNameAlreadyExists'">Nie przenieść |
| 171 | + tutaj pliku, bo taka nazwa jest już używana, zmień nazwę pliku przed jego przeniesieniem.</p> |
144 | 172 | </div> |
145 | 173 | </div> |
146 | 174 | <div class="fixed-bottom text-center"> |
147 | | - Icons made by <a href="https://www.flaticon.com/authors/smashicons" title="smashicons">smashicons</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> are licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a> |
| 175 | + Icons made by <a href="https://www.flaticon.com/authors/smashicons" title="smashicons">smashicons</a> from <a |
| 176 | + href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> are licensed by <a |
| 177 | + href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a> |
148 | 178 | </div> |
149 | 179 | </div> |
150 | 180 | </body> |
|
0 commit comments