Permalink
Browse files

Comitted first public revision of Solace. Development history from the

internal SVN was dropped for security reasons.
  • Loading branch information...
0 parents commit 0acfd9e704626bc32273ca15e85e9867b3917a44 @mitsuhiko committed Aug 31, 2009
Showing with 23,136 additions and 0 deletions.
  1. +8 −0 .hgignore
  2. +21 −0 AUTHORS
  3. +185 −0 HACKING
  4. +31 −0 LICENSE
  5. +170 −0 README
  6. BIN artwork/arrows.psd
  7. +495 −0 artwork/recycle.svg
  8. BIN artwork/tick.psd
  9. +73 −0 setup.py
  10. +14 −0 solace/__init__.py
  11. +413 −0 solace/application.py
  12. +231 −0 solace/auth.py
  13. +223 −0 solace/badges.py
  14. +371 −0 solace/database.py
  15. +258 −0 solace/forms.py
  16. +255 −0 solace/i18n/__init__.py
  17. +1 −0 solace/i18n/de/LC_MESSAGES/messages.js
  18. BIN solace/i18n/de/LC_MESSAGES/messages.mo
  19. +1,214 −0 solace/i18n/de/LC_MESSAGES/messages.po
  20. +1,097 −0 solace/i18n/messages.pot
  21. +967 −0 solace/models.py
  22. +27 −0 solace/packs.py
  23. +385 −0 solace/scripts.py
  24. +190 −0 solace/settings.py
  25. BIN solace/static/arrows.png
  26. BIN solace/static/arrows_gray.png
  27. +160 −0 solace/static/babel.js
  28. BIN solace/static/badge_earned.png
  29. BIN solace/static/badge_not_earned.png
  30. +65 −0 solace/static/badges.css
  31. BIN solace/static/badges/critic.png
  32. BIN solace/static/badges/editor.png
  33. BIN solace/static/badges/good_answer.png
  34. BIN solace/static/badges/great_answer.png
  35. BIN solace/static/badges/inquirer.png
  36. BIN solace/static/badges/nice_answer.png
  37. BIN solace/static/badges/reversal.png
  38. BIN solace/static/badges/self_critic.png
  39. BIN solace/static/badges/self_learner.png
  40. BIN solace/static/badges/troubleshooter.png
  41. BIN solace/static/badges/unique_answer.png
  42. +272 −0 solace/static/creole.js
  43. BIN solace/static/feed.png
  44. BIN solace/static/flashtick.png
  45. +10 −0 solace/static/ie.css
  46. +9 −0 solace/static/ie6.css
  47. +759 −0 solace/static/jquery.autocomplete.js
  48. +643 −0 solace/static/jquery.form.js
  49. +4,376 −0 solace/static/jquery.js
  50. +1,188 −0 solace/static/layout.css
  51. BIN solace/static/recycle.png
  52. BIN solace/static/recycle_big.png
  53. +472 −0 solace/static/solace.js
  54. +234 −0 solace/static/teal.css
  55. BIN solace/static/tick.png
  56. BIN solace/static/tick_gray.png
  57. +28 −0 solace/templates/_helpers.html
  58. +15 −0 solace/templates/api/debug_dump.html
  59. +106 −0 solace/templates/api/help.html
  60. +30 −0 solace/templates/badges/show_badge.html
  61. +21 −0 solace/templates/badges/show_list.html
  62. +8 −0 solace/templates/core/about.html
  63. +23 −0 solace/templates/core/login.html
  64. +10 −0 solace/templates/core/no_javascript.html
  65. +7 −0 solace/templates/core/not_found.html
  66. +12 −0 solace/templates/core/register.html
  67. +24 −0 solace/templates/core/reset_password.html
  68. +168 −0 solace/templates/kb/_boxes.html
  69. +12 −0 solace/templates/kb/_comments.html
  70. +28 −0 solace/templates/kb/_editor.html
  71. +22 −0 solace/templates/kb/by_tag.html
  72. +17 −0 solace/templates/kb/delete_post.html
  73. +26 −0 solace/templates/kb/edit_post.html
  74. +14 −0 solace/templates/kb/new.html
  75. +19 −0 solace/templates/kb/overview.html
  76. +36 −0 solace/templates/kb/post_revisions.html
  77. +28 −0 solace/templates/kb/restore_post.html
  78. +23 −0 solace/templates/kb/sections.html
  79. +18 −0 solace/templates/kb/tags.html
  80. +47 −0 solace/templates/kb/topic.html
  81. +19 −0 solace/templates/kb/unanswered.html
  82. +90 −0 solace/templates/layout.html
  83. +13 −0 solace/templates/mails/activate_user.txt
  84. +6 −0 solace/templates/mails/layout.txt
  85. +12 −0 solace/templates/mails/reset_password.txt
  86. +12 −0 solace/templates/users/edit_profile.html
  87. +76 −0 solace/templates/users/profile.html
  88. +37 −0 solace/templates/users/userlist.html
  89. +59 −0 solace/templating.py
  90. +112 −0 solace/tests/__init__.py
  91. +126 −0 solace/tests/core_views.py
  92. +124 −0 solace/tests/kb_views.py
  93. +215 −0 solace/tests/models.py
  94. +84 −0 solace/tests/querycount.py
  95. +96 −0 solace/urls.py
  96. +10 −0 solace/utils/__init__.py
  97. +2,348 −0 solace/utils/_translit_tab.py
  98. +184 −0 solace/utils/api.py
  99. +26 −0 solace/utils/ctxlocal.py
  100. +268 −0 solace/utils/formatting.py
  101. +1,859 −0 solace/utils/forms.py
  102. +115 −0 solace/utils/lazystring.py
  103. +147 −0 solace/utils/mail.py
  104. +96 −0 solace/utils/pagination.py
  105. +82 −0 solace/utils/recaptcha.py
  106. +77 −0 solace/utils/remoting.py
  107. +257 −0 solace/utils/support.py
  108. +10 −0 solace/views/__init__.py
  109. +124 −0 solace/views/api.py
  110. +35 −0 solace/views/badges.py
  111. +204 −0 solace/views/core.py
  112. +565 −0 solace/views/kb.py
  113. +89 −0 solace/views/users.py
@@ -0,0 +1,8 @@
+\.py[oc]$
+\.DS_Store$
+^dist/
+\.egg$
+\.log$
+\.cfg$
+^env/
+\.egg-info$
@@ -0,0 +1,21 @@
+Solace is written and maintained by the Plurk Inc. and various contributors.
+
+Development Lead:
+
+- Armin Ronacher <armin.ronacher@active-4.com>
+
+Some parts of the code are taken from existing projects:
+
+ From the Zine blogging platform:
+
+ - solace.utils.forms
+ - solace.utils.mail
+ - solace.i18n
+
+ From the Sphinx documentation tool:
+
+ - solace.scripts
+
+ From Jason Kirtland's translit tab:
+
+ - solace.utils._translit_tab
@@ -0,0 +1,185 @@
+
+
+ // HACKING ON SOLACE //
+
+ ~ HACKING ~
+
+ Hacking on Solace is fun. It's written in Python and based
+ on pupular libraries. The dynamic parts in the user interface
+ are created using HTML 4 and jQuery.
+
+ This file should give you a brief overview how the code works
+ and what you should keep in mind when working on it.
+
+ ~ STYLEGUIDE ~
+
+ Solace follows PEP 8 for Python code. The rule you should
+ follow is "adapt to the code style used in the file". And
+ that also means, put whitespace where the original author
+ put it and so on.
+
+ Indent with 4 *spaces* only.
+
+ JavaScript code is intended with 2 spaces and only two spaces.
+ The same rule applies for HTML as well.
+
+ **Every page has to validate against HTML 4.01 transitional**.
+
+ If you need features HTML 4 does not give you, use JavaScript!
+ We're using the transitional DTD because recaptcha uses iframes
+ for non-JavaScript enabled browsers.
+
+ We will probably switch to HTML 5 once support is widespread
+ but until then, the doctype has to be HTML 4.01 transitional.
+ The reason for this rule is that many browser validators such as
+ the firefox validator plugin does not support HTML 5 yet which
+ makes it nearly impossible to ensure that every page validates.
+
+ CSS spacing rules should follow the existing rules in the files.
+ Use whitespace after property, value colons.
+
+ CSS files *have* to use relative paths, so do templates. A
+ template should use `url_for` where possible. The application
+ does not enforce itself to be mounted on the URL root, so assume
+ it can be anywhere.
+
+ CSS classes are lowercase and use underscore for separation.
+
+ All filenames have to be lowercase and ASCII only.
+
+ ~ URLS ~
+
+ Rules for URLs are simple. Stuff that depends on a language and
+ is *publically* available is mounted below `/<lang_code>`.
+
+ Stuff invoked by JavaScript, that redirects back or is remotely
+ JavaScript related has a leading underscore.
+
+ Examples:
+
+ /login
+ /<lang_code>/
+ /_set_timezone
+ /_vote/<post>
+
+ ~ INTERFACE GUIDELINES ~
+
+ The Solace user interface is intended to be used by everybody
+ not just hackers. Keep that in mind when working on the code
+ base.
+
+ // Emphasis //
+
+ The emphasis is always on the non-technical elements. For
+ example in the overview page the emphasis is on the title,
+ number of votes and replies, but not on the tags. Tags are
+ elements not everybody is familiar with.
+
+ // Font Sizes //
+
+ The following font sizes are in use:
+
+ 10px preferred bold and only for navigation, errors
+ and popup menus.
+ 11px for meta information such as authors etc.
+ 13px for regular text
+ 20px for headline like content such as questions on
+ the overview page.
+ 24px the biggest headline and in caps the header
+
+ Special font sizes
+
+ 18px used by the hinted editor. As long as a field is
+ empty it may display a 18px big and #69A9B8 colored
+ text instead.
+
+ // Margins & Padding //
+
+ Standard margins 10px
+ above header, below footer 50px
+ small separation 3px 7px
+
+ // Colors //
+
+ Use the following colors for the CSS:
+
+ #2a606d standard link color, darkish blue
+ #0E3640 very dark blue, nav background
+ (combine with white) or marked text
+ #458696 popup background
+ #C2DDE3 blue box background
+ #E1EDF0 tag background
+ #EEF8FA editor background
+
+ #69A9B8 hint text color
+ #B5DDE6 editor border color
+
+ #FAFAFA preview boxes, deleted content
+ #eee inactive elements, headline background
+ #ccc boxes on deleted content
+ #555 text on deleted content
+
+ #A8DFAA background for inserted text
+ #FDF5F5 background for deleted text
+ #EB4040 color for deleted text
+ #F5F2D7 background for modified text
+
+ // Client-side Scripting //
+
+ The core functionality of Solace should work without
+ JavaScript on modern browsers. (We do not consider either
+ IE6 or IE7 as modern browser).
+
+ Currently the only feature that does not work without
+ JavaScript is adding comments to questions and replies.
+
+ Whenever you cannot provide a non-javascript implementation
+ of a feature, make sure that the user somehow ends up on
+ the special `_no_javascript` page. Either on click or
+ somehow else. That one tells the user to enable JavaScript
+ to use this feature.
+
+ // Language Handling //
+
+ Solace has two indepdendent language context. The language
+ of the UI and the language of the section the user is active
+ in.
+
+ Sometimes the user leaves a section in which case the links
+ that point back to a section (in the navigation bar) will
+ point to the section of the UI language. Whenever that
+ happens the link that points to that section has to be marked
+ with the faded color so that the user knows the link might
+ not take him back to where he came from. At the same time
+ the link to the active section disappears.
+
+ You can try that by clicking on the "badges" link. The
+ "ask" and other buttons will be slightly faded out.
+
+ If you're adding new pages, keep that behavior in mind.
+
+ ~ TEMPLATES ~
+
+ Templates must not contain any CSS information besides classes.
+ Use classes as appropriate, and use as many of them as you like.
+ Keep them easy to read.
+
+ Use macros to ensure that you are using the same elements and
+ classes for the same widget (tags, users, badges etc.)
+
+ ~ UNIT TESTS ~
+
+ Solace uses standard Python unittests for all tests. You can use
+ doctest as well if you convert it into a unittest testsuite
+ using the `doctest.DocTestSuite`.
+
+ In general what you have to do is to add a test to one of the
+ existing test modules (`solace.tests.module`) and make sure that
+ you either add the test to an existing suite or add a new suite
+ and register it in the `suite` factory function.
+
+ If you add a full new module to the test module, also open the
+ `tests` package's `__init__` file and make sure your suite is
+ added properly.
+
+ To run the tests you can use `python setup.py test`.
@@ -0,0 +1,31 @@
+Copyright (c) 2009 by the Solace Team, see AUTHORS for more details.
+
+Some rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
+ * The names of the contributors may not be used to endorse or
+ promote products derived from this software without specific
+ prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Oops, something went wrong. Retry.

0 comments on commit 0acfd9e

Please sign in to comment.