diff --git a/README.rst b/README.rst
index d505bdd..157c4e7 100644
--- a/README.rst
+++ b/README.rst
@@ -36,13 +36,10 @@
To install GNU Mailman follow the instructions in the documentation:
http://packages.python.org/mailman/
-A description how to run Postorius on Django's dev server, can be found in
-the GNU Mailman wiki:
-http://wiki.list.org/display/DEV/A+5+minute+guide+to+get+the+Mailman+web+UI+running
+A description how to run Postorius on Django's dev server or using
+Apache/mod_wsgi, can be found in the package documentation:
-You can also find a guide how to run Postorius using the Apache web server
-on the Mailman wiki:
-http://wiki.list.org/display/DEV/How+to+get+Postorius+running+on+Apache+and+mod_wsgi
+src/postorius/doc/setup.rst
Acknowledgements
diff --git a/src/postorius/doc/_build/doctrees/environment.pickle b/src/postorius/doc/_build/doctrees/environment.pickle
index 57bdd05..419c813 100644
--- a/src/postorius/doc/_build/doctrees/environment.pickle
+++ b/src/postorius/doc/_build/doctrees/environment.pickle
Binary files differ
diff --git a/src/postorius/doc/_build/doctrees/index.doctree b/src/postorius/doc/_build/doctrees/index.doctree
index df97384..1b2a526 100644
--- a/src/postorius/doc/_build/doctrees/index.doctree
+++ b/src/postorius/doc/_build/doctrees/index.doctree
Binary files differ
diff --git a/src/postorius/doc/_build/doctrees/news.doctree b/src/postorius/doc/_build/doctrees/news.doctree
index 09ed2fc..3e9a45e 100644
--- a/src/postorius/doc/_build/doctrees/news.doctree
+++ b/src/postorius/doc/_build/doctrees/news.doctree
Binary files differ
diff --git a/src/postorius/doc/_build/doctrees/setup.doctree b/src/postorius/doc/_build/doctrees/setup.doctree
index 51aa299..6d082be 100644
--- a/src/postorius/doc/_build/doctrees/setup.doctree
+++ b/src/postorius/doc/_build/doctrees/setup.doctree
Binary files differ
diff --git a/src/postorius/doc/_build/doctrees/using.doctree b/src/postorius/doc/_build/doctrees/using.doctree
index 74cc4fa..e61cc4e 100644
--- a/src/postorius/doc/_build/doctrees/using.doctree
+++ b/src/postorius/doc/_build/doctrees/using.doctree
Binary files differ
diff --git a/src/postorius/doc/_build/html/.buildinfo b/src/postorius/doc/_build/html/.buildinfo
index e035e7c..0636256 100644
--- a/src/postorius/doc/_build/html/.buildinfo
+++ b/src/postorius/doc/_build/html/.buildinfo
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
-config: cca8bccba816f1a79080c55d505c09f8
+config: b7c499bf02394c05c2168ae495bae526
tags: fbb0d17656682115ca4d033fb2f83ba1
diff --git a/src/postorius/doc/_build/html/_sources/index.txt b/src/postorius/doc/_build/html/_sources/index.txt
index 8b99081..b6027ff 100644
--- a/src/postorius/doc/_build/html/_sources/index.txt
+++ b/src/postorius/doc/_build/html/_sources/index.txt
@@ -1,10 +1,5 @@
-.. mailman_django documentation master file, created by
- sphinx-quickstart on Wed Aug 17 15:43:10 2011.
- You can adapt this file completely to your liking, but it should at least
- contain the root `toctree` directive.
-
-Welcome to mailman_django's documentation!
-==========================================
+Postorius - The New Mailman Web UI
+==================================
Contents:
diff --git a/src/postorius/doc/_build/html/_sources/news.txt b/src/postorius/doc/_build/html/_sources/news.txt
index 81a30f2..1a1c336 100644
--- a/src/postorius/doc/_build/html/_sources/news.txt
+++ b/src/postorius/doc/_build/html/_sources/news.txt
@@ -20,6 +20,15 @@
along with postorius. If not, see
' + _('Hide Search Matches') + '
') + .appendTo($('#searchbox')); } }, @@ -213,7 +213,7 @@ * helper function to hide the search marks again */ hideSearchWords : function() { - $('.sidebar .this-page-menu li.highlight-link').fadeOut(300); + $('#searchbox .highlight-link').fadeOut(300); $('span.highlighted').removeClass('highlighted'); }, diff --git a/src/postorius/doc/_build/html/_static/down-pressed.png b/src/postorius/doc/_build/html/_static/down-pressed.png new file mode 100644 index 0000000..6f7ad78 --- /dev/null +++ b/src/postorius/doc/_build/html/_static/down-pressed.png Binary files differ diff --git a/src/postorius/doc/_build/html/_static/down.png b/src/postorius/doc/_build/html/_static/down.png new file mode 100644 index 0000000..3003a88 --- /dev/null +++ b/src/postorius/doc/_build/html/_static/down.png Binary files differ diff --git a/src/postorius/doc/_build/html/_static/searchtools.js b/src/postorius/doc/_build/html/_static/searchtools.js index dae92b5..663be4c 100644 --- a/src/postorius/doc/_build/html/_static/searchtools.js +++ b/src/postorius/doc/_build/html/_static/searchtools.js @@ -1,6 +1,6 @@ /* - * searchtools.js - * ~~~~~~~~~~~~~~ + * searchtools.js_t + * ~~~~~~~~~~~~~~~~ * * Sphinx JavaScript utilties for the full-text search. * @@ -36,10 +36,11 @@ return rv; } + /** * Porter Stemmer */ -var PorterStemmer = function() { +var Stemmer = function() { var step2list = { ational: 'ate', @@ -300,20 +301,20 @@ }, query : function(query) { - var stopwords = ['and', 'then', 'into', 'it', 'as', 'are', 'in', - 'if', 'for', 'no', 'there', 'their', 'was', 'is', - 'be', 'to', 'that', 'but', 'they', 'not', 'such', - 'with', 'by', 'a', 'on', 'these', 'of', 'will', - 'this', 'near', 'the', 'or', 'at']; + var stopwords = ["and","then","into","it","as","are","in","if","for","no","there","their","was","is","be","to","that","but","they","not","such","with","by","a","on","these","of","will","this","near","the","or","at"]; - // stem the searchterms and add them to the correct list - var stemmer = new PorterStemmer(); + // Stem the searchterms and add them to the correct list + var stemmer = new Stemmer(); var searchterms = []; var excluded = []; var hlterms = []; var tmp = query.split(/\s+/); - var object = (tmp.length == 1) ? tmp[0].toLowerCase() : null; + var objectterms = []; for (var i = 0; i < tmp.length; i++) { + if (tmp[i] != "") { + objectterms.push(tmp[i].toLowerCase()); + } + if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/) || tmp[i] == "") { // skip this "word" @@ -344,9 +345,6 @@ var filenames = this._index.filenames; var titles = this._index.titles; var terms = this._index.terms; - var objects = this._index.objects; - var objtypes = this._index.objtypes; - var objnames = this._index.objnames; var fileMap = {}; var files = null; // different result priorities @@ -357,40 +355,19 @@ $('#search-progress').empty(); // lookup as object - if (object != null) { - for (var prefix in objects) { - for (var name in objects[prefix]) { - var fullname = (prefix ? prefix + '.' : '') + name; - if (fullname.toLowerCase().indexOf(object) > -1) { - match = objects[prefix][name]; - descr = objnames[match[1]] + _(', in ') + titles[match[0]]; - // XXX the generated anchors are not generally correct - // XXX there may be custom prefixes - result = [filenames[match[0]], fullname, '#'+fullname, descr]; - switch (match[2]) { - case 1: objectResults.push(result); break; - case 0: importantResults.push(result); break; - case 2: unimportantResults.push(result); break; - } - } - } - } + for (var i = 0; i < objectterms.length; i++) { + var others = [].concat(objectterms.slice(0,i), + objectterms.slice(i+1, objectterms.length)) + var results = this.performObjectSearch(objectterms[i], others); + // Assume first word is most likely to be the object, + // other words more likely to be in description. + // Therefore put matches for earlier words first. + // (Results are eventually used in reverse order). + objectResults = results[0].concat(objectResults); + importantResults = results[1].concat(importantResults); + unimportantResults = results[2].concat(unimportantResults); } - // sort results descending - objectResults.sort(function(a, b) { - return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); - }); - - importantResults.sort(function(a, b) { - return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); - }); - - unimportantResults.sort(function(a, b) { - return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); - }); - - // perform the search on the required terms for (var i = 0; i < searchterms.length; i++) { var word = searchterms[i]; @@ -489,7 +466,7 @@ listItem.slideDown(5, function() { displayNextItem(); }); - }); + }, "text"); } else { // no source available, just display title Search.output.append(listItem); @@ -510,9 +487,74 @@ } } displayNextItem(); + }, + + performObjectSearch : function(object, otherterms) { + var filenames = this._index.filenames; + var objects = this._index.objects; + var objnames = this._index.objnames; + var titles = this._index.titles; + + var importantResults = []; + var objectResults = []; + var unimportantResults = []; + + for (var prefix in objects) { + for (var name in objects[prefix]) { + var fullname = (prefix ? prefix + '.' : '') + name; + if (fullname.toLowerCase().indexOf(object) > -1) { + var match = objects[prefix][name]; + var objname = objnames[match[1]][2]; + var title = titles[match[0]]; + // If more than one term searched for, we require other words to be + // found in the name/title/description + if (otherterms.length > 0) { + var haystack = (prefix + ' ' + name + ' ' + + objname + ' ' + title).toLowerCase(); + var allfound = true; + for (var i = 0; i < otherterms.length; i++) { + if (haystack.indexOf(otherterms[i]) == -1) { + allfound = false; + break; + } + } + if (!allfound) { + continue; + } + } + var descr = objname + _(', in ') + title; + anchor = match[3]; + if (anchor == '') + anchor = fullname; + else if (anchor == '-') + anchor = objnames[match[1]][1] + '-' + fullname; + result = [filenames[match[0]], fullname, '#'+anchor, descr]; + switch (match[2]) { + case 1: objectResults.push(result); break; + case 0: importantResults.push(result); break; + case 2: unimportantResults.push(result); break; + } + } + } + } + + // sort results descending + objectResults.sort(function(a, b) { + return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); + }); + + importantResults.sort(function(a, b) { + return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); + }); + + unimportantResults.sort(function(a, b) { + return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); + }); + + return [importantResults, objectResults, unimportantResults] } } $(document).ready(function() { Search.init(); -}); +}); \ No newline at end of file diff --git a/src/postorius/doc/_build/html/_static/sidebar.js b/src/postorius/doc/_build/html/_static/sidebar.js index e9ef491..a45e192 100644 --- a/src/postorius/doc/_build/html/_static/sidebar.js +++ b/src/postorius/doc/_build/html/_static/sidebar.js @@ -29,6 +29,9 @@ var sidebar = $('.sphinxsidebar'); var sidebarwrapper = $('.sphinxsidebarwrapper'); + // for some reason, the document has no sidebar; do not run into errors + if (!sidebar.length) return; + // original margin-left of the bodywrapper and width of the sidebar // with the sidebar expanded var bw_margin_expanded = bodywrapper.css('margin-left'); diff --git a/src/postorius/doc/_build/html/_static/underscore.js b/src/postorius/doc/_build/html/_static/underscore.js index 9146e08..5d89914 100644 --- a/src/postorius/doc/_build/html/_static/underscore.js +++ b/src/postorius/doc/_build/html/_static/underscore.js @@ -1,3 +1,10 @@ +// Underscore.js 0.5.5 +// (c) 2009 Jeremy Ashkenas, DocumentCloud Inc. +// Underscore is freely distributable under the terms of the MIT license. +// Portions of Underscore are inspired by or borrowed from Prototype.js, +// Oliver Steele's Functional, and John Resig's Micro-Templating. +// For all details and documentation: +// http://documentcloud.github.com/underscore/ (function(){var j=this,n=j._,i=function(a){this._wrapped=a},m=typeof StopIteration!=="undefined"?StopIteration:"__break__",b=j._=function(a){return new i(a)};if(typeof exports!=="undefined")exports._=b;var k=Array.prototype.slice,o=Array.prototype.unshift,p=Object.prototype.toString,q=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;b.VERSION="0.5.5";b.each=function(a,c,d){try{if(a.forEach)a.forEach(c,d);else if(b.isArray(a)||b.isArguments(a))for(var e=0,f=a.length;e\ + <%username%>\ + \ + <%time.delta%>\ +
\ +\ + reply ▿\ + proposal ▹\ + \ + \ + \ +
\ + \ +\ +<#proposal_diff#>\ +\ +
+ + |
Contents:
You should have received a copy of the GNU Lesser General Public License along with postorius. If not, see <http://www.gnu.org/licenses/>.
+(2012-XX-XX)
+(2012-03-23)
@@ -98,6 +110,7 @@Welcome to mailman_django’s documentation!
+ title="previous chapter">Postorius - The New Mailman Web UI---Warning
-This installation guide is outdated and needs to be updated. -Please use the following resources instead:
-To install GNU Mailman follow the instructions in the documentation: +
+-Note
+This installation guide covers Postorius, the web user interface for +GNU Mailman 3. To install GNU Mailman follow the instructions in the documentation: http://packages.python.org/mailman/
-A description how to run postorius on Django’s dev server, can be found in -the GNU Mailman wiki: -http://wiki.list.org/display/DEV/A+5+minute+guide+to+get+the+Mailman+web+UI+running
-You can also find a guide how to run postorius using the Apache web server -on the Mailman wiki: -http://wiki.list.org/display/DEV/How+to+get+Postorius+running+on+Apache+and+mod_wsgi
-Mailman3 - a7¶
--
-
- Check Dependecys
- -Note
-This might differ on different systems - I was testing Ubuntu 11.04 natty and needed to install Postfix before running the installation.
++Install Dependencies¶
+Django:
+- - - -$ sudo pip install django- -
Download or branch Mailman3a7 from http://launchpad.net/mailman/3.0/3.0.0a7/+download/mailman-3.0.0a7.tar.gz and unpack it.
--
- Change into the unpacked DIR which might be named “mailman-3.0.0a7”
- -Note
-Please be aware that the following steps only work if you’re really in that DIR. If you consider adding a subfolder name to the commands those woun’t work !
+mailman.client:
+- - - -$ bzr branch lp:mailman.client +$ cd mailman.client +$ sudo python setup.py install- -
Run the Installation from a Shell (not Python)
----$ python bootstrap.py -$ bin/buildout -Vertify that everything was setup correclty and your branch fullfills the version requirements by running it’s own test module
--+$ bin/test -
+Install Postorius¶
++- -Latest release¶
+If you just want to install the latest release of Postorius, install it from +PyPi:
+-$ sudo pip install postoriusNow you’re able to run mailman using
---- -+$ bin/mailman -
or:
+-$ sudo easy_install postorius-Mailman Client / REST Api¶
-Next thing you need to do is installing the Plugin used for communication with non-mailman-code parts like our WebUI. Within the Client Branch we’ve put both, Classes to access the Core which are run as a Plugin and some Python Bindings. -The Python Bindings were used later on within our Django Application to access the Server. Failing to install the Client would result in an offline version of WebUI
-Once again start by branching the code which is on Launchpad
--+++$ bzr branch lp:mailman.client -
++Latest dev version¶
+If you want to keep up to date with the latest development version, you +should install Postorius using bazaar:
+-$ bzr branch lp:postorius +$ cd postorius +$ sudo python setup.py develop +$ cd ..You can always pull in the latest changes from the development branch:
++$ cd postorius +$ bzr pull +$ cd ..++Setup your django project¶
+Since you have now installed the necessary packages to run Postorius, it’s +time to setup your Django site.
+First, get the project directory from launchpad:
++$ bzr branch lp:~mailman-coders/postorius/postorius_standalone+Second, change the database setting in postorius_standalone/settings.py to +your preferred database. If you’re OK with using sqlite, just change the path +in line 48 to the correct location.
-Note
-We’ve successfully tested our functionality with Revision 16 - In case the Client gets updated which it surely will in future we can’t guarentee that it is compatible anymore.
+Detailed information on how to use different databse engines can be found +in the Django documentation.
As you only want to run the Client and not modify it’s code you’re fine with running the install command from within the directory. At the moment this requires Sudo Priveledges as files will copied to the Python Site-Packages Directory which is available to all users.
--+++$ sudo python setup.py install -
Third, prepare the database:
+-$ cd postorius_standalone +$ python manage.py syncdb +$ cd ..This will create the .db file (if you ar using SQLite) and will setup all the +necessary db tables. You will also be prompted to create a superuser which +will act as an admin account for Postorius.
+++Running the development server¶
+The quickest way to run postorius is to just start the development server:
++$ cd postorius_standalone +$ python manage.py runserver+++Warning
+You should use the development server only locally. While it’s possible to +make your site publicly available using the dev server, you should never +do that in a production environment.
++Running Postorius on Apache with mod_wsgi¶
@@ -301,11 +181,15 @@Note
-If you want to change parts of the Client you can use the development option which will create a Symlink instead of a Hardcopy of all files:
-++$ sudo python setup.py develop -
This guide assumes that you know how to setup a VirtualHost with Apache. +If you are using SQLite, the .db file as well as its folder need to be +writable by the web server.
These settings need to be added to your Apache VirtualHost:
+-Alias /static /path/to/postorius_standalone/static +<Directory "/path/to/postorius_standalone/static"> + Order deny,allow + Allow from all +</Directory> + +WSGIScriptAlias / /path/to/postorius_standalone/srv/postorius.wsgi +<Directory "/path/to/postorius_standalone/srv"> + Order deny,allow + Allow from all +</Directory>All changes will apply once you restart Mailman itself.
+The first Alias serves the static files (CSS, JS, Images, etc.). The +WSGIScriptAlias serves the Django application. The paths need to be changed +depending on which location you downloaded postorius_standalone to.
+We’re almost ready. But you need to collect the static files from Postorius +(which resides somewhere on your pythonpath) to be able to serve them from the +site directory. All you have to do is to change into the +postorius_standalone directory and run:
+-$ python manage.py collectstatic--Django 1.3¶
-During our development we started a Django Site based on the 1.2 Version which is included into Ubuntu’s repositorys. This made the installation easy but we ended up having some points which would get a much better code when using some elements introducing in 1.3. -As Mailman is supposed to be long-time stable - or however you call it - we decided that we should stick to the latest stable version right away. For this reason you’re required to install Django 1.3+ which is descriped on their Website. (https://www.djangoproject.com/download/)
---Note
-Please be Aware that it’s not recommended to run both 1.2 and 1.3 at the same time
-In Django you’ve got 3 different levels of data. -- Django Installation Files -- Django Site -- Django Apps -usually you don’t see the Installation as it’s hidden somewhere within the System and the Apps are simply included into The Site Directory. -As we wanted to have the possibility to include the App into any Django Site which might already exist we decided to keep Site and App seperated.
-During GSoC we’ve used different branches for this: -- lp:mailmanwebgsoc2011 -- lp:mailmanwebgsoc2011/django-site-0.1
---Django Site Installation¶
-We’ve created this branch for quick development - everyone is free to use his own Django site, but this one already includes a couple of modifications we’ve made that will allow running the Development Server just a few seconds after Branching both Site and App.
-As far as I know at the moment we’ve made the following alignments: (All of these are in the settings.py file of the Django Site)
---REST_SERVER = ‘localhost:8001’ -API_USER = ‘restadmin’ -API_PASS = ‘restpass’
---Note
-These are the default values used by the Mailman Client we’ve installed earlier. Feel free to modify the password and username if you need to.
-MAILMAN_TEST_BINDIR = ‘/home/benste/Projects/Gsoc_mailman/mailman-3.0.0a7/bin’ -#/home/florian/Development/mailman/bin’
-----Note
-Running the test modules requires to launch a special version of mailman with it’s own testing DB otherwise you’d destroy you’re sites content during testing. This Path needs to point to YOUR own installation of mailman.
-MAILMAN_THEME = “default”
-----Note
-We decided to allow simple Appearance Modifications, to use a custom CSS you could simply add a Directory within the media directory of the app and Link it’s name here. All HTML Pages will use the Styles from the Directory mentioned in here
-PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) -MEDIA_ROOT = os.path.join(os.path.split(PROJECT_PATH)[0], “mailman_django/media/mailman_django/”)
-----Note
-Absolute path to the directory that holds media. -Example: “/home/media/media.lawrence.com/”
-MEDIA_URL = ‘/mailman_media/’
-----Note
-URL that handles the media served from MEDIA_ROOT. Make sure to use a trailing slash if there is a path component (optional in other cases).Examples: “http://media.lawrence.com”, “http://example.com/media/“
--
-- AUTHENTICATION_BACKENDS = (
-- -
‘mailman_django.auth.restbackend.RESTBackend’, -‘django.contrib.auth.backends.ModelBackend’ -)
---Note
-This creates a connection in between Djangos Login and Permission Decorators which we use for authentification and a custom Backend which we created in Preparation to work together with the REST API or an upcoming Middleware. -You need to keep the Django one for testing fallback.
-- TEMPLATE_CONTEXT_PROCESSORS=(
-- -
“django.contrib.auth.context_processors.auth”, -“django.core.context_processors.debug”, -“django.core.context_processors.i18n”, -“django.core.context_processors.media”, -“django.core.context_processors.csrf”, -“django.contrib.messages.context_processors.messages”, -“mailman_django.context_processors.lists_of_domain”, -“mailman_django.context_processors.render_MAILMAN_THEME”, -“mailman_django.context_processors.extend_ajax”
---Note
-We’re using Context Processors to easily render value which we need in nearly every view.
-ROOT_URLCONF = ‘mailman_django.urls’
-----Note
-This is where our URL Config is - if you run your own site with other Apps as well you might want to adjust this to your urls.py which includes our file.
--
-- TEMPLATE_DIRS = (
-- -
os.path.join(PROJECT_PATH, “mailman_django/templates”),
---Note
-Adds our own Templates
-- INSTALLED_APPS = (
-- -
‘django.contrib.auth’, -‘django.contrib.contenttypes’, -‘django.contrib.sessions’, -‘django.contrib.sites’, -‘django.contrib.admin’, -‘mailman_django’,
---Note
-Makes sure that Django knows about our directory as an App and creates needed Tables () when running
---$ python manage.py syncdb -
Now that you know about all these you might start the development server. As usual in Django this is done by running
-----$ python manage.py runserver -
within the Django Site Directory - as usual the default address is localhost:8000 -Of course it will only be able to start once our app is in place as well.
--Django Application¶
-First get the files, and make sure you paste them into your Project directory and adjust it’s name to the appropriate configuration you’ve made earlier in the Django Site. Remeber our default is mailman_django
-----$ bzr branch lp:mailmanwebgsoc2011 -
--Note
-We’ve tested Revision 172
--+Note
-We’re planning to ease up installation by creating an egg
-After reloading the webserver Postorius should be running!
Table Of Contents
@@ -324,7 +208,7 @@
\ + Sort by:\ + best rated\ + newest\ + oldest\ +
\ +\ +
Add a comment\ + (markup):
\ +