16 lines
2.2 KiB
Markdown
16 lines
2.2 KiB
Markdown
- nav_items: this method should be called only if there is a station in the context.
|
|
- idea behind the station is that a station is always defined, except in one case: just right the platform is installed. Otherwise the idea is that user can eventually select the station through a dropbox in the nav menu (happened in last versions of aircox in the admin, should still be there).
|
|
- don't forget to add your exported module member name to __all__ ;)
|
|
- it is better to put forms inside aircox.forms submodule (as aircox.forms.program subfiles, etc. if the file is to big + reexport in aircox.forms.__init__)
|
|
- you can eventually regroup urls under "/admin" or sth like this, in order to avoid mixing public and backoffice urls.
|
|
- you can use fontawesome icons instead of UTF-8 ones (=> Editer sur la page d'émission, etc.): https://fontawesome.com/icons?d=gallery&m=free
|
|
- Forms:
|
|
- tables should not be used to render forms: either use flexbox or stack vertically labels and inputs. Generally, tables are in used to render data sets in modern web dev.;
|
|
- CSS framework partially use Bulma's ones (https://bulma.io/documentation/form/general/ ). You can customize form rendering by iterating over fields (example: aircox/templates/aircox/page_detail.html => comment form; no need for honeypot if user is authenticated)
|
|
- you can use template inheritance and inclusion in order to avoid repeating the code over all templates. If required you can just have base template as "page_form.html" that you can even set directly to your view classes if nothing specific is required for the model (on view class => template_name attribute). Less code = less bugs = less maintenance.
|
|
- btw some templates *_form extends from different base template.
|
|
- also, for submit button, just use class "button" (for color panel coherency). For secondary buttons, there is the css class "secondary" (as in `<button class="button secondary" />`
|
|
- you might add an `<hr>` between episode form and playlist editor;
|
|
- if you want you can also add comment management;
|
|
- you might want to use aria-label too for accessibility (eventually, aria-description). Not mandatory but still is cool to think of accessibility: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA
|