-
-
Notifications
You must be signed in to change notification settings - Fork 22
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 #197 from plone/pat-contentbrowser-widget
Implement `ContentBrowserWidget` for the new `pat-contentbrowser` pattern
- Loading branch information
Showing
10 changed files
with
539 additions
and
63 deletions.
There are no files selected for viewing
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 @@ | ||
Implement new `ContentBrowserWidget` for `pat-contentbrowser` pattern. | ||
|
||
The deprecated `RelatedItemsWidget` and `pat-relateditems` pattern is still available | ||
and imports should not break. But the default widget and converter adapter registration for | ||
z3c.relationfield is changed to the new widget. | ||
|
||
Since `plone.app.relationfield` defines the widget with `plone.autoform` schema | ||
hints nothing changes until the package is updated to the new widget. | ||
[petschki] |
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
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
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
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,44 @@ | ||
<div class="contentbrowser-widget ${python:normalizeString(view.field.__class__.__name__)}-field" | ||
id="form-widgets-${python:view.__name__}" | ||
tal:define=" | ||
plone_view nocall:context/@@plone; | ||
normalizeString python:plone_view.normalizeString; | ||
items python: view.items(); | ||
" | ||
tal:condition="items" | ||
i18n:domain="plone" | ||
> | ||
<ul> | ||
<li tal:repeat="item items"> | ||
<span title="${item_type}" | ||
tal:define=" | ||
item_type python:item.portal_type; | ||
item_type_class python:item.ContentTypeClass(); | ||
item_wf_state_class python:item.ReviewStateClass(); | ||
appendViewAction python:item.appendViewAction(); | ||
item_url python:item.getURL(); | ||
item_url python:item_url+'/view' if appendViewAction else item_url; | ||
" | ||
> | ||
|
||
<a href="${item_url}"> | ||
<img class="mime-icon" | ||
src="${python:item.MimeTypeIcon()}" | ||
tal:condition="python:item_type =='File'" | ||
/> | ||
|
||
<span class="${item_type_class} ${item_wf_state_class} url" | ||
tal:content="python:item.Title()" | ||
> | ||
Title | ||
</span> | ||
<span class="discreet" | ||
tal:content="python:item.Description()" | ||
> | ||
Description | ||
</span> | ||
</a> | ||
</span> | ||
</li> | ||
</ul> | ||
</div> |
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
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,46 +1,44 @@ | ||
<span class="relateditems-widget ${python:normalizeString(view.field.__class__.__name__)}-field" | ||
id="form-widgets-${python:view.__name__}" | ||
tal:define=" | ||
plone_view nocall:context/@@plone; | ||
normalizeString python:plone_view.normalizeString; | ||
items python: view.items(); | ||
" | ||
tal:condition="items" | ||
i18n:domain="plone" | ||
<div class="relateditems-widget ${python:normalizeString(view.field.__class__.__name__)}-field" | ||
id="form-widgets-${python:view.__name__}" | ||
tal:define=" | ||
plone_view nocall:context/@@plone; | ||
normalizeString python:plone_view.normalizeString; | ||
items python: view.items(); | ||
" | ||
tal:condition="items" | ||
i18n:domain="plone" | ||
> | ||
<div> | ||
<ul> | ||
<li tal:repeat="item items"> | ||
<span title="${item_type}" | ||
tal:define=" | ||
item_type python:item.portal_type; | ||
item_type_class python:item.ContentTypeClass(); | ||
item_wf_state_class python:item.ReviewStateClass(); | ||
appendViewAction python:item.appendViewAction(); | ||
item_url python:item.getURL(); | ||
item_url python:item_url+'/view' if appendViewAction else item_url; | ||
" | ||
> | ||
<ul> | ||
<li tal:repeat="item items"> | ||
<span title="${item_type}" | ||
tal:define=" | ||
item_type python:item.portal_type; | ||
item_type_class python:item.ContentTypeClass(); | ||
item_wf_state_class python:item.ReviewStateClass(); | ||
appendViewAction python:item.appendViewAction(); | ||
item_url python:item.getURL(); | ||
item_url python:item_url+'/view' if appendViewAction else item_url; | ||
" | ||
> | ||
|
||
<a href="${item_url}"> | ||
<img class="mime-icon" | ||
src="${python:item.MimeTypeIcon()}" | ||
tal:condition="python:item_type =='File'" | ||
/> | ||
<a href="${item_url}"> | ||
<img class="mime-icon" | ||
src="${python:item.MimeTypeIcon()}" | ||
tal:condition="python:item_type =='File'" | ||
/> | ||
|
||
<span class="${item_type_class} ${item_wf_state_class} url" | ||
tal:content="python:item.Title()" | ||
> | ||
<span class="${item_type_class} ${item_wf_state_class} url" | ||
tal:content="python:item.Title()" | ||
> | ||
Title | ||
</span> | ||
<span class="discreet" | ||
tal:content="python:item.Description()" | ||
> | ||
</span> | ||
<span class="discreet" | ||
tal:content="python:item.Description()" | ||
> | ||
Description | ||
</span> | ||
</a> | ||
</span> | ||
</li> | ||
</ul> | ||
</div> | ||
</span> | ||
</span> | ||
</a> | ||
</span> | ||
</li> | ||
</ul> | ||
</div> |
Oops, something went wrong.