helpers.py 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # -*- coding: utf-8 -*-
  2. """WebHelpers used in pboard."""
  3. #from webhelpers import date, feedgenerator, html, number, misc, text
  4. from markupsafe import Markup
  5. from datetime import datetime
  6. from tg.i18n import ugettext as _, lazy_ugettext as l_
  7. def current_year():
  8. now = datetime.now()
  9. return now.strftime('%Y')
  10. def icon(icon_name, white=False):
  11. if (white):
  12. return Markup('<i class="icon-%s icon-white"></i>' % icon_name)
  13. else:
  14. return Markup('<i class="icon-%s"></i>' % icon_name)
  15. def getExplanationAboutStatus(psStatusId, psCurrentStatusId):
  16. lsMsg = ""
  17. if psStatusId==psCurrentStatusId:
  18. return _("This is the current status.")
  19. else:
  20. if psStatusId=='information':
  21. return _("The item is a normal document, like a howto or a text document.")
  22. if psStatusId=='automatic':
  23. return _("The item will be automatically computed as \"in progress\" or \"done\" according to its children status.")
  24. if psStatusId=='new':
  25. return _("No action done on the item.")
  26. if psStatusId=='inprogress':
  27. return _("The item is being worked on.")
  28. if psStatusId=='standby':
  29. return _("Waiting for some external actions.")
  30. if psStatusId=='done':
  31. return _("The work associated with the item is finished.")
  32. if psStatusId=='closed':
  33. return _("Close the item if you want not to see it anymore. The data won't be deleted")
  34. if psStatusId=='deleted':
  35. return _("This status tells that the item has been deleted.")