Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch delete of collection_items #454

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Batch delete of collection_items #454

wants to merge 2 commits into from

Conversation

damisul
Copy link
Collaborator

@damisul damisul commented Dec 19, 2024

Added ability to select multiple items on collections/manage page by clicking on items (hold Ctrl to select multiple items).

If one or more items are selected page will show a button to remove selected items:
screenshot

I've removed 'delete' link we had previously on every item in list as it become obsolete now.

@@ -0,0 +1,8 @@
$selected-background: navy;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

styles used to highlight selected items in list.
I've used SCSS, so you can change those two constants only and they'll be used in underlying styles

@@ -1,3 +0,0 @@
ele = $('div[id*="<%= 'collitem_'+@deleted_id.to_s %>"]');
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've used this code in $.ajax success callback

@@ -26,7 +26,6 @@
%br
.editable{ id: "#{nonce}_editable_#{ci.id}" }
!= MultiMarkdown.new(ci.markdown).to_html
= link_to t(:delete), collection_item_path(ci.id), method: :delete, remote: true, data: { confirm: t(:confirm_delete_collection_item) }, class: 'collection-btn', style: 'float: left;top:-40px;left:5px;position:relative;z-index:5;'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those 'delete' links are removed as now we have batch delete button

@@ -1483,6 +1483,11 @@ he:
permission_for_all: על אף שהיצירה עדיין מוגנת בזכויות יוצרים, פרויקט בן־יהודה קיבל *רשות מפורשת לפרסם* את היצירה במאגר היצירה של פרויקט בן־יהודה, לשימוש הקהל הרחב לקריאה ומחקר. שימושים אחרים (כגון המחזה, הלחנה, או ביצוע מסחרי) עדיין *טעונים אישור מפורש* מאת בעלי הזכויות.
permission_for_selected: על אף שהיצירה עדיין מוגנת בזכויות יוצרים, פרויקט בן־יהודה קיבל *רשות מפורשת לפרסם* את היצירה במאגר היצירה של פרויקט בן־יהודה, לשימוש הקהל הרחב לקריאה ומחקר. שימושים אחרים (כגון המחזה, הלחנה, או ביצוע מסחרי) עדיין *טעונים אישור מפורש* מאת בעלי הזכויות.
unknown: "על אף כל המאמצים, לא ניתן לקבוע מה מצב זכויות היוצרים, בדרך כלל בשל מידע חסר לגבי זהות או מועד פטירת המחבר[ים] או המתרגם[ים]."
manage_collection:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As usual some strings awaits translation

url: '/collection_items/' + id,
type: 'DELETE',
success: function() {
const ele = $('div[id*="collitem_' + id + '"]');
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the code from removed destroy.js.erb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant