Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoSave shouldn't overwrite the original file - but create a draft #188

Closed
n00dles opened this issue Nov 2, 2012 · 12 comments
Closed

AutoSave shouldn't overwrite the original file - but create a draft #188

n00dles opened this issue Nov 2, 2012 · 12 comments
Milestone

Comments

@n00dles
Copy link
Contributor

n00dles commented Nov 2, 2012

Original author: ccagle8 (April 01, 2011 14:50:33)

This looks pretty easy to implement:
http://stackoverflow.com/questions/931252/ajax-autosave

Original issue: http://code.google.com/p/get-simple-cms/issues/detail?id=188

@n00dles
Copy link
Contributor Author

n00dles commented Nov 2, 2012

From ccagle8 on April 08, 2011 17:27:38
added in r451. Initially will need to be turned on via gsconfig.php. It can be turned on for good once we get a procedure to work around the fact that auto-saves shouldn't overwrite the original file - but create a draft mode file.

@n00dles
Copy link
Contributor Author

n00dles commented Nov 2, 2012

From ccagle8 on December 08, 2011 14:33:30
Changing title since it's the last remaining real "bug" with the autosave feature.

@n00dles
Copy link
Contributor Author

n00dles commented Nov 2, 2012

From tablatronics on April 19, 2012 21:47:35
I was going to work on this, but I had some issues with the autosave feature itself.
( basicly it wasn't working )
So I rewrote a few things, and added some new features. After I commit them, we can figure out how we want drafts to work. And this should be implementable.

I think we should check for drafts and display the draft when editing the page, i prefer this over a 'a draft is available' as backups are now done, this way you can go right back to working on the draft.

Drafts will have 2 options, publish ( at which point doc will become the backup )
Or discard.

Maybe we can add a tab at the top of the page form for DRAFT, and a link to open the current file. I think it would be annoying to edit the normal page then have to click a draft link to continue editing it.

So the flow would be.

edit page load
we check for draft of page
if draft we open as a normal editor page, but we stick some kind of label or flag at the top to indicate this is a draft. We also add a similar tab or flag or link to the original, pass a new argument to edit nodraft or something, and the normal page loads, in the page we flag this page as a draft(hidden field?) so we can work on it and save it as normal, but it will be saved as a draft always.

This draft page has a few special options at the top.
Publish ( confirmation )
Discard ( confirmation )

@n00dles
Copy link
Contributor Author

n00dles commented Nov 2, 2012

From tablatronics on June 19, 2012 20:58:02
After we get this all figured out, we can also make all saves ajax, not just autosaves.
Possibly with another global variable, so button clicks are ajax saves instead of form submits ( we might have to add some kind of check summing on this so the client knows its in sync and saves were indeed successful, it would suck to reload a page and find out nothing actually saved due to some failure that we failed to receive, or simply make that more robust with some other kind of check )

This would be a nice addition to components.

@tablatronix
Copy link
Member

Until we actually have drafts, I am enabling this.
autosave will not use autosave path, it will save to pages.
6d459e9

@mvlcek
Copy link

mvlcek commented May 10, 2013

Autosave saving directly to the pages will make GetSimple (or at least Autosave) unfit for live sites. If somebody creates or updates an existing page, this page MUST NOT be saved until the editor has reviewed the changes and pressed save. Otherwise incomplete pages would be visible for visitors, which is NOT acceptable at all.

If autosave works like this, it must not be enabled by default and the setting to enable it must have a comment warning the user about the consequences.

@tablatronix
Copy link
Member

It is not enabled by default, it is experimental, at least this way it is experiment-able.
It is not like this is code, its html.

And if you are writing incomplete pages, then the page should be off the menu or private until its presentable.

Not seeing a problem. Ill add notes to gsconfig and wiki i guess.

@mvlcek
Copy link

mvlcek commented May 10, 2013

If it's not enabled by default, it's fine.

As for private: if you update a page, you can't set it to private, as this would remove it from the site.

@tablatronix
Copy link
Member

Then that would typically be a minor edit, not an incomplete page.
For major rewrites you have the option to clone and swap it out.

People can start to test ajax updates then we can add it to normal saving also.

I doubt anyone is even using it yet, i mean how do you even preview autosaves ?

@mvlcek
Copy link

mvlcek commented May 10, 2013

Even if it's a minor edit and it takes longer than the auto-save interval, a possible incomplete/in-progress page would be published.

I suppose a usable autosave solution looks like this:

  • in the frontend:
    • when viewed by a logged in user, frontend will show the autosaved version of a page
  • on the edit page view:
    • the autosave version is displayed, if there is one when the users starts editing a page. Also a marker/message is shown.
    • the page is automatically saved every x minutes to an autosave folder
    • the view button in admin will save the page like autosave
    • if there is an autosave version, a revert button/link is shown
    • if the user leaves the page, an autosave is performed, too.
  • on the list pages view:
    • autosaved pages have a marker
    • there is a "confirm drafts" button/link to move all autosaved versions to the page files

This way an editor can edit multiple pages, preview/review them and only publish them when everything is correct.

@tablatronix
Copy link
Member

Well this will actually become drafts, so i will apply your input to that. The whole sense of autosave will be gone, it will just be the standard method of saving, like google docs.

Non live copies of pages will always be a draft, always be autosaved, and allow live previews, they will be publishable, at which point it will overwrite the page file. but there will not be mutiple versioning, too non-simple.

I think there is another discussion on drafts somewhere in here, but i cannot find it. Github just changed the damn issue search or rather removed it.

aha
#506

@tablatronix
Copy link
Member

closing, reference for #570

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants