-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
184 additions
and
71 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
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
Empty file.
20 changes: 20 additions & 0 deletions
20
src/plonemeeting/portal/core/browser/providers/change_state.pt
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,20 @@ | ||
<tal:change-state-menu> | ||
<button class="btn-delib btn-delib-icon-text dropdown-toggle" type="button" data-bs-toggle="dropdown" | ||
aria-expanded="false"> | ||
<i class="bi bi-bezier2"></i> | ||
<span i18n:translate="">Change state</span> | ||
<i class="bi bi-caret-right-fill"></i> | ||
</button> | ||
<ul class="dropdown-menu" i18n:domain="plone"> | ||
<li tal:repeat="transition view/transitions"> | ||
<a class="dropdown-item" href="#" | ||
tal:attributes="href transition/url"> | ||
<tal:title content="structure transition/title" | ||
i18n:translate="" | ||
> | ||
Title | ||
</tal:title> | ||
</a> | ||
</li> | ||
</ul> | ||
</tal:change-state-menu> |
44 changes: 44 additions & 0 deletions
44
src/plonemeeting/portal/core/browser/providers/change_state.py
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 @@ | ||
from IPython.testing.ipunittest import ipdoctest | ||
from Products.CMFCore.utils import getToolByName | ||
from plone.base.interfaces.controlpanel import ISiteSchema | ||
from plone.protect.utils import addTokenToUrl | ||
from plone.registry.interfaces import IRegistry | ||
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile | ||
from zope.browsermenu.interfaces import IBrowserMenu | ||
from zope.component import getUtility | ||
from zope.contentprovider.interfaces import ITALNamespaceData | ||
from zope.contentprovider.provider import ContentProviderBase | ||
from zope.interface import implementer, Interface, provider | ||
from zope.schema import Field | ||
from plone.memoize.instance import memoize | ||
|
||
|
||
@provider(ITALNamespaceData) | ||
class IChangeStateButton(Interface): | ||
actual_context = Field("Provider context.", required=False) | ||
|
||
|
||
@implementer(IChangeStateButton) | ||
class ChangeStateButtonProvider(ContentProviderBase): | ||
"""Content menu provider for the "view" tab: displays the menu""" | ||
|
||
index = ViewPageTemplateFile("change_state.pt") | ||
|
||
def update(self): | ||
if not hasattr(self, "actual_context") or self.actual_context is None: | ||
self.actual_context = self.context | ||
self.transitions = self._transitions() | ||
super().update() | ||
|
||
def render(self): | ||
return self.index() | ||
|
||
def _transitions(self): | ||
wf_tool = getToolByName(self.actual_context, "portal_workflow") | ||
transitions = wf_tool.listActionInfos(object=self.actual_context) | ||
res = [] | ||
for t in transitions: | ||
if t["allowed"] and t["available"]: | ||
t["url"] = addTokenToUrl(t["url"], self.request) | ||
res.append(t) | ||
return res |
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
13 changes: 0 additions & 13 deletions
13
src/plonemeeting/portal/core/browser/templates/macros/annexes.pt
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
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