Commit Graph

501 Commits

Author SHA1 Message Date
Darks fbc500e833 Merge pull request 'Switch to LessCSS' (#102) from lesscss into dev
Reviewed-on: https://gitea.planet-casio.com/devs/PCv5/pulls/102
2021-07-14 16:42:06 +02:00
Darks 87d795959f
less (#97): first shot to Less
Quick switch, still may need some refacto and delete unused code
2021-07-14 16:30:45 +02:00
Darks 1112decbd0
less (#97): created makefile 2021-07-14 13:22:23 +02:00
Lephe b9abfcfde7
forum: properly redirect topic after changing forum
The URL changes so using the referrer is not much of an option.
2021-07-12 22:33:17 +02:00
Lephe 3551103c88
forum: allow users to move topics to wherever they can write 2021-07-12 21:33:03 +02:00
Lephe be644a6e18
forum: update trophies/xp of deleted topics' contributors 2021-07-12 20:39:44 +02:00
Lephe 76f03be60f
forum: do not delete threads of promoted topics
Threads of promoted topics belong to the programs they were promoted
into, so they shouldn't be deleted.
2021-07-12 20:39:19 +02:00
Lephe a6689312cf
master.py: enforce non-antialised upscaling of trophy icons
Either the default changed in PIL, the mode of the source image was
affected, or something else.
2021-07-12 20:11:44 +02:00
Lephe 306f1bab64
forum: balance XP of topic creation and deletion 2021-07-12 20:05:32 +02:00
Lephe 9f0cbc810b
forum: enable topic modification
This works only after a top comment has been selected (but topics
without top comments are an anomaly of databases initialized before it
was added, so we don't care).
2021-07-12 19:08:31 +02:00
Lephe b8ed0bba99 forum: enable topic deletion
Topic modification does not work in this snapshot, this is normal.
2021-07-12 18:37:06 +02:00
Lephe 9727c2a986 forum: add an action to change the top comment of a topic
This also prepares the thread_leader macro for top comments of
topics, programs, etc. which have extra stuff to render and more
specific actions.
2021-07-12 18:37:06 +02:00
Lephe 7423e522c3 forum: minor improvements to thread display 2021-07-12 18:37:06 +02:00
Lephe d10f9b3b48 forum: decrease XP when deleting posts (+penalty) 2021-07-12 18:37:06 +02:00
Lephe b533f8a161 forum: replace comment action links with contextual menu
The menu works with HTML/CSS only, and JS support will also allow
closing it by clicking outside of it (instead of closing allow when
clicking on the menu icon again).
2021-07-12 18:37:06 +02:00
Darks 44d2a59cbe
requirements: add python-email-validator as flask-wtf now requires it 2021-07-12 18:35:23 +02:00
Lephe b1ca1c4bbc
model: fix a bug in Guest.__repr__ 2021-07-12 17:47:45 +02:00
Lephe 2d6007ead4
improve rendering and overflow of code blocks 2021-07-11 10:09:08 +02:00
Lephe 7fc4424812
forum: use a more readable date format 2021-07-10 17:54:07 +02:00
Lephe 1837f8f9a6
forum: anti-bot fields for guest topics and comments (#51) 2021-07-10 12:30:12 +02:00
Lephe 888006cf86
theme: add Tituya's v43 theme 2021-07-10 09:28:36 +02:00
Lephe 08a8be1766
simplemde: improve preview of code blocks
Other tables are still shaky.
2021-07-08 19:27:59 +02:00
Lephe 6532dc8940
admin: remove empty group table in attachment manager 2021-07-08 17:55:32 +02:00
Lephe 64a6f270c5
master.py: also update title CSS 2021-07-08 17:52:54 +02:00
Lephe 59236cac70
master.py: update trophies in a lossless fashion (#82) 2021-07-08 17:48:14 +02:00
Lephe c4c9421beb
utils: allow empty CSS in validator 2021-07-08 17:47:01 +02:00
Lephe b31ed9bec2
master.py: reorganize commands (#82) 2021-07-08 17:47:01 +02:00
Darks f848615ff1 Petite amélioration sur la page de modération des images 2021-07-08 17:00:19 +02:00
Lephe 05f56a1cf4
forum: improve attachment inputs and allow edition (#49) 2021-07-08 16:50:28 +02:00
Lephe 619ea85eeb
css: add dark mode code, and improve code tables 2021-07-08 16:50:28 +02:00
Lephe c8c030081b
forum: preview formatting when editing messages (#49) 2021-07-08 16:50:28 +02:00
Eragon 78b6448167
Correct typo 2021-07-08 16:45:22 +02:00
Lephe 2aa2fd539f
clean up account forms (factor + syntax) (#70)
* Factor the update account forms (user and admin)
* Slightly cleaner syntax (I hope), also a bit shorter
2021-07-08 15:12:37 +02:00
Lephe 7b948979aa
specify GPLv3+ license and add LICENSE file (#6) 2021-07-08 14:20:30 +02:00
Lephe 47a1e1fc65
(align indent) 2021-07-08 14:19:57 +02:00
Lephe 7301aa954b
theme: update dark theme, override SimpleMDE (#14)
This commit updates the dark theme by FlamingKite, and adds a
simplemde-override.css file which overrides most of SimpleMDE's styling
for the edition area (CodeMirror) to replace fixed, bright-style values
with references to theme variables.
2021-07-08 14:09:17 +02:00
Lephe b3d99b93f8
account: add a theme setting (#14) 2021-07-08 11:43:09 +02:00
Lephe 8f0e15029c
utils: add a simple regex-based CSS validator (#11)
* Property name is [a-zA-Z-]+
* Value is anything but ;{}'"
2021-07-08 10:59:43 +02:00
Lephe 61f48259f2
trophy: fix deleteion 2021-07-08 10:58:53 +02:00
Lephe 5904019048
css: fix the size of XP bars 2021-07-08 10:57:55 +02:00
Lephe cc5f4e481b
account: member deletion, with post anonymization (#57) 2021-07-08 10:39:22 +02:00
Lephe bee912f88c
model: add all deletion methods (except Guest/Member) 2021-07-07 21:23:35 +02:00
Lephe 3c5599adf7
model: avoid the foreign key cycle between Thread and Comment
By specifying use_alter=True on one of the keys, the ORM will generate
an ALTER command to set the second foreign key after inserting both
objects, in case two new objects referring to each other have to be
created.

See: https://docs.sqlalchemy.org/en/14/core/exceptions.html#sqlalchemy.exc.CircularDependencyError
2021-07-07 19:38:28 +02:00
Lephe 3876e3470e
forum: improve responsiveness for viewports < 500px (#75) 2021-07-07 19:23:53 +02:00
Lephe fe039e4092
forum: fix a bug in c59e84485 for forums with no topics
WHERE would be on its own without argument.
2021-07-07 19:22:36 +02:00
Lephe e29c73d09e
utils/render: remove obsolete bug notice
Fixed by e99e45b4c.
2021-07-07 18:57:54 +02:00
Lephe f75f1618bc
add a developer warning for slow requests (#63) 2021-07-07 18:42:17 +02:00
Lephe c59e844852
forum: count comments for all presented topics in a single request (#63)
It appears as though performing a lot of requests is the most costly
aspect of listing comment counts per topic; this change aims to address
that by reading all the counts in a single request.

On my computer, this changes loading times from an absolute 100-200 ms to
50-100 ms most of the time. The request impact is not easy to measure as a
couple ms is small enough to fall in the range of disk access and other
semi-random events.
2021-07-07 17:26:22 +02:00
Lephe b00d44ddc1
model: index comments by thread for faster lookup 2021-07-07 16:30:21 +02:00
Lephe daadd21877
utils/converters: use ValidationError instead of Exception
This ensures that after validation the page is resolved as a 404 instead
of displaying a 500.
2021-07-07 15:23:55 +02:00