Skip to content
Open
Show file tree
Hide file tree
Changes from 83 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
10cc964
Add deletion request handling and update related components
NishantSinghhhhh Nov 7, 2025
ebb1901
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 7, 2025
4ed678c
Removing pre-commit error
NishantSinghhhhh Nov 8, 2025
3fe3e40
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 8, 2025
92ea9d2
Fix formatting by removing unnecessary newline in declineDeletionRequ…
NishantSinghhhhh Nov 8, 2025
b8bc5c3
Merge branch '10033/expand-merge-queue' of https://github.com/Nishant…
NishantSinghhhhh Nov 8, 2025
72cbd64
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 8, 2025
37eaeaa
Add deletion functionality for works and authors with corresponding t…
NishantSinghhhhh Nov 29, 2025
fe3bb08
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 29, 2025
f5a80a0
Remove deletion handling code for works and authors
NishantSinghhhhh Nov 29, 2025
f61292f
Remove deletion handling code for works and authors
NishantSinghhhhh Nov 29, 2025
eece618
Refactor delete request logging and streamline response handling in e…
NishantSinghhhhh Nov 29, 2025
c8db5d3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 29, 2025
9bf00cd
Implement deletion request handling and UI updates for merge requests
NishantSinghhhhh Dec 1, 2025
907ff60
Implement deletion request handling and UI updates for merge requests
NishantSinghhhhh Dec 1, 2025
54e7227
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 1, 2025
b356131
resolving commit errros
NishantSinghhhhh Dec 1, 2025
228369c
Merge branch '10033/expand-merge-queue' of https://github.com/Nishant…
NishantSinghhhhh Dec 1, 2025
20c04c0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 1, 2025
ea482b6
resolving commit errros
NishantSinghhhhh Dec 1, 2025
28978fd
Merge branch '10033/expand-merge-queue' of https://github.com/Nishant…
NishantSinghhhhh Dec 1, 2025
2889621
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 1, 2025
22778bd
Refactor delete authors and works templates for improved styling and …
NishantSinghhhhh Dec 1, 2025
334254e
Resolving merge conflicts
NishantSinghhhhh Dec 1, 2025
2889508
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 1, 2025
d3eab0c
Remove button icon from deletion request forms for a cleaner UI
NishantSinghhhhh Dec 1, 2025
4d6c466
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 1, 2025
91cb43e
Update openlibrary/core/edits.py
NishantSinghhhhh Dec 6, 2025
41f7d92
Update static/css/components/merge-request-table.less
NishantSinghhhhh Dec 6, 2025
b679bd3
Update openlibrary/core/edits.py
NishantSinghhhhh Dec 6, 2025
75f3f03
Update openlibrary/plugins/openlibrary/js/ile/utils/SelectionManager/…
NishantSinghhhhh Dec 6, 2025
c45aab9
Update openlibrary/core/edits.py
NishantSinghhhhh Dec 6, 2025
84bfaab
Update openlibrary/plugins/openlibrary/js/merge-request-table/MergeRe…
NishantSinghhhhh Dec 6, 2025
ff19c5e
Update openlibrary/templates/merge_request_table/merge_request_table.…
NishantSinghhhhh Dec 6, 2025
73f9f90
Update openlibrary/templates/merge_request_table/table_row.html
NishantSinghhhhh Dec 6, 2025
71b25b9
Update openlibrary/templates/merge_request_table/table_row.html
NishantSinghhhhh Dec 6, 2025
b571917
Update openlibrary/templates/merge_request_table/table_row.html
NishantSinghhhhh Dec 6, 2025
d34a86f
Added code]
NishantSinghhhhh Dec 6, 2025
b839eb7
Merge branch 'master' into 10033/expand-merge-queue
NishantSinghhhhh Dec 6, 2025
666aede
Merge branch '10033/expand-merge-queue' of https://github.com/Nishant…
NishantSinghhhhh Dec 6, 2025
4a94558
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 6, 2025
59aaba7
Refactor: Clean up commented code in table_row.html
NishantSinghhhhh Dec 6, 2025
48502df
Merge branch '10033/expand-merge-queue' of https://github.com/Nishant…
NishantSinghhhhh Dec 6, 2025
52023aa
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 6, 2025
d299797
Refactor: Simplify status filtering logic in CommunityEditsQueue
NishantSinghhhhh Dec 6, 2025
ed81bc1
Merge branch '10033/expand-merge-queue' of https://github.com/Nishant…
NishantSinghhhhh Dec 6, 2025
4a122ea
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 6, 2025
7b08ebf
Refactor: Simplify status filtering logic in CommunityEditsQueue
NishantSinghhhhh Dec 6, 2025
e036718
Merge branch '10033/expand-merge-queue' of https://github.com/Nishant…
NishantSinghhhhh Dec 6, 2025
5869767
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 6, 2025
6918773
Merge branch 'master' into 10033/expand-merge-queue
NishantSinghhhhh Dec 23, 2025
10999e1
Refactor SelectionManager to integrate merge request functionality an…
NishantSinghhhhh Dec 26, 2025
c2ec1c3
Merge branch '10033/expand-merge-queue' of https://github.com/Nishant…
NishantSinghhhhh Dec 26, 2025
19a1396
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 26, 2025
9a23818
Implement merge request handling and UI updates for editing and delet…
NishantSinghhhhh Dec 26, 2025
58097fe
Merge branch '10033/expand-merge-queue' of https://github.com/Nishant…
NishantSinghhhhh Dec 26, 2025
8880c41
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 26, 2025
e7174ed
Enhance merge request handling: improve MRID processing, update UI fo…
NishantSinghhhhh Dec 30, 2025
e788f0c
Enhance merge request handling: improve MRID processing, update UI fo…
NishantSinghhhhh Dec 30, 2025
197c067
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 30, 2025
2f670f2
Refactor MRID extraction: improve handling of query parameters in dat…
NishantSinghhhhh Dec 30, 2025
5631661
Merge branch '10033/expand-merge-queue' of https://github.com/Nishant…
NishantSinghhhhh Dec 30, 2025
04d3492
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 30, 2025
3683692
Enhance author merge request handling: add support for author-specifi…
NishantSinghhhhh Dec 30, 2025
94a8442
Merge branch '10033/expand-merge-queue' of https://github.com/Nishant…
NishantSinghhhhh Dec 30, 2025
1362498
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 30, 2025
7c78ccc
Refactor code for improved clarity: enable TypeScript checks, remove …
NishantSinghhhhh Dec 30, 2025
a254a49
Refactor code for improved clarity: enable TypeScript checks, remove …
NishantSinghhhhh Dec 30, 2025
e02835e
Merge branch 'master' into 10033/expand-merge-queue
NishantSinghhhhh Dec 30, 2025
a92a4b1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 30, 2025
b8ce0cd
removed commit errors
NishantSinghhhhh Dec 30, 2025
b20b3db
Removed commit errors
NishantSinghhhhh Dec 30, 2025
48e912c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 30, 2025
85c3f4f
Removing unnecessary changes
NishantSinghhhhh Jan 9, 2026
4bd44cc
Merge branch '10033/expand-merge-queue' of https://github.com/Nishant…
NishantSinghhhhh Jan 9, 2026
cea518e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 9, 2026
bf31495
Removed commit errors
NishantSinghhhhh Jan 9, 2026
3a4d53c
Merge branch '10033/expand-merge-queue' of https://github.com/Nishant…
NishantSinghhhhh Jan 9, 2026
432fcae
Restored unrelated changes
NishantSinghhhhh Jan 9, 2026
da8ef14
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 9, 2026
3006ca2
Removed declineDeletionRequest and approveDeletionRequest
NishantSinghhhhh Jan 9, 2026
06dd66b
Merge branch '10033/expand-merge-queue' of https://github.com/Nishant…
NishantSinghhhhh Jan 9, 2026
041bf85
restored edit.html for books
NishantSinghhhhh Jan 9, 2026
8b67339
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 9, 2026
30963d4
Removed commit errros
NishantSinghhhhh Jan 10, 2026
5d5bcd4
Merge branch 'master' into 10033/expand-merge-queue
NishantSinghhhhh Jan 10, 2026
9c4a514
Refactor edit URL generation and improve formatting in author and edi…
NishantSinghhhhh Jan 10, 2026
4eecce3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 10, 2026
0a7c923
Refactor edit URL generation and improve formatting in author and edi…
NishantSinghhhhh Jan 10, 2026
ebfd0a3
4Merge branch '10033/expand-merge-queue' of https://github.com/Nishan…
NishantSinghhhhh Jan 10, 2026
9105ec3
Refactor edit URL generation and improve formatting in author and edi…
NishantSinghhhhh Jan 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions openlibrary/core/edits.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class CommunityEditsQueue:
{
'WORK_MERGE': 1,
'AUTHOR_MERGE': 2,
'WORK_DELETE': 3,
'AUTHOR_DELETE': 4,
}
)

Expand Down
107 changes: 14 additions & 93 deletions openlibrary/i18n/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -1015,8 +1015,8 @@ msgstr ""
msgid "View the editing history of this page"
msgstr ""

#: databarDiff.html databarEdit.html databarTemplate.html databarView.html
#: lib/history.html openlibrary/plugins/openlibrary/home.py
#: databarDiff.html databarEdit.html databarTemplate.html lib/history.html
#: openlibrary/plugins/openlibrary/home.py
msgid "History"
msgstr ""

Expand All @@ -1032,27 +1032,27 @@ msgstr ""
msgid "View this page (exit Edit mode)"
msgstr ""

#: databarHistory.html databarView.html
#: databarHistory.html
#, python-format
msgid "Last edited by %(author_link)s"
msgstr ""

#: databarHistory.html databarView.html
#: databarHistory.html
msgid "Last edited anonymously"
msgstr ""

#: databarHistory.html databarView.html type/edition/compact_title.html
#: databarHistory.html type/edition/compact_title.html
msgid "Edit this page"
msgstr ""

#: account.html databarHistory.html databarTemplate.html databarView.html
#: account.html databarHistory.html databarTemplate.html
#: my_books/check_ins/check_in_prompt.html
#: reading_goals/reading_goal_progress.html subjects.html
#: type/edition/compact_title.html type/user/view.html
msgid "Edit"
msgstr ""

