pauloamgomes / CockpitCMS-Autosave

Cockpit CMS add-on with autosave capabilities for collections and singletons

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Autosave add-on for Cockpit CMS

This add-on enhances Cockpit CMS by providing the ability to persist automatically changes on collection entries or singletons form data. That means if the user closes by mistake the browser (by mistake or by a system failure) the changes will not be lost and when someone tries to edit the same resource, the system will ask if he wants to continue from a previous saved version.

Installation

Manual

Download latest release and extract to COCKPIT_PATH/addons/Autosave directory

Git

git clone https://github.com/pauloamgomes/CockpitCMS-Autosave.git ./addons/Autosave

Cockpit CLI

php ./cp install/addon --name Autosave --url https://github.com/pauloamgomes/CockpitCMS-Autosave.git

Composer

  1. Make sure path to cockpit addons is defined in your projects' composer.json file:
{
    "name": "MY_PROJECT",
    "extra": {
        "installer-paths": {
            "cockpit/addons/{$name}": ["type:cockpit-module"]
        }
    }
}
  1. In your project root run:
composer require pauloamgomes/cockpitcms-autosave

Configuration

In order to use the addon, it's required to specifiy in the Cockpit config the collections and/or singletons we want to autosave, e.g.:

autosave:
  collections: *
  singletons:
    - settings
    - seo

In the above example we are saying to apply Autosave to all collections (use of *) and to specifically the singletons with name "settings" and "seo".

For non admin users its required to provide a permission ("access"), e.g.:

groups:
  editor:
    autosave:
      access: true

Usage

When enabled, the addon will provide a small sidebar block that will display status of autosaves user did:

Autosave Screencast

When using Autosave, only a version is stored in the database containing the latest changes user did in the resource. When user saves the resource, the autosave entry is automatically removed.

Copyright and license

Copyright 2019 pauloamgomes under the MIT license.

About

Cockpit CMS add-on with autosave capabilities for collections and singletons

License:MIT License


Languages

Language:PHP 68.7%Language:Hack 31.3%