Skip to content

Commit 78b8954

Browse files
committed
Initial commit
0 parents  commit 78b8954

17 files changed

Lines changed: 1764 additions & 0 deletions

File tree

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Winter CMS
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Plugin.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php namespace Winter\Notes;
2+
3+
use System\Classes\PluginBase;
4+
5+
class Plugin extends PluginBase
6+
{
7+
/**
8+
* Returns information about this plugin.
9+
*
10+
* @return array
11+
*/
12+
public function pluginDetails()
13+
{
14+
return [
15+
'name' => 'winter.notes::lang.plugin.name',
16+
'description' => 'winter.notes::lang.plugin.description',
17+
'author' => 'Winter CMS',
18+
'icon' => 'icon-file-text-o'
19+
];
20+
}
21+
22+
/**
23+
* Register the plugin's form widgets
24+
*
25+
* @return array
26+
*/
27+
public function registerFormWidgets()
28+
{
29+
return [
30+
'Winter\Notes\FormWidgets\Notes' => 'notes',
31+
];
32+
}
33+
}

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# About
2+
3+
Easily add notes to any record in WinterCMS through a Mac OS-like user experience.
4+
5+
# Installation
6+
7+
To install from the [Marketplace](https://wintercms.com/plugin/winter-notes), click on the "Add to Project" button and then select the project you wish to add it to before updating the project to pull in the plugin.
8+
9+
To install from the backend, go to **Settings -> Updates & Plugins -> Install Plugins** and then search for `Winter.Notes`.
10+
11+
To install from [the repository](https://github.com/wintercms/wn-notes-plugin), clone it into `plugins/winter/notes` and then run `composer update` from your project root in order to pull in the dependencies.
12+
13+
To install it with Composer, run `composer require wintercms/wn-notes-plugin` from your project root.
14+
15+
# Documentation
16+
17+
Simply add the `notes` MorphMany relationship to your model and add a field with a type of `notes` to your fields.yaml to get started.
18+
19+
Example `fields.yaml`:
20+
21+
```yaml
22+
fields:
23+
name:
24+
label: Name
25+
span: full
26+
27+
tabs:
28+
fields:
29+
notes: # The name of the relationship the FormWidget will use
30+
label: ''
31+
tab: Notes
32+
type: notes
33+
span: full
34+
# autosaveDelay: 2000 # The amount of milliseconds to delay after typing stops to trigger an autosave
35+
# dateFormat: 'Y-m-d H:i:s' # the php date format for updated_at column
36+
```
37+
38+
Example MorphMany Relationship definition:
39+
40+
```php
41+
public $morphMany = [
42+
'notes' => [\Winter\Notes\Models\Note::class, 'name' => 'target']
43+
];
44+
```

composer.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "winter/wn-notes-plugin",
3+
"type": "winter-plugin",
4+
"description": "Easily add notes to any record in WinterCMS",
5+
"homepage": "https://github.com/wintercms/wn-notes-plugin",
6+
"keywords": ["winter", "wintercms", "notes", "dynamic notes", "macos notes"],
7+
"license": "MIT",
8+
"authors": [
9+
{
10+
"name": "Luke Towers",
11+
"email": "luke@luketowers.ca"
12+
},
13+
{
14+
"name": "Eric Yang",
15+
"email": "ericy@captive.ca"
16+
}
17+
],
18+
"require": {
19+
"composer/installers": "~1.11"
20+
}
21+
}

0 commit comments

Comments
 (0)