#: databarTemplate.html databarView.html
#: databarTemplate.html
msgid "View this template's edit history"
msgstr ""

Expand Down Expand Up @@ -1743,7 +1743,7 @@ msgstr ""
msgid "Status Summary"
msgstr ""

#: batch_import_view.html
#: batch_import_view.html books/edit.html
msgid "Approve"
msgstr ""

Expand Down Expand Up @@ -2235,7 +2235,7 @@ msgid "Show changed files"
msgstr ""

#: admin/inspect/store.html admin/people/index.html status.html
#: type/author/edit.html type/language/view.html
#: type/language/view.html
msgid "Name"
msgstr ""

Expand Down Expand Up @@ -3368,7 +3368,6 @@ msgid "Infobase Mean"
msgstr ""

#: admin/history.html admin/imports.html authors/infobox.html
#: type/author/edit.html
msgid "Date"
msgstr ""

Expand Down Expand Up @@ -4464,12 +4463,11 @@ msgstr ""
msgid "Title"
msgstr ""

#: books/add.html books/edit.html
#: books/add.html
msgid "Use <b><i>Title: Subtitle</i></b> to add a subtitle."
msgstr ""

#: books/add.html books/edit.html type/author/edit.html
#: type/tag/tag_form_inputs.html
#: books/add.html type/tag/tag_form_inputs.html
msgid "Required field"
msgstr ""

Expand Down Expand Up @@ -4762,7 +4760,7 @@ msgstr ""
msgid "Editing..."
msgstr ""

#: books/edit.html type/author/edit.html type/template/edit.html
#: books/edit.html type/template/edit.html
msgid "Delete Record"
msgstr ""

Expand All @@ -4778,22 +4776,11 @@ msgstr ""
msgid "This Work"
msgstr ""

#: books/edit.html
msgid ""
"You can search by author name (like <em>j k rowling</em>) or by Open "
"Library ID (like <a href=\"/authors/OL23919A\" "
"target=\"_blank\"><em>OL23919A</em></a>)."
msgstr ""

#: books/edit.html
msgid "Author editing requires javascript"
msgstr ""

#: books/edit.html
msgid "Add Excerpts"
msgstr ""

#: books/edit.html type/about/edit.html type/author/edit.html
#: books/edit.html type/about/edit.html
msgid "Links"
msgstr ""

Expand All @@ -4802,14 +4789,7 @@ msgid "Work Identifiers"
msgstr ""

