/PageCommunity.py

https://github.com/cherokee/web · Python · 78 lines · 40 code · 13 blank · 25 comment · 0 complexity · f49ce85afcbd2771d805858eb8c364e9 MD5 · raw file

  1. # -*- Mode: python; coding: utf-8 -*-
  2. #
  3. # Cherokee Web Site
  4. #
  5. # Authors:
  6. # Alvaro Lopez Ortega <alvaro@alobbs.com>
  7. #
  8. # Copyright (C) 2001-2011 Alvaro Lopez Ortega
  9. #
  10. # This program is free software; you can redistribute it and/or
  11. # modify it under the terms of version 2 of the GNU General Public
  12. # License as published by the Free Software Foundation.
  13. #
  14. # This program is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. # GNU General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU General Public License
  20. # along with this program; if not, write to the Free Software
  21. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  22. # 02110-1301, USA.
  23. #
  24. import os
  25. import re
  26. import CTK
  27. import Page
  28. import config
  29. import ProudList
  30. URL_BASE = "/community"
  31. MAILING_P1 = 'The primary discussion forum for Cherokee community members is the <a href="http://lists.octality.com/">Cherokee Project\'s mailing lists</a>.'
  32. MAILING_P2 = 'If you prefer a forums interface, you can interact with other Cherokee users and developers through the <a href="/forums.html">Forums interface</a> to our mailing lists.'
  33. IRC_P1 = 'The Cherokee developers, as well as many members of the Cherokee user community, can be found online in the <a href="irc://irc.freenode.net/cherokee">#cherokee</a> IRC channel on the FreeNode IRC Network (servers: irc.freenode.net).'
  34. SOCIAL_P1 = 'The Cherokee project has also presence in the following social networks. Please, do not hesitate to join us!'
  35. class PageCommunity:
  36. def __call__ (self):
  37. title = "Community"
  38. page = Page.Page_Menu_Side (title=title)
  39. page += CTK.RawHTML ("<h1>%s</h1>"%(title))
  40. # Proud Cherokee Users List
  41. page.sidebar += CTK.RawHTML ('<h3>Proud Cherokee Users</h3>')
  42. page.sidebar += ProudList.Add_New_Domain()
  43. page.sidebar += ProudList.DomainList()
  44. # Content
  45. box = CTK.Box ({'class': 'community-lists'})
  46. box += CTK.RawHTML ('<h2>Mailing Lists / Forums</h2>')
  47. box += CTK.RawHTML ('<p>%s</p>' %(MAILING_P1))
  48. box += CTK.RawHTML ('<p>%s</p>' %(MAILING_P2))
  49. page += box
  50. box = CTK.Box ({'class': 'community-chat'})
  51. box += CTK.RawHTML ('<h2>IRC / Chat</h2>')
  52. box += CTK.RawHTML ('<p>%s</p>' %(IRC_P1))
  53. page += box
  54. box = CTK.Box ({'class': 'community-social'})
  55. box += CTK.RawHTML ('<h2>Social Networks</h2>')
  56. l = CTK.List()
  57. l += CTK.LinkWindow ("http://www.github.com/cherokee", CTK.RawHTML("Github"), {'class': 'github-link'})
  58. l += CTK.LinkWindow ("http://www.twitter.com/webserver", CTK.RawHTML("Twitter"), {'class': 'twitter-link'})
  59. l += CTK.LinkWindow ("http://www.linkedin.com/groups/Cherokee-Web-Server-1819726", CTK.RawHTML("LinkedIn"), {'class': 'linkedin-link'})
  60. l += CTK.LinkWindow ("http://www.facebook.com/cherokee.project", CTK.RawHTML("Facebook"), {'class': 'fb-link'})
  61. box += CTK.RawHTML ('<p>%s</p>' %(SOCIAL_P1))
  62. box += l
  63. page += box
  64. return CTK.HTTP_Cacheable (60, body=page.Render())
  65. CTK.publish (URL_BASE, PageCommunity)