Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mficzel committed Apr 17, 2020
0 parents commit bc02301
Show file tree
Hide file tree
Showing 8 changed files with 853 additions and 0 deletions.
52 changes: 52 additions & 0 deletions Configuration/NodeTypes.Content.StickyNote.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Sitegeist.PaperTrail:Content.StickyNote:
ui:
label: 'Sticky Note'
icon: sticky-note
inspector:
groups:
stickyNote:
label: 'sticky note'
tab: default
icon: sticky-note

superTypes:
'Neos.Neos:Content': true
properties:
text:
type: string
ui:
inlineEditable: true
inline:
editorOptions:
placeholder: 'Enter note here...'
autoparagraph: false
formatting:
strong: true
em: true
u: true
del: true
underline: true
strikethrough: true
removeFormat: true
a: true
color:
type: string
defaultValue: 'yellow'
ui:
label: 'Color'
reloadIfChanged: true
inspector:
group: stickyNote
editor: 'Neos.Neos/Inspector/Editors/SelectBoxEditor'
editorOptions:
values:
'yellow':
label: 'yellow'
'green':
label: 'green'
'orange' :
label: 'orange'
'pink' :
label: 'pink'
'blue' :
label: 'blue'
5 changes: 5 additions & 0 deletions Configuration/Settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Neos:
Neos:
fusion:
autoInclude:
Sitegeist.PaperTrail: true
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Sitegeist.PaperTrail

## Sticky notes for Neos CMS that can only be seen in the backend

This allows editors to leave notes for colleagues, reviewers or their
future self directly with the content.

### Authors & Sponsors

* Martin Ficzel - [email protected]

*The development and the public-releases of this package is generously sponsored
by our employer http://www.sitegeist.de.*

## Installation

Sitegeist.PaperTrail is available via packagist run `composer require sitegeist/papertrail`.
We use semantic versioning so every breaking change will increase the major-version number.

## Usage

Create content elements "Sticky Note" and type your comment.

## Contribution

We will gladly accept contributions. Please send us pull requests.
60 changes: 60 additions & 0 deletions Resources/Private/Fusion/Component/StickyNote.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
prototype(Sitegeist.PaperTrail:Component.StickyNote) < prototype(Neos.Fusion:Component) {

identifier = ${node.identifier}
text = ''
color = 'yellow'


renderer = Neos.Fusion:Component {
@apply.props = ${props}

hexColor = Neos.Fusion:Case {
yellow {
condition = ${props.color == 'yellow'}
renderer = '#f9d10c'
}

green {
condition = ${props.color == 'green'}
renderer = '#d5e252'
}

orange {
condition = ${props.color == 'orange'}
renderer = '#fd9c45'
}

pink {
condition = ${props.color == 'pink'}
renderer = '#f05ea3'
}

blue {
condition = ${props.color == 'blue'}
renderer = '#579cf4'
}

default {
condition = true
renderer= '#f9d10c'
}
}

css = ${'
#note-' + props.identifier + ' {
transform: rotate(-2.5deg);
box-shadow: 0 0 10px rgba(0,0,0,.5);
margin: 2em 0;
padding: 2em;
background: ' + this.hexColor + ';
min-height: 5em;`
color: black;
}
'}

renderer = afx`
<style>{props.css}</style>
<div id={'note-' + props.identifier}>{props.text}</div>
`
}
}
16 changes: 16 additions & 0 deletions Resources/Private/Fusion/Content/StickyNote.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
prototype(Sitegeist.PaperTrail:Content.StickyNote) < prototype(Neos.Neos:ContentComponent) {

renderer = Sitegeist.PaperTrail:Component.StickyNote {
# ensure this is only visible in the backend
@if.show = ${node.context.inBackend && node.context.currentRenderingMode.edit}

identifier = ${node.identifier}

text = Neos.Neos:Editable {
property = 'text'
block = false
}

color = ${q(node).property('color')}
}
}
1 change: 1 addition & 0 deletions Resources/Private/Fusion/Root.fusion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: **/*.fusion
19 changes: 19 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"description": "Sticky Notes for Neos, only visible in the Backend",
"type": "neos-package",
"name": "sitegeist/papertrail",
"license": "GPL-3.0-or-later",
"require": {
"neos/neos": "~5.0 || dev-master"
},
"autoload": {
"psr-4": {
"Sitegeist\\PaperTrail\\": "Classes/"
}
},
"extra": {
"neos": {
"package-key": "Sitegeist.PaperTrail"
}
}
}

0 comments on commit bc02301

Please sign in to comment.