(self, obj)
| 191 | files.short_description = 'Files Saved' |
| 192 | |
| 193 | def size(self, obj): |
| 194 | archive_size = (Path(obj.link_dir) / 'index.html').exists() and obj.archive_size |
| 195 | if archive_size: |
| 196 | size_txt = printable_filesize(archive_size) |
| 197 | if archive_size > 52428800: |
| 198 | size_txt = mark_safe(f'<b>{size_txt}</b>') |
| 199 | else: |
| 200 | size_txt = mark_safe('<span style="opacity: 0.3">...</span>') |
| 201 | return format_html( |
| 202 | '<a href="/{}" title="View all files">{}</a>', |
| 203 | obj.archive_path, |
| 204 | size_txt, |
| 205 | ) |
| 206 | |
| 207 | size.admin_order_field = 'archiveresult__count' |
| 208 |
no test coverage detected