La version 5 de Planète Casio. Regroupe le forum, les programmes, les tutoriel, les sprites et tous les autres outils développés par nos soins.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

render.py 1.1KB

123456789101112131415161718192021222324252627282930313233343536
  1. from flask import render_template
  2. from app.forms.login import LoginForm
  3. from app.forms.search import SearchForm
  4. def render(*args, styles=None, **kwargs):
  5. # TODO: debugguer cette merde : au logout, ça foire
  6. # if current_user.is_authenticated:
  7. # login_form = LoginForm()
  8. # return render_template(*args, **kwargs, login_form=login_form)
  9. # return render_template(*args, **kwargs)
  10. # Pour jouer sur les feuilles de style :
  11. # render('page.html', styles=['-css/form.css', '+css/admin/forms.css'])
  12. styles_= [
  13. 'css/global.css',
  14. 'css/navbar.css',
  15. 'css/header.css',
  16. 'css/container.css',
  17. 'css/form.css',
  18. 'css/footer.css',
  19. 'css/flash.css',
  20. 'css/responsive.css',
  21. 'css/table.css'
  22. ]
  23. for s in styles:
  24. print(s[1:])
  25. if s[0] == '-':
  26. styles_.remove(s[1:])
  27. if s[0] == '+':
  28. styles_.append(s[1:])
  29. login_form = LoginForm()
  30. search_form = SearchForm()
  31. return render_template(*args, **kwargs,
  32. login_form=login_form, search_form=search_form, styles=styles_)