Commit Graph

113 Commits

Author SHA1 Message Date
Lephe 39748667ee
model: add a number of missing indexes
See #107.

[MIGRATION] This commit contains a new version of the schema.
2022-04-21 17:58:59 +01:00
Darks c6ef83d32c
post: add move to another thread operation (#79)
Currently only support forum
2021-07-14 19:55:16 +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 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 b1ca1c4bbc
model: fix a bug in Guest.__repr__ 2021-07-12 17:47:45 +02:00
Lephe 05f56a1cf4
forum: improve attachment inputs and allow edition (#49) 2021-07-08 16:50:28 +02:00
Lephe b3d99b93f8
account: add a theme setting (#14) 2021-07-08 11:43:09 +02:00
Lephe 61f48259f2
trophy: fix deleteion 2021-07-08 10:58:53 +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 b00d44ddc1
model: index comments by thread for faster lookup 2021-07-07 16:30:21 +02: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
Lephe d50b58cd24
(random improvements on texts) 2021-02-26 18:31:10 +01:00
Eldeberen d6512bb197
polls: added multi-choices polls 2021-02-22 22:49:11 +01:00
Eldeberen cd8ce4f5bc
admin: fix name edition through admin panel (#85) 2021-02-20 19:32:18 +01:00
Lephe 1d457d7e65
topic: fix model preventing Post from polymorphic loading as Topic 2021-02-20 19:03:14 +01:00
Eldeberen cd8efcced8
Merge branch 'dev' of gitea.planet-casio.com:devs/PCv5 into polls 2021-02-20 01:36:04 +01:00
Eldeberen 473448ab5b
poll: add ability to vote
Fixed some bugs too
2021-02-20 00:33:34 +01:00
Eldeberen d2c5ddd874
polls: added models 2021-02-19 22:07:31 +01:00
Eragon c0ae3cc8ab
#84 Confirmation anti-nécropost 2021-01-12 16:40:52 +01:00
Darks 4aa1802afb
polls: created backbone of models (#72) 2020-11-12 00:11:33 +01:00
Lephe cf9cb8a8c6
forum: add true, recursive deletion methods
Each object has a .delete() which removes it and its owned subcontents.
This delete() unfortunately has to commit the database session because
circularly-dependent objects (such as a thread and its top comment)
cannot be deleted together; two commits are needed.
2020-11-01 10:49:24 +01:00
Darks e265e003b9
admin: fixed the forum panel 2020-09-24 00:22:20 +02:00
Darks 7395835e71
refact: models files are nom uniform (all singular) 2020-08-06 21:19:01 +02:00
Darks a7bde62ff2
feat(trophies): added programs count 2020-08-06 21:05:49 +02:00
Darks 3fb3ee40d2
fix: better PEP8
Flake8 returns less errors. I ignored lots of them though
2020-08-05 22:52:56 +02:00
Darks 3a35c26bd7
forum: add pagination to topic list (#64) 2020-08-02 17:28:43 +02:00
Lephe 03c577316f
thread: add a reference to the owner post 2020-08-02 11:01:08 +02:00
Darks 554898db87
attachments: merged attachments system into dev 2020-08-01 21:47:25 +02:00
Darks 56a584c535
attachments: added attachments system
Still need some work on it…
2020-08-01 21:26:06 +02:00
Lephe d3f137b92d
programs: add models for programs and topic promotions (#20)
Not tested yet since there is a lack of tools to manipulate comments,
topics and programs. The /programmes routes is used to display a list of
all programs, temporarily.
2020-08-01 15:11:19 +02:00
Darks 47efd6689b
Merge remote-tracking branch 'filoji/dev' into attachments 2020-08-01 10:22:22 +02:00
Darks a4efe29a7d
__init__.py: refactor registration of assets 2020-07-30 14:49:18 +02:00
Darks b108ce4cfe
titles: add displayed title (#65)
- with forms for user and admins
2020-07-29 00:57:06 +02:00
Darks b79bac1fc4
config: fix bug before it appears 2020-07-26 16:55:12 +02:00
Darks e35910ee76
config: refactor configuration values
- System/host config values stay in `config.py`
- Application config values moves in corresponding models
- BREAK: AVATAR_FOLDER becomes DATA_FOLDER. Edit your local config if 
needed
2020-07-26 16:50:07 +02:00
Darks 0896a6b163
passwords: enhances passwords rules
- based on entropy (min 60 bits)
- adds a coloured progress bar if Js is enabled
2020-07-25 18:06:49 +02:00
Darks 3a46f8046c
topics: ADD une relationship dans `Member`
Et une relation `comments` vers les commentaires. Moins utile, mais ça 
coute rien.
Corrige par la même occasion les problèmes de perfs
2020-07-23 20:19:03 +02:00
Darks 889a091030
admin: ADD suivi des comptes inactifs, validation manuelle (#58) 2020-07-23 19:12:37 +02:00
Filoji 20622315bd Corrections 2020-07-23 10:01:57 +02:00
Filoji 1689f73e89 Correct errors 2020-07-22 17:51:23 +02:00
Filoji 229551a218 Add attachement.py 2020-07-22 17:48:01 +02:00
Darks 8bf825f9ea
registration: ADD email validation 2020-07-21 21:06:00 +02:00
Darks 1b17234623
trophies: ADD hidden parameter, FIX admin panel 2020-07-20 19:35:05 +02:00
Lephe 8f43933521
users: do not fail to remove nonexisting avatars
Configuration changes and manual editions can cause this error, which is
unimportant, so we can ignore it to improve stability.
2020-07-20 15:15:14 +02:00
Lephe c4bfef4765
trophies: add descriptions
DATABASE UPDATE: run [flask db upgrade], then use the [create-trophies]
command of the master script to recreate trophies.
2020-07-19 22:27:00 +02:00
Darks e6c1545031
feature: ajout du post en tant qu'invité
- Pour les commentaires seulement
- Ajout d'une option pour désactiver (antispam)
- Penser à faire les ACL rapidement…
- Un poil de CSS pour l'intégration du bouzin
2020-07-17 23:49:04 +02:00