changeset 2950:70d81ebcf2c5

merge
author RogerHaase <haaserd@gmail.com>
date Sat, 13 Jun 2015 15:00:29 -0700
parents 65fe46bad988 (diff) ccad02fc9281 (current diff)
children e85b62acee29
files setup.py
diffstat 17 files changed, 98 insertions(+), 217 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/html_in.py	Wed Jun 10 01:23:47 2015 +0200
+++ b/MoinMoin/converter/html_in.py	Sat Jun 13 15:00:29 2015 -0700
@@ -558,6 +558,10 @@
             attrib[moin_page('number-columns-spanned')] = colspan
         return self.new_copy(moin_page.table_cell, element, attrib=attrib)
 
+    def visit_xhtml_th(self, element):
+        """html_out does not support th tags, so we do td tags like all other converters."""
+        return self.visit_xhtml_td(element)
+
 
 from . import default_registry
 from MoinMoin.util.mime import Type, type_moin_document
--- a/MoinMoin/static/css/common.css	Wed Jun 10 01:23:47 2015 +0200
+++ b/MoinMoin/static/css/common.css	Sat Jun 13 15:00:29 2015 -0700
@@ -347,7 +347,8 @@
 .moin-tabs .moin-tab-titles a{ color: #00008b; }
 .moin-tab-titles{ margin: 0; padding: -10px 0 0; list-style: none; border-bottom: 3px solid #4e7da9; }
 .moin-tab-titles li { display: inline-block; *display: inline; zoom: 1; margin: 10px 0 -3px; padding: 0 5px; border-bottom: 3px solid #4e7da9; }
-.moin-tab-titles a { display: inline-block; padding: 4px; background-color: #eef1f6; border-width: 1px 1px 0; border-style: solid; border-color: #4e7da9; color: #00008b; border-top-left-radius: 7px; border-top-right-radius: 7px; }
+.moin-tab-titles a { display: inline-block; padding: 4px; background-color: #eef1f6; border-width: 1px 1px 0; border-style: solid;
+    border-color: #4e7da9; color: #00008b; border-top-left-radius: 7px; border-top-right-radius: 7px; }
 .moin-tab-titles a: hover { background-color: #d8dfe9; text-decoration: none; }
 .moin-tab-titles a.moin-current-tab { background: #d8dfe9; padding-top: 8px; margin-top: -4px; }
 .moin-tab-titles .moin-change-indicator { font-weight: bold; color: #1f9ae0; }
@@ -367,3 +368,16 @@
 #options dt { width: 60%; max-width: 40em; }
 #subscriptions textarea { width: 80%; max-width: 40em; margin-bottom: 1em; }
 #subscriptions div.tip { width: 80%; max-width: 40em; margin: auto; }
+
+/* Global history */
+
+#moin-global-history { font-size: 75%; width: 100%; }
+.moin-history-day-banner { background: #00417f; color: #fff; }
+.moin-history-day-banner a.moin-bookmark-link { margin-left: 20px; color: #fff; }
+.moin-history-date { font-size: 125%; font-weight: bold; }
+.moin-history-time { text-align: right; }
+.moin-history-comment { min-width: 30%; }
+.moin-history-action { width: .5em; cursor: default; }
+.moin-history-action a: hover { text-decoration: none; }
+.moin-history-links { width: .5em; }
+.moin-history-end-of-day { border: 0; border-top: 2px solid #4e7da9; }
--- a/MoinMoin/templates/base.html	Wed Jun 10 01:23:47 2015 +0200
+++ b/MoinMoin/templates/base.html	Sat Jun 13 15:00:29 2015 -0700
@@ -15,6 +15,7 @@
         {% block head %}
             {% block head_meta %}
                 <meta charset="utf-8" />{# must be at the beginning #}
+                <meta name="viewport" content="width=device-width, initial-scale=1" />
                 {% if pi_refresh -%}
                     {{ '<meta http-equiv="refresh" content="%d;URL=%s" />' % pi_refresh }}
                 {%- endif %}
--- a/MoinMoin/templates/global_history.html	Wed Jun 10 01:23:47 2015 +0200
+++ b/MoinMoin/templates/global_history.html	Sat Jun 13 15:00:29 2015 -0700
@@ -17,55 +17,63 @@
 {% block content %}
     <h1>{{ _("Global History") }}</h1>
     <div class='moin-clr'></div>
-    <div id="moin-global-history">
-        {% for day, revs in history %}
-           {% set latest_timestamp = revs[0].meta['mtime'] %}
-            <div class="moin-history-container">
-                <div class="moin-history-container-header">
-                    <h2>{{ day }}</h2>
-                    {% if user.valid %}
-                        <a class="bookmark-link btn btn-primary" href="{{ url_for('frontend.bookmark', time=latest_timestamp+1) }}">{{ _("Set bookmark") }}</a>
-                    {% endif %}
-                </div>
-                <div class="moin-history-container-body">
-                    <table class="zebra table table-hover">
-                        {% for rev in revs %}
-                            {% set meta = rev.meta %}
-                            <tr>
-                                <td class="moin-action col-md-1">
-                                    <span title="{{ meta.action|title }}" class="{{ awesome_class[meta.action] }}"></span>
-                                </td>
-                                <td class="moin-history-links col-md-1">
-                                    <a href="{{ url_for('frontend.history', item_name=rev.fqname, bookmark=bookmark_time) }}">HIST</a>
-                                    {% if bookmark_time -%}
-                                        <a href="{{ url_for('frontend.diff', item_name=rev.fqname, bookmark=bookmark_time) }}">DIFF</a>
-                                    {%- endif %}
-                                </td>
-                                <td class="moin-history-time col-md-1">{{ meta.mtime|timeformat }}</td>
-                                <td class="moin-history-item col-md-7">
-                                    <a class="{{ meta.contenttype|contenttype_to_class }}" href="{{ url_for('frontend.show_item', item_name=rev.fqname) }}" title="{{ meta.contenttype }}">
-                                        {% if meta.name %}
-                                            {{ meta.name|join(' | ') }}
-                                        {% elif meta.summary %}
-                                            {{ meta.summary }}
-                                        {% else %}
-                                            {{ rev.fqname|shorten_fqname }}
-                                        {% endif %}
-                                    </a>
-                                </td>
-                            </tr>
-                        {% endfor %}
-                    </table>
-                </div>
-            </div>
-        {% endfor %}
-        {% if bookmark_time %}
-            <div class="moin-history-container">
-                <div class="moin-history-container-header">
-                    <h2>{{ bookmark_time|datetimeformat }}</h2>
-                    <a class="bookmark-link btn btn-danger" href="{{ url_for('frontend.bookmark', time='del') }}">{{ _("Delete bookmark") }}</a>
-                </div>
-            </div>
-        {% endif %}
-    </div>
+        <table id="moin-global-history">
+            {% for day, revs in history %}
+                {% set latest_timestamp = revs[0].meta['mtime'] %}
+                <tr class="moin-history-day-banner">
+                    <td colspan="7">
+                        <span class="moin-history-date">{{ day }}</span>
+                        {% if user.valid %}
+                            <a class="moin-bookmark-link" href="{{ url_for('frontend.bookmark', time=latest_timestamp+1) }}">{{ _("Set bookmark") }}</a>
+                        {% endif %}
+                    </td>
+                </tr>
+                {% for rev in revs|sort(attribute='fqname') %}
+                    {% set meta = rev.meta %}
+                    <tr>
+                        <td class="moin-history-item moin-wordbreak">
+                            <a class="{{ meta.contenttype|contenttype_to_class }}" href="{{ url_for('frontend.show_item', item_name=rev.fqname) }}"
+                                    title="{{ meta.contenttype|shorten_ctype }}">
+                                {% if meta.name %}
+                                    {{ meta.name|join(' | ') }}
+                                {% elif meta.summary %}
+                                    {{ meta.summary }}
+                                {% else %}
+                                    {{ rev.fqname|shorten_fqname }}
+                                {% endif %}
+                            </a>
+                        </td>
+                        <td class="moin-wordbreak moin-history-editorinfo">{{ utils.editor_info(rev.meta) }}</td>
+                        <td class="moin-history-time">{{ meta.mtime|time_hh_mm }}</td>
+                        <td class="moin-history-action">
+                            <span title="{{ _("Last action: ") + meta.action|title }}" class="{{ awesome_class[meta.action] }}"></span>
+                        </td>
+                        <td class="moin-history-links">
+                            <a href="{{ url_for('frontend.history', item_name=rev.fqname, bookmark=bookmark_time) }}">
+                                <span class="fa fa-clock-o" title="{{ _('History') }}"></span>
+                            </a>
+                        </td>
+                        {% if bookmark_time -%}
+                            <td class="moin-history-links">
+                                <a href="{{ url_for('frontend.diff', item_name=rev.fqname, bookmark=bookmark_time) }}">
+                                    <span class="fa fa-copy" title="{{ _('Diff') }}"></span>
+                                </a>
+                            </td>
+                        {%- endif %}
+                        <td class="moin-wordbreak moin-history-comment">{{ rev.meta['comment'] }}</td>
+                    </tr>
+                {% endfor %}
+                <tr>
+                    <td class="moin-history-end-of-day" colspan="7">&nbsp;</td>
+                </tr>
+            {% endfor %}
+            {% if bookmark_time %}
+                <tr class="moin-history-container">
+                    <td class="moin-history-day-banner" colspan="7">
+                        <span class="moin-history-date">{{ bookmark_time|datetimeformat }}</span>
+                        <a class="moin-bookmark-link" href="{{ url_for('frontend.bookmark', time='del') }}">{{ _("Delete bookmark") }}</a>
+                    </td>
+                </tr>
+            {% endif %}
+        </table>
 {% endblock %}
--- a/MoinMoin/templates/login.html	Wed Jun 10 01:23:47 2015 +0200
+++ b/MoinMoin/templates/login.html	Sat Jun 13 15:00:29 2015 -0700
@@ -29,7 +29,7 @@
                 <dl>
                     {{ forms.render(form['openid']) }}
                 </dl>
-                {{ forms.render(form['submit']) }}
+                {{ forms.render(form['submit'], id='openid_login_submit') }}
                 {{ forms.render_submit(form) }}
             {{ gen.form.close() }}
         {% endif %}
--- a/MoinMoin/templates/modify.html	Wed Jun 10 01:23:47 2015 +0200
+++ b/MoinMoin/templates/modify.html	Sat Jun 13 15:00:29 2015 -0700
@@ -32,7 +32,7 @@
     <h1>{{ title }}</h1>
     <div id="moin-modify" class="moin-form">
         <a class="btn btn-success" style="float: right" href="{{ url_for('.download_item', item_name=item_name, mimetype='application/x.moin.download') }}">
-        <span class="fa fa-download"></span> {{ _('Download') }}
+            <span class="fa fa-download"></span> {{ _('Download') }}
         </a>
         {{ gen.form.open(form, method='post', enctype='multipart/form-data') }}
             {{ forms.render_errors(form) }}
--- a/MoinMoin/themes/__init__.py	Wed Jun 10 01:23:47 2015 +0200
+++ b/MoinMoin/themes/__init__.py	Sat Jun 13 15:00:29 2015 -0700
@@ -9,6 +9,7 @@
 
 
 import urllib
+import datetime
 
 from json import dumps
 
@@ -651,6 +652,14 @@
     return CONTENTTYPES_MAP.get(contenttype, "Unknown")
 
 
+def time_hh_mm(dt):
+    """
+    Convert a datetime object into a short string of the form HH:MM
+    where HH varies from 0 to 23.
+    """
+    return datetime.datetime.fromtimestamp(dt).strftime('%H:%M')
+
+
 def setup_jinja_env():
     app.jinja_env.filters['shorten_fqname'] = shorten_fqname
     app.jinja_env.filters['shorten_item_name'] = shorten_item_name
@@ -658,6 +667,7 @@
     app.jinja_env.filters['contenttype_to_class'] = contenttype_to_class
     app.jinja_env.filters['json_dumps'] = dumps
     app.jinja_env.filters['shorten_ctype'] = shorten_ctype
+    app.jinja_env.filters['time_hh_mm'] = time_hh_mm
     # please note that these filters are installed by flask-babel:
     # datetimeformat, dateformat, timeformat, timedeltaformat
 
--- a/MoinMoin/themes/basic/static/css/theme.css	Wed Jun 10 01:23:47 2015 +0200
+++ b/MoinMoin/themes/basic/static/css/theme.css	Sat Jun 13 15:00:29 2015 -0700
@@ -6795,18 +6795,6 @@
 #editor > textarea {
   width: 100%;
 }
-.moin-history-container-header {
-  margin-bottom: 5px;
-}
-.moin-history-container-header > h2 {
-  display: inline;
-}
-.moin-history-container-header > .bookmark-link {
-  margin-bottom: 15px;
-  margin-left: 20px;
-  height: 2em;
-  line-height: 1em;
-}
 img {
   vertical-align: bottom;
 }
--- a/MoinMoin/themes/basic/static/custom-less/theme.less	Wed Jun 10 01:23:47 2015 +0200
+++ b/MoinMoin/themes/basic/static/custom-less/theme.less	Sat Jun 13 15:00:29 2015 -0700
@@ -378,18 +378,6 @@
 #editor > textarea {
   width: 100%;
 }
-.moin-history-container-header {
-  margin-bottom: 5px;
-  > h2 {
-    display: inline;
-  }
-  > .bookmark-link {
-    margin-bottom: 15px;
-    margin-left: 20px;
-    height: 2em;
-    line-height: 1em;
-  }
-}
 
 img {
   vertical-align: bottom;  // moin std is bottom, bootstrap sets to middle
--- a/MoinMoin/themes/basic/templates/layout.html	Wed Jun 10 01:23:47 2015 +0200
+++ b/MoinMoin/themes/basic/templates/layout.html	Sat Jun 13 15:00:29 2015 -0700
@@ -67,12 +67,6 @@
     </div>
 {% endmacro %}
 
-
-{% block head_meta %}
-    {{ super() }}
-    <meta name="viewport" content="width=device-width, initial-scale=1">
-{% endblock %}
-
 {% block layout %}
     <div class="container-fluid">
         <div id="moin-main-wrapper" class="row">
--- a/MoinMoin/themes/basic/templates/login.html	Wed Jun 10 01:23:47 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-{% extends theme("layout.html") %}
-{% import "forms.html" as forms %}
-
-{% block content %}
-    <h2>{{ _('Moin Login') }}</h2>
-    <div class="row">
-        <div class="col-md-4">
-            {{ forms.render_errors(form) }}
-
-            {% if 'username' in login_inputs or 'password' in login_inputs %}
-                {{ gen.form.open(form, method="post", action=url_for('frontend.login', next=request.args.get('next'))) }}
-
-                    {% if 'username' in login_inputs %}
-                        <div class="form-group">
-                            {{ gen.label(form['username']) }}
-                            {{ gen.input(form['username'], type="text", class="form-control") }}
-                        </div>
-                    {% endif %}
-                    {% if 'password' in login_inputs %}
-                        <div class="form-group">
-                            {{ gen.label(form['password']) }}
-                            {{ gen.input(form['password'], type="password", class="form-control") }}
-                        </div>
-                    {% endif %}
-
-                    {{ forms.render(form['submit']) }}
-
-                    <div class="form-group">
-                        {{ forms.render_submit(form, class='btn btn-primary') }}
-                    </div>
-                {{ gen.form.close() }}
-            {% endif %}
-
-            {% if 'openid' in login_inputs %}
-                <h2>{{ _('OpenID Login') }}</h2>
-
-                {{ gen.form.open(form, method="post", action=url_for('frontend.login')) }}
-
-                    {{ forms.render(form['openid']) }}
-
-                    {{ forms.render(form['submit']) }}
-                    <div class="form-group">
-                        {{ forms.render_submit(form, class='btn btn-primary') }}
-                    </div>
-                {{ gen.form.close() }}
-            {% endif %}
-
-        </div>
-    </div>
-{% endblock %}
--- a/MoinMoin/themes/basic/templates/modify.html	Wed Jun 10 01:23:47 2015 +0200
+++ b/MoinMoin/themes/basic/templates/modify.html	Sat Jun 13 15:00:29 2015 -0700
@@ -27,7 +27,7 @@
     <h1>{{ title }}</h1>
     <div id="moin-modify" class="moin-form">
         <a class="btn btn-success" style="float: right" href="{{ url_for('.download_item', item_name=item_name, mimetype='application/x.moin.download') }}">
-        <span class="fa fa-download"></span> {{ _('Download') }}
+            <span class="fa fa-download"></span> {{ _('Download') }}
         </a>
         {{ gen.form.open(form, method='post', enctype='multipart/form-data') }}
             {{ forms.render_errors(form) }}
--- a/MoinMoin/themes/modernized/static/css/stylus/theme.styl	Wed Jun 10 01:23:47 2015 +0200
+++ b/MoinMoin/themes/modernized/static/css/stylus/theme.styl	Sat Jun 13 15:00:29 2015 -0700
@@ -251,7 +251,7 @@
 .moin-hist-rev
     margin 0
 
-#moin-global-history,
+
 #moin-page-history
     font-size 75%
 
@@ -272,68 +272,7 @@
                         &:hover
                             box-shadow 1px 1px 2px font_color
 
-.moin-history-time
-    width 10%
-    text-align right
-
-.moin-history-contenttype
-    width 18%
-
-.moin-history-editorinfo
-    width 17%
-
-.moin-history-comment
-    width 30%
-
-.moin-action
-    width 2%
-
-.moin-action a:hover
-    text-decoration none
-
-.moin-history-container
-    border border_style
-    margin 2em 2em
-    border-top-left-radius 5px
-    border-top-right-radius 5px
 
-.moin-history-container-header
-    background header_bg_color
-    margin 0px
-    padding 4px
-    color heading_color
-    border-bottom border_style
-    border-top-left-radius 5px
-    border-top-right-radius 5px
-    h2
-        display inline
-        border none
-    a.bookmark-link
-        margin-left 10px
-        color heading_color
-
-.moin-history-container-body
-    margin 0
-    padding 0
-    font-size 1.2em
-    table
-        margin 0
-        border none
-        width 100%
-
-.moin-history-links
-    width 5%
-
-.moin-history-links a
-    display block
-    margin-bottom 4px
-
-.moin-history-editortext,
-.moin-history-links span,
-.moin-history-comment span
-    color font_color
-    display block
-    margin-bottom 5px
 
 .moin-offset-links
     float right
--- a/MoinMoin/themes/modernized/static/css/theme.css	Wed Jun 10 01:23:47 2015 +0200
+++ b/MoinMoin/themes/modernized/static/css/theme.css	Sat Jun 13 15:00:29 2015 -0700
@@ -342,27 +342,12 @@
 #preview{border:1px solid #4e7da9;padding:10px 30px 20px 30px;background:url("../img/draft.png");margin-top:.5em}
 .moin-hist-rev input{float:left}
 .moin-hist-rev{margin:0}
-#moin-global-history,#moin-page-history{font-size:75%}
+#moin-page-history{font-size:75%}
 #moin-page-history table{border:1px solid #4e7da9;border-radius:5px;}
 #moin-page-history table thead{border-top-left-radius:5px;border-top-right-radius:5px;}
 #moin-page-history table thead tr th{text-align:center;}
 #moin-page-history table thead tr th input[type="Submit"]{padding:4px 10px;box-shadow:1px 1px 2px #9d9d9b;cursor:pointer;font-size:1em;}
 #moin-page-history table thead tr th input[type="Submit"]:hover{box-shadow:1px 1px 2px #000}
-.moin-history-time{width:10%;text-align:right}
-.moin-history-contenttype{width:18%}
-.moin-history-editorinfo{width:17%}
-.moin-history-comment{width:30%}
-.moin-action{width:2%}
-.moin-action a:hover{text-decoration:none}
-.moin-history-container{border:1px solid #4e7da9;margin:2em 2em;border-top-left-radius:5px;border-top-right-radius:5px}
-.moin-history-container-header{background:#00417f;margin:0;padding:4px;color:#fff;border-bottom:1px solid #4e7da9;border-top-left-radius:5px;border-top-right-radius:5px;}
-.moin-history-container-header h2{display:inline;border:none}
-.moin-history-container-header a.bookmark-link{margin-left:10px;color:#fff}
-.moin-history-container-body{margin:0;padding:0;font-size:1.2em;}
-.moin-history-container-body table{margin:0;border:none;width:100%}
-.moin-history-links{width:5%}
-.moin-history-links a{display:block;margin-bottom:4px}
-.moin-history-editortext,.moin-history-links span,.moin-history-comment span{color:#000;display:block;margin-bottom:5px}
 .moin-offset-links{float:right;margin-right:20px}
 .moin-offset-links a{margin-right:10px;padding:3px 7px;font-size:20px;background:#fff;border:1px groove #4e7da9;border-radius:5px}
 .moin-offset-links a:hover{box-shadow:0 0 12px #9d9d9b}
--- a/docs/_static/custom.css	Wed Jun 10 01:23:47 2015 +0200
+++ b/docs/_static/custom.css	Sat Jun 13 15:00:29 2015 -0700
@@ -1,7 +1,7 @@
 /* Custom CSS for Sphinx */
 
 /* Import the default theme's CSS file */
-@import "default.css";
+@import "classic.css";
 
 .bolditalic {
     font-weight: bold;
--- a/docs/conf.py	Wed Jun 10 01:23:47 2015 +0200
+++ b/docs/conf.py	Sat Jun 13 15:00:29 2015 -0700
@@ -45,7 +45,7 @@
 
 # General information about the project.
 project = u'MoinMoin'
-copyright = u'2011-2012, The MoinMoin developers'
+copyright = u'2011-2015, The MoinMoin developers'
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
@@ -96,7 +96,7 @@
 
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
-html_theme = 'default'
+html_theme = 'classic'
 
 # The style sheet to use for HTML pages. A file of that name must exist either
 # in Sphinx’ static/ path, or in one of the custom paths given in
--- a/setup.py	Wed Jun 10 01:23:47 2015 +0200
+++ b/setup.py	Sat Jun 13 15:00:29 2015 -0700
@@ -90,7 +90,7 @@
         'flatland',  # form handling
         'Jinja2>=2.7',  # template engine
         'pygments>=1.4',  # src code / text file highlighting
-        'Werkzeug==0.9.6',  # wsgi toolkit
+        'Werkzeug>=0.10.4',  # wsgi toolkit
         'pytest<2.7',  # pytest is needed by unit tests (only tested with 2.5 and 2.6)
         'pytest-pep8<1.1',  # coding style checker (only tested with 1.0.x)
         'whoosh>=2.5.0',  # needed for indexed search