diff --git a/browser/form.py b/browser/form.py index e7e6e2b..ad73acf 100644 --- a/browser/form.py +++ b/browser/form.py @@ -642,8 +642,11 @@ class EditObject(FormController, I18NView): def checkCreateVersion(self, obj): form = self.request.form - if form.get('version.create'): - versionable = IVersionable(obj) + versionable = IVersionable(obj) + notVersioned = bool(form.get('version.not_versioned')) + if notVersioned != versionable.notVersioned: + versionable.notVersioned = notVersioned + if not notVersioned and form.get('version.create'): level = int(form.get('version.level', 0)) version = versionable.createVersion(level) notify(ObjectCreatedEvent(version)) diff --git a/browser/form_macros.pt b/browser/form_macros.pt index 1a18cfb..d8a1acf 100644 --- a/browser/form_macros.pt +++ b/browser/form_macros.pt @@ -229,12 +229,25 @@ - Versioning + Versioning + + + + + + - + Version: 1.1 (current, released) diff --git a/browser/skin/lobo/print.css b/browser/skin/lobo/print.css index c8b0c74..19dd977 100644 --- a/browser/skin/lobo/print.css +++ b/browser/skin/lobo/print.css @@ -13,6 +13,6 @@ body { #content { /* width: 100%; */ - width: 70%; + width: 80%; color: Black; } diff --git a/locales/de/LC_MESSAGES/loops.mo b/locales/de/LC_MESSAGES/loops.mo index 0a47ea7..8bbd48c 100644 Binary files a/locales/de/LC_MESSAGES/loops.mo and b/locales/de/LC_MESSAGES/loops.mo differ diff --git a/locales/de/LC_MESSAGES/loops.po b/locales/de/LC_MESSAGES/loops.po index ffdfd5f..f684b84 100644 --- a/locales/de/LC_MESSAGES/loops.po +++ b/locales/de/LC_MESSAGES/loops.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: $Id$\n" "POT-Creation-Date: 2007-05-22 12:00 CET\n" -"PO-Revision-Date: 2012-02-16 12:00 CET\n" +"PO-Revision-Date: 2012-03-28 12:00 CET\n" "Last-Translator: Helmut Merz \n" "Language-Team: loops developers \n" "MIME-Version: 1.0\n" @@ -437,6 +437,12 @@ msgstr "Suchbegriff" msgid "Select if you want to create a new version" msgstr "Bitte markieren, wenn Sie eine neue Version anlegen möchten" +msgid "Suppress Versioning" +msgstr "Keine Versionierung" + +msgid "Check this field if you want to suppress versioning for this resource." +msgstr "Bitte markieren, wenn diese Ressource nicht versioniert werden soll." + msgid "Search text" msgstr "Suchtext" diff --git a/versioning/interfaces.py b/versioning/interfaces.py index 1241dea..51e130c 100644 --- a/versioning/interfaces.py +++ b/versioning/interfaces.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2006 Helmut Merz helmutm@cy55.de +# Copyright (c) 2012 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,8 +18,6 @@ """ Versioning interfaces. - -$Id$ """ from zope.interface import Interface, Attribute @@ -30,31 +28,34 @@ class IVersionable(Interface): """ An object that may exist in different versions. """ - versionNumbers = Attribute(u'A tuple of version numbers for the context ' + versionNumbers = Attribute('A tuple of version numbers for the context ' 'object, with a number for each level') - variantIds = Attribute(u'A tuple of variant IDs (e.g. for language ' + variantIds = Attribute('A tuple of variant IDs (e.g. for language ' 'varuants) for the context object') - versionId = Attribute(u'A string identifying this version, e.g. 1.1_de, ' + versionId = Attribute('A string identifying this version, e.g. 1.1_de, ' 'derived from versionNumbers and variantIds') - master = Attribute(u'The object (master version) that should be used for access to ' + master = Attribute('The object (master version) that should be used for access to ' 'version-independent attributes and central ' 'versioning metadata') - parent = Attribute(u'The version this one was created from') + parent = Attribute('The version this one was created from') - comment = Attribute(u'Somme informative text provided when creating ' + comment = Attribute('Somme informative text provided when creating ' 'this version') # attributes taken from the master version: - versions = Attribute(u'A dictionary of all versions of this object') + versions = Attribute('A dictionary of all versions of this object') - currentVersion = Attribute(u'The default version to be used for editing') + currentVersion = Attribute('The default version to be used for editing') - releasedVersion = Attribute(u'The default version to be used for viewing') + releasedVersion = Attribute('The default version to be used for viewing') + + notVersioned = Attribute('A boolean that is True if this object should ' + 'not be versioned') def createVersion(level=1): """ Create a copy of the context object as a new version and return it. diff --git a/versioning/versionable.py b/versioning/versionable.py index 421bc4d..1e85db3 100644 --- a/versioning/versionable.py +++ b/versioning/versionable.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2007 Helmut Merz helmutm@cy55.de +# Copyright (c) 2012 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,8 +18,6 @@ """ Utilities for managing version informations. - -$Id$ """ from BTrees.OOBTree import OOBTree @@ -129,6 +127,13 @@ class VersionableResource(object): m = self.versionableMaster return self.versionableMaster.getVersioningAttribute('releasedVersion', None) + def getNotVersioned(self): + m = self.versionableMaster + return self.versionableMaster.getVersioningAttribute('notVersioned', False) + def setNotVersioned(self, value): + self.versionableMaster.setVersioningAttribute('notVersioned', bool(value)) + notVersioned = property(getNotVersioned, setNotVersioned) + def createVersionObject(self, versionNumbers, variantIds, comment=u''): versionableMaster = self.versionableMaster versionableMaster.initVersions()