Attachment 'simpler.patch'

Download

   1 --- MoinMoin/web/static/htdocs/modern/css/screen.css.orig	2006-11-21 03:51:13.000000000 +0800
   2 +++ MoinMoin/web/static/htdocs/modern/css/screen.css	2010-10-13 12:06:21.000000000 +0800
   3 @@ -246,6 +246,41 @@
   4      background: #81BBF2; /* url(../img/tab-selected.png) repeat-x; */
   5  }
   6  
   7 +#langbar {
   8 +    display: block;
   9 +    margin: 0;
  10 +    padding: 0 10px;
  11 +    font-size: 0.82em;
  12 +    zoom: 1; /* for avoiding a gap between langbar and pageline on IE */
  13 +}
  14 +
  15 +#langbar li {
  16 +    float: right;
  17 +    display: inline;
  18 +    margin: 0 2px;
  19 +    padding: 2px 5px;
  20 +    border: 1px solid #9C9C9C;
  21 +    border-bottom: none;
  22 +    white-space: nowrap;
  23 +}
  24 +
  25 +*[dir="rtl"] #langbar li {
  26 +    float: left;
  27 +}
  28 +
  29 +#langbar li.wikilink {
  30 +    background: white; /*url(../img/tab-wiki.png) repeat-x;*/
  31 +}
  32 +
  33 +#langbar a, #langbar a:visited {
  34 +    color: black;
  35 +    text-decoration: none;    
  36 +}
  37 +
  38 +#langbar li:hover {
  39 +    background: #CCCCCC;
  40 +}
  41 +
  42  #pageline {
  43      clear: both;
  44      margin: 0;
  45 --- MoinMoin/theme/modern.py.orig	2006-05-12 00:24:00.000000000 +0800
  46 +++ MoinMoin/theme/modern.py	2010-10-13 13:14:24.000000000 +0800
  47 @@ -34,6 +34,7 @@
  48              u'</div>',
  49              self.trail(d),
  50              self.navibar(d),
  51 +            self.langbar(d),
  52              #u'<hr id="pageline">',
  53              u'<div id="pageline"><hr style="display:none;"></div>',
  54              self.msg(d),
  55 @@ -48,6 +49,49 @@
  56          ]
  57          return u'\n'.join(html)
  58  
  59 +    def langbar(self, d):
  60 +        """ Create language panel
  61 +
  62 +        @param d: parameter dictionary
  63 +        @rtype: unicode
  64 +        @return: language panel html
  65 +        """
  66 +        from MoinMoin.util import pysupport
  67 +        from MoinMoin.Page import Page
  68 +        from MoinMoin import i18n
  69 +
  70 +        # Find page without i18n prefix (assumed to be in English)
  71 +        org = d['page_name']
  72 +        p = org.split('/')
  73 +        if len(p) > 1 and p[0] in i18n.languages:
  74 +            del p[0]
  75 +        bare = u'/'.join(p)
  76 +
  77 +        # Setup a list of pages to check for
  78 +        names = {bare: 'English'}
  79 +        for lang in i18n.wikiLanguages():
  80 +            lang_module = 'MoinMoin.i18n.%s' % i18n.filename(lang)
  81 +            meta = pysupport.importName(lang_module, "meta") 
  82 +            names[lang + '/' + bare] = meta['language'].decode('utf-8')
  83 +        del names[org]
  84 +
  85 +        # Check for other translations now
  86 +        item = u'<li class="wikilink">%s</li>'
  87 +        items = []
  88 +        for n in names:
  89 +            translation = Page(self.request, n)
  90 +            if translation.exists():
  91 +                link = translation.link_to(self.request, names[n])
  92 +                items.append(item % link)
  93 +
  94 +        if items:
  95 +            # Assemble html
  96 +            items = u''.join(items)
  97 +            html = u'<ul id="langbar">%s</ul>' % items
  98 +            return html
  99 +        else:
 100 +            return u''
 101 +
 102      def editorheader(self, d, **kw):
 103          """ Assemble wiki header for editor
 104          

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2007-04-05 22:30:23, 2.7 KB) [[attachment:modern.patch]]
  • [get | view] (2007-04-11 04:59:29, 4.2 KB) [[attachment:modern_v2.patch]]
  • [get | view] (2010-10-13 05:21:50, 2.9 KB) [[attachment:simpler.patch]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.