Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove deprecated contenttype icons #59

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Changelog
3.1.3 (unreleased)
------------------

- Nothing changed yet.
- remove deprecated icons ...
https://github.com/plone/Products.CMFPlone/issues/1151
[fgrcon]


3.1.2 (2015-09-27)
Expand Down
1 change: 1 addition & 0 deletions plone/app/portlets/portlets/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def root_item_class(self):
return ''

def root_icon(self):
''' should be deprecated for plone > 5.0 '''
plone_layout = getMultiAdapter((self.context, self.request),
name='plone_layout')
icon = plone_layout.getIcon(self.getNavRoot())
Expand Down
14 changes: 9 additions & 5 deletions plone/app/portlets/portlets/navigation_recurse.pt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
item_url node/getURL;
item_remote_url node/getRemoteUrl;
use_remote_url node/useRemoteUrl | nothing;
item_icon nocall:node/item_icon;
item_type node/portal_type;
hasImage node/item/getIcon;
imageBase node/path;
is_current node/currentItem;
is_in_path node/currentParent;
li_class python:is_current and ' navTreeCurrentNode' or '';
Expand All @@ -25,12 +26,15 @@
item_type_class python:'contenttype-' + normalizeString(item_type);
item_class python:is_current and item_class + ' navTreeCurrentItem' or item_class;">


<a tal:attributes="href python:use_remote_url and item_remote_url or item_url;
title node/Description;
class string:$item_class${li_class}${li_extr_class}${li_folder_class} $item_type_class">
<img tal:replace="structure item_icon/html_tag" />
<span tal:replace="node/Title">Selected Item Title</span>
class string:$item_class${li_class}${li_extr_class}${li_folder_class} $item_type_class">
<img class="image-icon"
tal:define="getIcon string:$imageBase/@@images/image/icon"
tal:condition="hasImage"
tal:attributes="href string:item_url;
src string:$getIcon">
<span tal:replace="node/Title">Selected Item Title</span>
</a>

<tal:children condition="python: len(children) > 0">
Expand Down
20 changes: 11 additions & 9 deletions plone/app/portlets/portlets/news.pt
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,24 @@
<section class="portletContent">
<ul>
<tal:newsitems tal:define="toLocalizedTime nocall:context/@@plone/toLocalizedTime;
plone_layout context/@@plone_layout;
getIcon nocall:plone_layout/getIcon;"
plone_layout context/@@plone_layout"
tal:repeat="obj view/published_news_items">
<li tal:define="oddrow repeat/obj/odd;
item_icon python:getIcon(obj);"
<li tal:define="oddrow repeat/obj/odd;"
tal:attributes="class python:oddrow and 'portletItem even' or 'portletItem odd'">

<a href=""
class="tile"
tal:attributes="href obj/getURL;
title obj/Description">
<img tal:replace="structure item_icon/html_tag" />
<span tal:replace="obj/pretty_title_or_id">
Plone 2.1 announced!
</span>
</a>
<img class="image-icon"
tal:define="getIcon python:obj.getURL()+'/@@images/image/icon'"
tal:condition="python: obj.getIcon"
tal:attributes="href obj/getURL;
src string:$getIcon">
<span tal:replace="obj/pretty_title_or_id">
Plone 5.1 announced!
</span>
</a>
<time class="portletItemDetails"
tal:content="python:toLocalizedTime(obj.Date)">May 5</time>

Expand Down
17 changes: 9 additions & 8 deletions plone/app/portlets/portlets/recent.pt
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@
<section class="portletContent"
tal:condition="view/recent_items">
<ul>
<tal:items tal:define="plone_layout context/@@plone_layout;
plone_view context/@@plone;
getIcon nocall:plone_layout/getIcon;
<tal:items tal:define="plone_view context/@@plone;
normalizeString nocall:plone_view/normalizeString;
toLocalizedTime nocall:plone_view/toLocalizedTime;"
tal:repeat="obj view/recent_items">

<li class="portletItem"
tal:define="oddrow repeat/obj/odd;
item_icon python:getIcon(obj);
item_wf_state obj/review_state;
item_wf_state_class python:'state-' + normalizeString(item_wf_state);
item_class python:'contenttype-' + normalizeString(obj.portal_type);"
Expand All @@ -32,10 +29,14 @@
tal:attributes="href string:${obj/getURL}/view;
title obj/Description;
class string:$item_wf_state_class tile $item_class">
<img tal:replace="structure item_icon/html_tag" />
<tal:title content="obj/pretty_title_or_id">
Title
</tal:title>
<img class="image-icon"
tal:define="getIcon python:obj.getURL()+'/@@images/image/icon'"
tal:condition="python: obj.getIcon"
tal:attributes="href obj/getURL;
src string:$getIcon">
<span tal:content="obj/pretty_title_or_id">
Title
</span>

</a>
<time class="portletItemDetails"
Expand Down
16 changes: 11 additions & 5 deletions plone/app/portlets/portlets/review.pt
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,28 @@
<tal:items tal:repeat="o view/review_items">
<li class="portletItem"
tal:define="oddrow repeat/o/odd;
review_state o/review_state;"
review_state_class o/review_state_class;
item_class o/item_class;"
tal:attributes="class python:oddrow and 'portletItem even' or 'portletItem odd'">

<a href="#"
tal:attributes="href string:${o/path}/view;
title o/description;
class string:${o/review_state_class}visualIconPadding tile">
<img tal:replace="structure o/icon" />
class string:$review_state_class tile $item_class">
<img class="image-icon"
tal:define="getIcon string:${o/path}/@@images/image/icon"
tal:condition="o/hasImage"
tal:attributes="href string:${o/path}/view;
src string:$getIcon">
<span tal:replace="o/title">
Title
</span>
</a>

<span class="portletItemDetails">
<span tal:replace="o/creator">Jim Smith</span> &mdash;
<span tal:replace="o/mod_date"> May 5</span>
<time tal:replace="o/mod_date"> May 5</time>
</span>
</a>

</li>
</tal:items>
Expand Down
5 changes: 2 additions & 3 deletions plone/app/portlets/portlets/review.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ def _data(self):
workflow = getToolByName(context, 'portal_workflow')

plone_view = getMultiAdapter((context, self.request), name='plone')
plone_layout = getMultiAdapter((context, self.request), name='plone_layout')
getMember = getToolByName(context, 'portal_membership').getMemberById
getIcon = plone_layout.getIcon
toLocalizedTime = plone_view.toLocalizedTime

idnormalizer = queryUtility(IIDNormalizer)
Expand All @@ -81,12 +79,13 @@ def _data(self):
items.append(dict(
path=obj.absolute_url(),
title=obj.pretty_title_or_id(),
item_class = 'contenttype-' + norm(obj.portal_type),
description=obj.Description(),
icon=getIcon(obj).html_tag(),
creator=creator_name,
review_state=review_state,
review_state_class='state-%s ' % norm(review_state),
mod_date=toLocalizedTime(obj.ModificationDate()),
hasImage = True if obj.image else False,
))
return items

Expand Down