Commits

Thomas Waldmann committed 089f0f9 Merge

merged default into gae branch

Comments (0)

Files changed (13)

MoinMoin/items/ticket.py

         super(TicketUpdateForm, self)._load(item)
         self['submit'].properties['labels'] = {
             'update': L_('Update ticket'),
-            'update_negate_status':
-                L_('Update & reopen ticket') if item.meta.get('closed') else
-                L_('Update & close ticket')
+            'update_negate_status': (L_('Update & reopen ticket') if item.meta.get('closed')
+                                     else L_('Update & close ticket'))
         }
 
     def _dump(self, item):

MoinMoin/script/migration/moin19/import19.py

 
 from MoinMoin.constants.keys import *
 from MoinMoin.constants.contenttypes import CONTENTTYPE_USER
+from MoinMoin.constants.namespaces import NAMESPACE_DEFAULT, NAMESPACE_USERPROFILES
 
 UID_OLD = 'old_user_id'  # dynamic field *_id, so we don't have to change schema
 
             # handle deleted revisions (for all revnos with 0<=revno<=current) here
             # we prepare some values for the case we don't find a better value in edit-log:
             meta = {MTIME: -1,  # fake, will get 0 in the end
-                    NAME: item_name,  # will get overwritten with name from edit-log
-                                      # if we have an entry there
+                    NAME: [item_name],  # will get overwritten with name from edit-log
+                                        # if we have an entry there
                    }
             try:
                 revpath = os.path.join(item.path, 'revisions', '{0:08d}'.format(revno - 1))
             except KeyError:
                 if 1 <= revno <= item.current:
                     editlog_data = {  # make something up
-                        NAME: item.name,
+                        NAME: [item.name],
                         MTIME: int(os.path.getmtime(path)),
                         ACTION: u'SAVE',
                     }
         meta[SIZE] = size
         meta[ITEMID] = itemid
         meta[REVID] = make_uuid()
+        meta[NAMESPACE] = NAMESPACE_DEFAULT
         self.meta = {}
         for k, v in meta.iteritems():
             if isinstance(v, list):
                 MTIME: int(os.path.getmtime(attpath)),
                 ACTION: u'SAVE',
             }
-        meta[NAME] = u'{0}/{1}'.format(item_name, attach_name)
+        meta[NAME] = [u'{0}/{1}'.format(item_name, attach_name)]
         if acl is not None:
             meta[ACL] = acl
         meta[CONTENTTYPE] = unicode(MimeType(filename=attach_name).content_type())
         # do some conversions/cleanups/fallbacks:
         result[MTIME] = int(long(result[MTIME] or 0) / 1000000)  # convert usecs to secs
         result['__rev'] = int(result['__rev']) - 1  # old storage is 1-based, we want 0-based
-        result[NAME] = unquoteWikiname(result[NAME])
+        result[NAME] = [unquoteWikiname(result[NAME])]
         action = result[ACTION]
         extra = result[EXTRA]
         if extra:
         for key, default in int_defaults:
             metadata[key] = int(metadata.get(key, default))
 
+        metadata[NAMESPACE] = NAMESPACE_USERPROFILES
+        metadata[NAME] = [metadata[NAME]]
+
         # rename last_saved to MTIME, int MTIME should be enough:
         metadata[MTIME] = int(float(metadata.get('last_saved', '0')))
 

MoinMoin/templates/base.html

 {%- set head = snippets.head() %}
 {%- set scripts = snippets.scripts() %}
 {%- set stylesheets = snippets.stylesheets() %}
