– L'utilisateur a le droit 'write-everywhere'
– C'est un topic de news et l'utilisateur a le droit 'write-news'
— Ce n'est pas un topic de news et le topic est une feuille de l'arbre
du forum
Je me rends compte que c'est foireux pour la gestion des permissions.
Faudra reprendre ça pour faire quelque chose de plus modulable…
J'ai fait mon possible pour que ça rende bien et que le css ne soit pas
trop moche. Il faudra peut-être modifier légèrement l'afichage du
profil, ce dernier est pas assez bien en place à mon goût.
Ajout d'un if dans le template de l'index du forum pour ne pas afficher l'option
de post en invité si l'utilisateur est connecté.
Remplacement des caractères d'espaces insécables pour html par des
espaces insécables en utf-8.
This changes fixes#25 by restructuring the forum models in a way
compatible with the polymorphic behavior of SQLAlchemy. Incidentally,
the new form turns out to be more appropriate for our use than the
polymorphic one originally used.
The migration for this task is non-trivial because the Thread class was
created with a foreign-key id which thus had no auto-increment or
associated sequence. The most reliable way of getting it back was to
recreate the table because SQLAlchemy ony performs automated sequence
introduction at table creation time. Four separate migration files
perform the whole change.
This commit also adds views and forms to create topics, and the
boilerplate for an advanced markup editor that can be used as a widget.
With this change, URLs for forum listings are now available. This
includes URLs like /news or /projects/games. Each of them show a
(currently empty) forum index.
Note that URLs that are not linked to in the forum index, namely URLs
for forums that have children (eg. /forum/news), are still accessible. We
could ban this by raising ValidationError if the forum has a non-empty
[sub_forums] attribute but displaying all subjects feels better.
URLs that point to /forum, but do not name a sub-forum and are not of
the form of a topic URL produce 404 errors.
This commit adds a forum tree YAML file (URL-based rather than an
actual tree...) and the 'forums' and 'create-forums' commands for
the master script.
A page /admin/forums is also used to currently display the forum
tree, although this will probably be turned into a full table with
forum descriptions, and a form with edition capabilities.
First migrate without the foreign key to create the tables, then add the
foreign key in a second migration.
Also removed unneeded imports that caused dependency cycles.
Minor "style" edits with the ambiguous use of super and unnecessary
db.Model inheritance.