summaryrefslogtreecommitdiff
path: root/lib/VNDB/Util
AgeCommit message (Collapse)AuthorFilesLines
2021-01-20v2rw: Rewrite done, time to clean up old v2 codeYorhel6-458/+0
Yay! There are no more request handlers in the VNDB::* namespace and no more Javascript in data/js/. This cleans up a lot of old legacy code that wasn't fun to maintain.
2021-01-17Use SASS for CSS + static asset reoganizationYorhel1-1/+1
Had been planning to use a more powerful preprocessor for CSS for a while, so that I can also reorganize and clean up the CSS a bit. The cleanup will come later, this is the first step to reorganize the build system a bit and remove skingen.pl. I moved all generated static assets to static/g/ (for _g_enerated), including icons.png and js files. This simplifies management of static/f/ and static/s/, which are fully in git. Skins are now defined as sass files in css/skins/ with their images in static/s/ using plain directory structure.
2021-01-04VNDB::Util::LayoutHTML: Fix reference to config params in old codeYorhel1-1/+2
Turns out I forgot something in 3fc190f1898342d63b1308a83152fe45a88f7c3f
2020-10-13notifications: Add subscribing for (un)applications of traitsYorhel1-0/+1
2020-10-02v2rw: Move redirects + cleanup some moreYorhel1-49/+1
2020-09-30Fix old reference to VNWeb::Tags::*Yorhel1-1/+1
2020-09-29v2rw/TraitEdit: Rewrite trait edit form + cleanup bunch of old codeYorhel3-385/+2
This was the last form in the old v2 code, so this allowed me to get rid of the old form validation and generation abstractions. The form is mostly a duplicate of the tag editing form, as expected. It's really annoying to have to maintain pretty much duplicate code for tags and traits, but there are just enough differences that the complexity of sharing code or creating a new abstraction outweigh the benefits. :(
2020-09-10v2rw/filters: Add experimental validation + move compat to VNWebYorhel1-16/+3
This is a minor start towards rewriting the filter logic in the new v2rw code. Filters were never validated before (I didn't have a good framework for it - now I do) and invalid filters would result in a 500. The new validation code is not yet applied, but failed validations will be logged so that I can see if it's working correctly. I mean, what better way to test than to throw it in production? I'll write new (and more flexible) SQL generation functions for these filters later, so that v2rw code can get filtered results and I can make a start on rewriting the pages that depend on the functionality. The validation schema can also be used to validate the filters stored in the DB, so I can use it to get rid of the complex handling of stored invalid filters.
2020-07-21Delete old producer edit form + a few more cleanupsYorhel1-189/+1
2020-06-15Releases: Allow custom resolutions to be enteredYorhel1-9/+0
The resolution field now works much like the engine field.
2020-05-29JS: Split v2rw.js into plain.js and elm.js, only include JS files when necessaryYorhel1-1/+0
The trace_log showed that the vast majority of pageviews do not need any Elm modules at all, so we can save a lot by not loading them on the page. Some pages (most notably: VN pages for not-logged-in visitors) do need JS but don't load any Elm modules. I've added a 'js' flag to HTML::framework_() to indicate that and ensure that plain.js is still loaded.
2020-04-24v2rw/VN::Page: Remove old and unused codeYorhel1-83/+1
There's a lot of unused code in VNDB::DB::{VN,Release} still, but I'll not fiddle with that for now.
2020-04-15SQL: Split "perm" column into multiple booleansYorhel1-1/+1
This simplifies several actions and makes permission checks more obvious. This is also yack shaving for another feature I've been planning to add: boardmods should be able to set other users' "board" permission, tagmods for tags, etc. So that partial user bans don't need the full "usermod" permission.
2020-04-01VN::Graph: Also generate VN graphs on-demandYorhel1-24/+1
Same change as with Producers::Graph before. This also adds an option to show/hide unofficial relations. Restructured the code a bit to allow for sharing code between Producers::Graph and VN::Graph.
2020-01-08Slightly less ugly tagscore displayYorhel1-1/+1
And get rid of the spoiler warning in the tag link browser. There are lots of pages that would need it if we applied it consistently.
2019-12-29ulist: Display labels on VN browserYorhel1-1/+2
Replaces the old "wishlist status" column that I removed earlier. It's kind of awkward, but at least the functionality still exists now.
2019-12-24ulist: Add list management widget on VN pagesYorhel1-0/+2
Minimal version. It reuses the LabelEdit and VoteEdit widgets, but doesn't allow setting a note or start/finish date at the moment. VN pages now have both v2rw.js and the old vndb.js; Those two scripts aren't meant to be used together on a single page, so I'm hoping this will be temporary. I removed the 'checkall' handling from vndb.js as that might conflict. It's only used on the old list pages anyway.
2019-12-22ulist: Use new lists for VN vote stats & listingYorhel1-8/+12
To my surprise, I actually managed to achieve acceptable performance by just adding two indices. I totally expected I'd have to keep a cache column in ulist_vns whether the row is private or not. The partial index on the users table in fact improves the performance of the vote graph query. A covering index improves that even further, but that requires Postgres 11+, which the Docker image doesn't have yet (and isn't all that crucial anyway). There's a rather annoying potential for confusion regarding the private flag on votes. The user page & list stats only look at whether the 'Voted' label is private, whereas the VN stats use the "proper" approach of checking for any public label. Not entirely sure which of the two is more intuitive.
2019-11-27CSS: Less hacky .maintabsYorhel3-102/+34
Flexbox instead of floats. Apart from that, it's still very hacky. Uses relative positioning in order to overlay 1px over the .mainbox. This should fix the ages-old 'bottom tabs overlay next mainbox' bug and provide more flexibility with adding a top-level <fieldset> or centered buttons.
2019-11-14v2rw: Convert staff pagesYorhel1-1/+0
This is where the ExtLink module comes in handy: generating the revision comparison thing is much easier now. Did find and fix a bunch of issues with the new revision box generator code, but that was to be expected, I hadn't tested that code well yet and this is its first more demanding use. Rest of this is a pretty direct rewrite, nothing too special.
2019-11-12v2rw: Move entryLinks() into separate VNDB::ExtLinks moduleYorhel1-84/+1
This is yak shaving. The new module doesn't have much value as it is, apart from having a central place to define link formats. This new enrich_extlinks() approach is also a bit more efficient in that it can avoid separate SQL queries for multiple objects. But the real reason for these changes is that I can use that %LINKS hash table to automatically generate the links part in the edit summary and it should (hopefully) also be useful to generate a more convenient/streamlined Elm edit form.
2019-11-08Wikidata: Add support for doujinshi.org author linksYorhel1-0/+2
2019-11-02Add character cup size field + conversion + filterYorhel1-1/+1
2019-10-26Fix Wikipedia URLs with a question markYorhel1-2/+2
https://vndb.org/t2520.307
2019-10-16v2rw: Convert staff adding/editing formYorhel2-98/+5
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.
2019-10-14v2rw: Convert user listingYorhel1-16/+1
2019-10-14Delete the user deletion featureYorhel1-6/+0
It's rather much code just to run a single SQL statement that I almost never need. Incidentally, the feature was also broken because the DELETE permission wasn't granted in perms.sql.
2019-10-11Two rewards-related bug fixesYorhel1-2/+2
2019-10-10rewards: Apply supporters badge and unicode name (almost) everywhereYorhel3-44/+5
Only place where this isn't applied (yet?): Sorting user lists still goes by the old username and board names don't use the new unicode names. I have to say, I quite like the sql_user() and user_() pattern. It's not without problems when applied to everything, but it's good enough for several use cases.
2019-10-10Fix noinxed tag on non-v2rw pagesYorhel1-0/+1
2019-10-03SQL: Get rid of the users_prefs table, store preferences in users tableYorhel1-1/+1
This bloats the users table a little bit, but that's fine. The main advantage of this change is that we now have a proper schema for user preferences, rather than the schemaless key-value mess we had before. This commit also splits the 'tags_cat' preference up into tags_cont, tags_ero and tags_tech bools, as that's more compact to store and easier to work with. This commit also changes the 'notify_nodbedit' preference to 'notify_dbedit' with inverted meaning. The reason the value was negated in the first place was because the old schemaless approach did not support positive defaults.
2019-09-27v2rw: Convert history listingsYorhel1-1/+0
And I changed the filter selection into a more form-like thing. It's slightly more powerful, but not sure it's such a huge improvement in terms of UI. Everything should be identical apart from that.
2019-09-26Disallow usernames that look like DB identifiers + minor BBCode fixYorhel1-1/+1
A '-' before or after a DB identifier now counts as a "word character", meaning in "d5-something" won't turn that "d5" into a link.
2019-09-25v2rw: Add Elm & db_edit framework + Convert doc page editingYorhel1-17/+1
Most of this is copied from v3. I did improve on a few aspects: - db_edit() and db_entry() use VNDB::Schema rather than dynamically querying the DB. This has the minor advantage of a faster startup. - The Elm code generator now writes to multiple files, this avoids the namespace pollution seen in v3's Lib.Gen and makes the dependency graph a bit more lean (i.e. faster incremental builds). - The Elm code generator doesn't update the timestamp of files that haven't been modified. This also speeds up incremental builds, the elm compiler can now skip rebuilding unmodified files. - The Elm API response generator code now uses plain functions rather than code references and all possible responses are now defined in Elm.pm. Turns out most API responses were used from more than a single place, so it makes sense to have them centrally defined. The doc page preview function is also much nicer; I'd like to apply this to all BBCode textareas as well. (Elm.pm itself is ugly as hell though. And we will prolly need some HTML form generation functions in Elm to make that part less verbose)
2019-09-18v2rw: Convert authentication code to VNWeb::AuthYorhel2-131/+32
More churn! Also converted v3 to use VNWeb::Auth, considering the API is pretty much the same. Converted VNWeb::* to use VNDB::Config directly rather than read from tuwf->{}, converted VNWeb::HTML to use VNWeb::Auth, and updated util/vndb.pl with the new code style. I tested as much as I could, but I'm sure I broke something.
2019-09-17v2rw: Initial start on an incremental rewrite; Layout HTML firstYorhel1-174/+10
I copied and modified VN3::DB to VNWeb::DB, but it isn't used yet. Now that I think about it, that module isn't "web" specific at all and should perhaps be in the VNDB:: namespace. Oh well.
2019-09-17Clean up DB statistics displayYorhel1-6/+3
Present them in the same order as the main menu. Remove user and forum stats, they're pretty much irrelevant. The user count, in particular, is misleading - those aren't "active" users.
2019-09-14Add "msg user" to revision box + add own ID to boards when PMingYorhel1-1/+5
2019-09-14Remove spoiler warning from character revision pagesYorhel1-9/+0
1. Every revision page may contain spoilers 2. Nobody reads those big red warnings, anyway
2019-09-12Add VNDB::Config module and unified conf.pl config fileYorhel2-4/+7
This gets rid of global.pl, config.pl and config3.pl and uses the cleaner config3.pl format for the config file. The config is easily accessible from anywhere by importing the new VNDB::Config module; The global $VNDB::S,O,M,ROOT variables have been removed. Sorry for all the churn...
2019-09-12VNDB::Types: Convert medium & resolutionYorhel1-1/+2
2019-09-11VNDB::Types: Convert (wishlist|rlist|vnlist)_statusYorhel1-1/+1
I did create a function to export arrays, but ended up exporting them as hashes. That ought to simplify a conversion to an enum type. Which will likely never happen because I'd rather switch to dynamic user-defined statuses, but that's quite a step further...
2019-09-11VNDB::Types: Convert platforms into %PLATFORMYorhel1-1/+1
2019-09-11VNDB::Types: Convert languages into %LANGUAGEYorhel1-1/+2
2019-09-03Add Pixiv ID to staff entriesYorhel1-1/+2
2019-09-03Fetch some more IDs from Wikidata + display IGDB & Pixiv linksYorhel1-0/+2
2019-09-01Add ErogeTrailers.com links to releasesYorhel1-1/+2
2019-09-01Add EGS links to releasesYorhel1-0/+1
2019-08-27Display Twitter links from Wikidata on producer pagesYorhel1-0/+1
2019-08-26Display shop+price info on VN pages + delete old affiliate codeYorhel1-10/+9
The current affiliate links format doesn't display as much information as before but it's also a lot less messy.