summaryrefslogtreecommitdiff
path: root/lib/VNWeb/TT
AgeCommit message (Collapse)AuthorFilesLines
9 daysAdd support for account soft-deletion and email opt-out listYorhel1-2/+5
This work is to support a safe self-service account deletion feature, but I haven't implemented that part yet.
2024-03-11Don't throw an error on multiple 'fil' query paramsYorhel2-2/+2
2023-12-04Stricter input validation for single-line fieldsYorhel2-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-10-10Validation: Remove "required" and be explicit about optional fieldsYorhel4-7/+7
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-07-11Remove popularity rating + adjust bayesian averageYorhel1-1/+1
As discussed in https://vndb.org/t20453
2023-07-01Adjust tag score calculationYorhel1-1/+1
As suggested in https://vndb.org/t13470.28 - with a few minor adjustments. This took me a few hours to code & test, SQL is hard :(
2023-06-22AdvSearch: Move save/load button + always display the thingYorhel2-4/+2
So that the save/load functionality is also available on a user's list. Suggested by https://vndb.org/t950.1537
2023-06-01UserEdit rewrite part 6: Title preferences + more dropdown select thingy ↵Yorhel1-2/+2
tweaking
2023-05-24UserEdit rewrite part 5: Public traits + some dropdown search featuresYorhel1-0/+14
Not yet super happy with the table-in-form layout thingy; buttons jump around when adding/removing items, ugh. I *am* quite happy with the dropdown search thingy, the new features make it much more intuitive to have items that can't be selected. The current Elm code usually ignores the selection of items that are already present or otherwise unselectable, which can be rather confusing. Having the input field replaced with a button is something I'm not yet decided on. It does makes sense, but also requires an additional action when adding multiple traits. Even if that action is just pressing the enter key. Multi-select built into the DS abstraction might be a solution.
2023-05-20JS: Add dropdown search thingyYorhel1-0/+13
I considered a few general purpose selection libraries, but they're all significantly larger and would take a bit of effort to properly integrate anyway.
2023-05-05CSS: Use semantic tags + flexbox for global layoutYorhel8-15/+15
Hopefully without breaking anything. Switched to using flexbox for the homepage boxes instead of grid, in order to fix an overflow issue on Pale Moon. But I later fixed a similar issue with the relation graphs and history tables, so perhaps that switch wasn't necessary.
2023-05-03Fix two remaining references to "desc" and "order"Yorhel1-1/+1
2023-05-03SQL: Rename columns that are SQL keywordsYorhel4-11/+11
So that there aren't any columns in need of quoting anymore.
2023-04-15CSS: Use <strong>/<span> instead of <b> for bold/marker tagsYorhel2-5/+5
To reserve <b> for the standout styling.
2023-04-15CSS: Stop abusing <b> for grayedout, use <small> insteadYorhel4-8/+8
Which is also kind of an abuse, but at least the semantics are much closer. (Next up: the standout class. Slowly working towards a "font: inherit" and "color: inherit" reset, which'll remove the need for a bunch of ugly workarounds)
2023-03-24*::Elm: Don't throw error on "empty" search queriesYorhel1-4/+4
Queries that normalize to nothing (e.g. ".") do not really need to throw an error - it's not a bug in the front-end code - and should also not prevent such entries from being created.
2023-03-24Search backend changes: faster results with trigram index + rankingYorhel2-28/+15
With this ranking system, searching for titles like 'L' and 'ONE.' is now at least possible, and YU-NO at least shows up on the first page when searching for "yu no". The actual normalization and matching algorithm hasn't really changed, except that all search terms must now match a single title, but there's still a whole bunch of false positives. Ranking is not available through the API yet. The trigram index should make it possible to do site-wide searching at a more reasonable speed, I'll experiment with that later.
2023-03-09TitlePrefs: Also apply prefs to character namesYorhel1-3/+3
2023-02-19Rework passing around entry titles + add proper HTML5 'lang' attrsYorhel2-6/+6
This is a huge back-end change for a small benefit, but it also improves consistency a bit in the way that titles are handled and passed around. The Elm code still uses separate title/alttitle fields at various places, not sure if I want to bother converting that, too. I'm sure there's bugs, given how many files this touches.
2023-02-02Refactor part 2: get rid of temporary vnt/releasest viewsYorhel2-3/+3
Instead using the static view for the default title preferences, inline SELECT statements for custom preferences and wonderful vnt()/releasest() SQL functions for item_info(). Performance wise I don't expect much of a difference, except there's fewer writes and less per-page overhead from the CREATE TEMPORARY VIEW commands. Primary motivation for these changes is so that we can extend title preferences to other database types without incurring more overhead by needing to create more views.
2022-12-12Add card+grid mode to UList::List + some fixes for rows modeYorhel1-1/+1
The card/grid modes are totally half-assed, they don't display release status or notes and changes using the widget are not reflected in the listing until a page refresh. And the card mode will overflow if too many fields are selected.
2022-12-12Consolidate UList tableopts with VN::ListYorhel1-1/+1
Goal is to slowly consolidate more UList code with VN::List, so that all columns and display options of the latter are also available on the former. The only real change with the current commit is that more columns can be selected in UList, but this is just step one.
2022-10-27TraitPage: Add exclude lies optionYorhel1-1/+12
2022-10-25TagPage: Add lie exclude optionYorhel1-1/+13
2022-08-09Tagmod: allow setting spoiler level independent of the lie flagYorhel1-4/+10
2022-06-21VN/tags: add support for flagging tags as "false"Yorhel1-2/+2
Somewhat experimental feature, needs better testing, guidelines and integration with the search function. Probably.
2022-04-21TT::TagPage: Fix VN listing length column on tag pagesYorhel1-1/+2
Fixes https://vndb.org/t2520.647
2022-02-12TT::TagLinks: Display alttitle as tooltip for VN linksYorhel1-4/+6
2022-02-08VN: Add support for multiple titles in different languagesYorhel2-4/+4
This implements the main database model part of custom title languages (https://vndb.org/t12465). Selecting the right title for display is done in SQL through the 'vnt' VIEW, which can be overridden in each session with a TEMPORARY VIEW in order to support user title preferences, but that part has not been implemented yet. I had started out using an sql_vn() function that returned a subquery instead of using a VIEW, but then ran into trouble with the item_info() SQL function. This VIEW approach also happened to simplify much of the code. I did have to get rid of the Discusssions::Lib::sql_boards() function, as Postgres was unable to optimize the subquery inside a UNION inside a subquery for some reason. Haven't run into any other noticeable performance regressions yet. TODO: - Implement actual user title preferences - Add the correct 'lang' HTML attributes everywhere a title is displayed (we do have the information now, though it still isn't trivial) - Add title fetching support to API
2021-11-24Apply improved search to tags & traits as wellYorhel2-8/+5
2021-06-17TT::TagPage: Fix display of VN image in card modeYorhel1-1/+1
Fixes https://vndb.org/t2520.567
2021-06-04VN listing: Add table options + developer and raw average columnsYorhel1-21/+15
With additional VN cache columns for the new developers and average table columns. The developers cache is also used by the AdvSearch to potentially speed up some queries (and slow down others). I also changed the popularity and rating caches to smallint. Doesn't save anything with the current padding, but there's not much point in using a floating point type when the values get rounded anyway.
2021-05-21TT::Lib: Fix duplication in parent path displayYorhel1-1/+1
2021-05-21Tags/Traits: Add main/primary flag to parents listYorhel5-10/+21
This way there is always a single canonical path for each tag/trait, which fixes the problem with traits that could belong to multiple groups yet you couldn't control which one was selected, and this also removes duplication in the VN->tags tab, which now doesn't have to non-canonical tag paths.
2021-03-23Tags/Traits: Display parents of selected instead of latest revisionYorhel1-3/+3
2021-03-23HTML: Use hiddenmsg for tags/traits and to display awaiting moderation stateYorhel2-34/+2
This also fixes the issue that the reason for deletion is not displayed if it's in the message of the last change, which is the case for newly rejected tags/traits. The edit message is not displayed if the entry was deleted in the first revision, as that's most likely an import.
2021-03-23Traits: Convert to vndbids + add edit historyYorhel6-100/+89
Much the same as the previous conversion of tags.
2021-03-11TT::TagPage: Fix tag id comparison check in old URLsYorhel1-1/+1
I obviously forgot to test this one.
2021-03-11Tags: Convert to vndbids + add edit historiesYorhel8-106/+132
Another commit with changes all across the tree. But at least we have a tangible improvement now: edit histories for tags.
2021-03-02CSS: Fix formatting of block elements in entry descriptionsYorhel2-2/+2
Fixes https://vndb.org/t2520.542
2021-03-01SQL: vndbid data type conversion for most DB entriesYorhel1-4/+4
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.
2021-02-22TT:TraitPage: Also add char list options to trait pagesYorhel1-6/+9
2021-02-13SQL: Remove user id 0 and fix existing columns to use NULLYorhel2-2/+2
User id '0' referred to a special "deleted" user was a quick and dirty hack to support proper account deletion. It didn't end up working in all scenarios because some tables would have to allow multiple rows with uid=0 (tag votes, among other things) and that required using NULL to not trigger any UNIQUE constraints. So we ended up with inconsistent handling of deleted users, some tables using 0 and others using NULL. I've been using NULL for all recent code, this commit migrates the last 0s to NULL as well.
2021-01-29AdvSearch: Convert old-url redirects into permanent redirectsYorhel2-2/+2
I had them as temporary redirects in order to safely handle a rollback, but that won't be necessary anymore.
2021-01-29TT/(Tag|Trait)Edit: Substitute vndbid links in descriptions on editYorhel2-0/+4
Fixes the first part of https://vndb.org/t2520.538
2021-01-21AdvSearch: Stop logging filter compatibility conversion errorsYorhel2-10/+2
I think I've seen all the possible errors by now, what remains are invalid/corrupted filter strings that aren't very interesting to handle.
2021-01-16TraitPage: Rewrite to use new AdvSearch systemYorhel3-34/+170
Largely a copy-paste from TagPage.
2021-01-15TagPage: Fix display of tag propertiesYorhel1-1/+1
2021-01-10AdvSearch: Improve error reporting when query validation failedYorhel1-1/+1
Amazing how can browsers(?) and bots mangle URLs sometimes. Anyway, the user will now get a friendly error message instead of a 500, and I get to see log messages. Everyone happy. I hope.
2021-01-10TagPage: Fix URL compatibility conversion for URLS with a tag filterYorhel1-2/+7