+
+{# This allows child templates passing their header_search macro to the common layout (eg blog).
+   If there is no header_search macro defined in child templates use the default one. #}
+{% if not header_search %}
+    {% from "utils.html" import header_search %}
+{% endif %}
+
 <html>
 <head>
 {% block head %}

MoinMoin/templates/blog/utils.html

 
 {% macro header_search(blog_name, form) %}
     {{ gen.form.open(form, id='moin-searchform', method='get', action=url_for('frontend.search')) }}
-        <div>
             {{ forms.render(form['q']) }}
             {{ forms.render_submit(form, id='moin-search-submit') }}
             {{ forms.render_errors(form) }}
             <input type="checkbox" id="moin-blog-search-this"
             onclick="$('#moin-searchform').attr('action', this.checked ? '{{ url_for('frontend.search', item_name=blog_name) }}' : '{{ url_for('frontend.search') }}' );" />
             {{ _("only this blog") }}
-        </div>
     {{ gen.form.close() }}
 {% endmacro %}

MoinMoin/templates/layout.html

 {% set creditlogos = snippets.creditlogos() %}
 {% set credits = snippets.credits() %}
 
-
-{# This allows child templates passing their header_search macro to the common layout.
-   If there is no header_search macro defined in child templates use the default one. #}
-{% if not header_search %}
-    {% from "utils.html" import header_search %}
-{% endif %}
-
 {% block layout %}
 
 <div id="moin-main-wrapper">

MoinMoin/templates/utils.html

 
 {% macro header_search(form) %}
     {{ gen.form.open(form, id='moin-searchform', method='get', action=url_for('frontend.search')) }}
-        <div>
             {{ forms.render(form['q']) }}
             {{ forms.render_submit(form, id='moin-search-submit') }}
             {{ forms.render_errors(form) }}
-        </div>
     {{ gen.form.close() }}
 {% endmacro %}

MoinMoin/themes/__init__.py

         """
         current = item_name
         # Process config navi_bar
-        items = [(cls, url_for(endpoint, **args), link_text, title)
-                 for cls, endpoint, args, link_text, title in self.cfg.navi_bar]
+        items = []
+        for cls, endpoint, args, link_text, title in self.cfg.navi_bar:
+            if endpoint == "frontend.show_root":
+                endpoint = "frontend.show_item"
+                args['item_name'] = app.cfg.item_root
+            items.append((cls, url_for(endpoint, **args), link_text, title))
 
         # Add user links to wiki links.
         for text in self.user.quicklinks:

MoinMoin/themes/foobar/static/css/common.css

 #moin-global-tray{float:left;width:16.666666666666668%;padding:.5%;overflow:hidden}
 #moin-main-container{float:left;width:81.13333333333333%;padding:.5%}
 #moin-main-box{background-color:#f4f4f4;border:1px solid #ccc;border-radius:6px;box-shadow:2px 2px 4px #9d9d9b;overflow:hidden}
-#moin-header{background-color:#2d2d2d;color:#fff;border-bottom:1px solid #ccc;padding:.2% .5%;overflow:auto;}
+#moin-header{background-color:#2d2d2d;color:#fff;border-bottom:1px solid #ccc;padding:0;overflow:auto;}
 #moin-header a{color:#fff}
 #moin-content-no-panel{float:left;width:98.56746096959736%;padding:.6162695152013148%;border-right:1px solid #ccc}
 #moin-content{float:left;width:76.79260476581759%;padding:.6162695152013148%;border-right:1px solid #ccc}
 #moin-interwiki a{vertical-align:middle}
 #moin-pagelocation{vertical-align:middle}
 .moin-pagepath{vertical-align:middle}
-#moin-search{float:right;padding:.3em .5em .2em .5em}
-#moin-search-submit{vertical-align:middle}
 #moin-logo{width:100%;padding:0 0 1em 0;}
 #moin-logo a{display:block;width:100%;height:70px;background-repeat:no-repeat;background-position:center center}
 #moin-global-panel ul,#moin-local-panel ul{list-style-type:none;margin:0;}
 .moin-flash-warning{background-image:url("../img/smileys/alert.png");color:#ff2727}
 .moin-flash-error{background-image:url("../img/smileys/icon-error.png");color:#ff2727}
 .moin-error{color:#ff2727;background:#d6d5d0;padding:4px;margin:1em;text-align:center;list-style-type:none;border-radius:5px}
-#moin-searchform{padding:0;font-size:.82em;float:right;text-align:right;}
-#moin-searchform input{font-size:1em;vertical-align:middle;background-color:#f4f4f4;border:1px solid #ccc}
-#moin-searchform button{box-shadow:none}
-#moin-searchform #moin-search-submit{text-indent:-9000%;margin-left:-24px;padding:0;width:20px;height:16px;background:url("../img/moin-search.png") center center no-repeat;background-size:16px 16px;border:none;overflow:hidden;vertical-align:middle;cursor:pointer}
-#moin-searchform #moin-search-query{padding-right:20px}
-#moin-searchform div{margin:0}
+#moin-searchform{margin:7px 12px 0 0;font-size:.82em;text-align:right;float:right;padding:0;width:15em;}
+#moin-searchform input{font-size:1em;vertical-align:middle;background-color:#f4f4f4;border:0;box-shadow:none}
+#moin-search-submit{text-indent:-9000%;margin-left:-24px;padding:0;width:20px;height:16px;background:url("../img/moin-search.png") center center no-repeat;background-size:16px 16px;border:none;overflow:hidden;vertical-align:middle;cursor:pointer}
+#moin-search-query{padding-right:20px}
 #moin-long-searchform{padding:0;font-size:.82em;text-align:left;}
 #moin-long-searchform div{margin:0}
 #moin-long-searchform label{display:inline}
-#moin-search-query{width:50%}
 .searchresults dt{margin-top:1em;font-weight:normal}
 .searchresults dd,.searchresults p{font-size:.85em}
 .searchresults td{border-width:0}
 .moin-big{font-size:1.17em}
 .moin-small{font-size:.83em}
 .moin-integer{text-align:right;padding-right:1em;width:2%}
-@media print{#moin-global-tray,#moin-local-panel,#moin-footer,#moin-search{display:none}
+@media print{#moin-global-tray,#moin-local-panel,#moin-footer,#moin-searchform{display:none}
 }

MoinMoin/themes/foobar/static/css/stylus/main.styl

     background-color header_bg_color
     color heading_color
     border-bottom border_style
-    padding 0.2% 0.5%
+    padding 0
     overflow auto
     a
         color heading_color
 .moin-pagepath
     vertical-align middle
 
-#moin-search
-    float opposite-position(dir)
-    padding 0.3em 0.5em 0.2em 0.5em
-
-#moin-search-submit
-    vertical-align middle
-
 // panels, footer
 #moin-logo
     width 100%
 
 // search
 #moin-searchform
+    margin 7px 12px 0px 0px
+    font-size 0.82em
+    text-align right
+    float opposite-position(dir)
     padding 0
-    font-size 0.82em
-    float right
-    text-align right
+    width 15em
     input
         font-size 1em
         vertical-align middle
         background-color page_color
-        border border_style
-    button
+        border 0
         box-shadow none
 
-#moin-searchform #moin-search-submit
+#moin-search-submit
     text-indent -9000%
     margin-left -24px
     padding 0px
     vertical-align middle
     cursor pointer
 
-#moin-searchform #moin-search-query
+#moin-search-query
     padding-right 20px
 
-#moin-searchform div
-    margin 0
 
 #moin-long-searchform
     padding 0
     label
         display inline
 
-#moin-search-query
-    width 50%
-
 .searchresults
     dt
         margin-top 1em
     #moin-global-tray
     #moin-local-panel
     #moin-footer
-    #moin-search
+    #moin-searchform
         display none

MoinMoin/themes/foobar/templates/blog/layout.html

     {% set supertags = blog_item.meta['supertags'] %}
 {% endif %}
 
+{% if blog_name %}
+    {% macro header_search(form) %}
+        {{ blog_utils.header_search(blog_name, form) }}
+    {% endmacro %}
+{% endif %}
+
 {% block theme_stylesheets %}
     {{ super() }}
     <link media="all" rel="stylesheet" href="{{ theme_static('css/blog.css') }}" />

MoinMoin/themes/foobar/templates/layout.html

 {% set footer_items = '' %}
 {% set credits = snippets.credits() %}
 
-
 {% block layout %}
 
 <div id="moin-global-tray">
 <div id="moin-main-container">
 <div id="moin-main-box">
 <div id="moin-header">
+
     {% if search_form %}
-    <div id="moin-search">
-    {{ gen.form.open(search_form, id='moin-searchform', method='get', action=url_for('frontend.search')) }}
-        {{ gen.input(search_form['q'], type='search', id='moin-search-query', size='40') }}
-        {{ forms.render_submit(search_form, id='moin-search-submit') }}
-        {{ forms.render_errors(search_form) }}
-    {{ gen.form.close() }}
-    </div>
+        {{ header_search(search_form) }}
     {% endif %}
+
     <div id="moin-breadcrumbs-location">
         {% if cfg.show_interwiki -%}
         <span id="moin-interwiki">

MoinMoin/themes/modernized/static/css/common.css

 a.moin-nonexistent:hover{color:#1f9ae0;text-decoration:underline}
 .current-link{color:inherit !important}
 #moin-header{margin:0;padding:7px 0 10px 0;background:#708090;color:#fff;line-height:1.12em;border-bottom-left-radius:9px;border-bottom-right-radius:9px}
-#moin-searchform{margin:8px .5em;padding:0;font-size:.82em;float:right;text-align:right;width:15em}
-#moin-searchform input{font-size:100%;vertical-align:middle;background-color:#fff;border:1px solid #4e7da9}
-#moin-searchform #moin-search-submit{text-indent:-9000%;margin-left:-26px;width:20px;height:16px;background:url("../img/moin-search.png") center center no-repeat;background-size:16px 16px;border:none;overflow:hidden;vertical-align:middle;cursor:pointer;padding:0;box-shadow:none}
-#moin-searchform #moin-search-query{padding-right:20px}
-#moin-searchform div{margin:-6px 5px 0 0}
+#moin-searchform{margin:2px 12px 0 0;padding:0;font-size:.82em;float:right;text-align:right;width:15em}
+#moin-search-submit{text-indent:-9000%;margin-left:-26px;width:20px;height:16px;background:url("../img/moin-search.png") center center no-repeat;background-size:16px 16px;border:none;overflow:hidden;vertical-align:middle;cursor:pointer;padding:0;box-shadow:none}
+#moin-search-query{padding-right:20px;font-size:100%;vertical-align:middle;background-color:#fff;border:1px solid #4e7da9}
 #moin-long-searchform{padding:0;font-size:.82em;text-align:left}
 #moin-long-searchform div{margin:0}
 #moin-search-query{width:50%}

MoinMoin/themes/modernized/static/css/stylus/main.styl

     border-bottom-right-radius 9px
 
 #moin-searchform
-    margin 8px .5em
+    margin 2px 12px 0px 0px
     padding 0
     font-size 0.82em
     float right
     text-align right
     width 15em
 
-#moin-searchform input
-    font-size 100%
-    vertical-align middle
-    background-color page_color
-    border border_style
-
-#moin-searchform #moin-search-submit
+#moin-search-submit
     text-indent -9000%
     margin-left -26px
     width 20px
     padding 0px
     box-shadow none
 
-#moin-searchform #moin-search-query
+#moin-search-query
     padding-right 20px
+    font-size 100%
+    vertical-align middle
+    background-color page_color
+    border border_style
 
-#moin-searchform div
-    margin -6px 5px 0px 0px
 
 #moin-long-searchform
     padding 0