changeset 1:444316e49fec

google-likeness removed
author Radomir Dopieralski <devel@sheep.art.pl>
date Fri, 16 May 2008 20:59:46 +0200
parents c6c1f4bfa28f
children 9da7d4bfb09f
files css/common.css css/print.css css/screen.css gugiel.py
diffstat 4 files changed, 864 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/css/common.css	Fri May 16 12:45:07 2008 +0200
+++ b/css/common.css	Fri May 16 20:59:46 2008 +0200
@@ -0,0 +1,491 @@
+/*  common.css - MoinMoin Default Styles
+
+Copyright (c) 2001, 2002, 2003 by Juergen Hermann
+*/
+
+/* content styles */
+
+/* Links */
+
+a {color: #0044B3;}
+a:visited {color: #597BB3;}
+a.nonexistent, a.badinterwiki {color: gray;}
+
+a.www:before {content: url(../img/moin-www.png); margin: 0 0.2em;}
+a.http:before {content: url(../img/moin-www.png); margin: 0 0.2em;}
+a.https:before {content: url(../img/moin-www.png); margin: 0 0.2em;}
+a.file:before {content: url(../img/moin-ftp.png); margin: 0 0.2em;}
+a.ftp:before {content: url(../img/moin-ftp.png); margin: 0 0.2em;}
+a.nntp:before {content: url(../img/moin-news.png); margin: 0 0.2em;}
+a.news:before {content: url(../img/moin-news.png); margin: 0 0.2em;}
+a.telnet:before {content: url(../img/moin-telnet.png); margin: 0 0.2em;}
+a.irc:before,a.ircs:before  {content: url(../img/moin-telnet.png); margin: 0 0.2em;}
+a.mailto:before {content: url(../img/moin-email.png); margin: 0 0.2em;}
+a.attachment:before {content: url(../img/moin-attach.png); margin: 0 0.2em;}
+a.badinterwiki:before {content: url(../img/moin-inter.png); margin: 0 0.2em;}
+a.interwiki:before {content: url(../img/moin-inter.png); margin: 0 0.2em;}
+
+li p {
+	margin: .25em 0;
+}
+
+li.gap {
+    margin-top: 0.5em;
+}
+
+dt {
+    margin-top: 0.5em;
+    font-weight: bold;
+}
+
+dd {
+    margin-top: 0;
+    margin-bottom: 0;
+}
+
+dd p {
+    margin: 0.25em 0;
+}
+   
+a, img, img.drawing {
+	border: 0;
+}
+
+pre {
+	border: 1pt solid #AEBDCC;
+	background-color: #F3F5F7;
+	padding: 5pt;
+	font-family: courier, monospace;
+	white-space: pre;
+	/* begin css 3 or browser specific rules - do not remove!
+	see: http://forums.techguy.org/archive/index.php/t-249849.html */
+    white-space: pre-wrap;
+    word-wrap: break-word;
+    white-space: -moz-pre-wrap;
+    white-space: -pre-wrap;
+    white-space: -o-pre-wrap;
+    /* end css 3 or browser specific rules */
+}
+
+pre.comment {
+    background-color: #CCCCCC;
+    color: red;
+    padding: 0;
+    margin: 0;
+    border: 0;
+}
+
+pre.comment:before {
+    content: url(../img/attention.png);
+}
+
+
+/* .comment css definition must be top of .red/.green/.blue or it won't work */
+.comment { color: #555555; background-color: #DDDDFF; }
+
+.red { background-color: #FFCCCC; }
+.green { background-color: #CCFFCC; }
+.blue { background-color: #CCCCFF; }
+.yellow { background-color: #FFF29F; }
+.orange { background-color: #FFD59B; }
+
+.solid { border: 2px solid #000000; padding: 2px; }
+.dashed { border: 2px dashed #000000; padding: 2px; }
+.dotted { border: 2px dotted #000000; padding: 2px; }
+
+
+table
+{
+	margin: 0.5em 0 0 0.5em;
+	border-collapse: collapse;
+}
+
+th, td
+{
+	padding: 0.25em 0.5em 0.25em 0.5em;
+	border: 1pt solid #ADB9CC;
+}
+
+td p {
+	margin: 0;
+	padding: 0;
+}
+
+/* TableOfContents macro */
+.table-of-contents { border: 1px solid #bbbbbb;
+                     color: black; background-color: #eeeeee;
+                     font-size: small;
+                     text-align:left;
+                     margin: 0.5em; padding-left: 2em;
+                     min-width:50%; }
+.table-of-contents ol { margin:0; margin-left:1em;
+                        list-style-type:decimal; }
+.table-of-contents ul { margin:0;
+                        list-style-type:none; }
+.table-of-contents-heading { font-weight:bold; padding:0; margin:0; }
+
+
+.footnotes div {
+	width: 5em;
+	border-top: 1pt solid gray;
+}
+
+.footnotes ol {
+	padding: 0 2em;
+	margin: 0 0 1em;
+}
+
+.footnotes li {
+}
+
+.info {
+    float: right;
+    font-size: 0.7em;
+    color: gray;
+}
+
+.seperator {
+    color: gray;
+}
+
+#pagebottom {clear: both;}
+
+/* standard rule ---- */
+hr {
+    height: 1pt;
+    background-color: #9C9C9C;
+    border: 0;
+}
+
+/* custom rules ----- to ---------- */
+.hr1 {height: 2pt;}
+.hr2 {height: 3pt;}
+.hr3 {height: 4pt;}
+.hr4 {height: 5pt;}
+.hr5 {height: 6pt;}
+.hr6 {height: 7pt;}
+
+/* Replacement for deprecated html 3 <u> element and html 4 <strike> */
+.u {text-decoration: underline;}
+.strike {text-decoration: line-through;}
+
+/* eye catchers */
+.warning 
+{
+	color: red;
+}
+
+.error 
+{
+	color: red;
+}
+
+strong.highlight 
+{
+	background-color: #CCE0FF;
+	padding: 1pt;
+}
+
+
+/* Recent changes */
+
+.rcrss {
+	float: right;
+	margin: 0;
+}
+
+.recentchanges[dir="rtl"] .rcrss {
+	float: left;
+}
+
+.recentchanges table {
+	clear: both;
+}
+
+.recentchanges td {
+	vertical-align: top;
+	border: none;
+	border-bottom: 1pt solid #E6EAF0;
+	background: #F2F4F7;
+}
+
+.rcdaybreak td {
+	background: #B8C5D9;
+	border: none;
+}
+
+.rcdaybreak td a {
+	font-size: 0.88em;
+}
+
+.rcicon1, .rcicon2 {
+	text-align: center;
+}
+
+.rcpagelink {
+	width: 33%;
+}
+
+.rctime {
+	font-size: 0.88em;
+	white-space: nowrap;
+}
+
+.rceditor {
+	white-space: nowrap;
+	font-size: 0.88em;
+}
+
+.rccomment {
+	width: 50%;
+	color: gray;
+	font-size: 0.88em;
+}
+
+
+/* User Preferences */
+
+.userpref table, .userpref td {
+	border: none;
+}
+
+/* CSS for new code_area markup used by Colorizer and ParserBase */
+
+div.codearea { /* the div makes the border */
+	margin: 0.5em 0;
+	padding: 0;
+	border: 1pt solid #AEBDCC;
+	background-color: #F3F5F7;
+	color: black;
+}
+
+div.codearea pre { /* the pre has no border and is inside the div */
+	margin: 0;
+	padding: 10pt;
+	border: none;
+}
+
+a.codenumbers { /* format of the line numbering link */
+	margin: 0 10pt;
+	font-size: 0.85em;
+	color: gray;
+}
+
+/* format of certain syntax spans */
+div.codearea pre span.LineNumber {color: gray;}
+div.codearea pre span.ID         {color: #000000;}
+div.codearea pre span.Operator   {color: #0000C0;}
+div.codearea pre span.Char       {color: #004080;}
+div.codearea pre span.Comment    {color: #008000;}
+div.codearea pre span.Number     {color: #0080C0;}
+div.codearea pre span.String     {color: #004080;}
+div.codearea pre span.SPChar     {color: #0000C0;}
+div.codearea pre span.ResWord    {color: #A00000;}
+div.codearea pre span.ConsWord   {color: #008080; font-weight: bold;}
+div.codearea pre span.Error      {color: #FF8080; border: solid 1.5pt #FF0000;}
+div.codearea pre span.ResWord2   {color: #0080ff; font-weight: bold;}
+div.codearea pre span.Special    {color: #0000ff;}
+div.codearea pre span.Preprc     {color: #803999;}
+
+/* for diff parser */
+div.codearea pre span.DiffAdded   {color: #4876FF;}
+div.codearea pre span.DiffRemoved {color: #FF0000;}
+div.codearea pre span.DiffChanged {color: #FF7F50;}
+div.codearea pre span.DiffSeparator {color: #228B22; font-weight: bold}
+
+/* Search results */
+.advancedsearch {
+    border: 1pt solid #ADB9CC;
+}
+
+.advancedsearch td {
+    vertical-align: top;
+    background-color: #E7E7E7;    
+    border: 0px;
+}
+
+.advancedsearch td.searchfor {
+    font-weight: bold;
+}
+
+.advancedsearch input {
+    border: 1px solid #ADB9CC;
+    background-color: #fff;
+}
+
+.advancedsearch input[disabled] {
+    background-color: #eee;
+}
+
+.advancedsearch td.submit {
+    border-top: 1px solid #ADB9CC;
+    background-color: #fff;
+    text-align: right;
+}
+
+.advancedsearch option, .advancedsearch option select {
+    border: 1px solid #ADB9CC;
+    background-color: #fff;
+}
+
+
+.searchresults dt {
+    margin-top: 1em;
+    font-weight: normal;
+}
+
+.searchresults dd, .searchresults p {
+    font-size: 0.85em;
+}
+
+.searchresults .searchhitinfobar {
+    color: #008000;
+    margin-left: 15px;
+    margin-top: 0;
+}
+
+p.searchstats {
+    font-size: 0.8em;
+    text-align: right;
+    width: 100%;
+    background-color: #E6EAF0;
+    border-top: 1px solid #9088DC;
+    padding: 2px;
+}
+
+p.searchhint {
+    background-color: #E6EAF0;
+    border: 1px solid #9088DC;
+    padding: 2px;
+}
+
+.searchpages {
+    margin-left: auto;
+    margin-right: auto;
+}
+
+.searchpages tr, .searchpages td {
+    border: 0;
+    padding: 5px;
+    margin: 0;
+    text-align: center;
+    vertical-align: middle;
+    color: #b93a58;
+    font-weight: bold;
+    font-size: 1.05em;
+}
+
+.searchpages td a, .searchpages td a:link {
+    text-decoration: underline;
+}
+
+/* MonthCalendar css */
+
+/* days without and with pages linked to them */
+a.cal-emptyday {
+    color: #777777;
+    text-align: center;
+}
+a.cal-usedday {
+    color: #000000;
+    font-weight: bold;
+    text-align: center;
+}
+/* general stuff: workdays, weekend, today */
+td.cal-workday {
+    background-color: #DDDDFF;
+    text-align: center;
+}
+td.cal-weekend {
+    background-color: #FFDDDD;
+    text-align: center;
+}
+td.cal-today {
+    background-color: #CCFFCC;
+    border-style: solid;
+    border-width: 2pt;
+    text-align: center;
+}
+/* invalid places on the monthly calendar sheet */
+td.cal-invalidday {
+    background-color: #CCCCCC;
+}
+/* links to prev/next month/year */
+a.cal-link {
+    color: #000000;
+    text-decoration: none;
+}
+th.cal-header {
+    background-color: #DDBBFF;
+    text-align: center;
+}
+
+/* for MonthCalendar mouseover info boxes */
+TABLE.tip {
+    color: black;
+    background-color: #FF8888;
+    font-size: small;
+    font-weight: normal;
+    border-style: solid;
+    border-width: 1px;
+}
+
+TH.tip {
+    background-color: #FF4444;
+    font-weight: bold;
+    text-align: center;
+}
+
+TD.tip {
+    text-align: left;
+}
+*[dir="rtl"] TD.tip {
+    text-align: right;
+}
+
+/* end MonthCalendar stuff */
+
+#message .hint {font-style: italic;}
+#message .info {
+    float: none;
+    font-size: 1em;
+    color: black;
+}
+#message .info:before {content: url('../img/icon-info.png'); margin: 0 0.2em;}
+#message .warning:before {content: url('../img/alert.png'); margin: 0 0.2em;}
+#message .error:before {content: url('../img/icon-error.png'); margin: 0 0.2em;}
+
+
+/* admonition start */
+#content div.caution, 
+#content div.important, 
+#content div.note, 
+#content div.tip, 
+#content div.warning {
+    border: 1pt solid #E5E5E5;
+    background-color: #F9F9FF;
+    color: black;
+    
+    margin: 10pt 30pt 10pt 30pt;
+    background-repeat: no-repeat;
+    background-position: 8px 8px;
+    min-height: 64px; /*64=48+8+8 but doesn't work with IE*/
+    padding-left: 64px;
+}
+ 
+#content div.caution p, 
+#content div.important p, 
+#content div.note p, 
+#content div.tip p, 
+#content div.warning p {
+    margin-top: 8px; /*to align text with bg graphic*/
+}
+
+#content div.tip { background-image: url("../img/admon-tip.png"); }
+#content div.note { background-image: url("../img/admon-note.png"); }
+#content div.important { background-image: url("../img/admon-important.png"); }
+#content div.caution { background-image: url("../img/admon-caution.png"); }
+#content div.warning { background-image: url("../img/admon-warning.png"); }
+
+/* admonition end */
+
--- a/css/print.css	Fri May 16 12:45:07 2008 +0200
+++ b/css/print.css	Fri May 16 20:59:46 2008 +0200
@@ -0,0 +1,1 @@
+#header { display: none }
--- a/css/screen.css	Fri May 16 12:45:07 2008 +0200
+++ b/css/screen.css	Fri May 16 20:59:46 2008 +0200
@@ -0,0 +1,127 @@
+body {
+    padding: 0;
+    margin: 0 0.5em;
+    font-size: 90%;
+    font-family: sans-serif;
+    line-height: 1.3;
+}
+a {
+    color: #f57900;
+    text-decoration: underline;
+}
+a:visited {
+    color: #ce5c00;
+}
+a.nonexistent {
+    color: #666;
+}
+a img { border: none }
+
+#utils {
+    float:right;
+    text-align: right;
+}
+#username {
+    font-size: 90%;
+}
+#searchform {
+    margin: 0.125em 0;
+}
+#logo {
+    float: left;
+    margin: 1em 0.25em;
+}
+#navibar {
+    clear: both;
+    display: block;
+    margin: 0;
+    padding: 0;
+    line-height: 1.25;
+}
+#navibar li {
+    display: inline;
+    margin: 0 0.5em 0 0;
+    padding: 0.25em 0.75em 0 0.75em;
+    background: #dcf1a9;
+    border: 1px solid #93ae79;
+    border-bottom: none;
+    -moz-border-radius-topleft: 0.33em;
+    -moz-border-radius-topright: 0.33em;
+}
+#navibar li.current {
+    background: #bbe555;
+    border: 1px solid #6e9b43;
+    border-bottom: 1px solid #bbe555;
+    margin-bottom: -1px;
+}
+#navibar li a {
+    color: #000;
+    text-decoration: none;
+    font-size: 80%;
+    font-weight: bold;
+}
+h1#locationline {
+    margin: 0;
+    font-size: 100%;
+}
+.editbar {
+    display: block;
+    padding: 0.25em;
+    margin: 0;
+    background: #bbe555;
+    border: 1px solid #6e9b43;
+/*    text-align:right; */
+}
+.editbar a {
+    color: #000;
+}
+#header .editbar {
+    -moz-border-radius-topright: 0.5em;
+}
+#footer .editbar {
+    -moz-border-radius-bottomright: 0.5em;
+    -moz-border-radius-bottomleft: 0.5em;
+}
+.editbar li {
+    display: inline;
+    margin: 0 0.5em 0 0;
+}
+.editbar form {
+    display: inline;
+}
+.editbar form div {
+    display: inline;
+}
+
+
+#credits {
+    margin: 0;
+    padding: 0;
+    text-align: center;
+    font-size: 80%;
+}
+#credits li {
+    margin: 0.25em;
+    display: inline;
+}
+
+p.info {
+    text-align: right;
+    font-size: 80%;
+    margin: 0;
+    color: #999;
+}
+
+#message {
+    -moz-border-radius: 0.5em;
+    background: #dcf1a9;
+    font-size; 90%;
+    clear: both;
+    padding: 0.5em;
+    margin: 0.5em 0;
+    border: 1px solid #93ae79;
+}
+#message p {
+    margin: 0;
+}
+
--- a/gugiel.py	Fri May 16 12:45:07 2008 +0200
+++ b/gugiel.py	Fri May 16 20:59:46 2008 +0200
@@ -1,10 +1,250 @@
-#
-# this ifile goes into data/plugin/theme/gugiel.py
-#
-from MoinMoin.theme import modern
+# -*- coding: iso-8859-1 -*-
+"""
+    MoinMoin - modern theme
 
-class Theme(modern.Theme):
+    @copyright: 2003-2005 Nir Soffer, Thomas Waldmann
+    @license: GNU GPL, see COPYING for details.
+"""
+
+from MoinMoin.theme import ThemeBase
+from MoinMoin import wikiutil
+from MoinMoin.Page import Page
+
+class Theme(ThemeBase):
+
     name = "gugiel"
 
+    def header(self, d, **kw):
+        """ Assemble wiki header
+
+        @param d: parameter dictionary
+        @rtype: unicode
+        @return: page header html
+        """
+        html = [
+            # Pre header custom html
+            self.emit_custom_html(self.cfg.page_header1),
+
+            # Header
+            u'<div id="header">',
+            self.trail(d),
+            u'<div id="utils">',
+            self.username(d),
+            self.searchform(d),
+            u'</div>',
+            self.logo(),
+            self.navibar(d),
+            #u'<hr id="pageline">',
+            u'<div id="pageline"><hr style="display:none;"></div>',
+            self.editbar(d),
+            self.interwiki(d),
+            self.title(d),
+            self.msg(d),
+            u'</div>',
+
+            # Post header custom html (not recommended)
+            self.emit_custom_html(self.cfg.page_header2),
+
+            # Start of page
+            self.startPage(),
+        ]
+        return u'\n'.join(html)
+
+    def editorheader(self, d, **kw):
+        """ Assemble wiki header for editor
+
+        @param d: parameter dictionary
+        @rtype: unicode
+        @return: page header html
+        """
+        html = [
+            # Pre header custom html
+            self.emit_custom_html(self.cfg.page_header1),
+
+            # Header
+            u'<div id="header">',
+            u'<h1 id="locationline">',
+            self.title(d),
+            u'</h1>',
+            self.msg(d),
+            u'</div>',
+
+            # Post header custom html (not recommended)
+            self.emit_custom_html(self.cfg.page_header2),
+
+            # Start of page
+            self.startPage(),
+        ]
+        return u'\n'.join(html)
+
+    def footer(self, d, **keywords):
+        """ Assemble wiki footer
+
+        @param d: parameter dictionary
+        @keyword ...:...
+        @rtype: unicode
+        @return: page footer html
+        """
+        page = d['page']
+        html = [
+            # End of page
+            self.pageinfo(page),
+            self.endPage(),
+
+            # Pre footer custom html (not recommended!)
+            self.emit_custom_html(self.cfg.page_footer1),
+
+            # Footer
+            u'<div id="footer">',
+            self.editbar(d),
+            self.credits(d),
+            self.showversion(d, **keywords),
+            u'</div>',
+
+            # Post footer custom html
+            self.emit_custom_html(self.cfg.page_footer2),
+            ]
+        return u'\n'.join(html)
+
+    def title(self, d):
+        """ Assemble the title (now using breadcrumbs)
+
+        @param d: parameter dictionary
+        @rtype: string
+        @return: title html
+        """
+        _ = self.request.getText
+        content = []
+        if d['title_text'] == d['page'].split_title(): # just showing a page, no action
+            curpage = ''
+            segments = d['page_name'].split('/') # was: title_text
+            for s in segments[:-1]:
+                curpage += s
+                content.append(Page(self.request, curpage).link_to(self.request, s))
+                curpage += '/'
+            link_text = segments[-1]
+            link_title = _('Click to do a full-text search for this title')
+            link_query = {
+                'action': 'fullsearch',
+                'value': 'linkto:"%s"' % d['page_name'],
+                'context': '180',
+            }
+            # we dont use d['title_link'] any more, but make it ourselves:
+            link = d['page'].link_to(self.request, link_text, querystr=link_query, title=link_title, css_class='backlink', rel='nofollow')
+            content.append(link)
+        else:
+            content.append(wikiutil.escape(d['title_text']))
+
+        location_html = u'<span class="sep">/</span>'.join(content)
+        html = u'<span id="pagelocation">%s</span>' % location_html
+        return html
+
+    def username(self, d):
+        """ Assemble the username / userprefs link
+
+        @param d: parameter dictionary
+        @rtype: unicode
+        @return: username html
+        """
+        request = self.request
+        _ = request.getText
+
+        userlinks = []
+        # Add username/homepage link for registered users. We don't care
+        # if it exists, the user can create it.
+        if request.user.valid and request.user.name:
+            interwiki = wikiutil.getInterwikiHomePage(request)
+            name = request.user.name
+            aliasname = request.user.aliasname
+            if not aliasname:
+                aliasname = name
+            title = "%s @ %s" % (aliasname, interwiki[0])
+            # link to (interwiki) user homepage
+            homelink = (request.formatter.interwikilink(1, title=title, id="userhome", generated=True, *interwiki) +
+                        request.formatter.text(name) +
+                        request.formatter.interwikilink(0, title=title, id="userhome", *interwiki))
+            userlinks.append(homelink)
+            # link to userprefs action
+            if 'userprefs' not in self.request.cfg.actions_excluded:
+                userlinks.append(d['page'].link_to(request, text=_('Settings'),
+                                               querystr={'action': 'userprefs'}, id='userprefs', rel='nofollow'))
+
+        if request.user.valid:
+            if request.user.auth_method in request.cfg.auth_can_logout:
+                userlinks.append(d['page'].link_to(request, text=_('Logout'),
+                                                   querystr={'action': 'logout', 'logout': 'logout'}, id='logout', rel='nofollow'))
+        else:
+            query = {'action': 'login'}
+            # special direct-login link if the auth methods want no input
+            if request.cfg.auth_login_inputs == ['special_no_input']:
+                query['login'] = '1'
+            if request.cfg.auth_have_login:
+                userlinks.append(d['page'].link_to(request, text=_("Login"),
+                                                   querystr=query, id='login', rel='nofollow'))
+
+        userlinks_html = u'<span class="sep"> | </span>'.join(userlinks)
+        html = u'<div id="username">%s</div>' % userlinks_html
+        return html
+
+    def trail(self, d):
+        """ Assemble page trail
+
+        @param d: parameter dictionary
+        @rtype: unicode
+        @return: trail html
+        """
+        request = self.request
+        user = request.user
+        html = ''
+        if not user.valid or user.show_page_trail:
+            trail = user.getTrail()
+            if trail:
+                items = []
+                for pagename in trail:
+                    try:
+                        interwiki, page = wikiutil.split_interwiki(pagename)
+                        if interwiki != request.cfg.interwikiname and interwiki != 'Self':
+                            link = (self.request.formatter.interwikilink(True, interwiki, page) +
+                                    self.shortenPagename(page) +
+                                    self.request.formatter.interwikilink(False, interwiki, page))
+                            items.append(link)
+                            continue
+                        else:
+                            pagename = page
+
+                    except ValueError:
+                        pass
+                    page = Page(request, pagename)
+                    title = page.split_title()
+                    title = self.shortenPagename(title)
+                    link = page.link_to(request, title)
+                    items.append(link)
+                html = u'<div id="pagetrail">%s</div>' % u'<span class="sep"> &raquo; </span>'.join(items)
+        return html
+
+    def interwiki(self, d):
+        """ Assemble the interwiki name display, linking to page_front_page
+
+        @param d: parameter dictionary
+        @rtype: string
+        @return: interwiki html
+        """
+        if self.request.cfg.show_interwiki:
+            page = wikiutil.getFrontPage(self.request)
+            text = self.request.cfg.interwikiname or 'Self'
+            link = page.link_to(self.request, text=text, rel='nofollow')
+            html = u'<span id="interwiki">%s<span class="sep">: </span></span>' % link
+        else:
+            html = u''
+        return html
+
 def execute(request):
+    """
+    Generate and return a theme object
+
+    @param request: the request object
+    @rtype: MoinTheme
+    @return: Theme object
+    """
     return Theme(request)
+