Author: jmorliaguet Date: Mon Jun 19 21:37:28 2006 New Revision: 3462 Modified: cpsskins/branches/paris-sprint-2006/storage/configure.zcml cpsskins/branches/paris-sprint-2006/storage/locations.py cpsskins/branches/paris-sprint-2006/ui/screens/common/configure.zcml cpsskins/branches/paris-sprint-2006/ui/screens/common/location_selector.pt cpsskins/branches/paris-sprint-2006/ui/screens/common/page_tabs.pt cpsskins/branches/paris-sprint-2006/ui/screens/common/theme_tabs.pt cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py cpsskins/branches/paris-sprint-2006/ui/zmi/views.py
Log: - the location selector now shows existing paths Modified: cpsskins/branches/paris-sprint-2006/storage/configure.zcml ============================================================================== --- cpsskins/branches/paris-sprint-2006/storage/configure.zcml (original) +++ cpsskins/branches/paris-sprint-2006/storage/configure.zcml Mon Jun 19 21:37:28 2006 @@ -53,6 +53,7 @@ title="Location storage" description="A location storage contains local information about the site" class=".locations.LocationStorage" + interface=".locations.ILocationStorage" contains="cpsskins.locations.interfaces.ILocation" /> Modified: cpsskins/branches/paris-sprint-2006/storage/locations.py ============================================================================== --- cpsskins/branches/paris-sprint-2006/storage/locations.py (original) +++ cpsskins/branches/paris-sprint-2006/storage/locations.py Mon Jun 19 21:37:28 2006 @@ -92,3 +92,4 @@ for key in self.keys(): paths.add(key[1:]) return list(paths) + Modified: cpsskins/branches/paris-sprint-2006/ui/screens/common/configure.zcml ============================================================================== --- cpsskins/branches/paris-sprint-2006/ui/screens/common/configure.zcml (original) +++ cpsskins/branches/paris-sprint-2006/ui/screens/common/configure.zcml Mon Jun 19 21:37:28 2006 @@ -179,13 +179,18 @@ /> <page + name="setLocation" + attribute="setLocation" + /> + + <page name="setPerspective" attribute="setPerspective" /> <page - name="setWorkPage" - attribute="setWorkPage" + name="setPage" + attribute="setPage" /> <page Modified: cpsskins/branches/paris-sprint-2006/ui/screens/common/location_selector.pt ============================================================================== --- cpsskins/branches/paris-sprint-2006/ui/screens/common/location_selector.pt (original) +++ cpsskins/branches/paris-sprint-2006/ui/screens/common/location_selector.pt Mon Jun 19 21:37:28 2006 @@ -1,3 +1,11 @@ - -<div class="locationSelector">Choose location: /.../.../</div> - +<div class="locationSelector" + tal:define="paths view/getLocationPaths" + tal:condition="paths"> + <span style="float:left">Current location:</span> + <form action="@@setLocation" onchange="submit()"> + <select name="location"> + <option>(choose a location)</option> + <option tal:repeat="path paths" tal:content="path" /> + </select> + </form> +</div> Modified: cpsskins/branches/paris-sprint-2006/ui/screens/common/page_tabs.pt ============================================================================== --- cpsskins/branches/paris-sprint-2006/ui/screens/common/page_tabs.pt (original) +++ cpsskins/branches/paris-sprint-2006/ui/screens/common/page_tabs.pt Mon Jun 19 21:37:28 2006 @@ -8,7 +8,7 @@ <li tal:define="selected python: page == effective_page" tal:attributes="class python: selected and 'selected' or None"> <a tal:content="python: page.title or 'No title'" - tal:attributes="href string:@@setWorkPage?name=${theme/name}:${page/name}" /></li> + tal:attributes="href string:@@setPage?name=${theme/name}:${page/name}" /></li> </tal:block> <li><a tal:attributes="href string:./@@addPage?theme_name=${theme/name}">+</a></li> </ul> Modified: cpsskins/branches/paris-sprint-2006/ui/screens/common/theme_tabs.pt ============================================================================== --- cpsskins/branches/paris-sprint-2006/ui/screens/common/theme_tabs.pt (original) +++ cpsskins/branches/paris-sprint-2006/ui/screens/common/theme_tabs.pt Mon Jun 19 21:37:28 2006 @@ -12,7 +12,7 @@ </td> <td tal:attributes="class python: selected and 'tabselected' or 'tab'"> <a tal:content="python: theme.title or 'No title'" - tal:attributes="href string:@@setWorkPage?name=${theme/name}" /> + tal:attributes="href string:@@setPage?name=${theme/name}" /> <img alt="" width="12" height="12" src="++resource++edit-12.png" /> </td> <td tal:attributes="class python: selected and 'rtabselected' or 'rtab'"> Modified: cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py ============================================================================== --- cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py (original) +++ cpsskins/branches/paris-sprint-2006/ui/screens/common/views.py Mon Jun 19 21:37:28 2006 @@ -156,6 +156,13 @@ else: self.data['provider'] = provider + def getLocationPaths(self): + """Return the list of location paths. + """ + locations = getThemeManager(self.context).getLocationStorage() + paths = locations.getAllPaths() + return u'/'.join(paths) + def listPortlets(self): """Return the factories of all registered portlets by provider name. """ @@ -174,6 +181,7 @@ return [{'provider': name, 'selected': name == current_provider, 'factories': providers[name]} for name in names] + class IAuthoring(Interface): """ """ @@ -231,7 +239,7 @@ session_info['perspective'] = perspective self._redirect() - def setWorkPage(self, name=u''): + def setPage(self, name=u''): """Set the work page. """ # only the theme is specified, set the default page @@ -242,6 +250,10 @@ response.setCookie('cpsskins_page', name) response.redirect('.') + def setLocation(self, path): + """Set the current location + """ + def addTheme(self): """Add a theme. """ @@ -261,6 +273,7 @@ response.redirect('.') + ### Presentation ################################################# def clonePresentation(self, perspective=None): Modified: cpsskins/branches/paris-sprint-2006/ui/zmi/views.py ============================================================================== --- cpsskins/branches/paris-sprint-2006/ui/zmi/views.py (original) +++ cpsskins/branches/paris-sprint-2006/ui/zmi/views.py Mon Jun 19 21:37:28 2006 @@ -99,7 +99,7 @@ request = self.request authoring = getMultiAdapter((context, request), IAuthoring, name='authoring') - authoring.setWorkPage(name) + authoring.setPage(name) request.response.redirect('./@@editor.html') def addTheme(self): -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins