changeset 1865:05158c12c271

merged main, added comment about more work needed
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 09 Mar 2007 00:56:44 +0100
parents 2b24220424fa (diff) 5dd9f0eb99a7 (current diff)
children 0194beaf511e
files MoinMoin/PageEditor.py
diffstat 2 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/PageEditor.py	Fri Mar 09 00:33:30 2007 +0100
+++ b/MoinMoin/PageEditor.py	Fri Mar 09 00:56:44 2007 +0100
@@ -1016,9 +1016,11 @@
             f.write(revstr+'\n')
             f.close()
 
-            # we need to actualize the request.rev number here to get the right revision used for
-            # actions on newly saved pages (#preview)
-            request.rev = rev
+            # we need to update request.rev here to get the right revision used for
+            # action links rendered by the final send_page() call (#preview display)
+            # XXX this is not the right place to do this as you could use this function
+            # to save any other page than the currently displayed one
+            #request.rev = rev
 
             if not deleted:
                 # save to page file
--- a/MoinMoin/action/AttachFile.py	Fri Mar 09 00:33:30 2007 +0100
+++ b/MoinMoin/action/AttachFile.py	Fri Mar 09 00:56:44 2007 +0100
@@ -293,8 +293,9 @@
         label_install = _("install")
 
         for file in files:
-            fsize = float(os.stat(os.path.join(attach_dir, file).encode(config.charset))[6]) # in byte
-            fsize = "%.1f" % (fsize / 1024)
+            st = os.stat(os.path.join(attach_dir, file).encode(config.charset))
+            fsize = "%.1f" % (float(st.st_size) / 1024)
+            fmtime = request.user.getFormattedDateTime(st.st_mtime)
             baseurl = request.getScriptname()
             action = action_name
             urlpagename = wikiutil.quoteWikinameURL(pagename)
@@ -312,6 +313,7 @@
                         'get_url': get_url, 'label_get': label_get,
                         'file': wikiutil.escape(file).replace(' ', '%20'),
                         'fsize': fsize,
+                        'fmtime': fmtime,
                         'pagename': pagename}
 
             del_link = ''
@@ -342,7 +344,7 @@
             parmdict['move_link'] = move_link
             str = str + ('<li>[%(del_link)s%(move_link)s'
                 '<a href="%(get_url)s">%(label_get)s</a>&nbsp;| %(viewlink)s]'
-                ' (%(fsize)s KB) attachment:<strong>%(file)s</strong></li>') % parmdict
+                ' (%(fmtime)s, %(fsize)s KB) attachment:<strong>%(file)s</strong></li>') % parmdict
         str = str + "</ul>"
     else:
         if showheader: