changeset 2779:c227de3a4096

merge
author RogerHaase <haaserd@gmail.com>
date Fri, 05 Sep 2014 10:22:20 -0700
parents 9c036e6c2265 (current diff) 239e3b34c6b4 (diff)
children 49184fa45ed7
files MoinMoin/static/js/common.js
diffstat 16 files changed, 119 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/frontend/views.py	Mon Sep 01 21:23:30 2014 -0700
+++ b/MoinMoin/apps/frontend/views.py	Fri Sep 05 10:22:20 2014 -0700
@@ -961,11 +961,19 @@
 
     :returns: a page with all the items the current user has contributed to
     """
+    offset = request.values.get('offset', 0)
+    offset = max(int(offset), 0)
+    if flaskg.user.valid:
+        results_per_page = flaskg.user.results_per_page
+    else:
+        results_per_page = app.cfg.results_per_page
     my_changes = _mychanges(flaskg.user.itemid)
-    return render_template('link_list_no_item_panel.html',
+    my_changes_page = util.getPageContent(my_changes, offset, results_per_page)
+    return render_template('mychanges.html',
                            title_name=_(u'My Changes'),
                            headline=_(u'My Changes'),
-                           fq_names=my_changes
+                           my_changes=my_changes,
+                           my_changes_page=my_changes_page,
     )
 
 
@@ -979,9 +987,14 @@
     """
     q = And([Term(WIKINAME, app.cfg.interwikiname),
              Term(USERID, userid)])
-    revs = flaskg.storage.search(q, idx_name=ALL_REVS, limit=None)
-    fq_names = {fq_name for rev in revs for fq_name in rev.fqnames}
-    return fq_names
+    revs = flaskg.storage.search(q, idx_name=ALL_REVS, sortedby=[MTIME], reverse=True, limit=None)
+    # get rid of the content value to save potentially big amounts of memory:
+    history = []
+    for rev in revs:
+        entry = dict(rev.meta)
+        entry[FQNAME] = rev.fqname
+        history.append(entry)
+    return history
 
 
 @frontend.route('/+refs/<itemname:item_name>')
--- a/MoinMoin/items/__init__.py	Mon Sep 01 21:23:30 2014 -0700
+++ b/MoinMoin/items/__init__.py	Fri Sep 05 10:22:20 2014 -0700
@@ -429,7 +429,7 @@
     def prepare_meta_for_modify(self, meta):
         """
         transform the meta dict of the current revision into a meta dict
-        that can be used for savind next revision (after "modify").
+        that can be used for saving next revision (after "modify").
         """
         meta = dict(meta)
         revid = meta.pop(REVID, None)
