Changeset 1377
- Timestamp:
- 09/02/08 16:54:23 (3 months ago)
- Files:
-
- pleiades.workspace/trunk/pleiades/workspace/browser/collection_icon.gif (added)
- pleiades.workspace/trunk/pleiades/workspace/browser/configure.zcml (modified) (2 diffs)
- pleiades.workspace/trunk/pleiades/workspace/browser/import_kml_form.pt (modified) (1 diff)
- pleiades.workspace/trunk/pleiades/workspace/browser/kml.py (modified) (1 diff)
- pleiades.workspace/trunk/pleiades/workspace/browser/manage.py (added)
- pleiades.workspace/trunk/pleiades/workspace/browser/manage_collection_form.pt (added)
- pleiades.workspace/trunk/pleiades/workspace/browser/workspace.css (modified) (1 diff)
- pleiades.workspace/trunk/pleiades/workspace/browser/workspace.pt (modified) (1 diff)
- pleiades.workspace/trunk/pleiades/workspace/browser/workspace_icon.gif (modified) (previous)
- pleiades.workspace/trunk/pleiades/workspace/content/workspace.py (modified) (1 diff)
- pleiades.workspace/trunk/pleiades/workspace/interfaces.py (modified) (1 diff)
- pleiades.workspace/trunk/pleiades/workspace/profiles/default/types/Workspace_Collection.xml (added)
- pleiades.workspace/trunk/pleiades/workspace/profiles/default/types/Workspace_Folder.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pleiades.workspace/trunk/pleiades/workspace/browser/configure.zcml
r1373 r1377 16 16 image="workspace_icon.gif" 17 17 /> 18 18 19 <browser:resource 20 name="collection_icon.gif" 21 image="collection_icon.gif" 22 /> 23 19 24 <browser:page 20 25 for="..interfaces.IWorkspace" … … 60 65 /> 61 66 62 < !--browser:page63 for="..interfaces.IWorkspace "64 name=" import-xml-form"65 class=". xml.XMLImportForm"66 permission=" zope2.View"67 / -->67 <browser:page 68 for="..interfaces.IWorkspaceCollection" 69 name="manage-collection-form" 70 class=".manage.ManageCollectionForm" 71 permission="cmf.ModifyPortalContent" 72 /> 68 73 69 74 <browser:page 70 for=" Products.PleiadesEntity.content.interfaces.IName"71 name="manage- workspaces"72 class=".manage.Manage Workspaces"73 permission="cmf. AddPortalContent"75 for="..interfaces.IWorkspaceCollection" 76 name="manage-collection" 77 class=".manage.ManageCollection" 78 permission="cmf.ModifyPortalContent" 74 79 /> 75 80 pleiades.workspace/trunk/pleiades/workspace/browser/import_kml_form.pt
r1289 r1377 9 9 10 10 <metal:main fill-slot="main"> 11 <tal:main-macro metal:define-macro="main" 12 tal:define="text context/text;"> 11 <tal:main-macro 12 metal:define-macro="main" 13 tal:define="text context/text;" 14 > 13 15 14 <form action="import-kml" enctype="multipart/form-data" method="post"> 15 <p>KML File: <input name="file" type="file"/></p> 16 <p><input name="submit" type="submit" value="Import"/></p> 17 </form> 16 <div tal:replace="structure provider:plone.abovecontenttitle" /> 17 18 <h1 class="documentFirstHeading">Upload Data From KML</h1> 19 20 <!--div class="documentDescription"> 21 <span 22 metal:use-macro="python:context.widget('description', mode='view')" 23 /> 24 </div--> 25 26 <!--div tal:replace="structure provider:plone.abovecontentbody" /--> 27 28 <p>Select an uncompressed KML document (.kml) from your filesystem and post 29 it using the form below. One feature and one place will be created for each 30 placemark element in the document; one name will be created for each 31 placemark title; one location will be created for each geometry. 32 </p> 33 34 <form 35 action="import-kml" 36 enctype="multipart/form-data" 37 method="post" 38 > 39 <p>KML File: <input name="file" type="file"/></p> 40 <p><input name="submit" type="submit" value="Upload"/></p> 41 </form> 18 42 19 </tal:main-macro>43 </tal:main-macro> 20 44 </metal:main> 21 45 pleiades.workspace/trunk/pleiades/workspace/browser/kml.py
r1374 r1377 67 67 68 68 transaction.commit() 69 return "Success" 69 70 # Redirect to the workspace 71 response.setStatus(201) 72 response.setHeader( 73 'Location', 74 '%s/drafting' % self.context.absolute_url() 75 ) 76 response.redirect('%s/drafting' % self.context.absolute_url()) 70 77 71 78 pleiades.workspace/trunk/pleiades/workspace/browser/workspace.css
r1374 r1377 1 table { 1 div.ws-dashboard { 2 border: solid orange 1px; 3 padding: 1em; 4 } 5 6 table.ws-dashboard { 2 7 text-align: left; 3 8 border-spacing: 1em; 4 }9 } 5 10 pleiades.workspace/trunk/pleiades/workspace/browser/workspace.pt
r1374 r1377 34 34 <div tal:replace="structure provider:plone.abovecontentbody" /> 35 35 36 <p tal:condition="python: not text and is_editable" 37 i18n:translate="no_body_text" 38 class="discreet"> 39 This item does not have any body text, click the edit tab to change it. 40 </p> 36 <div class="ws-dashboard"> 37 <p>Current status of data by type is shown in the table below. Count of items in each collection is shown in a link. Alternate representations of the data collections appear in square brackets.</p> 38 <table class="ws-dashboard"> 39 <tr> 40 <th>Type/Status</th> 41 <th>Drafting</th> 42 <th>Pending</th> 43 <th>Published</th> 44 <th>All</th> 45 </tr> 46 <tr tal:repeat="tname python:['locations', 'names', 'features', 'places']"> 47 <tal:row tal:define="row python:view.collections_data()[tname]"> 48 <th tal:content="python:tname.capitalize()">NAME</th> 49 <td tal:repeat="data python:[row[state] for state in ('drafting', 'pending', 'published', 'all')]"> 50 <a tal:attributes="href data/url"><span tal:replace="data/count">COUNT</span></a>, <a tal:attributes="href string:${data/url}/@@kml-document">[KML]</a> 51 </td> 52 </tal:row> 53 </tr> 54 <tr tal:define="row python:view.collections_data()['all']"> 55 <th>All</th> 56 <td tal:repeat="data python:[row[state] for state in ('drafting', 'pending', 'published')]"> 57 <a tal:attributes="href data/url"><span tal:replace="data/count">COUNT</span></a> 58 <a tal:attributes="href string:${data/url}/@@kml-document">[KML]</a> 59 </td> 60 </tr> 61 </table> 62 </div> 41 63 42 <div tal:condition="text" metal:use-macro="python:context.widget('text', mode='view')" /> 43 44 <tal:collections> 45 <h2 i18n:translate="title_workspace_collections">Data Dashboard</h2> 46 <table class="workspace-dashboard"> 47 <tr> 48 <th>Type</th> 49 <th>Drafting</th> 50 <th>Pending</th> 51 <th>Published</th> 52 <th>All</th> 53 </tr> 54 <tr tal:repeat="tname python:['locations', 'names', 'features', 'places']"> 55 <tal:row tal:define="row python:view.collections_data[tname]"> 56 <th tal:content="python:tname.capitalize()">NAME</th> 57 <td tal:repeat="data python:[row[state] for state in ('drafting', 'pending', 'published', 'all')]"> 58 <a tal:attributes="href data/url"><span tal:replace="data/count">COUNT</span></a>, <a tal:attributes="href string:${data/url}/@@kml-document">[KML]</a> 59 </td> 60 </tal:row> 61 </tr> 62 <tr tal:define="row python:view.collections_data['all']"> 63 <th>All</th> 64 <td tal:repeat="data python:[row[state] for state in ('drafting', 'pending', 'published')]"> 65 <a tal:attributes="href data/url"><span tal:replace="data/count">COUNT</span></a> 66 <a tal:attributes="href string:${data/url}/@@kml-document">[KML]</a> 67 </td> 68 </tr> 69 </table> 70 </tal:collections> 71 64 <h3>Importing Data</h3> 65 <p>New data can be created by <a href="@@import-kml-form">posting a KML file</a> or by <a href="@@import-xml-form">importing a Pleiades XML file</a>.</p> 66 72 67 <div metal:use-macro="context/document_relateditems/macros/relatedItems"> 73 68 show related items if they exist pleiades.workspace/trunk/pleiades/workspace/content/workspace.py
r1374 r1377 31 31 implements(IWorkspaceCollection) 32 32 portal_type = "Workspace Collection" 33 34 @property 35 def members(self): 36 for brain in self.queryCatalog(): 37 yield brain.getObject() 33 38 34 39 pleiades.workspace/trunk/pleiades/workspace/interfaces.py
r1374 r1377 14 14 15 15 contains('pleiades.workspace.interfaces.IWorkspaceCollection') 16 17 members = Attribute("""Iterator over members of the collection.""") 16 18 17 19 pleiades.workspace/trunk/pleiades/workspace/profiles/default/types/Workspace_Folder.xml
r1327 r1377 10 10 i18n:translate="" 11 11 >A folder for content development workspaces</property> 12 < !--property name="content_icon">++resource++workspace_icon.gif</property-->12 <property name="content_icon">++resource++workspace_icon.gif</property> 13 13 <property name="content_meta_type">Workspace Folder</property> 14 14 <property name="product">pleiades.workspace</property> 15 15 <property name="factory">addWorkspaceFolder</property> 16 <property name="immediate_view"> atct_edit</property>16 <property name="immediate_view">folder_listing</property> 17 17 <property name="global_allow">False</property> 18 18 <property name="filter_content_types">True</property> 19 19 <property name="allowed_content_types"> 20 20 <element value="Workspace" /> 21 <element value="Document" />22 21 </property> 23 22 <property name="allow_discussion">False</property> 24 <property name="default_view"> view</property>23 <property name="default_view">folder_listing</property> 25 24 <property name="view_methods"> 26 <element value="view"/>27 25 <element value="folder_summary_view"/> 28 26 <element value="folder_tabular_view"/> 27 <element value="atct_album_view"/> 29 28 <element value="folder_listing"/> 30 </property>29 </property> 31 30 <alias from="(Default)" to="(dynamic view)"/> 32 31 <alias from="edit" to="atct_edit"/>
