abartov / bybeconv

Project Ben-Yehuda's content management system.
https://benyehuda.org/
Other
10 stars 5 forks source link

Intellectual property enum for Person #336

Closed damisul closed 1 month ago

damisul commented 2 months ago

Updated person model and people table: replaced public_domain column with intellectual_property enum.

Fixed incongruous copyright report.

Also this PR contains changes to speedup ManifestationIdex rebuilding: I've added preloading of all involved persons and tags, and modified methods used to fetch authors/translators etc to be able to use preloaded data.

It allowed to reduce chewy:reset time for ManifestationIndex on my machine from 23 minutes to 11 minutes.

I propose to use 'Rebase and merge' policy for this PR to keep those changes separated in commit history.

abartov commented 1 month ago

@damisul - I am testing this, and noticed what I missed in a previous PR: the manifestation/edit_metadata form has not been updated to offer the new intellectual property modes, and still has a boolean radio button. Please fix this.

abartov commented 1 month ago

also: Manifestation.copyright? yields a NoMethodError


app/models/manifestation.rb:78:in `copyright?'
app/views/shared/_anth_panel.html.haml:96
app/views/shared/_anth_panel.html.haml:57:in `each'
app/views/shared/_anth_panel.html.haml:57
app/views/shared/_anthology.html.haml:52
app/views/shared/_anth_stuff.html.haml:2
app/views/manifestation/browse.html.haml:21
app/controllers/manifestation_controller.rb:45:in `browse'
app/controllers/manifestation_controller.rb:317:in `genre' 
damisul commented 1 month ago

@damisul - I am testing this, and noticed what I missed in a previous PR: the manifestation/edit_metadata form has not been updated to offer the new intellectual property modes, and still has a boolean radio button. Please fix this.

Hm... this is strange. I see this on my machine using current master (after this PR was merged): Снимок экрана в 2024-05-07 01-14-33

@abartov , are you sure you're using latest version of sources?

damisul commented 1 month ago

And

also: Manifestation.copyright? yields a NoMethodError

Just checked and currently on 96th line of _anth_panel.html.haml we don't check copyrighted? field. Instead we render intellectual_property partial there: https://github.com/abartov/bybeconv/blob/df03ee7742ac84d983df3782962583a3b7f5e76c/app/views/shared/_anth_panel.html.haml#L96

abartov commented 1 month ago

Pardon me! Both are my mistake. I accidentally looked at the production branch.