|
1 | 1 | {% extends 'layouts/base.html' %} |
2 | | -{% load static file_extension %} |
| 2 | +{% load static file_extension info_value %} |
3 | 3 |
|
4 | 4 | {% block extrastyle %} |
5 | 5 | <style> |
|
88 | 88 | </tr> |
89 | 89 | {% for file in files %} |
90 | 90 | <tr> |
91 | | - <td>{{ file.filename }}</td> |
| 91 | + <td> |
| 92 | + <span data-bs-toggle="tooltip" title="{{file.file_path|info_value}}"> |
| 93 | + {{ file.filename }} |
| 94 | + </span> |
| 95 | + </td> |
92 | 96 | <td>{{ file.filename|file_extension|cut:"."|upper }}</td> |
93 | 97 | <td> |
94 | 98 | <div class="d-flex align-items-center actions"> |
| 99 | + <span data-bs-toggle="modal" data-bs-target="#info-{{forloop.counter}}"> |
| 100 | + <i title="Info" class="fa-solid fa-info text-success"></i> |
| 101 | + </span> |
| 102 | + <div class="dot-separator mx-2"></div> |
95 | 103 | <span data-bs-toggle="modal" data-bs-target="#file-{{forloop.counter}}"> |
96 | 104 | <i title="View" class="fa-solid fa-eye text-primary"></i> |
97 | 105 | </span> |
@@ -151,6 +159,31 @@ <h1 class="modal-title fs-5" id="exampleModalLabel">Delete File</h1> |
151 | 159 | </div> |
152 | 160 | </div> |
153 | 161 | </div> |
| 162 | + <!-- Info Modal --> |
| 163 | + <div class="modal fade" id="info-{{forloop.counter}}" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> |
| 164 | + <div class="modal-dialog"> |
| 165 | + <div class="modal-content"> |
| 166 | + <div class="modal-header"> |
| 167 | + <h1 class="modal-title fs-5" id="exampleModalLabel">File Info</h1> |
| 168 | + <div class="" id="modal-close-btn-{{forloop.counter}}" data-bs-dismiss="modal" aria-label="Close"> |
| 169 | + <i class="fa-solid fa-circle-xmark fs-5"></i> |
| 170 | + </div> |
| 171 | + </div> |
| 172 | + <div class="modal-body"> |
| 173 | + <form action="{% url 'save_info' file.file_path|encoded_file_path %}" method="post"> |
| 174 | + {% csrf_token %} |
| 175 | + <div class="form-group mb-2"> |
| 176 | + <label for="" class="form-label">File Info</label> |
| 177 | + <input type="text" value="{{file.file_path|info_value}}" name="info" id="" class="form-control"> |
| 178 | + </div> |
| 179 | + <div class="d-flex justify-content-end"> |
| 180 | + <button type="submit" class="btn btn-primary" data-bs-dismiss="modal">Save</button> |
| 181 | + </div> |
| 182 | + </form> |
| 183 | + </div> |
| 184 | + </div> |
| 185 | + </div> |
| 186 | + </div> |
154 | 187 | {% endfor %} |
155 | 188 | </table> |
156 | 189 | </div> |
|
0 commit comments