Commit Graph

127 Commits

Author SHA1 Message Date
Eragon e41bfaddff
Load shoutbox UI scripts only when the shoutbox is displayed 2024-03-09 13:58:22 +01:00
Lephe cddd4baa8a
shoutbox: update chat and show it on homepage 2024-03-09 13:58:21 +01:00
Eragon bb5534c0ee
search: search page template 2024-03-09 13:58:18 +01:00
Darks af61b21fc8
news: add summary and thumbnails to topics
Provides data for homepage, as well as others topics
2024-03-09 13:58:17 +01:00
Darks c68b9b2048
account: add antibot fileld to registration form 2024-03-09 13:58:17 +01:00
Darks 4797433dcd
scripts: add modules to render helper 2024-03-09 13:58:17 +01:00
Eragon 912380ddf1
ldap: Update user informations in LDAP when edited from PCv5 2024-03-09 13:58:15 +01:00
Darks 6b74b6fea6
glados: add some 'say' messages 2024-03-09 13:57:00 +01:00
Darks 6519cf4a6a
markdown: add ins (underline) and del (strikethrough) tags 2023-06-07 21:33:06 +02:00
Darks 65fd5c8188
Added more french special chars to list 2023-05-15 15:17:00 +02:00
Lephe d6a3faa161
markdown: make header slugs unique in every thread 2022-12-14 11:22:12 +01:00
Eragon 5fb06732ff
Remove old & add buttons for new editor 2022-12-14 11:21:14 +01:00
Lephe 2b9ab64f6e
routes: fix constant 404s due to new werkzeug handling of / 2022-11-15 11:03:36 +01:00
Lephe 760c2f20b2
programs: a reasonable start for the program page (#93) 2022-06-16 17:37:39 +01:00
Lephe 8ff21c615d
program: add infrastructure for the progrank job (#114)
* Add an automatic job every day at 4 AM to recompute the progrank of
  every program. Currently everyone gets progrank 0.

[MIGRATION] This commit contains a new version of the schema.

[SETUP]
* Install flask-crontab (with pip)
* Run `flask crontab add` to register the jobs
2022-06-15 11:27:29 +01:00
Lephe db0e42d285
programs: add tag input and display (#114)
* Add a TagListField which automatically validates its input against the
  TagInformation database, and has a richer .selected_tags() method
* Add a dynamic tag input widget, available through a macro (*import
  with context*), that supports both JS and non-JS input
* Add a TagInformation.all_tags() function
* Add colored tag display to all themes
* Fix a bug causing programs to have no names
* Add tags: games.action, games.narrative, courses.informatics

[MASTER] Run the 'update-tags' command of master.py.
2022-06-14 23:19:41 +01:00
Lephe b047ed97af
programs: program creation + view + comments
This is very much a work in progress, but the main ideas are here.

[MIGRATION] This commit contains a new version of the schema.
2022-05-19 20:34:46 +01:00
Darks f64e3a2c39
debugger: add some style to enhance it 2022-05-12 20:07:28 +02:00
Darks eb5ce1bd5c
attachement: switch to uuid + check permission in dl widget (#109)
Also added is_default_accessible() to Thread class as its owner may be a 
Topic with forum access restrictions or public main content (like 
Program)

[MIGRATION] This commit contains a new version of the schema. /!\ This 
migration breaks all attachments
2022-04-26 23:29:11 +02:00
Darks 3e399fb4c4
gallery: second prototype, evolving into a beta 2022-04-26 01:38:33 +02:00
Darks 17f5e82a2a
pclinks: switched to <> as delimiters (#108)
And some other enhancements
2022-04-24 17:50:46 +02:00
Darks 2119329997
widgets: add '[[f: 123]]' pclink widget 2022-04-24 17:24:47 +02:00
Lephe f53032fc88
markdown: add an extension for image/video galleries
This will be used on program pages. Currently there is no check that
list elements are images and videos.
2022-04-21 22:07:49 +01:00
Lephe 610fe6f1fd
markdown: allow videos with size and positioning
Same options as for images, except for [pixelated]. Supported sources
are standard videos and YouTube, and there is basic auto-detection which
avoids the need to set the [video] attribute.
2022-04-21 20:43:50 +01:00
Lephe 48d6c1c03c
markdown: allow positioning attributes on images
New attributes
  * left, center, right: Exactly what you expect
  * float-left, float-right: Also just what you expect

Currently there is no way to force a clear.
2022-04-21 20:03:22 +01:00
Lephe e9c1f04f42
markdown: add a MediaExtension that allows attributes on images
Supported attributes:
  * size=<WIDTH>x<HEIGHT>, both being optional
  * pixelated

In the near future it will also support audio files and videos.
2022-04-21 19:31:18 +01:00
Darks dda7cce5d5
Updated WTForms imports 2022-04-14 20:01:45 +02:00
Lephe 19586f9087
fix incorrect date display omitting years 2021-10-03 17:34:30 +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
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 c4c9421beb
utils: allow empty CSS in validator 2021-07-08 17:47:01 +02:00
Lephe 619ea85eeb
css: add dark mode code, and improve code tables 2021-07-08 16:50:28 +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 e29c73d09e
utils/render: remove obsolete bug notice
Fixed by e99e45b4c.
2021-07-07 18:57:54 +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
Darks 9afdc63a8e
filters: add humanize filter 2021-04-27 19:33:21 +02:00
Darks 8bdf3909ea
login_as: fixed some issues
See https://gitea.planet-casio.com/devs/PCv5/issues/90#issuecomment-1131
2021-03-06 11:36:35 +01:00
Darks 87ef91b9e3
login_as: add function to login as arbitrary account 2021-03-05 23:56:03 +01:00
Lephe 6f98cba65e
review of privileges and forum permissions
* Sorted privileges into categories, similar to the v4.3 style

Added privilege check utilities:
* Forum: is_news(), is_default_accessible() and is_default_postable()
* Member: can_access_forum(), can_post_in_forum(), can_edit_post(),
  and can_delete_post()

Unfortunately current_user is not a Guest when logged out, so one
cannot usually write current_user.can_*() without checking for
authentication first, so the checks are still somewhat verbose.

Reviewed forum permissions; the following permission issues have been
fixed (I have tested most but not all of them prior to fixing):

* app/routes/forum/index.py: Users that were not meant to access a
  forum could still obtain a listing of the topics
* app/routes/forum/topic.py: Users that were not meant to see topics
  could still read them by browsing the URL
* app/routes/forum/topic.py: Authenticated users could post in any
  topic, including ones that they should not have access to
* app/routes/posts/edit.py: Users with edit.posts (eg. mods) could edit
  and delete messages in forums they can't access (eg. creativecalc)

* app/templates/account/user.html: Users with admin panel access would
  see account editing links they can't use (affects developers)
* app/templates/base/navbar/forum.html: The "Forum" tab would list all
  forums including ones the user doesn't have access to
* app/templates/forum/index.html: Users would see every single forum,
  including ones they can't access
* app/template/widgets/thread.html: Anyone would see Edit/Delete links
  on every message, even though most were unusable

Miscellaneous changes:
* app/routes/forum/topic.py: Ordered comments by date as intended,
  which I assume worked by chance until now
* Removed the old assets/privs.txt files which is now superseded by the
  list implemented in app/data/groups.yaml

This commit changes group and forum information, run master.py with:
@> forums update
@> groups update
2021-02-26 18:32:45 +01:00
Darks 0edc996287
markdown: add linkify extension 2021-02-24 00:38:26 +01:00
Darks 41d1411f86
markdown: add hard breaks with \\
Plus some PEP8 enhancements
2021-02-24 00:06:49 +01:00
Darks f722d700c2
markdown: add some tags to bleach allowlist 2021-02-23 23:25:20 +01:00
Darks 53afccf2a3
markdown: fixed allowlists 2021-02-23 13:49:14 +01:00
Darks 6136c6e9bf
markdown: add better sanitization
And disable nl2br extension
2021-02-23 13:30:09 +01:00
Darks eba1b7dd3b
markdown: better input sanitization 2021-02-23 12:00:34 +01:00
Eldeberen 0c7474d8ba
pclink: add handle for topics
rewrite some handles in french
2021-02-21 12:02:12 +01:00