#: books/edit.html
msgid "Do you know any identifiers for this work?"
msgstr ""

#: books/edit.html
msgid ""
"These identifiers apply to all editions of this work, for example "
"Wikidata work identifiers. For edition-specific identifiers, like ISBN or"
" LCCN, go to the edition tab."
msgid "Decline"
msgstr ""

#: books/edition-sort.html
Expand Down Expand Up @@ -7434,65 +7414,6 @@ msgstr ""
msgid "For more information"
msgstr ""

#: type/author/edit.html
msgid "Edit Author"
msgstr ""

#: type/author/edit.html
msgid ""
"Please use natural order. For example: <strong>Leo Tolstoy</strong> not "
"<strong>Tolstoy, Leo</strong>."
msgstr ""

#: type/author/edit.html
msgid "A short bio?"
msgstr ""

#: type/author/edit.html
msgid ""
"If you \"borrow\" information from somewhere, please make sure to cite "
"the source."
msgstr ""

#: type/author/edit.html
msgid "Date of birth"
msgstr ""

#: type/author/edit.html
msgid "Date of death"
msgstr ""

#: type/author/edit.html
msgid ""
"We're not storing structured dates (yet) so a date like \"21 May 2000\" "
"is recommended."
msgstr ""

#: type/author/edit.html
msgid ""
"This is a deprecated field. You can help improve this record by removing "
"this date and populating the \"Date of birth\" and \"Date of death\" "
"fields. Thanks!"
msgstr ""

#: type/author/edit.html
msgid "Does this author go by any other names?"
msgstr ""

#: type/author/edit.html
msgid ""
"For example: Lev Nikolayevich Tolstoy was also known as Leo Tolstoy. "
"Please list one name per line."
msgstr ""

#: type/author/edit.html
msgid "Identifiers"
msgstr ""

#: type/author/edit.html
msgid "Author Identifiers Purpose"
msgstr ""

#: type/author/view.html type/edition/view.html type/work/view.html
#, python-format
msgid "%(page_title)s | Open Library"
Expand Down
33 changes: 29 additions & 4 deletions openlibrary/macros/databarView.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
$def with (page, edition=None, edit=True)

$code:
# Properly extract mrid from query parameters
mrid_raw = query_param("mrid", None)
mrid = None

if mrid_raw is not None:
# Handle if it's a list (some frameworks return lists)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Explain this to me.

Copy link
Author

Choose a reason for hiding this comment

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

I added this change because the mrid value was not being preserved when navigating via the Edit button on the Book or Author page.

The intended flow is:

Merge page → Book/Author page → Edit page → Request Deletion

However, during the transition from the Book/Author page to the Edit page, the mrid query parameter was being dropped. As a result, the Edit page no longer had the merge-request context, which is required to submit a delete request and subsequently close the merge request.

To fix this, I updated databarView.html

if isinstance(mrid_raw, list):
mrid = mrid_raw[0] if mrid_raw else None
else:
mrid = mrid_raw

# Clean and validate
if mrid is not None:
mrid = str(mrid).strip()
if not mrid or mrid == '':
mrid = None

$if page.type.key in ["/type/work", "/type/edition", "/type/author"]:
$if edition and page.type.key in ["/type/work"]:
$ edit_url = edition.url(suffix="/edit")
Expand All @@ -9,6 +27,10 @@
$else:
$ edit_url = page.key + "?m=edit"

$# Append mrid to edit_url if it exists
$if mrid:
$ edit_url += ('&' if '?' in edit_url else '?') + 'mrid=' + str(mrid)

<div id="editTools" class="edit">
<div id="editInfo">
$if "superfast" in ctx.features:
Expand All @@ -20,13 +42,16 @@
$else:
<div class="brown smaller sansserif">$_("Last edited anonymously")</div>
$if page.url:
<div class="smallest gray sansserif">$(page.last_modified and datestr(page.last_modified)) | <a href="$page.url(m='history')" rel="nofollow" title="$_('View this template\'s edit history')">$_('History')</a></div>
<div class="smallest gray sansserif">$(page.last_modified and datestr(page.last_modified)) |<a href="$page.url(m='history')" rel="nofollow" title="$_('View this
template\'s edit history')">$_('History')</a></div>
$else:
<div class="smallest gray sansserif">$(page.last_modified and datestr(page.last_modified)) | <a href="$changequery(m='history')" rel="nofollow" title="$_('View this template\'s edit history')">$_('History')</a></div>
<div class="smallest gray sansserif">$(page.last_modified and datestr(page.last_modified)) |<a href="$changequery(m='history')" rel="nofollow" title="$_('View this
template\'s edit history')">$_('History')</a></div>
</div>

