Merge branch 'bbmaster2' of http://git.cy55.de/loops into bbmaster2

This commit is contained in:
hplattner 2016-08-25 12:17:21 +02:00
commit 214fb2dc0f
5 changed files with 42 additions and 17 deletions

View file

@ -196,6 +196,7 @@ class BaseView(GenericView, I18NView, SortableMixin):
icon = None
modeName = 'view'
isToplevel = False
isVisible = True
def __init__(self, context, request):
context = baseObject(context)

View file

@ -183,14 +183,17 @@
tal:attributes="value related/uidToken" />
</td>
</tr>
<tr tal:define="children python:list(related.unique(related.children()));
<tal:nested condition="list_nested">
<tr tal:define="children python:
list(related.unique(related.children()));
resources python:list(related.resources())"
tal:condition="python:list_nested and (children or resources)">
tal:condition="python:children or resources">
<td tal:condition="item/showCheckboxes|nothing" />
<td colspan="5">
<metal:list use-macro="item/template/macros/list_nested" />
</td>
</tr>
</tal:nested>
</tal:item>
</tal:items>
</tbody>

View file

@ -1,5 +1,5 @@
#
# Copyright (c) 2015 Helmut Merz helmutm@cy55.de
# Copyright (c) 2016 Helmut Merz helmutm@cy55.de
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -111,7 +111,9 @@ class NodeView(BaseView):
parts.extend(getParts(n))
return parts
def update(self):
def update(self, topLevel=True):
if topLevel and self.view != self:
return self.view.update(False)
result = super(NodeView, self).update()
self.recordAccess()
return result
@ -410,8 +412,9 @@ class NodeView(BaseView):
@Lazy
def menuItems(self):
return [NodeView(child, self.request)
items = [NodeView(child, self.request).view
for child in self.context.getMenuItems()]
return [item for item in items if item.isVisible]
@Lazy
def parents(self):
@ -439,6 +442,10 @@ class NodeView(BaseView):
def active(self, item):
return item.context == self.context or item.context in self.parents
@Lazy
def authenticationMethod(self):
return self.viewAnnotations.get('auth_method') or 'standard'
# virtual target support
@Lazy

View file

@ -95,6 +95,12 @@
<!-- specialized forms -->
<browser:page
name="create_person.html"
for="loops.interfaces.INode"
class="loops.organize.browser.party.CreatePersonForm"
permission="zope.View" />
<browser:page
name="edit_person.html"
for="loops.interfaces.INode"

View file

@ -1,5 +1,5 @@
#
# Copyright (c) 2015 Helmut Merz helmutm@cy55.de
# Copyright (c) 2016 Helmut Merz helmutm@cy55.de
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -32,7 +32,7 @@ from cybertools.ajax import innerHtml
from cybertools.browser.action import actions
from cybertools.browser.form import FormController
from loops.browser.action import DialogAction
from loops.browser.form import EditConceptForm
from loops.browser.form import CreateConceptForm, EditConceptForm
from loops.browser.node import NodeView
from loops.common import adapted
from loops.organize.party import getPersonForUser
@ -44,7 +44,8 @@ organize_macros = ViewPageTemplateFile('view_macros.pt')
actions.register('createPerson', 'portlet', DialogAction,
title=_(u'Create Person...'),
description=_(u'Create a new person.'),
viewName='create_concept.html',
#viewName='create_concept.html',
viewName='create_person.html',
dialogName='createPerson',
typeToken='.loops/concepts/person',
fixedType=True,
@ -115,19 +116,26 @@ actions.register('send_email', 'object', DialogAction,
)
class EditPersonForm(EditConceptForm):
class PersonForm(object):
@Lazy
def presetTypesForAssignment(self):
types = list(self.typeManager.listTypes(include=('workspace',)))
#assigned = [r.context for r in self.assignments]
#types = [t for t in types if t.typeProvider not in assigned]
predicates = [n for n in ['standard', 'ismember', 'ismaster', 'isowner']
if n in self.conceptManager]
return [dict(title=t.title, token=t.tokenForSearch, predicates=predicates)
for t in types]
class CreatePersonForm(PersonForm, CreateConceptForm):
pass
class EditPersonForm(PersonForm, EditConceptForm):
pass
class SendEmailForm(NodeView):