Преглед изворни кода

hotlink to snapshots using generic search query link instead of id__startswith

Nick Sweeting пре 1 година
родитељ
комит
7164fb961c

+ 1 - 1
archivebox/templates/admin/base.html

@@ -281,7 +281,7 @@
                 // if we arrive at the index with a url like ??id__startswith=...
                 // we were hotlinked here with the intention of making it easy for the user to perform some
                 // actions on the given snapshot. therefore we should preselect the snapshot to save them a click
-                if (window.location.search.startsWith('?id__startswith=') || window.location.search.startsWith('?id__exact=')) {
+                if (window.location.search.startsWith('?')) {
                     const result_checkboxes = [...document.querySelectorAll('#result_list .action-checkbox input[type=checkbox]')]
                     if (result_checkboxes.length === 1) {
                         result_checkboxes[0].click()

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

@@ -351,7 +351,7 @@
                             <a href="warc/" title="Any WARC archives for the page">WARC</a> | 
                             <a href="media/" title="Audio, Video, and Subtitle files.">Media</a> | 
                             <a href="git/" title="Any git repos at the url">Git</a> | 
-                            <a href="/admin/core/snapshot/?id__startswith={{snapshot_id}}" title="Go to the Snapshot admin to update, overwrite, or delete this Snapshot">Actions</a> | 
+                            <a href="/admin/core/snapshot/?q={{snapshot_id}}" title="Go to the Snapshot admin to update, overwrite, or delete this Snapshot">Actions</a> | 
                             <a href="/admin/core/snapshot/{{snapshot_id}}/change/" title="Edit this snapshot in the Admin UI">Admin</a> | 
                             <a href="." title="Webserver-provided index of files directory.">See all files...</a><br/>
                         </div>

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

@@ -349,7 +349,7 @@
                             </a>
                         </div>
                         <div class="badge badge-{{status_color}}" style="float: left">
-                            <a href="/admin/core/snapshot/?id__startswith={{snapshot_id}}" title="Click to see options to pull, re-snapshot, or delete this Snapshot">
+                            <a href="/admin/core/snapshot/?q={{snapshot_id}}" title="Click to see options to pull, re-snapshot, or delete this Snapshot">
                                 {{status|upper}}
                             </a>
                         </div>