@@ -534,7 +534,11 @@
                       suitable as arguments of the same names to pass to
                       item.modify
             """
-            meta = self['meta_form'].value.copy()
+            # Since the metadata form for tickets is an incomplete one, we load the
+            # original meta and update it with those from the metadata editor
+            # e.g. we get PARENTID in here
+            meta = item.meta_filter(item.prepare_meta_for_modify(item.meta))
+            meta.update(self['meta_form'].value)
             meta.update(item.meta_text_to_dict(self['extra_meta_text'].value))
             data, contenttype_guessed = self['content_form']._dump(item.content)
             comment = self['comment'].value
--- a/MoinMoin/static/js/common.js	Mon Sep 01 21:23:30 2014 -0700
+++ b/MoinMoin/static/js/common.js	Fri Sep 05 10:22:20 2014 -0700
@@ -97,7 +97,7 @@
     "use strict";
     var elem, overlayUL, overlayLR, wrapper, wrappers, transclusions, classes,
         rightArrow = '\u2192',
-        mediaTags = ['OBJECT', 'IMG', 'AUDIO', 'VIDEO' ]
+        mediaTags = ['OBJECT', 'IMG', 'AUDIO', 'VIDEO' ];
     // get list of elements to be wrapped; must work in reverse order in case there are nested transclusions
     transclusions = $($('.moin-transclusion').get().reverse());
     transclusions.each(function (index) {
--- a/MoinMoin/static/js/search.js	Mon Sep 01 21:23:30 2014 -0700
+++ b/MoinMoin/static/js/search.js	Fri Sep 05 10:22:20 2014 -0700
@@ -30,7 +30,7 @@
     }
 
     $('#moin-search-query').keyup(function() {
-        var allrev;
+        var allrev, time_sorting;
         var mtime = false;
         var filetypes= '';
         allrev = $('[name="history"]:checked').val() === "all";
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/templates/mychanges.html	Fri Sep 05 10:22:20 2014 -0700
@@ -0,0 +1,59 @@
+{% extends theme("layout.html") %}
+{% import "utils.html" as utils %}
+
+{% block content %}
+    {% set (history, next_offset, previous_offset) = my_changes_page %}
+    {% if my_changes %}
+        <div class='moin-offset-links'>
+            {% if previous_offset >= 0 %}
+                <a href="{{ url_for('frontend.mychanges', offset=previous_offset) }}" title="{{ _("Previous") }}">&laquo;</a>
+            {% endif %}
+            {% if next_offset %}
+                <a href="{{ url_for('frontend.mychanges', offset=next_offset) }}" title="{{ _("Next") }}">&raquo;</a>
+            {% endif %}
+        </div>
+        <h1>{{ _('My Changes') }}</h1>
+        <div class="moin-clr"></div>
+        <div id="moin-page-history">
+            <table class="zebra">
+                <thead>
+                    <tr>
+                        <th>{{ _("Item") }}</th>
+                        <th>{{ _("Rev.") }}</th>
+                        <th>{{ _("Timestamp") }}</th>
+                        <th class="moin-integer">{{ _("Size") }}</th>
+                        <th>{{ _("Diff") }}</th>
+                        <th>{{ _("Content-Type") }}</th>
+                        <th>{{ _("Comment") }}</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    {% for doc in my_changes %}
+                        <tr>
+                            <td class="moin-wordbreak">
+                                {% for name in doc.name %}
+                                    {% if not loop.first %}|{% endif %}
+                                    <a href="{{ url_for_item(name, namespace=doc.fqname.namespace, endpoint='frontend.show_item') }}">{{ name }}</a>
+                                {% endfor %}
+                            </td>
+                            <td>{{ doc.revid|shorten_id }}</td>
+                            <td>{{ doc.mtime|datetimeformat }}</td>
+                            <td class="moin-integer">{{ doc.size }}</td>
+                            <td>
+                                <div class="moin-hist-rev">
+                                    <form action="{{ url_for('frontend.diff', item_name=doc.fqname) }}" method="GET">
+                                        <input type="hidden" name="rev1" value="{{ doc.parentid }}" />
+                                        <input type="hidden" name="rev2" value="{{ doc.revid }}" />
+                                        <input type="submit" class="btn btn-sm btn-primary" value="Diff" />
+                                    </form>
+                                </div>
+                            </td>
+                            <td class="moin-wordbreak">{{ doc.contenttype }}</td>
+                            <td class="moin-wordbreak">{{ doc.comment }}</td>
+                        </tr>
+                    {% endfor %}
+                </tbody>
+            </table>
+        </div>
+    {% endif %}
+{% endblock %}
--- a/MoinMoin/templates/utils.html	Mon Sep 01 21:23:30 2014 -0700
+++ b/MoinMoin/templates/utils.html	Fri Sep 05 10:22:20 2014 -0700
@@ -164,6 +164,7 @@
             {% endif %}
         </li>
         <li class="list-group-item">Namespace: '{{ meta['namespace'] }}'</li>
+        <li class="list-group-item">Parent Revision ID: {{ meta['parentid'] }}</li>
         <li class="list-group-item">Revision ID: {{ meta['revid'] }}</li>
         <li class="list-group-item">SHA1: {{ meta['sha1'] }}</li>
         <li class="list-group-item">Size: {{ meta['size']|filesizeformat }}</li>
@@ -177,6 +178,7 @@
                 (None)
             {% endif %}
         </li>
+        <li class="list-group-item">User ID: {{ meta['userid'] }}</li>
         <li class="list-group-item">Wiki Name: {{ meta['wikiname'] }}</li>
     </ul>
 {% endmacro %}
--- a/docs/admin/backup.rst	Mon Sep 01 21:23:30 2014 -0700
+++ b/docs/admin/backup.rst	Fri Sep 05 10:22:20 2014 -0700
@@ -21,7 +21,8 @@
 * logging configuration, e.g. logging.conf
 * moin deployment script, e.g. moin.wsgi
 * web server configuration, e.g. apache virtualhost config
-* optional: moin code + dependencies; you should at least know which version you ran, so you can reinstall that version when you need to restore
+* optional: moin code + dependencies; you should at least know which version
+  you ran, so you can reinstall that version when you need to restore
 
 To create a dump of all data stored in moinmoin (wiki items, user profiles), run the
 following command::
--- a/docs/admin/configure.rst	Mon Sep 01 21:23:30 2014 -0700
+++ b/docs/admin/configure.rst	Fri Sep 05 10:22:20 2014 -0700
@@ -984,7 +984,8 @@
                   u'AdminGroup': [u'Admin1', u'Admin2', u'John']}
         return ConfigGroups(groups)
 
-CompositeGroups can use, for the most part, any combination of backends. The following is an example of using the ConfigGroups and WikiGroups backends::
+CompositeGroups can use, for the most part, any combination of backends. The
+following is an example of using the ConfigGroups and WikiGroups backends::
 
     def groups(self):
         from MoinMoin.datastruct import ConfigGroups, WikiGroups, CompositeGroups
@@ -1016,7 +1017,8 @@
                                   u'2': 'Two'}}
         return ConfigDicts(request, dicts)
 
-The CompositeDicts backend can use any combination of backends. The following is an example of using the ConfigDicts and WikiDicts backends::
+The CompositeDicts backend can use any combination of backends. The following
+is an example of using the ConfigDicts and WikiDicts backends::
 
     def dicts(self, request):
         from MoinMoin.datastruct import ConfigDicts, WikiDicts, CompositeDicts
--- a/docs/admin/install.rst	Mon Sep 01 21:23:30 2014 -0700
+++ b/docs/admin/install.rst	Fri Sep 05 10:22:20 2014 -0700
@@ -197,9 +197,9 @@
 If you encounter some other issue not described above, try
 researching the unresolved issues at
 https://bitbucket.org/thomaswaldmann/moin-2.0/issues?status=new&status=open.
-If you find a similar issue, please
-add a note saying you also have the problem and add any new
-information that may assist in the problem resolution.
+
+If you find a similar issue, please add a note saying you also have the problem
+and add any new information that may assist in the problem resolution.
 
 If you cannot find a similar issue please create a new issue.
 Or, if you are not sure what to do, join us on IRC at #moin-dev
--- a/docs/admin/requirements.rst	Mon Sep 01 21:23:30 2014 -0700
+++ b/docs/admin/requirements.rst	Fri Sep 05 10:22:20 2014 -0700
@@ -19,8 +19,9 @@
 Python distribution.
 Many linux distributions have a package manager that may do
 the installation. Windows users (and perhaps others) may download
-setuptools from https://pypi.python.org/pypi/setuptools. Once setuptools is installed, do "`easy_install virtualenv`". Current ActiveState
-distributions include virtualenv in the installation bundle.
+setuptools from https://pypi.python.org/pypi/setuptools.
+Once setuptools is installed, do "`easy_install virtualenv`".
+Current ActiveState distributions include virtualenv in the installation bundle.
 If all else fails, try Google.
 
 Mercurial (hg) is required should you wish to contribute
@@ -31,8 +32,7 @@
 with most linux package managers or downloaded
 from http://mercurial.selenic.com/. As an alternative,
 most Windows users will prefer to install TortoiseHG
-(includes Mercurial) from
-http://tortoisehg.bitbucket.org/.
+(includes Mercurial) from http://tortoisehg.bitbucket.org/.
 
 
 Servers
@@ -52,7 +52,9 @@
 Dependencies
 ============
 
-Dependent packages will be automatically downloaded and installed during the moin2 installation process. For a list of dependencies, see setup.py.
+Dependent packages will be automatically downloaded and installed during the
+moin2 installation process. For a list of dependencies, see setup.py.
+
 
 Clients
 =======
--- a/docs/devel/development.rst	Mon Sep 01 21:23:30 2014 -0700
+++ b/docs/devel/development.rst	Fri Sep 05 10:22:20 2014 -0700
@@ -353,13 +353,19 @@
 Templates and Themes
 --------------------
 Moin uses jinja2 as its templating engine and Flask-Themes as a flask extension to
-support multiple themes. There is a ``MoinMoin/templates`` directory that contains a base set of templates designed for the Modernized theme. Other themes may override or add to the base templates with a directory named ``themes/<theme_name>/templates``. 
+support multiple themes. There is a ``MoinMoin/templates`` directory that contains
+a base set of templates designed for the Modernized theme. Other themes may
+override or add to the base templates with a directory named ``themes/<theme_name>/templates``.
 
 When rendering a template, the template is expanded within an environment of
 values it can use. In addition to this general environment, parameters can
 also be given directly to the render call.
 
-Each theme has a ``static/css`` directory. Stylesheets for the Basic theme in MoinMoin are compiled using the source ``theme.less`` file in the Basic theme's ``static/custom-less`` directory. Stylesheets for the Modernized and Foobar themes are compiled using the ``theme.styl files`` in their respective ``static/css/stylus`` directories. To compile CSS for all themes::
+Each theme has a ``static/css`` directory. Stylesheets for the Basic theme in
+MoinMoin are compiled using the source ``theme.less`` file in the Basic theme's
+``static/custom-less`` directory. Stylesheets for the Modernized and Foobar
+themes are compiled using the ``theme.styl files`` in their respective ``static/css/stylus``
+directories. To compile CSS for all themes::
 
     ./m css  # Windows: m css
 
--- a/docs/intro/features.rst	Mon Sep 01 21:23:30 2014 -0700
+++ b/docs/intro/features.rst	Fri Sep 05 10:22:20 2014 -0700
@@ -17,6 +17,7 @@
 * Any server that talks WSGI to moin:
 
   - Apache2 with mod_wsgi
+  - nginx with uwsgi
   - IIS with isapi-wsgi (not recommended - if you must use Windows, but have
     a choice concerning the web server, please use Apache2).
   - Other WSGI servers, see http://wsgi.org/
--- a/docs/intro/general.rst	Mon Sep 01 21:23:30 2014 -0700
+++ b/docs/intro/general.rst	Fri Sep 05 10:22:20 2014 -0700
@@ -73,7 +73,7 @@
 This shows some of the better-known users of MoinMoin:
 
 Web Sites
-~~~~~~~~~~~~~~
+~~~~~~~~~
 * KernelNewbies, Xen, LinuxWireless, GCC
 * Debian, Ubuntu, CentOS
 * Apache, Gnome, Wine, OpenOffice, Squid, Exim, Dovecot
--- a/docs/intro/glossary.rst	Mon Sep 01 21:23:30 2014 -0700
+++ b/docs/intro/glossary.rst	Fri Sep 05 10:22:20 2014 -0700
@@ -88,4 +88,3 @@
    werkzeug
       A WSGI library used by moin.
 
-
--- a/docs/user/namespaces.rst	Mon Sep 01 21:23:30 2014 -0700
+++ b/docs/user/namespaces.rst	Fri Sep 05 10:22:20 2014 -0700
@@ -15,11 +15,12 @@
  It is used to access global views like global history, global tags etc.
 
 FIELD
- Whoosh schema value where to lookup the VALUE. Default value for field is ``name_exact`` (search by name). FIELD can be a unique identifier like (``itemid, revid, name_exact``) or can be non-unique like (``tags``).
+ Whoosh schema field where to lookup the VALUE (default: ``name_exact``, lookup by name).
+ FIELD can be a unique identifier like (``itemid, revid, name_exact``) or can be non-unique like (``tags``).
 
 VALUE
- Value to search in the FIELD. The default value is the default root within that namespace. If the FIELD is non-unique, we
- show a list items which can have the ``FIELD value:VALUE``.
+ Value to search in the FIELD (default: the default root within that namespace). If the FIELD is non-unique,
+ we show a list of items that have ``FIELD:VALUE``.
 
 VIEW
  used to select the intended view method (default: ``show``).
--- a/docs/user/search.rst	Mon Sep 01 21:23:30 2014 -0700
+++ b/docs/user/search.rst	Fri Sep 05 10:22:20 2014 -0700
@@ -132,6 +132,8 @@
 +-----------------------+-------------------------------------------------------+
 | ``mtime``             | document modification (submission) time, 201112312359 |
 +-----------------------+-------------------------------------------------------+
+| ``username``          | submitter user name, e.g. JoeDoe                      |
++-----------------------+-------------------------------------------------------+
 | ``address``           | submitter IP address, e.g. 127.0.0.1                  |
 +-----------------------+-------------------------------------------------------+
 | ``hostname``          | submitter DNS name, e.g. foo.example.org              |