Merge branch 'master' into bbmaster
This commit is contained in:
commit
e21adfa364
6 changed files with 50 additions and 25 deletions
|
@ -392,6 +392,40 @@ class BaseView(GenericView, I18NView):
|
|||
def uniqueId(self):
|
||||
return util.getUidForObject(self.context)
|
||||
|
||||
@Lazy
|
||||
def breadcrumbsTitle(self):
|
||||
return self.title
|
||||
|
||||
@Lazy
|
||||
def listingTitle(self):
|
||||
return self.title
|
||||
|
||||
def getViewForObject(self, obj):
|
||||
if obj is not None:
|
||||
obj = baseObject(obj)
|
||||
basicView = component.getMultiAdapter((obj, self.request))
|
||||
if hasattr(basicView, 'view'):
|
||||
return basicView.view
|
||||
|
||||
def viewIterator(self, objs):
|
||||
request = self.request
|
||||
for obj in objs:
|
||||
view = self.getViewForObject(obj)
|
||||
if view is None:
|
||||
view = BaseView(obj, request)
|
||||
yield view
|
||||
|
||||
def xx_viewIterator(self,obj):
|
||||
view = component.queryMultiAdapter(
|
||||
(o, request), name='index.html')
|
||||
#if view is None:
|
||||
# view = component.queryMultiAdapter((o, request), IBrowserView)
|
||||
if view is None:
|
||||
view = BaseView(o, request)
|
||||
if hasattr(view, 'view'): # use view setting for type
|
||||
view = view.view
|
||||
yield view
|
||||
|
||||
# type stuff
|
||||
|
||||
@Lazy
|
||||
|
@ -434,16 +468,6 @@ class BaseView(GenericView, I18NView):
|
|||
return absoluteURL(provider, self.request)
|
||||
return None
|
||||
|
||||
def viewIterator(self, objs):
|
||||
request = self.request
|
||||
for o in objs:
|
||||
view = component.queryMultiAdapter((o, request), name='index.html')
|
||||
#if view is None:
|
||||
# view = component.queryMultiAdapter((o, request), IBrowserView)
|
||||
if view is None:
|
||||
view = BaseView(o, request)
|
||||
yield view
|
||||
|
||||
def renderText(self, text, contentType):
|
||||
text = util.toUnicode(text)
|
||||
typeKey = util.renderingFactories.get(contentType, None)
|
||||
|
|
|
@ -397,6 +397,8 @@ class CreateConceptForm(CreateObjectForm):
|
|||
parentType.getChildren([subtypePred]))
|
||||
types = [dict(token=ConceptTypeInfo(t).token, title=t.title)
|
||||
for t in tconcepts]
|
||||
if self.defaultTypeToken is None and types:
|
||||
self.defaultTypeToken = types[0]['token']
|
||||
if include or include is None:
|
||||
return util.KeywordVocabulary(types + self.listTypes(include, ('hidden',)))
|
||||
return util.KeywordVocabulary(types)
|
||||
|
|
|
@ -78,7 +78,10 @@
|
|||
id="dialog_form" class="dialog"
|
||||
dojoType="dijit.form.Form"
|
||||
tal:define="qualifier request/qualifier|view/qualifier|string:resource;
|
||||
innerForm request/inner_form|view/inner_form|string:inner_form.html;
|
||||
innerForm
|
||||
request/inner_form|view/inner_form|string:inner_form.html;
|
||||
typesVocabulary python:
|
||||
view.getTypesVocabulary((qualifier,));
|
||||
typeToken view/typeToken;
|
||||
fixedType view/fixedType;
|
||||
langInfo view/languageInfo;
|
||||
|
@ -104,8 +107,7 @@
|
|||
'${view/virtualTargetUrl}/$innerForm')">
|
||||
<option value=".loops/concepts/note"
|
||||
i18n:translate=""
|
||||
tal:repeat="type python:
|
||||
view.getTypesVocabulary((qualifier,))"
|
||||
tal:repeat="type typesVocabulary"
|
||||
tal:content="type/title"
|
||||
tal:attributes="value type/token;
|
||||
selected python:type.token == typeToken">
|
||||
|
@ -115,12 +117,6 @@
|
|||
<input type="hidden" name="form.type"
|
||||
tal:condition="fixedType"
|
||||
tal:attributes="value typeToken" />
|
||||
<script type="text/javascript"
|
||||
tal:condition="not:fixedType"
|
||||
tal:content="string:replaceFieldsNode(
|
||||
'form.fields', 'form.type',
|
||||
'${view/virtualTargetUrl}/$innerForm')">
|
||||
</script>
|
||||
</th></tr></tbody>
|
||||
|
||||
<tbody><tr><td colspan="5">
|
||||
|
@ -313,7 +309,7 @@
|
|||
<input value="Save" type="submit"
|
||||
i18n:attributes="value"
|
||||
tal:attributes="onClick python: view.closeAction(True) or
|
||||
'submit()'">
|
||||
'return true'">
|
||||
<input type="button" value="Cancel" onClick="dlg.hide();"
|
||||
i18n:attributes="value"
|
||||
tal:condition="view/isInnerHtml"
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
<img tal:define="icon row/icon"
|
||||
tal:condition="icon"
|
||||
tal:attributes="src icon/src" />
|
||||
<div tal:content="row/title" /></a>
|
||||
<div tal:content="row/listingTitle" /></a>
|
||||
</td>
|
||||
<td i18n:translate="" class="center"
|
||||
tal:content="row/longTypeTitle|row/typeTitle">Type</td>
|
||||
|
|
|
@ -37,7 +37,7 @@ from loops import util
|
|||
class Field(BaseField):
|
||||
|
||||
def getSelectValue(self, row):
|
||||
return self.getRawValue(row)
|
||||
return self.getValue(row)
|
||||
|
||||
|
||||
class TextField(Field):
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
|
||||
"""
|
||||
Adapter and view class(es) for statistics reporting.
|
||||
|
||||
$Id$
|
||||
"""
|
||||
|
||||
from datetime import date, datetime
|
||||
|
@ -268,9 +266,14 @@ class TrackDetails(BaseView):
|
|||
obj = self.object
|
||||
node = self.view.nodeView
|
||||
url = node is not None and node.getUrlForTarget(obj) or ''
|
||||
view = self.view.getViewForObject(obj)
|
||||
if view is None:
|
||||
title = obj.title
|
||||
else:
|
||||
title = view.listingTitle
|
||||
versionable = IVersionable(self.object, None)
|
||||
version = versionable is not None and versionable.versionId or ''
|
||||
return dict(object=obj, title=obj.title,
|
||||
return dict(object=obj, title=title,
|
||||
type=self.longTypeTitle, url=url, version=version,
|
||||
canAccess=canAccessObject(obj))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue