summaryrefslogtreecommitdiff
path: root/lib/VNWeb/Staff/Edit.pm
AgeCommit message (Collapse)AuthorFilesLines
2023-12-04Stricter input validation for single-line fieldsYorhel1-2/+2
Tried some malicious multiline inputs, wasn't a big issue given that HTML doesn't render newlines, but could still be surprising in some places.
2023-12-03Staff::Edit: Fix setting the main alias on creationYorhel1-1/+1
2023-12-03SQL: Rename staff.aid to staff.mainYorhel1-3/+3
Both to remove the copies of the column lists in the staff_aliast definition and to align the underlying table with said VIEW. Using a different name from staff_alias.aid also makes it easier to see what the code is trying to do. (No doubt I broke something)
2023-12-03Staff/ReleaseEdit: Flatten & simplify extlinks fields into form dataYorhel1-4/+1
Removes the need for entry_to_extlinks() and entry_from_extlinks() crap. The original reason for this separation was so that a single Elm links management module could be used for all forms, but Perl and JS are flexible enough to do that without separating out the extlinks.
2023-12-02StaffEdit: Use ExtLinks editing componentYorhel1-4/+5
Abstract it out of the Release edit form (easy, I had written it with re-use in mind) and fix it to support NULLable fields.
2023-11-30StaffEdit: Warn about editing referenced aliases + alias sortingYorhel1-0/+2
Fixes https://vndb.org/t950.1579
2023-11-30StaffEdit: Rewrite to JSYorhel1-11/+8
No major changes compared to the Elm version, just a few minor improvements: - Better error reporting of invalid URLs - Language field does not have a default anymore - Duplicate staff list also displays alttitle - Allow romanization for Greek names
2023-10-10Validation: Remove "required" and be explicit about optional fieldsYorhel1-8/+8
See TUWF commit fd3d2ca6a18222dafaa13dbcb7a6ccce1c4d9e6e Fixes https://vndb.org/t2520.822 and a few related bugs. (I may have introduced a few new bugs with this, let's see...)
2023-05-03SQL: Rename columns that are SQL keywordsYorhel1-2/+2
So that there aren't any columns in need of quoting anymore.
2023-03-20Also swap staff name/originalYorhel1-7/+7
That should be the last one.
2023-02-20Also apply title preferences to staff namesYorhel1-4/+4
2021-10-03Staff::Edit: Fix accepting large Pixiv IDsYorhel1-2/+2
Same for AniDB IDs, while I'm at it. Fixes https://vndb.org/t2520.606
2021-03-01SQL: vndbid data type conversion for most DB entriesYorhel1-8/+8
I had wanted to split this up into multiple commits and roll out in stages, but couldn't really find a natural way to do so. There are several places that take a generic identifier and expect it to work the same for all entries they support, so changing one entry at a time wasn't going to be any easier. Only the tags & traits haven't been updated yet, I'll convert those later. While this is a major change and affects a lot of code, the individual changes are all pretty simple. I'm surprised how much code did not have to be updated at all. No doubt I've missed a few places, though, so this commit will almost certainly break something.
2020-06-20Staff::Edit: Fix re-adding aliases by revertingYorhel1-2/+2
A revert will retain the original alias ID, which was incorrectly rejected during validation.
2020-05-28Staff::Edit: Fix staff adding form initializationYorhel1-1/+1
Forgot to add this one in 980b704417133dbbdec6f2571620dc3dcab2bb40
2020-05-28Staff::Edit: Make sure not to remove referenced aliases on revertYorhel1-4/+10
2020-04-13FIXUP: How did I not commit this?Yorhel1-1/+1
2020-04-13Fix input validation of Wikidata IDs + fix "id" upper boundYorhel1-1/+1
The 'id' validation is to be used for internal VNDB ids only and associativity of << and - were different from what I had expected.
2020-03-09refactor: Convert Staff edit form to the same initialization approachYorhel1-4/+8
As in 220dfdad9046631bb94f839ea3949daef1c6229e
2020-02-16Staff::Edit: Disallow name=original in aliasesYorhel1-0/+1
2020-01-05refactor: Combine json_api() & elm_form() + generate Elm function to msg API ↵Yorhel1-3/+1
endpoint The new elm_api() function now creates an API endpoint (like json_api()) and generates a corresponding Elm module to interact with that API (like elm_form()). The API endpoint URL is now derived from the name of the Elm module, so there's no need to think of a separate URL and less prone to making typos when using that URL from Elm. Reduces the boilerplace a bit as well.
2019-12-10Elm: Add Redirect response + fix redirect to last post on replyYorhel1-1/+1
Fixes https://vndb.org/t2520/14#334 - I originally had some trouble to do this because `load` doesn't actually reload the page if you're just changing the hash. The `reload` following it handles that now. The Redirect response is just cleanup, there's several places that could benefit form it.
2019-12-08Fix json_api() URL matching + move URL parameters to POST bodyYorhel1-4/+4
For more consistency. Only exception right now is the password reset form, which still has parameters in the URL. Didn't convert it as that code doesn't use the elm_form() framework at the moment.
2019-10-16Fix editing of staff entries without WikidataYorhel1-1/+1
And I can't say the wikidata field is all that intuitive to edit. Need to look at it later...
2019-10-16v2rw: Convert staff adding/editing formYorhel1-0/+103
This is the first major editing form to be converted, so I'm expecting a little breakage. A good chunk of this code has been copied from v3. In terms of the UI there has been a small change: aliases that are still referenced do not have the 'remove' link and instead have a flag that shows that they are still referenced. This ought to be a bit friendlier than throwing an error message after the user has submitted the form. Some other things I'd like to improve in this form: - BBCode preview - Pasting in external links and letting the form figure out the Pixiv ID, etc. - Or perhaps even: Integrate AniDB/Wikidata search/autocompletion.