diff -ur 1.5b2/Include.py modified/Include.py --- 1.5b2/Include.py 2005-10-28 03:46:38.000000000 +0900 +++ modified/Include.py 2005-11-24 03:09:42.649867300 +0900 @@ -218,7 +218,7 @@ request.redirect(strfile) try: cid = request.makeUniqueID("Include_%s" % wikiutil.quoteWikinameURL(inc_page.page_name)) - inc_page.send_page(request, content_only=1, content_id=cid) + inc_page.send_page(request, content_only=1, content_id=cid, do_cache=False) result.append(strfile.getvalue()) finally: request.redirect() diff -ur 1.5b2/multiconfig.py modified/multiconfig.py --- 1.5b2/multiconfig.py 2005-10-30 20:22:58.000000000 +0900 +++ modified/multiconfig.py 2005-11-23 02:56:50.156250000 +0900 @@ -290,6 +290,7 @@ show_hosts = 1 show_interwiki = 1 show_section_numbers = 0 + allow_section_edit = 1 show_timings = 0 show_version = 0 siteid = 'default' diff -ur 1.5b2/PageEditor.py modified/PageEditor.py --- 1.5b2/PageEditor.py 2005-11-06 06:28:50.000000000 +0900 +++ modified/PageEditor.py 2005-11-24 10:35:22.009242300 +0900 @@ -135,7 +135,28 @@ edit_lock_message = None preview = kw.get('preview', None) staytop = kw.get('staytop', 0) + + # for section editing + issectionedit = kw.get('issectionedit', 1) + pagetext = kw.get('pagetext', None) + startline = int(form.get('startline', ['0'])[0]) + endline = int(form.get('endline', ['0'])[0]) + srev = int(form.get('srev', ['0'])[0]) + + if startline or endline: + if not startline: + startline = 1 + + if not endline: + endline = -1 + else: + issectionedit = 0 + if issectionedit: + # need to add config + self._allow_section_edit = self.cfg.allow_section_edit + # self._allow_section_edit = 1 + from MoinMoin.formatter.text_html import Formatter self.request.formatter = Formatter(self.request, store_pagelinks=1) @@ -174,7 +195,10 @@ title = _('Edit "%(pagename)s"') else: title = _('Preview of "%(pagename)s"') - self.set_raw_body(preview, modified=1) + if issectionedit and pagetext is not None: + self.set_raw_body(pagetext, modified=1) + else: + self.set_raw_body(preview, modified=1) # send header stuff lock_timeout = self.lock.timeout / 60 @@ -214,9 +238,19 @@ # We don't show preview when in conflict preview = None + # no section-editing any more + if issectionedit: + conflict_msg = u'%s %s' % (conflict_msg, _('Section editing is canceled.')) + issectionedit = 0 + elif self.exists(): # revision of existing page rev = self.current_rev() + + if issectionedit and preview is None: + if not (srev and srev == rev): + conflict_msg = u'%s %s' % (_('Section editing is canceled.'), _('Someone else updated this page. You are editing the updated revision.')) + issectionedit = 0 else: # page creation rev = 0 @@ -273,6 +307,12 @@ # Generate default content for new pages if not raw_body: raw_body = _('Describe %s here.') % (self.page_name,) + elif issectionedit: + # for section editing + if pagetext is not None: + raw_body = preview + else: + raw_body = self.fetchsection(raw_body, startline, endline) # send form self.request.write('