Author: jmorliaguet Date: Sun Jun 25 22:07:22 2006 New Revision: 3523 Modified: cpsskins/branches/paris-sprint-2006/ui/screens/common/page_tabs.pt cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/configure.zcml cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/negotiation_section.pt cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/site_manager.css cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/views.py
Log: - UI updates: made the locations on the location screen directly clickable to simplify the edition. 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 Sun Jun 25 22:07:22 2006 @@ -8,9 +8,9 @@ <tal:block repeat="page pages"> <li tal:define="selected python: page == effective_page" tal:attributes="class python: selected and 'selected' or None"> - <ins class="model" tal:content="page/@@getModelInfo" /> - <img tal:attributes="id string:p${page/identifier}" - alt="" width="12" height="12" src="++resource++edit-12.png" /> + <ins class="model" tal:content="page/@@getModelInfo" /> + <img tal:attributes="id string:p${page/identifier}" + alt="" width="12" height="12" src="++resource++edit-12.png" /> <a tal:attributes="href string:@@setPage?name=${theme/name}:${page/name}" tal:content="python: page.title or 'No title'" /></li> </tal:block> Modified: cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/configure.zcml ============================================================================== --- cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/configure.zcml (original) +++ cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/configure.zcml Sun Jun 25 22:07:22 2006 @@ -93,18 +93,8 @@ /> <page - name="addLocation" - attribute="addLocation" - /> - - <page - name="deleteLocation" - attribute="deleteLocation" - /> - - <page - name="updateLocation" - attribute="updateLocation" + name="submitLocation" + attribute="submitLocation" /> </pages> Modified: cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/negotiation_section.pt ============================================================================== --- cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/negotiation_section.pt (original) +++ cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/negotiation_section.pt Sun Jun 25 22:07:22 2006 @@ -3,14 +3,16 @@ edited request/form/edited|nothing; add request/form/add|nothing; location_info context/@@getLocationInfo; - infos location_info/?section|nothing"> + infos location_info/?section|nothing;"> + +<form action="@@submitLocation" method="post"> - <form action="@@updateLocation" method="post"> <table style="width: 100%;" class="items"> <tr> - <th>path</th> - <th>scope</th> - <th>data</th> + <th style="width: 30%">path</th> + <th style="width: 30%">scope</th> + <th style="width: 30%">data</th> + <th></th> <th></th> </tr> <tr tal:repeat="path infos"> @@ -18,44 +20,52 @@ location_path location/path; edit python: edited == location_path"> - <tal:block condition="not:edit"> - <td tal:content="location_path" /> - <td tal:content="location/scope" /> - <td tal:content="location/data" /> - <a class="button" i18n:translate="" - tal:attributes="href string:javascript:CPSSkins.getModelById('negotiation-section').setData({'form': {'section': '$section', 'edited': '${location/path}' }})">edit</a> + <tal:block condition="not:edit" tal:define="edit_url string:javascript:CPSSkins.getModelById('negotiation-section').setData({'form': {'section': '$section', 'edited': '${location/path}' }})"> + <td><a tal:attributes="href edit_url" tal:content="location_path" /></td> + <td><a tal:attributes="href edit_url" tal:content="location/scope" /></td> + <td><a tal:attributes="href edit_url" tal:content="location/data" /></td> </tal:block> <tal:block condition="edit"> <tal:block define="widgets nocall:context/@@getLocationWidgets" - repeat="widget python: widgets(location['path'], section)"> + repeat="widget python: widgets(location_path, section)"> <td tal:content="structure widget" /> </tal:block> - <input type="hidden" name="root" tal:attributes="value section" /> - <input type="hidden" name="location_path" - tal:attributes="value location_path" /> - <input class="submit" type="submit" value="save" /> </tal:block> - - <a class="button" - tal:attributes="href string:@@deleteLocation?root=$section&location_path=$location_path"> - delete - </a> + <td> + <a class="button" + tal:attributes="href string:@@submitLocation?root=$section&location_path=$location_path&action=delete"> + delete + </a> + </td> </tal:block> </tr> </table> - </form> - - <a class="button" i18n:translate="" tal:condition="not:add" - tal:attributes="href string:javascript:CPSSkins.getModelById('negotiation-section').setData({'form': {'section': '$section', 'add': true }})">add a location</a> - - <form action="@@addLocation" method="post" tal:condition="add"> - <input type="hidden" name="root" tal:attributes="value section" /> - <input type="text" name="location_path" value="/" /> - <input class="submit" type="submit" value="add" /> - <a class="button" i18n:translate="" - tal:attributes="href string:javascript:CPSSkins.getModelById('negotiation-section').setData({'form': {'section': '$section'}})">cancel</a> - </form> + <table style="width: 100%; border-top: 1px solid #ccc"> + <tr> + <td tal:condition="not:edited"> + <a class="button" i18n:translate="" tal:condition="not:add" + tal:attributes="href string:javascript:CPSSkins.getModelById('negotiation-section').setData({'form': {'section': '$section', 'add': true }})">add a location »</a> + </td> + <td tal:condition="add"> + <input type="hidden" name="root" tal:attributes="value section" /> + <input type="hidden" name="action" value="add" /> + <input type="text" name="location_path" value="/" /> + <input class="submit" type="submit" value="add" /> + <a class="button" i18n:translate="" + tal:attributes="href string:javascript:CPSSkins.getModelById('negotiation-section').setData({'form': {'section': '$section'}})">cancel</a> + </td> + <td tal:condition="edited"> + <input type="hidden" name="action" value="edit" /> + <input type="hidden" name="root" tal:attributes="value section" /> + <input type="hidden" name="location_path" tal:attributes="value edited" /> + <input class="submit" type="submit" value="save" /> + <a class="button" i18n:translate="" + tal:attributes="href string:javascript:CPSSkins.getModelById('negotiation-section').setData({'form': {'section': '$section'}})">cancel</a> + </td> + </tr> + </table> +</form> </div> Modified: cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/site_manager.css ============================================================================== --- cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/site_manager.css (original) +++ cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/site_manager.css Sun Jun 25 22:07:22 2006 @@ -131,6 +131,10 @@ font-family: arial; } +a.button img { + border: none; +} + input { border: 1px solid #999; padding: 0 @@ -142,7 +146,7 @@ padding: 0; background-color: #fff; font-size: 11px; - color: #006; + color: #009; margin: 0; } Modified: cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/views.py ============================================================================== --- cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/views.py (original) +++ cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/views.py Sun Jun 25 22:07:22 2006 @@ -158,35 +158,29 @@ location = locations[root][path][u'object'] return LocationForm(location, self.request)() - def deleteLocation(self): + def submitLocation(self): request = self.request form = request.form root = form[u'root'] path = form[u'location_path'] locations = getThemeManager(self.context).getLocationStorage() - location = locations.getLocation(root, path) - locations.remove(location) - def addLocation(self): - request = self.request - form = request.form - locations = getThemeManager(self.context).getLocationStorage() - path = form[u'location_path'] - root = form[u'root'] - location = Location(path=path, root=root) - locations.add(location) + action = form[u'action'] + + if action == u'delete': + location = locations.getLocation(root, path) + locations.remove(location) + + elif action == u'add': + location = Location(path=path, root=root) + locations.add(location) + + elif action == u'edit': + location = locations.getLocation(root, path) + location.path = form[u'form.path'] + location.data = form[u'form.data'] + location.scope = form[u'form.scope'] - def updateLocation(self): - context = self.context - request = self.request - form = request.form - root = form[u'root'] - location_path = form[u'location_path'] - locations = getThemeManager(context).getLocationStorage() - location = locations.getLocation(root, location_path) - location.path = form[u'form.path'] - location.data = form[u'form.data'] - location.scope = form[u'form.scope'] self.request.response.setHeader('content-type', 'text/x-json') return json.write({'form': {'section': root}}) -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins