-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from daniellienert/task/refactor-modernize
TASK: Modernize Fusion code
- Loading branch information
Showing
16 changed files
with
78 additions
and
123 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
Resources/Private/Fusion/Component/DocumentSearchResult/DocumentSearchResult.fusion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
prototype(Neos.Neos:DocumentSearchResult) < prototype(Neos.Fusion:Template) { | ||
templatePath = 'resource://Flowpack.SearchPlugin/Private/Fusion/Component/DocumentSearchResult/DocumentSearchResult.html' | ||
node = ${node} | ||
highlight = ${Flowpack.SearchPlugin.Array.flatten(searchHit.highlight)} | ||
|
||
title = ${q(node).property('title')} | ||
description = '' | ||
parents = ${Array.reverse(q(node).parents('[instanceof Neos.Neos:Document]').get())} | ||
} |
File renamed without changes.
1 change: 1 addition & 0 deletions
1
Resources/Private/Fusion/Component/PageSearchResult/PageSearchResult.fusion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
prototype(Neos.NodeTypes:PageSearchResult) < prototype(Neos.Neos:DocumentSearchResult) |
2 changes: 1 addition & 1 deletion
2
Resources/Private/Fusion/AjaxSearch.fusion → ...SearchPlugin/AjaxSearch/AjaxSearch.fusion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
Resources/Private/Fusion/Content/SearchPlugin/Form/Form.fusion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
prototype(Flowpack.SearchPlugin:Search.Form) < prototype(Neos.Fusion:Template) { | ||
node = ${site} | ||
dimensionCombination = ${Json.stringify(this.node.context.dimensions)} | ||
templatePath = 'resource://Flowpack.SearchPlugin/Private/Fusion/Content/SearchPlugin/Form/Form.html' | ||
|
||
inputClassNames = '' | ||
searchWord = ${request.arguments.search} | ||
} |
File renamed without changes.
32 changes: 32 additions & 0 deletions
32
Resources/Private/Fusion/Content/SearchPlugin/Search/Search.fusion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
prototype(Flowpack.SearchPlugin:Search) < prototype(Neos.Neos:Content) { | ||
templatePath = 'resource://Flowpack.SearchPlugin/Private/Fusion/Content/SearchPlugin/Search/Search.html' | ||
|
||
searchTerm = ${request.arguments.search} | ||
searchQuery = ${this.searchTerm ? Search.query(site).fulltext(this.searchTerm).nodeType('Neos.Neos:Document') : null} | ||
|
||
totalSearchResults = ${this.searchQuery.count()} | ||
|
||
searchForm = Flowpack.SearchPlugin:Search.Form | ||
|
||
configuration = Neos.Fusion:RawArray { | ||
itemsPerPage = 25 | ||
insertAbove = false | ||
insertBelow = true | ||
maximumNumberOfLinks = 10 | ||
} | ||
|
||
searchResultRenderer = Neos.Fusion:Tag { | ||
tagName = 'ol' | ||
content = Flowpack.SearchPlugin:SearchResultRenderer | ||
} | ||
prototype(Flowpack.SearchPlugin:SingleResult).@process.wrap = ${'<li>' + value + '</li>'} | ||
|
||
@cache { | ||
mode = 'uncached' | ||
context { | ||
1 = 'site' | ||
2 = 'node' | ||
3 = 'documentNode' | ||
} | ||
} | ||
} |
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
Resources/Private/Fusion/Helper/ResultRendering/ResultRendering.fusion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
prototype(Flowpack.SearchPlugin:SingleResult) < prototype(Neos.Fusion:Case) { | ||
default { | ||
condition = Neos.Fusion:CanRender { | ||
type = ${node.nodeType.name + 'SearchResult'} | ||
} | ||
type = ${node.nodeType.name + 'SearchResult'} | ||
} | ||
|
||
fallback { | ||
condition = true | ||
type = 'Neos.Neos:DocumentSearchResult' | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
Resources/Private/Fusion/Helper/SearchResultrenderer/SearchresultRenderer.fusion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
prototype(Flowpack.SearchPlugin:SearchResultRenderer) < prototype(Neos.Fusion:Collection) { | ||
// the "searchResults" are filled from the <search:widget.paginate> ViewHelper. | ||
collection = ${searchResults} | ||
itemRenderer = Flowpack.SearchPlugin:SingleResult | ||
itemName = 'node' | ||
// we also make the full ElasticSearch hit available to nested rendering, if possible | ||
itemRenderer.@context.searchHit = ${searchResults.searchHitForNode(node)} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
prototype(Flowpack.SearchPlugin:CanRender).@class = 'Flowpack\\SearchPlugin\\FusionObjects\\CanRenderImplementation' | ||
|
||
include: SearchPlugin.fusion | ||
include: ResultRendering.fusion | ||
include: AjaxSearch.fusion | ||
include: **/*.fusion | ||
|
||
ajaxSearch = Flowpack.SearchPlugin:AjaxSearch |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters