Plugin feature 1: remove column
This commit is contained in:
75
README.md
75
README.md
@@ -1,19 +1,26 @@
|
||||
# Skeleton -- a Kanboard plugin template
|
||||
# OrganonTweaks -- umbrella plugin for small Kanboard tweaks
|
||||
|
||||
A minimal, working Kanboard plugin that you copy and rename as the starting point for a
|
||||
real plugin. By itself it does only one trivial thing: it renders the word "Skeleton" at
|
||||
the top of every page. It changes no data and runs no database migration.
|
||||
A home for small, unrelated Kanboard adjustments that are not big enough to deserve their
|
||||
own plugin. Each tweak is self-contained; more will be added over time. If a tweak grows
|
||||
into a real subsystem it graduates into its own plugin (see PLAN-organon-tweaks-plugin.md).
|
||||
|
||||
## What it demonstrates
|
||||
## Tweaks
|
||||
|
||||
- A complete `Plugin.php` registration class with all the metadata Kanboard shows in
|
||||
Settings -> Plugins (name, description, author, version, homepage, compatible version).
|
||||
- A template hook (`template:layout:top`) that injects a template into the page.
|
||||
- Asset hooks (`template:layout:css` and `template:layout:js`) that load a stylesheet and
|
||||
a script. They are empty for now but prove the injection path works -- handy when a real
|
||||
plugin needs custom CSS or JS.
|
||||
- The standard plugin directory layout, with stub folders (`Controller/`, `Model/`,
|
||||
`Schema/`, `Locale/`, `Test/`) ready to grow into.
|
||||
### Remove an empty column
|
||||
|
||||
Adds a **Remove this Column** entry (trash icon) to a board column's header dropdown, next
|
||||
to the other column actions. It appears only when the column is completely empty -- no
|
||||
tasks, open or closed -- because Kanboard's column removal is a plain delete and a non-empty
|
||||
column would orphan its tasks. Clicking it asks for confirmation, then removes the column
|
||||
and returns to the board.
|
||||
|
||||
- The menu entry is rendered by the `template:board:column:dropdown` hook (which sits
|
||||
outside the native menu list), then moved into the menu by `Asset/js/relocate.js`.
|
||||
- The empty check counts open and closed tasks via a helper
|
||||
(`Helper/OrganonColumnHelper.php`, `taskFinderModel->countByColumnId(...)`), since the
|
||||
board's own count is open-only.
|
||||
- Only users allowed to manage columns see it, and the controller re-checks both the
|
||||
permission and the emptiness before deleting.
|
||||
|
||||
## Requirements
|
||||
|
||||
@@ -21,45 +28,9 @@ the top of every page. It changes no data and runs no database migration.
|
||||
|
||||
## Installation
|
||||
|
||||
No build step and no dependencies.
|
||||
|
||||
1. Copy this folder into your Kanboard installation as `plugins/Skeleton/`.
|
||||
2. Reload any page. The word "Skeleton" appears at the top.
|
||||
3. Confirm it under Settings -> Plugins.
|
||||
|
||||
To uninstall, delete `plugins/Skeleton/`. Nothing else is left behind.
|
||||
|
||||
## Directory layout
|
||||
|
||||
```
|
||||
Skeleton/
|
||||
Plugin.php Registration and hook wiring (the only required file).
|
||||
README.md
|
||||
LICENSE AGPL-3.0.
|
||||
Template/
|
||||
layout/header.php The visible "Skeleton" word.
|
||||
Asset/
|
||||
css/skeleton.css Loaded via template:layout:css.
|
||||
js/skeleton.js Loaded via template:layout:js.
|
||||
Controller/ Stub for future request handlers.
|
||||
Model/ Stub for future business logic / DB access.
|
||||
Schema/ Stub for future database migrations.
|
||||
Locale/ Stub for future translations (e.g. pt_BR/, fr_FR/).
|
||||
Test/ Stub for future unit tests.
|
||||
```
|
||||
|
||||
## How to fork this into a new plugin
|
||||
|
||||
1. Copy the folder and rename it, e.g. `plugins/MyPlugin/`. The folder name must match the
|
||||
namespace and start with a capital letter.
|
||||
2. In `Plugin.php`, change the namespace from `Kanboard\Plugin\Skeleton` to
|
||||
`Kanboard\Plugin\MyPlugin`.
|
||||
3. Update the metadata methods (`getPluginName`, `getPluginDescription`, `getPluginAuthor`,
|
||||
`getPluginVersion`, `getPluginHomepage`, `getCompatibleVersion`).
|
||||
4. Update the hook target paths: the lowercase prefix in `'skeleton:layout/header'` and the
|
||||
`plugins/Skeleton/Asset/...` asset paths must match the new plugin name.
|
||||
5. Replace `Template/layout/header.php` with your real template, or attach to a different
|
||||
hook. See the Kanboard plugin hooks documentation for the full list of hook points.
|
||||
Copy this folder into your Kanboard installation as `plugins/OrganonTweaks/`. The directory
|
||||
name must be exactly `OrganonTweaks` (Kanboard derives the plugin namespace from the folder
|
||||
name). No build step and no database migration.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Reference in New Issue
Block a user