瀏覽代碼

change Snapshot admin action UI button text

Nick Sweeting 1 年之前
父節點
當前提交
9be7e1a0bc
共有 1 個文件被更改,包括 11 次插入9 次删除
  1. 11 9
      archivebox/core/admin.py

+ 11 - 9
archivebox/core/admin.py

@@ -251,6 +251,7 @@ from django.contrib.admin.widgets import FilteredSelectMultiple
 
 
 class SnapshotActionForm(ActionForm):
 class SnapshotActionForm(ActionForm):
     tags = forms.ModelMultipleChoiceField(
     tags = forms.ModelMultipleChoiceField(
+        label='Edit tags',
         queryset=Tag.objects.all(),
         queryset=Tag.objects.all(),
         required=False,
         required=False,
         widget=FilteredSelectMultiple(
         widget=FilteredSelectMultiple(
@@ -526,25 +527,26 @@ class SnapshotAdmin(SearchResultsAdminMixin, ABIDModelAdmin):
     #     return super().changelist_view(request, extra_context=None)
     #     return super().changelist_view(request, extra_context=None)
 
 
     @admin.action(
     @admin.action(
-        description="Pull"
+        description="ℹ️ Get Title"
     )
     )
-    def update_snapshots(self, request, queryset):
+    def update_titles(self, request, queryset):
         archive_links([
         archive_links([
             snapshot.as_link()
             snapshot.as_link()
             for snapshot in queryset
             for snapshot in queryset
-        ], out_dir=CONFIG.OUTPUT_DIR)
+        ], overwrite=True, methods=('title','favicon'), out_dir=CONFIG.OUTPUT_DIR)
 
 
     @admin.action(
     @admin.action(
-        description="⬇️ Title"
+        description="⬇️ Get Missing"
     )
     )
-    def update_titles(self, request, queryset):
+    def update_snapshots(self, request, queryset):
         archive_links([
         archive_links([
             snapshot.as_link()
             snapshot.as_link()
             for snapshot in queryset
             for snapshot in queryset
-        ], overwrite=True, methods=('title','favicon'), out_dir=CONFIG.OUTPUT_DIR)
+        ], out_dir=CONFIG.OUTPUT_DIR)
+
 
 
     @admin.action(
     @admin.action(
-        description="Re-Snapshot"
+        description="📑 Archive again"
     )
     )
     def resnapshot_snapshot(self, request, queryset):
     def resnapshot_snapshot(self, request, queryset):
         for snapshot in queryset:
         for snapshot in queryset:
@@ -553,7 +555,7 @@ class SnapshotAdmin(SearchResultsAdminMixin, ABIDModelAdmin):
             add(new_url, tag=snapshot.tags_str())
             add(new_url, tag=snapshot.tags_str())
 
 
     @admin.action(
     @admin.action(
-        description="Reset"
+        description="♲ Redo"
     )
     )
     def overwrite_snapshots(self, request, queryset):
     def overwrite_snapshots(self, request, queryset):
         archive_links([
         archive_links([
@@ -562,7 +564,7 @@ class SnapshotAdmin(SearchResultsAdminMixin, ABIDModelAdmin):
         ], overwrite=True, out_dir=CONFIG.OUTPUT_DIR)
         ], overwrite=True, out_dir=CONFIG.OUTPUT_DIR)
 
 
     @admin.action(
     @admin.action(
-        description="Delete"
+        description="☠️ Delete"
     )
     )
     def delete_snapshots(self, request, queryset):
     def delete_snapshots(self, request, queryset):
         remove(snapshots=queryset, yes=True, delete=True, out_dir=CONFIG.OUTPUT_DIR)
         remove(snapshots=queryset, yes=True, delete=True, out_dir=CONFIG.OUTPUT_DIR)