$if edit and not page.is_fake_record():
<div class="editButton">
<!-- FIXME: accesskey / keyboard shortcut needs i18n -->
<!-- FIXME: accesskey / keyboard shortcut needs i18n -->
<a
class="cta-btn cta-btn--vanilla"
href="$edit_url"
Expand All @@ -36,4 +61,4 @@
rel="nofollow"
>$_("Edit")</a>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import $ from 'jquery';
import { move_to_work, move_to_author } from '../ol.js';
import './SelectionManager.less';

import { createRequest, REQUEST_TYPES } from '../../../merge-request-table/MergeRequestService.js';
/**
* The SelectionManager is responsible for making things (e.g. books in search results,
* or authors on books pages) on Open Library selectable and drag/droppable from one
Expand Down Expand Up @@ -203,18 +203,72 @@ export default class SelectionManager {

for (const action of SelectionManager.ACTIONS) {
const items = [];
if (action.requires_type.every(type => this.selectedItems[type].length > 0)) {
action.applies_to_type.forEach(type => items.push(...this.selectedItems[type]));
if (action.multiple_only ? items.length > 1 : items.length > 0)
if (action.href) {
this.ile.$actions.append($(`<a target="_blank" href="${action.href(this.getOlidsFromSelectionList(items))}">${action.name}</a>`));
} else if (action.onclick && action.name === 'Tag Works') {
this.ile.$actions.append($(`<a href="javascript:;">${action.name}</a>`).on('click', () => this.ile.updateAndShowBulkTagger(this.getOlidsFromSelectionList(items))));
}

if (!action.requires_type.every(type => this.selectedItems[type].length > 0)) {
continue;
}

action.applies_to_type.forEach(type => {
items.push(...this.selectedItems[type]);
});

if (!(action.multiple_only ? items.length > 1 : items.length > 0)) {
continue;
}

if (action.href && !action.onclick) {
this.ile.$actions.append(
$(
`<a target="_blank" href="${action.href(
this.getOlidsFromSelectionList(items)
)}">${action.name}</a>`
)
);
continue;
}

if (action.onclick) {
this.ile.$actions.append(
$(`<a href="#">${action.name}</a>`).on('click', (e) => {
e.preventDefault();
this.handleActionClick(action, items);
})
);
}
}
}

handleActionClick(action, items) {
const olids = this.getOlidsFromSelectionList(items);

if (action.name === 'Tag Works') {
this.ile.updateAndShowBulkTagger(olids);
return;
}

if (action.name === 'Delete Works...') {
createRequest(
olids.join(','),
'create-pending',
REQUEST_TYPES.WORK_DELETE
).finally(() => {
window.open('/merges', '_blank');
});
return;
}

if (action.name === 'Delete Authors...') {
createRequest(
olids.join(','),
'create-pending',
REQUEST_TYPES.AUTHOR_DELETE
).finally(() => {
window.open('/merges', '_blank');
});
return;
}
}

addSelectedItem(item) {
this.selectedItems[this.getType(item).singular].push(item);
sessionStorage.setItem('ile-items', JSON.stringify(this.selectedItems));
Expand Down Expand Up @@ -500,6 +554,14 @@ SelectionManager.ACTIONS = [
name: 'Merge Works...',
href: olids => `/works/merge?records=${olids.join(',')}`,
},
{
applies_to_type: ['work'],
requires_type: ['work'],
multiple_only: false,
name: 'Delete Works...',
onclick: true,
},

/* Uncomment this when edition merging is available.
{
applies_to_type: ['edition'],
Expand All @@ -516,4 +578,11 @@ SelectionManager.ACTIONS = [
name: 'Merge Authors...',
href: olids => `/authors/merge?records=${olids.join(',')}`,
},
{
applies_to_type: ['author'],
requires_type: ['author'],
multiple_only: false,
name: 'Delete Authors...',
onclick: true,
},
];
Loading