Browse Source

minor fixes

Nick Sweeting 4 years ago
parent
commit
923f517a8f
3 changed files with 8 additions and 2 deletions
  1. 1 0
      archivebox/core/admin.py
  2. 6 1
      archivebox/index/html.py
  3. 1 1
      archivebox/templates/core/snapshot.html

+ 1 - 0
archivebox/core/admin.py

@@ -106,6 +106,7 @@ class SnapshotAdmin(SearchResultsAdminMixin, admin.ModelAdmin):
     actions = [delete_snapshots, overwrite_snapshots, update_snapshots, update_titles, verify_snapshots]
     actions = [delete_snapshots, overwrite_snapshots, update_snapshots, update_titles, verify_snapshots]
     actions_template = 'admin/actions_as_select.html'
     actions_template = 'admin/actions_as_select.html'
     form = SnapshotAdminForm
     form = SnapshotAdminForm
+    list_per_page = 40
 
 
     def get_urls(self):
     def get_urls(self):
         urls = super().get_urls()
         urls = super().get_urls()

+ 6 - 1
archivebox/index/html.py

@@ -118,6 +118,8 @@ def render_django_template(template: str, context: Mapping[str, str]) -> str:
 def snapshot_icons(snapshot) -> str:
 def snapshot_icons(snapshot) -> str:
     from core.models import EXTRACTORS
     from core.models import EXTRACTORS
 
 
+    # start = datetime.now()
+
     archive_results = snapshot.archiveresult_set.filter(status="succeeded")
     archive_results = snapshot.archiveresult_set.filter(status="succeeded")
     link = snapshot.as_link()
     link = snapshot.as_link()
     path = link.archive_path
     path = link.archive_path
@@ -169,4 +171,7 @@ def snapshot_icons(snapshot) -> str:
             output += '<a href="{}" class="exists-{}" title="{}">{}</a> '.format(canon["archive_org_path"], str(exists),
             output += '<a href="{}" class="exists-{}" title="{}">{}</a> '.format(canon["archive_org_path"], str(exists),
                                                                                         "archive_org", icons.get("archive_org", "?"))
                                                                                         "archive_org", icons.get("archive_org", "?"))
 
 
-    return format_html('<span class="files-icons" style="font-size: 1.1em; opacity: 0.8; min-width: 240px; display: inline-block">{}<span>', mark_safe(output))
+    result = format_html('<span class="files-icons" style="font-size: 1.1em; opacity: 0.8; min-width: 240px; display: inline-block">{}<span>', mark_safe(output))
+    # end = datetime.now()
+    # print(((end - start).total_seconds()*1000) // 1, 'ms')
+    return result

+ 1 - 1
archivebox/templates/core/snapshot.html

@@ -484,7 +484,7 @@
                 </div>
                 </div>
             </div>
             </div>
         </header>
         </header>
-        <iframe sandbox="allow-same-origin allow-scripts allow-forms" class="full-page-iframe" src="{{singlefile_url}}" name="preview"></iframe>
+        <iframe sandbox="allow-same-origin allow-scripts allow-forms" class="full-page-iframe" src="{{singlefile_path}}" name="preview"></iframe>
     
     
         <script
         <script
               src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
               src="https://code.jquery.com/jquery-3.2.1.slim.min.js"