Merge branch 'master' into bbmaster
This commit is contained in:
		
						commit
						0263eacb3b
					
				
					 3 changed files with 27 additions and 18 deletions
				
			
		|  | @ -68,6 +68,7 @@ from loops.config.base import DummyOptions | |||
| from loops.i18n.browser import I18NView | ||||
| from loops.interfaces import IResource, IView, INode, ITypeConcept | ||||
| from loops.organize.tracking import access | ||||
| from loops.organize.util import getRolesForPrincipal | ||||
| from loops.resource import Resource | ||||
| from loops.security.common import checkPermission | ||||
| from loops.security.common import canAccessObject, canListObject, canWriteObject | ||||
|  | @ -780,7 +781,16 @@ class BaseView(GenericView, I18NView): | |||
| 
 | ||||
|     @Lazy | ||||
|     def showObjectActions(self): | ||||
|         return not IUnauthenticatedPrincipal.providedBy(self.request.principal) | ||||
|         principal = self.request.principal | ||||
|         if IUnauthenticatedPrincipal.providedBy(principal): | ||||
|             return False | ||||
|         perms = self.globalOptions('action.object.permissions') | ||||
|         if perms: | ||||
|             for p in perms: | ||||
|                 if checkPermission(p, self.context): | ||||
|                     return True | ||||
|             return False | ||||
|         return True | ||||
| 
 | ||||
|     def checkAction(self, name, category, target): | ||||
|         if name in ('create_resource',): | ||||
|  |  | |||
|  | @ -25,30 +25,29 @@ | |||
|       <tal:title condition="not:view/isInnerHtml"> | ||||
|         <h1 tal:content="request/view_title|view/title" | ||||
|             i18n:translate="">Edit Information Object</h1> | ||||
|         <br /> | ||||
|       </tal:title> | ||||
| 
 | ||||
|       <table cellpadding="3" class="form"> | ||||
|         <tbody> | ||||
|           <tr tal:condition="view/isInnerHtml"> | ||||
|         <tbody tal:condition="view/isInnerHtml"> | ||||
|           <tr> | ||||
|             <th colspan="5" class="headline" | ||||
|                 tal:attributes="colspan python: useI18N and 4 or 5"> | ||||
|               <span tal:content="request/view_title|view/title" | ||||
|                     i18n:translate="">Edit Information Object</span> | ||||
|             </th> | ||||
|           <th tal:condition="useI18N" | ||||
|               style="vertical-align: bottom; text-align: right; | ||||
|                      padding-right: 1em"> | ||||
|             <select name="loops.language" id="loops.language" | ||||
|                     tal:attributes="onChange | ||||
|                             string:return replaceFieldsNodeForLanguage( | ||||
|                                     'form.fields', 'loops.language', | ||||
|                                     '${view/virtualTargetUrl}/$innerForm')"> | ||||
|               <option tal:repeat="lang languages" | ||||
|                       tal:content="lang" | ||||
|                       tal:attributes="selected python: lang == language;">en</option> | ||||
|             </select> | ||||
|           </th> | ||||
|             <th tal:condition="useI18N" | ||||
|                 style="vertical-align: bottom; text-align: right; | ||||
|                        padding-right: 1em"> | ||||
|               <select name="loops.language" id="loops.language" | ||||
|                       tal:attributes="onChange | ||||
|                               string:return replaceFieldsNodeForLanguage( | ||||
|                                       'form.fields', 'loops.language', | ||||
|                                       '${view/virtualTargetUrl}/$innerForm')"> | ||||
|                 <option tal:repeat="lang languages" | ||||
|                         tal:content="lang" | ||||
|                         tal:attributes="selected python: lang == language;">en</option> | ||||
|               </select> | ||||
|             </th> | ||||
|         </tr></tbody> | ||||
| 
 | ||||
|         <tbody metal:define-slot="custom_header" /> | ||||
|  |  | |||
|  | @ -138,7 +138,7 @@ class BaseMemberRegistration(NodeView): | |||
|         name = '.'.join((self.text_names_prefix, self.info_key)) | ||||
|         text = self.resourceManager.get(name) | ||||
|         if text: | ||||
|             return self.renderText(text.data) | ||||
|             return self.renderText(text.data, text.contentType) | ||||
|         return u'' | ||||
| 
 | ||||
|     @Lazy | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue