# HG changeset patch # User Paul Boddie # Date 1225506782 -3600 # Node ID 7aa975d1ddc1730c2763f591a2f9d1660778b666 # Parent 306d623bacd42ab6d06ab45e275f7a02e40f4c65# Parent cd1eed9898df09d3c88bae929402dbe9c69d9129 Merge MoinMoin 1.6.x changes to the default branch. diff -r 306d623bacd4 -r 7aa975d1ddc1 .hgtags --- a/.hgtags Fri May 16 01:01:08 2008 +0200 +++ b/.hgtags Sat Nov 01 03:33:02 2008 +0100 @@ -3,3 +3,4 @@ d6c55ab07502cbd9f0f39b57dfe99a8ea6f8dcdd update-1 2505e64ef1da8325c1dea90e7d9ecff8a7ef3c69 update-2 88d97586bc310a2751cb47277abf1e954f9a5aee update-3 +0fa03d82b23d1f436edcef6a43b4f9cbd2ec18aa final-2008 diff -r 306d623bacd4 -r 7aa975d1ddc1 COPYING.txt --- a/COPYING.txt Fri May 16 01:01:08 2008 +0200 +++ b/COPYING.txt Sat Nov 01 03:33:02 2008 +0100 @@ -17,3 +17,12 @@ License along with this library; see the file LICENCE.txt If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +Licence for the EuroPython Banner and Badge Logos +------------------------------------------------- + +EuroPython logo by Zachary Voase, licensed under the Creative Commons +Attribution-Share Alike 3.0 Unported License, the details of which can be +found at the following location: + +http://creativecommons.org/licenses/by-sa/3.0/legalcode diff -r 306d623bacd4 -r 7aa975d1ddc1 README.txt --- a/README.txt Fri May 16 01:01:08 2008 +0200 +++ b/README.txt Sat Nov 01 03:33:02 2008 +0100 @@ -18,19 +18,25 @@ To set up the Wiki in the main MoinMoin configuration, examine farmconfig.py, then: -sudo ./instwiki +sudo ./instwiki /etc/moin (This copies the ep2008.py and farmconfig.py files; if either change subsequently, it will be necessary to copy them again.) To set up an Apache site for the Wiki, examine site-ep2008, then: -sudo ./instsite +sudo ./instsite /etc/apache2/sites-available Macros (if used) can be installed as follows: sudo ./instmacros .../ep2008 +The path details employed by the moin.cgi file in the installed Wiki must +correspond to the paths employed by the installation process above; this file +can be found in a location of the following form: + +.../ep2008/www/moin.cgi + The FeedReader macro is used to fetch RSS 2.0 feeds and is preferable to the RSSReader macro available elsewhere since it parses the titles of feed entries correctly. @@ -60,3 +66,9 @@ Be sure to only add existing users - there exists a possibility of people otherwise creating accounts which would then have undeserved administrative privileges. + +Notes on Translations +--------------------- + +http://lists.centos.org/pipermail/centos-docs/2007-October/000690.html +http://moinmo.in/MoinMoinBugs/LanguageDictTranslationsNotFoundForLanguageNamesHavingSpaces diff -r 306d623bacd4 -r 7aa975d1ddc1 ep2008.py --- a/ep2008.py Fri May 16 01:01:08 2008 +0200 +++ b/ep2008.py Sat Nov 01 03:33:02 2008 +0100 @@ -28,7 +28,7 @@ #page_front_page = u"MyStartingPage" # b) if wiki content is maintained in many languages - page_front_page = u"FrontPage" + page_front_page = u"EuroPython" # PB: Specific EP2008 settings. @@ -76,4 +76,7 @@ title="EuroPython Conference RSS Feed" href="http://europython.wordpress.com/feed/" /> ''' + # If mail is disabled, don't permit subscriptions. + actions_excluded = ['SubscribeUser'] + # vim: tabstop=4 expandtab shiftwidth=4 diff -r 306d623bacd4 -r 7aa975d1ddc1 initwiki --- a/initwiki Fri May 16 01:01:08 2008 +0200 +++ b/initwiki Sat Nov 01 03:33:02 2008 +0100 @@ -1,7 +1,7 @@ #!/bin/bash # Based on the documentation: /usr/share/doc/python-moinmoin/README.Debian.gz -if [ ! $1 ] ; then +if [[ ! $1 ]] ; then echo "Please specify a directory such as ../ep2008 or /tmp/ep2008." exit fi diff -r 306d623bacd4 -r 7aa975d1ddc1 instmacros --- a/instmacros Fri May 16 01:01:08 2008 +0200 +++ b/instmacros Sat Nov 01 03:33:02 2008 +0100 @@ -1,6 +1,6 @@ #!/bin/bash -if [ ! $1 ] ; then +if [[ ! $1 ]] ; then echo "Please specify a directory such as ../ep2008 or /tmp/ep2008." exit fi diff -r 306d623bacd4 -r 7aa975d1ddc1 instsite --- a/instsite Fri May 16 01:01:08 2008 +0200 +++ b/instsite Sat Nov 01 03:33:02 2008 +0100 @@ -1,5 +1,11 @@ #!/bin/bash # Based on the documentation: /usr/share/doc/python-moinmoin/README.Debian.gz -cp site-ep2008 /etc/apache2/sites-available/ep2008 +if [[ ! $1 ]] ; then + echo "Please specify a directory containing Apache site definitions such as" + echo "/etc/apache2/sites-available (used by Debian and Ubuntu)." + exit +fi + +cp site-ep2008 $1/ep2008 a2ensite ep2008 diff -r 306d623bacd4 -r 7aa975d1ddc1 insttheme --- a/insttheme Fri May 16 01:01:08 2008 +0200 +++ b/insttheme Sat Nov 01 03:33:02 2008 +0100 @@ -1,6 +1,6 @@ #!/bin/bash -if [ ! $1 ] ; then +if [[ ! $1 ]] ; then echo "Please specify a directory such as ../ep2008 or /tmp/ep2008." exit fi diff -r 306d623bacd4 -r 7aa975d1ddc1 instwiki --- a/instwiki Fri May 16 01:01:08 2008 +0200 +++ b/instwiki Sat Nov 01 03:33:02 2008 +0100 @@ -1,5 +1,11 @@ #!/bin/bash # Based on the documentation: /usr/share/doc/python-moinmoin/README.Debian.gz -mv /etc/moin/farmconfig.py /etc/moin/farmconfig.py.old -cp ep2008.py farmconfig.py /etc/moin +if [[ ! $1 ]] ; then + echo "Please specify the directory containing farmconfig.py, such as" + echo "/etc/moin (used by Debian and Ubuntu)." + exit +fi + +mv $1/farmconfig.py $1/farmconfig.py.old +cp ep2008.py farmconfig.py $1 diff -r 306d623bacd4 -r 7aa975d1ddc1 macros/CategoryMenu.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros/CategoryMenu.py Sat Nov 01 03:33:02 2008 +0100 @@ -0,0 +1,181 @@ +# -*- coding: iso-8859-1 -*- +""" + MoinMoin - CategoryMenu Macro + + @copyright: 2008 by Paul Boddie + @copyright: 2000-2004 Juergen Hermann , + 2005-2008 MoinMoin:ThomasWaldmann. + @license: GNU GPL (v2 or later), see COPYING.txt for details. +""" + +from MoinMoin.Page import Page +from MoinMoin import wikiutil, search, version +import re + +category_regexp = None + +Dependencies = ['pages'] + +def isMoin15(): + return version.release.startswith("1.5.") + +def getCategoryPattern(request): + global category_regexp + + try: + return request.cfg.cache.page_category_regexact + except AttributeError: + + # Use regular expression from MoinMoin 1.7.1 otherwise. + + if category_regexp is None: + category_regexp = re.compile(u'^%s$' % ur'(?PCategory(?P(?!Template)\S+))', re.UNICODE) + return category_regexp + +def getCategories(request): + + """ + From the AdvancedSearch macro, return a list of category page names using + the given 'request'. + """ + + # This will return all pages with "Category" in the title. + + cat_filter = getCategoryPattern(request).search + pagenames = request.rootpage.getPageList(filter=cat_filter) + pagenames.sort() + return pagenames + +def getCategoryMapping(category_pagenames, request): + + """ + For the given 'category_pagenames' return a list of tuples of the form + (category name, category page name) using the given 'request'. + """ + + cat_pattern = getCategoryPattern(request) + mapping = [] + for pagename in category_pagenames: + name = cat_pattern.match(pagename).group("key") + if name != "Category": + mapping.append((name, pagename)) + mapping.sort() + return mapping + +def getPages(pagename, request): + + "Return the links minus category links for 'pagename' using the 'request'." + + query = search.QueryParser().parse_query('"%s"' % pagename) + if isMoin15(): + results = search.searchPages(request, query) + results.sortByPagename() + else: + results = search.searchPages(request, query, "page_name") + + cat_pattern = getCategoryPattern(request) + pages = [] + for page in results.hits: + if not cat_pattern.match(page.page_name): + pages.append(page) + return pages + +def execute(macro, args): + request = macro.request + fmt = macro.formatter + page = fmt.page + + # Interpret the arguments. + + try: + selected_category_names = wikiutil.parse_quoted_separated(args, name_value=False) + except AttributeError: + selected_category_names = args.split(",") + + selected_category_names = [arg for arg in selected_category_names if arg] + + # Get the categories. + + categories = getCategoryMapping(getCategories(request), request) + + # Generate a menu with the categories, together with expanded submenus for + # the categories employed by the current page, the category represented by + # the current page, or for those categories specified in the macro + # arguments. + + output = [] + output.append(fmt.bullet_list(on=1, attr={"class" : "category-menu"})) + + for category in categories: + category_name, category_pagename = category + + pages_in_category = getPages(category_pagename, request) + pagenames_in_category = [p.page_name for p in pages_in_category] + page_is_category = page.page_name == category_pagename + + # Generate the submenu where appropriate. + + if selected_category_names and category_name in selected_category_names or \ + not selected_category_names and ( + page_is_category or page.page_name in pagenames_in_category): + + if page_is_category: + output.append(fmt.listitem(on=1, attr={"class" : "selected current"})) + output.append(fmt.text(category_name)) + else: + output.append(fmt.listitem(on=1, attr={"class" : "selected"})) + output.append(fmt.pagelink(on=1, pagename=category_pagename)) + output.append(fmt.text(category_name)) + output.append(fmt.pagelink(on=0, pagename=category_pagename)) + + output.append(fmt.bullet_list(on=1, attr={"class" : "category-submenu"})) + + # Visit each page in the category. + + last_parts = [] + + for page_in_category in pages_in_category: + pagename = page_in_category.page_name + + if page.page_name == pagename: + output.append(fmt.listitem(on=1, attr={"class" : "selected"})) + else: + output.append(fmt.listitem(on=1)) + output.append(fmt.pagelink(on=1, pagename=pagename)) + + # Abbreviate long hierarchical names. + + parts = pagename.split("/") + common = 0 + for last, current in map(None, last_parts, parts): + if last == current: + common += 1 + else: + break + + prefix = u"\u2014" * common + suffix = "/".join(parts[common:]) + + output.append(fmt.text("%s %s" % (prefix, suffix))) + output.append(fmt.pagelink(on=0, pagename=pagename)) + output.append(fmt.listitem(on=0)) + + last_parts = parts + + output.append(fmt.bullet_list(on=0)) + output.append(fmt.listitem(on=0)) + + # Otherwise generate a simple link. + + else: + output.append(fmt.listitem(on=1)) + output.append(fmt.pagelink(on=1, pagename=category_pagename)) + output.append(fmt.text(category_name)) + output.append(fmt.pagelink(on=0, pagename=category_pagename)) + output.append(fmt.listitem(on=0)) + + output.append(fmt.bullet_list(on=0)) + + return ''.join(output) + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r 306d623bacd4 -r 7aa975d1ddc1 themes/ep2008/css/category.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/themes/ep2008/css/category.css Sat Nov 01 03:33:02 2008 +0100 @@ -0,0 +1,69 @@ +/* category.css - some additional styles for the CategoryMenu macro + which can be included in screen.css using... + + @import "category.css"; + + ...before any rules. + +Copyright (c) 2008 by Paul Boddie +Licensed under the GNU GPL (v2 or later), see COPYING.txt for details. +*/ + +/* Category menus... */ + +ul.category-menu { + list-style: none; + margin-left: 0; + padding-left: 0; + width: 20em; + float: left; + margin-right: 2em; +} + +/* Prevent issues with the above float. */ + +hr { + clear: left; +} + +ul.category-submenu { + list-style: none; + margin-left: 0; + padding-left: 0; + padding-top: 0.25em; +} + +ul.category-menu li { + list-style: none; + padding: 0.25em; + background-color: #073683; + color: white; +} + +ul.category-menu a, +ul.category-menu a:visited, +ul.category-menu a:hover { + text-decoration: none; + color: white; +} + +ul.category-menu li.selected, +ul.category-menu li:hover { + background-color: #10adf7; +} + +ul.category-submenu li.selected { + background-color: #073683; +} + +ul.category-menu li.current, +ul.category-submenu li.selected { + font-weight: bold; +} + +ul.category-submenu li { + font-weight: normal; +} + +/* vim: tabstop=4 expandtab shiftwidth=4 + */ diff -r 306d623bacd4 -r 7aa975d1ddc1 themes/ep2008/css/screen.css --- a/themes/ep2008/css/screen.css Fri May 16 01:01:08 2008 +0200 +++ b/themes/ep2008/css/screen.css Sat Nov 01 03:33:02 2008 +0100 @@ -1,9 +1,13 @@ /* screen.css - MoinMoin Default Styles Copyright (c) 2001, 2002, 2003 by Juergen Hermann -Copyright (c) 2007 by Paul Boddie +Copyright (c) 2007, 2008 by Paul Boddie */ +/* Category menus... */ + +@import "category.css"; + /* content styles */ /* debug @@ -570,7 +574,7 @@ /* Special rules for EuroPython content */ -.page-FrontPage #page { +.page-EuroPython #page { background-color: #ccc9e2; padding: 0; } diff -r 306d623bacd4 -r 7aa975d1ddc1 themes/ep2008/ep2008.py --- a/themes/ep2008/ep2008.py Fri May 16 01:01:08 2008 +0200 +++ b/themes/ep2008/ep2008.py Sat Nov 01 03:33:02 2008 +0100 @@ -14,7 +14,7 @@ name = "ep2008" - def rsslink(self): + def rsslink(self, d=None): """ Create rss link in head, used by FireFox RSS link for FireFox. This shows an rss link in the bottom of @@ -24,12 +24,11 @@ @return: html head """ - if self.shouldUseRSS(): - extra_rss = self.cfg.extra_rss + extra_rss = self.cfg.extra_rss + if d is not None: + return ThemeBase.rsslink(self, d) + u'\n' + extra_rss else: - extra_rss = u'' - - return ThemeBase.rsslink(self) + u'\n' + extra_rss + return ThemeBase.rsslink(self) + u'\n' + extra_rss def header(self, d, **kw): """ Assemble wiki header diff -r 306d623bacd4 -r 7aa975d1ddc1 themes/ep2008/img/moin-conflict.png Binary file themes/ep2008/img/moin-conflict.png has changed diff -r 306d623bacd4 -r 7aa975d1ddc1 themes/ep2008/img/moin-renamed.png Binary file themes/ep2008/img/moin-renamed.png has changed