summaryrefslogtreecommitdiff
path: root/lib/VNWeb/HTML.pm
AgeCommit message (Collapse)AuthorFilesLines
2019-11-27ulist: Add column selection + voted, modified, release date & rating columnsYorhel1-2/+5
It works pretty well, but Lists.pm is getting *really* ugly now. :(
2019-11-27CSS: Less hacky .maintabsYorhel1-44/+51
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-19Fix consistency between discussion counter in the dbentry tabs and actual ↵Yorhel1-1/+1
listing i.e. private and hidden threads are now included in the counter if you can see those threads.
2019-11-15Move pubskin fetching responsibility to VNWeb::HTML::framework_Yorhel1-4/+5
Requiring callers to fetch the right fields and pass it along to framework_() just seems brittle. This implementation requires an extra query but does make an effort to avoid fetching the skin and css when it's not needed.
2019-11-14v2rw: Convert staff pagesYorhel1-8/+59
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-10Reorganize JS and Elm instantiation + more efficient ulist loadingYorhel1-4/+13
The order in which .js files are concatenated is (and always has been) important, so rather than relying on name order I've changed that to an explicit $JS_FILES list in the Makefile. Less convenient, but at least we have more freedom regarding .js file naming and organization now. Rather than encoding the Elm flags as JSON in 'data-' attributes, I've added a system for global page variables (pagevars) where the Elm flags are now stored separately from their HTML tags. This has the advantage of more efficient encoding (no more &quot;s), faster parsing (just a single JSON.parse()), and easier/more efficient modification of the Elm arguments from JS. The pagevars provide a unified way of passing other variables to JS as well, which I've used to deduplicate the list of labels on the new ulist page. That shaves off a good 40 KiB on the page size for a typical listing. Whether all of this actually improves the page loading time, I don't really know. Most of the slowness in Firefox seems to come from simply instantiating many <input time="date"> objects.
2019-11-10ulist: "End date" -> "Finish date" + put placeholder values in Elm divsYorhel1-2/+2
2019-11-10ulist: Inline editable votesYorhel1-1/+1
2019-10-31Footer: Shorten version string + move source URLYorhel1-3/+2
2019-10-22"nofancy" option also removes the star next to "My Profile"Yorhel1-1/+1
2019-10-16v2rw: Convert staff adding/editing formYorhel1-2/+76
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-16Display star next to 'My profile' link when supporter options are availableYorhel1-1/+2
It's not very obvious when a users' account has been linked, and it wasn't clear to some that the rewards need to be enabled manually. Hopefully this clears up both.
2019-10-16HTML: Make "noindex" the defaultYorhel1-2/+2
Adding 'index => 0' to all pages is error-prone, and the majority of the pages aren't indexed. Requiring an 'index => 1' for pages that may be indexed is less work and a safer solution. (Doesn't affect the v2 codebase, which still requires an explicit 'noindex => 1')
2019-10-14v2rw: Convert user listingYorhel1-2/+35
2019-10-14Delete the user deletion featureYorhel1-1/+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-12Revert username capitalization in main menu and user pageYorhel1-3/+4
2019-10-12rewards: Fix applying the public skin even when disabledYorhel1-2/+3
2019-10-12Add Patreon link to main menu + minor fixesYorhel1-1/+6
2019-10-10rewards: Honor public custom css/skinYorhel1-2/+6
2019-10-10rewards: Apply supporters badge and unicode name (almost) everywhereYorhel1-11/+31
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-04VNWeb::HTML: Make sure to force reload v2rw.js on version changeYorhel1-1/+1
Not sure how I missed this.
2019-10-03SQL: Get rid of the users_prefs table, store preferences in users tableYorhel1-3/+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-10-01Fix <base href=..> so that form tabs work againYorhel1-1/+1
2019-10-01v2rw: Convert registration, account activation and password resetYorhel1-3/+6
This is largely copy-paste from v3.
2019-09-30v2rw: Convert login, logout & insecure-password-change formsYorhel1-3/+7
The insecure-password-change flow is now slightly more friendly. The logout functionality has been hardened to use POST and require CSRF.
2019-09-28Fix CSS sanitization to remove full @import statementsYorhel1-1/+1
Or at least, attempt to do so for compatibility with the custom CSS currently in the DB.
2019-09-27VNWeb::HTML: Attempt to sanitize custom CSSYorhel1-1/+20
I'm thinking of adding a feature so that custom CSS can be applied when others view your profile, but that's going to need some extra security.
2019-09-27VNWeb::HTML::_maintabs_: Fix display of relations tab for vns and producersYorhel1-1/+5
2019-09-27VNWeb::HTML::revision_: Fix handling of UTF-8 diffsYorhel1-6/+6
Turns out Algorithm::Diff::XS ignores the 3rd argument to compact_diff(), so we'll have to go back to using an encode/decode step to make this work. (Fixes a 500 on /d18.6)
2019-09-27v2rw: Convert history listingsYorhel1-2/+54
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-25v2rw: Add Elm & db_edit framework + Convert doc page editingYorhel1-3/+13
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-23Minor administrative fixesYorhel1-1/+0
The FCGI module is only required when running in FastCGI mode, which isn't how the container is configured. The AnyEvent::HTTP module, on the other hand, is required for many of the new Multi::* modules. They're not enabled by default but are still a significant part of Multi, so it's good to have the dependencies available.
2019-09-23v2rw: Convert doc pages + add framework for item fetching & display & revisionsYorhel1-9/+321
This bumps the minimum Perl version to 5.26 in order to make use of lexical subroutines - a feature I've been wanting for a while. This should be the last version bump, 5.26 is the highest version in Ubuntu LTS at the moment. Not that I use Ubuntu, but it's used by the Docker container and it's a sensible reference. I merged the 'maintabs' and 'hiddenmsg' features into the primary framework_ function; It fits quite well there, removes a little bit of boilerplate from the DB entry page code and reduces the reliance on common "dbSomethingGet()" methods. I was hoping I'd be able to reduce the boilerplate required for defining revisions, but I don't think that's going to happen. What I did do was reimplement the diffing to handle item and text diffs separately, with sensible defaults for the old split/join/diff options. Diffing is now performed on the raw structured data rather than on formatted HTML, which, combined with the db_entry() functions, ought to be less brittle.
2019-09-20CSS: Increase doc index box a bit + Add API/Dumps/Query links to main menuYorhel1-1/+4
2019-09-18v2rw: Convert authentication code to VNWeb::AuthYorhel1-17/+21
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-0/+200
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.