The following patch, when applied to the templates/edit.*.tmpl files changes them from the hardcoded next step in the workflow to an administrator changeable preference specified in TWikiPreferences.
I.e. it allows you to get rid of preview while retaining it for other users or groups.
62,63c62,63
< %TMPL:DEF{"topicaction"}% <input type="submit" value=" Save Changes " />
< %TMPL:P{"sep"}% <a href="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/%WEB%/%TOPIC%?unlock=on">Cancel</a> edit %TMPL:END%
---
> %TMPL:DEF{"topicaction"}% <input type="submit" value=" %SAVECYCLEeditnexttext% " />
> %TMPL:P{"sep"}% <a href="%SAVECYCLEeditpreviousurl%">%SAVECYCLEeditprevioustext%</a> %TMPL:END%
Preferences setting:
* Set SAVECYCLEeditnexturl = %SCRIPTURLPATH%/save%SCRIPTSUFFIX%/%WEB%/%TOPIC%
* Set SAVECYCLEeditnexttext = Save Topic
* Set SAVECYCLEeditpreviousurl = %SCRIPTURLPATH%/view%SCRIPTSUFFIX%/%WEB%/%TOPIC%?unlock=on
* Set SAVECYCLEeditprevioustext = Cancel edit
Aside: I actually wanted to write:
* Set SAVECYCLE{edit,next,url} = %SCRIPTURLPATH%/save%SCRIPTSUFFIX%/%WEB%/%TOPIC%
but twiki likes neither the {} nor the commas in the Set statement.
At first sight this could be made a plugin, but the appeal is to be able to apply it to all the plugins (eg.
ActionTracker,
SectionalEdit) and have them all behave the same way.
Perhaps some others can test it and then we can discuss whether others think this would be worth putting in the core.
Which files to apply it to?
$ cd templates
$ grep -l /preview `ls | grep -v preview`
--
MartinCleaver - 30 Jun 2003
Arthur, Matt and Andre - are you interested in this (or something similar)?
--
SvenDowideit - 18 Apr 2004
Itīs always nice, if you can customize your installation the way you want it. In this case I would like the user like to decide if he want a preview or not in an uncomplicated way:
* Set PREVIEW = on/off
But I know this is not that easy as it seems...
Maybe it is time to get rid of the preview-function as it does add more confusion and complexity instead of adding value.
--
AndreUlrich - 18 Apr 2004
Comment re requirements for this feature moved to
SavemultiCgiScript --
ThomasWeigert - 18 Apr 2004
I'll flesh out my viewpoint in another topic later, but for now: my chief reason for wanting to avoid Preview is performance. It takes at least 2, often 3, times as long to Edit > Preview > Save than it does to Edit > Save. This has been one of the drivers behind the long push for
CommentPlugin. The "save my work but don't publish it" feature is related but it isn't the same issue.
--
MattWilkie - 19 Apr 2004
I'm not sure I like having those long, unruly variable names.
AndreUlrich's idea isn't bad, and my complaint is really rather peripheral. Marking as
PatchAdjustmentRequired for now.
--
WalterMundt - 20 Apr 2004
By convention, TWiki uses just upper case names for preferences settings.
--
PeterThoeny - 20 Apr 2004
What does this patch and preference on/off setting accomplish which is not satisfied by having both a Preview and a Save button on the edit form?
--
MattWilkie - 20 Apr 2004
and to follow Matt - if you make the buttons with
CSS id's you'r stylesheet can hide the ones that you don't want..
--
SvenDowideit - 21 Apr 2004
The consensus seems to be that another approach is desirable, so I'm going to mark this as
PatchNotSuitable, with the intent that the new skin changes coming in Cairo provide equivalent functionality in a more friendly manner, e.g. via Sven's
CSS idea or something similar. (Hint: Hold us to this if Cairo approaches and the skin changes go in, but this doesn't happen. It's not that hard, but it'd be easy to forget.)
--
WalterMundt - 21 Apr 2004
WorkFlowAddOn may provide similar functionality.
MartinCleaver will reevaluate this after he installs
TWikiReleaseTrackerPlugin to all his twiki's
--
WillNorris - 03 Aug 2004
The core of the proposal is to have an "Admin defined" workflow for th view/edit/preview/save flow. Currently both the save and preview buttons are shown in
PatternSkin, so it is possible to implement using some cleverly hacked =IF=s here and there to enable or disable preview and save from the edit screen.
I think this can be done either directly on the shipped skins, or as a customization tip
--
RafaelAlvarez - 14 Aug 2008