provide simple object info page (as modal dialog)
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@2571 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
		
							parent
							
								
									1d375d5a5f
								
							
						
					
					
						commit
						89745445e2
					
				
					 6 changed files with 55 additions and 30 deletions
				
			
		| 
						 | 
					@ -98,14 +98,16 @@ class DialogAction(Action):
 | 
				
			||||||
actions.register('info', 'object', DialogAction,
 | 
					actions.register('info', 'object', DialogAction,
 | 
				
			||||||
        description=_(u'Information about this object.'),
 | 
					        description=_(u'Information about this object.'),
 | 
				
			||||||
        viewName='object_info.html',
 | 
					        viewName='object_info.html',
 | 
				
			||||||
        dialogName='object_info',
 | 
					        #dialogName='object_info',
 | 
				
			||||||
 | 
					        dialogName='',
 | 
				
			||||||
        icon='cybertools.icons/info.png',
 | 
					        icon='cybertools.icons/info.png',
 | 
				
			||||||
        cssClass='icon-action',
 | 
					        cssClass='icon-action',
 | 
				
			||||||
 | 
					        addParams=dict(version='this')
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
actions.register('external_edit', 'object', TargetAction,
 | 
					actions.register('external_edit', 'object', TargetAction,
 | 
				
			||||||
        description=_(u'Edit with external editor.'),
 | 
					        description=_(u'Edit with external editor.'),
 | 
				
			||||||
        viewName='external_edit?version=this',
 | 
					        viewName='external_edit',
 | 
				
			||||||
        icon='edit.gif',
 | 
					        icon='edit.gif',
 | 
				
			||||||
        cssClass='icon-action',
 | 
					        cssClass='icon-action',
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -138,7 +138,7 @@
 | 
				
			||||||
                  </td>
 | 
					                  </td>
 | 
				
			||||||
                </tal:version>
 | 
					                </tal:version>
 | 
				
			||||||
                <td style="text-align: right; white-space: nowrap">
 | 
					                <td style="text-align: right; white-space: nowrap">
 | 
				
			||||||
                  <span tal:replace="related/context/sizeForDisplay">Type</span>
 | 
					                  <span tal:replace="related/context/sizeForDisplay">2 MB</span>
 | 
				
			||||||
                </td>
 | 
					                </td>
 | 
				
			||||||
                <td><span tal:replace="related/modified">2007-03-30</span></td>
 | 
					                <td><span tal:replace="related/modified">2007-03-30</span></td>
 | 
				
			||||||
                <td><span tal:replace="related/creators">John</span></td>
 | 
					                <td><span tal:replace="related/creators">John</span></td>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										46
									
								
								browser/info.pt
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								browser/info.pt
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,46 @@
 | 
				
			||||||
 | 
					<!-- object information -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<metal:info define-macro="object_info"
 | 
				
			||||||
 | 
					            tal:define="item nocall:view/item">
 | 
				
			||||||
 | 
					  <table class="object_info">
 | 
				
			||||||
 | 
					    <tr>
 | 
				
			||||||
 | 
					      <td colspan="2"><h2 i18n:translate="">Object Information</h2><br /></td>
 | 
				
			||||||
 | 
					    </tr>
 | 
				
			||||||
 | 
					    <tr>
 | 
				
			||||||
 | 
					      <td><span i18n:translate="">Title</span>:</td>
 | 
				
			||||||
 | 
					      <td tal:content="item/title"></td>
 | 
				
			||||||
 | 
					    </tr>
 | 
				
			||||||
 | 
					    <tr>
 | 
				
			||||||
 | 
					      <td><span i18n:translate="">Description</span>:</td>
 | 
				
			||||||
 | 
					      <td tal:content="item/description"></td>
 | 
				
			||||||
 | 
					    </tr>
 | 
				
			||||||
 | 
					    <tr>
 | 
				
			||||||
 | 
					      <td><span i18n:translate="">Name</span>:</td>
 | 
				
			||||||
 | 
					      <td tal:content="item/context/__name__"></td>
 | 
				
			||||||
 | 
					    </tr>
 | 
				
			||||||
 | 
					    <tr>
 | 
				
			||||||
 | 
					      <td><span i18n:translate="">Type</span>:</td>
 | 
				
			||||||
 | 
					      <td tal:content="item/longTypeTitle"></td>
 | 
				
			||||||
 | 
					    </tr>
 | 
				
			||||||
 | 
					    <tr>
 | 
				
			||||||
 | 
					      <td><span i18n:translate="">Size</span>:</td>
 | 
				
			||||||
 | 
					      <td tal:content="item/context/sizeForDisplay"></td>
 | 
				
			||||||
 | 
					    </tr>
 | 
				
			||||||
 | 
					    <tr>
 | 
				
			||||||
 | 
					      <td><span i18n:translate="">modified</span>:</td>
 | 
				
			||||||
 | 
					      <td tal:content="item/modified"></td>
 | 
				
			||||||
 | 
					    </tr>
 | 
				
			||||||
 | 
					    <tr>
 | 
				
			||||||
 | 
					      <td><span i18n:translate="">Creators</span>:</td>
 | 
				
			||||||
 | 
					      <td tal:content="item/creators"></td>
 | 
				
			||||||
 | 
					    </tr>
 | 
				
			||||||
 | 
					    <tr>
 | 
				
			||||||
 | 
					      <td colspan="2"><br />
 | 
				
			||||||
 | 
					        <input type="button" value="Close" onclick="closeDialog()"
 | 
				
			||||||
 | 
					               i18n:attributes="value" />
 | 
				
			||||||
 | 
					      </td>
 | 
				
			||||||
 | 
					    </tr>
 | 
				
			||||||
 | 
					  </table>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</metal:info>
 | 
				
			||||||
| 
						 | 
					@ -105,14 +105,14 @@ function setConceptTypeForComboBox(typeId, cbId) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var dialog;
 | 
					var dialog;
 | 
				
			||||||
var dialogName
 | 
					var dialogName;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function objectDialog(dlgName, url) {
 | 
					function objectDialog(dlgName, url) {
 | 
				
			||||||
    dojo.require('dijit.Dialog');
 | 
					    dojo.require('dijit.Dialog');
 | 
				
			||||||
    dojo.require('dojo.parser');
 | 
					    dojo.require('dojo.parser');
 | 
				
			||||||
    dojo.require('dijit.form.FilteringSelect');
 | 
					    dojo.require('dijit.form.FilteringSelect');
 | 
				
			||||||
    dojo.require('dojox.data.QueryReadStore');
 | 
					    dojo.require('dojox.data.QueryReadStore');
 | 
				
			||||||
    if (dialogName == undefined || dialogName != dlgName) {
 | 
					    if (dialogName == undefined || dialogName != dlgName || dialogName == '') {
 | 
				
			||||||
        if (dialog != undefined) {
 | 
					        if (dialog != undefined) {
 | 
				
			||||||
            dialog.destroyRecursive();
 | 
					            dialog.destroyRecursive();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -64,6 +64,7 @@ from loops.versioning.util import getVersion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
node_macros = ViewPageTemplateFile('node_macros.pt')
 | 
					node_macros = ViewPageTemplateFile('node_macros.pt')
 | 
				
			||||||
 | 
					info_macros = ViewPageTemplateFile('info.pt')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class NodeView(BaseView):
 | 
					class NodeView(BaseView):
 | 
				
			||||||
| 
						 | 
					@ -375,25 +376,6 @@ class NodeView(BaseView):
 | 
				
			||||||
        if target is not None:
 | 
					        if target is not None:
 | 
				
			||||||
            return BaseView(target, self.request).url
 | 
					            return BaseView(target, self.request).url
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # states information
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    @Lazy
 | 
					 | 
				
			||||||
    def xxx_states(self):
 | 
					 | 
				
			||||||
        result = []
 | 
					 | 
				
			||||||
        if not checkPermission('loops.ManageSite', self.context):
 | 
					 | 
				
			||||||
            # TODO: replace by more sensible permission
 | 
					 | 
				
			||||||
            return result
 | 
					 | 
				
			||||||
        target = self.virtualTargetObject
 | 
					 | 
				
			||||||
        #statesDefs = ['loops.classification_quality', 'loops.simple_publishing']
 | 
					 | 
				
			||||||
        if IResource.providedBy(target):
 | 
					 | 
				
			||||||
            statesDefs = self.globalOptions('organize.stateful.resource', ())
 | 
					 | 
				
			||||||
        else:
 | 
					 | 
				
			||||||
            statesDefs = ()
 | 
					 | 
				
			||||||
        for std in statesDefs:
 | 
					 | 
				
			||||||
            stf = component.getAdapter(target, IStateful, name=std)
 | 
					 | 
				
			||||||
            result.append(stf)
 | 
					 | 
				
			||||||
        return result
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # target viewing and editing support
 | 
					    # target viewing and editing support
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def getUrlForTarget(self, target):
 | 
					    def getUrlForTarget(self, target):
 | 
				
			||||||
| 
						 | 
					@ -489,7 +471,7 @@ class ObjectInfo(NodeView):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @property
 | 
					    @property
 | 
				
			||||||
    def macro(self):
 | 
					    def macro(self):
 | 
				
			||||||
        return self.template.macros['object_info']
 | 
					        return info_macros.macros['object_info']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Lazy
 | 
					    @Lazy
 | 
				
			||||||
    def dialog_name(self):
 | 
					    def dialog_name(self):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -218,11 +218,6 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<!-- inner HTML macros -->
 | 
					<!-- inner HTML macros -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<metal:info define-macro="object_info">
 | 
					 | 
				
			||||||
  <div>Object Information</div>
 | 
					 | 
				
			||||||
</metal:info>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
<div metal:define-macro="inline_edit"
 | 
					<div metal:define-macro="inline_edit"
 | 
				
			||||||
     class="content-1" id="1.body">
 | 
					     class="content-1" id="1.body">
 | 
				
			||||||
  <form action="." method="post" id="1.form">
 | 
					  <form action="." method="post" id="1.form">
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue