include a table with subfolders in folder view (#4687)
This gives access to a link to remove the folder from its parent folder.
This commit is contained in:
parent
d7dd22c01c
commit
a00aadd3e6
|
@ -39,8 +39,6 @@ from collective.dms.thesaurus.keywordsfield import ThesaurusKeywords
|
|||
from collective.dms.basecontent.dmsdocument import IDmsDocument
|
||||
|
||||
|
||||
from .link import ILink
|
||||
|
||||
from . import _
|
||||
|
||||
class IFolder(model.Schema):
|
||||
|
@ -95,6 +93,7 @@ class Folder(Container):
|
|||
return self.title
|
||||
|
||||
def parent_folders(self):
|
||||
from .link import ILink
|
||||
parents = []
|
||||
sm = getSecurityManager()
|
||||
for id, item in self.contentItems():
|
||||
|
@ -107,6 +106,7 @@ class Folder(Container):
|
|||
return parents
|
||||
|
||||
def child_folders_brains(self):
|
||||
from .link import ILink
|
||||
intids = component.getUtility(IIntIds)
|
||||
intid_catalog = component.getUtility(ICatalog)
|
||||
try:
|
||||
|
@ -157,6 +157,7 @@ from collective.dms.basecontent.browser import column
|
|||
class ClassifiedItems:
|
||||
|
||||
def documents(self):
|
||||
from .link import ILink
|
||||
if self.context.id == 'documents' and aq_parent(self.context).portal_type == 'Plone Site':
|
||||
# never return anything in the main documents folder
|
||||
return []
|
||||
|
|
|
@ -21,6 +21,7 @@ from z3c.relationfield.schema import RelationChoice
|
|||
from plone.app.contentlisting.realobject import RealContentListingObject
|
||||
|
||||
from . import _
|
||||
from .folder import IFolder
|
||||
|
||||
from plone.app.layout.navigation.interfaces import INavtreeStrategy
|
||||
from plone.formwidget.contenttree.utils import closest_content
|
||||
|
@ -222,3 +223,13 @@ class LinkViewlet(BaseViewlet):
|
|||
grok.order(15)
|
||||
label = _(u"Filed in folders")
|
||||
__table__ = LinksTable
|
||||
|
||||
|
||||
class FolderBelowContentViewletManager(grok.ViewletManager):
|
||||
grok.context(IFolder)
|
||||
grok.name('folder.belowcontent')
|
||||
|
||||
|
||||
class LinkFolderViewlet(LinkViewlet):
|
||||
grok.context(IFolder)
|
||||
grok.viewletmanager(FolderBelowContentViewletManager)
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<div tal:replace="structure provider:plone.belowcontenttitle" />
|
||||
|
||||
<input type="hidden" name="folder_intid" tal:attributes="value context/intid"/>
|
||||
<div id="searchresults"/>
|
||||
<div id="searchresults"><span class="loading">(chargement en cours...)</span></div>
|
||||
|
||||
<div style="display: none;">
|
||||
<input id="sort_on" value="sortable_title"/>
|
||||
|
@ -27,6 +27,10 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div id="folder-metadata">
|
||||
<fieldset>
|
||||
<legend>Métadonnées et permissions</legend>
|
||||
<div tal:condition="context/keywords">
|
||||
<label>Mots-clés</label>
|
||||
<tal:list>
|
||||
|
@ -49,6 +53,13 @@
|
|||
<div tal:condition="context/recipient_groups">
|
||||
<label>Lisible par</label> <div tal:content="structure view/w/recipient_groups"/>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="folder-filed">
|
||||
<tal:belowcontent replace="structure provider:folder.belowcontent" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
|
Reference in New Issue