changeset 955:b48e18209f1a

remove copy_item, see below there is no implementation for this on storage level. semantics and uses cases are unclear (esp. as we can fork now). if there is a good plan for it, we can reimplement it later.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 09 Oct 2011 23:46:30 +0200
parents f79d471667b9
children 9838477f0b68
files MoinMoin/apps/frontend/views.py MoinMoin/config/default.py MoinMoin/items/__init__.py
diffstat 3 files changed, 0 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/frontend/views.py	Sun Oct 09 23:08:36 2011 +0200
+++ b/MoinMoin/apps/frontend/views.py	Sun Oct 09 23:46:30 2011 +0200
@@ -84,7 +84,6 @@
 Disallow: /+dom/
 Disallow: /+download/
 Disallow: /+modify/
-Disallow: /+copy/
 Disallow: /+content/
 Disallow: /+delete/
 Disallow: /+ajaxdelete/
@@ -396,9 +395,6 @@
 class DestroyItemForm(CommentForm):
     name = 'destroy_item'
 
-class CopyItemForm(TargetCommentForm):
-    name = 'copy_item'
-
 class RenameItemForm(TargetCommentForm):
     name = 'rename_item'
 
@@ -436,30 +432,6 @@
                           )
 
 
-@frontend.route('/+copy/<itemname:item_name>', methods=['GET', 'POST'])
-def copy_item(item_name):
-    try:
-        item = Item.create(item_name)
-    except AccessDeniedError:
-        abort(403)
-    if request.method == 'GET':
-        form = CopyItemForm.from_defaults()
-        TextCha(form).amend_form()
-        form['target'] = item.name
-    elif request.method == 'POST':
-        form = CopyItemForm.from_flat(request.form)
-        TextCha(form).amend_form()
-        if form.validate():
-            target = form['target'].value
-            comment = form['comment'].value
-            item.copy(target, comment)
-            return redirect(url_for_item(target))
-    return render_template(item.copy_template,
-                           item=item, item_name=item_name,
-                           form=form,
-                          )
-
-
 @frontend.route('/+rename/<itemname:item_name>', methods=['GET', 'POST'])
 def rename_item(item_name):
     try:
--- a/MoinMoin/config/default.py	Sun Oct 09 23:08:36 2011 +0200
+++ b/MoinMoin/config/default.py	Sun Oct 09 23:46:30 2011 +0200
@@ -372,7 +372,6 @@
         ('frontend.show_item_meta', L_('Meta'), L_('Display Metadata'), True, ),
         ('frontend.quicklink_item', None, L_('Create or remove a navigation link to this item'), True, ),
         ('frontend.subscribe_item', None, L_('Switch notifications about item changes on or off'), True, ),
-        ('frontend.copy_item', L_('Copy'), L_('Create a copy of this item'), True, ),
         ('frontend.rename_item', L_('Rename'), L_('Rename this item'), True, ),
         ('frontend.delete_item', L_('Delete'), L_('Delete this item'), True, ),
         ('frontend.destroy_item', L_('Destroy'), L_('Completely destroy this item'), True, ),
--- a/MoinMoin/items/__init__.py	Sun Oct 09 23:08:36 2011 +0200
+++ b/MoinMoin/items/__init__.py	Sun Oct 09 23:46:30 2011 +0200
@@ -376,16 +376,6 @@
             raise StorageError("unsupported content object: %r" % content)
         return written
 
-    def copy(self, name, comment=u''):
-        """
-        copy this item to item <name>
-        """
-        old_item = self.rev.item
-        flaskg.storage.copy_item(old_item, name=name)
-        current_rev = old_item.get_revision(CURRENT)
-        # we just create a new revision with almost same meta/data to show up on RC
-        self._save(current_rev, current_rev, name=name, action=u'COPY', comment=comment)
-
     def _rename(self, name, comment, action):
         self._save(self.meta, self.data, name=name, action=action, comment=comment)