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

Adapt styles to Plone 6 #96

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Next Next commit
Adapt viewlet styles to Plone 6
  • Loading branch information
pbauer committed Jul 26, 2021
commit 3fe7afd4aa93ceedb04a95a52cb3d5fdc2c406d0
1 change: 1 addition & 0 deletions news/95.news
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adapt viewlet styles to Plone 6 [pbauer]
5 changes: 5 additions & 0 deletions plone/app/iterate/browser/info.py
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
from plone.app.iterate.interfaces import ICheckinCheckoutPolicy
from plone.app.iterate.interfaces import keys
from plone.app.iterate.permissions import CheckoutPermission
from plone.app.layout.viewlets.globalstatusmessage import MTYPES_DISPLAY
from plone.memoize.instance import memoize
from Products.CMFCore.permissions import ModifyPortalContent
from Products.CMFCore.utils import getToolByName
@@ -97,6 +98,10 @@ def properties(self):
def _getReference(self):
raise NotImplementedError

def display_info_for_mtype(self, mtype):
"""get info for display of an mtype"""
return MTYPES_DISPLAY.get(mtype, MTYPES_DISPLAY["info"])


class BaselineInfoViewlet(BaseInfoViewlet):

14 changes: 10 additions & 4 deletions plone/app/iterate/browser/info_baseline.pt
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<div class="portalMessage warning"
<div class="portalMessage ${python:display_info['cssclass']}"
tal:define="working_copy view/working_copy;
isAnon context/@@plone_portal_state/anonymous;"
isAnon context/@@plone_portal_state/anonymous;
display_info python:view.display_info_for_mtype('warning');
icons nocall: context/@@iconresolver;
"
i18n:domain="plone"
tal:condition="python: not isAnon">
tal:condition="python: not isAnon"
role="alert">

<strong i18n:translate="">Warning</strong>
<tal:icon tal:replace="structure python:icons.tag(display_info['icon'], tag_alt=display_info['msg'], tag_class='statusmessage-icon mb-1 me-2')" />

<strong>${python:display_info['msg']}</strong>
<tal:block i18n:translate="working_copy_info">
This item is being edited by
<a i18n:name="creator"
11 changes: 8 additions & 3 deletions plone/app/iterate/browser/info_checkout.pt
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<div class="portalMessage info"
tal:define="baseline view/baseline;"
<div class="portalMessage ${python:display_info['cssclass']}"
tal:define="baseline view/baseline;
display_info python:view.display_info_for_mtype('warning');
icons nocall: context/@@iconresolver;
"
i18n:domain="plone">

<strong i18n:translate="">Warning</strong>
<tal:icon tal:replace="structure python:icons.tag(display_info['icon'], tag_alt=display_info['msg'], tag_class='statusmessage-icon mb-1 me-2')" />

<strong>${python:display_info['msg']}</strong>
<tal:block i18n:translate="checkout_info">

This is a working copy of