Changeset 1093
- Timestamp:
- 03/18/08 05:20:28
- Files:
-
- qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/plonetabs.py (modified) (5 diffs)
- qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/resources/plonetabs.css (modified) (6 diffs)
- qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/templates/actionslist.pt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/plonetabs.py
r1092 r1093 62 62 #elif action == "visible_action": 63 63 #pass 64 elif action == "move_action": 65 pass 64 elif action == "moveup_action": 65 postback = self.manage_moveUpAction(self.request, errors) 66 elif action == "movedown_action": 67 postback = self.manage_moveDownAction(self.request, errors) 66 68 elif action == "set_autogeneration": 67 69 if submitted: … … 105 107 else: 106 108 changeProperties(disable_nonfolderish_sections=True) 109 110 IStatusMessage(self.request).addStatusMessage(_(u"Changes saved!"), type="info") 107 111 108 112 self.redirect() … … 161 165 162 166 if not errors: 167 IStatusMessage(self.request).addStatusMessage(_(u"'%s' action successfully added." % id), type="info") 163 168 self.redirect(search="category=%s" % category) 164 169 return False … … 168 173 169 174 def manage_deleteAction(self, request, errors): 170 """ Server view for deletignaction with given id/category """175 """ Delete action with given id/category """ 171 176 portal_actions = getToolByName(self.context, "portal_actions") 172 177 … … 182 187 else: 183 188 cat_container.manage_delObjects(ids=[id,]) 184 IStatusMessage(self.request).addStatusMessage(_(u"'%s' action in '%s' category successfuly deleted" % (id, category)), type="info") 189 IStatusMessage(self.request).addStatusMessage(_(u"'%s' action in '%s' category successfully deleted" % (id, category)), type="info") 190 191 self.redirect(search="category=%s" % category) 192 return False 193 194 def manage_moveUpAction(self, request, errors): 195 """ Move up given action by one position """ 196 portal_actions = getToolByName(self.context, "portal_actions") 197 198 id = request.get("id", "") 199 category = request.get("category", "") 200 201 if category not in portal_actions.objectIds(): 202 IStatusMessage(self.request).addStatusMessage(_(u"Unexistent root portal actions category '%s'" % category), type="error") 203 else: 204 cat_container = portal_actions[category] 205 if id not in map(lambda x: x.id, filter(lambda x: IAction.providedBy(x), cat_container.objectValues())): 206 IStatusMessage(self.request).addStatusMessage(_(u"'%s' action does not exist in '%s' category" % (id, category)), type="error") 207 else: 208 cat_container.moveObjectsUp([id,], 1) 209 IStatusMessage(self.request).addStatusMessage(_(u"'%s' action in '%s' category moved up" % (id, category)), type="info") 210 211 self.redirect(search="category=%s" % category) 212 return False 213 214 def manage_moveDownAction(self, request, errors): 215 """ Move up given action by one position """ 216 portal_actions = getToolByName(self.context, "portal_actions") 217 218 id = request.get("id", "") 219 category = request.get("category", "") 220 221 if category not in portal_actions.objectIds(): 222 IStatusMessage(self.request).addStatusMessage(_(u"Unexistent root portal actions category '%s'" % category), type="error") 223 else: 224 cat_container = portal_actions[category] 225 if id not in map(lambda x: x.id, filter(lambda x: IAction.providedBy(x), cat_container.objectValues())): 226 IStatusMessage(self.request).addStatusMessage(_(u"'%s' action does not exist in '%s' category" % (id, category)), type="error") 227 else: 228 cat_container.moveObjectsDown([id,], 1) 229 IStatusMessage(self.request).addStatusMessage(_(u"'%s' action in '%s' category moved down" % (id, category)), type="info") 185 230 186 231 self.redirect(search="category=%s" % category) qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/resources/plonetabs.css
r1092 r1093 38 38 #app #addaction.adding .field-id, 39 39 #app #addaction.adding .field-condition, 40 #app #addaction.adding .add-controls { 40 #app #addaction.adding .add-controls, 41 .kssTabsActive #app.viewing #tabslist li .url-helper, 42 .kssTabsActive #app.viewing #tabslist li .tab-title { 41 43 display: block; 42 44 } … … 46 48 #app .reorder-controls, 47 49 #app .sort-controls, 50 51 /* fix for 'non js' version 48 52 #app.viewing li.editing .url-helper, 49 #app.viewing li.editing .tab-title, 53 #app.viewing li.editing .tab-title, */ 54 #app.viewing #tabslist li .url-helper, 55 #app.viewing #tabslist li .tab-title, 56 50 57 #app .drag-handle, 51 58 .kssTabsActive #app .delete, 52 59 .kssTabsActive #app .visibility, 53 #app.editform,60 .kssTabsActive #app .editform, 54 61 #app.sorting #addaction, 55 62 .kssTabsActive #app .field-visible, … … 60 67 .kssTabsActive #app .field-condition, 61 68 .kssTabsActive #app .add-controls, 62 .kssTabsActive #app .change-button { 69 .kssTabsActive #app .change-button, 70 .kssTabsActive #app .up-arrow, 71 .kssTabsActive #app .down-arrow { 63 72 display: none; 64 73 } … … 149 158 } 150 159 160 /* Up & Down arrows */ 161 #app .up-arrow { 162 line-height: 1.8em; 163 font-size: 80%; 164 border: 0; 165 position: absolute; 166 right: 0; 167 margin-right: -6.7em; 168 color: #436976 !important; 169 } 170 171 #app .down-arrow { 172 line-height: 1.8em; 173 font-size: 80%; 174 border: 0; 175 position: absolute; 176 right: 0; 177 margin-right: -7.7em; 178 color: #436976 !important; 179 } 180 151 181 #app ul.csshover li { 152 182 border: 1px solid transparent; … … 272 302 /*hover***************************************************/ 273 303 274 #app.viewing ul#tabslist.csshover li:hover,275 #app.viewing ul#tabslist.csshover li.onHover {304 .kssTabsActive #app.viewing ul#tabslist.csshover li:hover, 305 .kssTabsActive #app.viewing ul#tabslist.csshover li.onHover { 276 306 background-color: #FFFFDD; 277 307 border: 1px inset threedface; … … 342 372 } 343 373 344 #app dl.collapsedBlock dd.contentAdvanced {374 .kssTabsActive #app dl.collapsedBlock dd.contentAdvanced { 345 375 display: none; 346 376 } qPloneTabs/branches/quintagroup.plonetabs/trunk/quintagroup/plonetabs/browser/templates/actionslist.pt
r1092 r1093 22 22 <a class="delete" href="#" 23 23 tal:attributes="href string:${context/portal_url}/@@plonetabs-controlpanel?action=delete_action&category=${category}&id=${id}">Delete</a> 24 <a href="#" title="Move up" class="up-arrow" 25 tal:condition="not:repeat/tab/start" 26 tal:attributes="href string:${context/portal_url}/@@plonetabs-controlpanel?action=moveup_action&category=${category}&id=${id}"> 27 ↑ 28 </a> 29 <a href="#" title="Move down" class="down-arrow" 30 tal:condition="not:repeat/tab/end" 31 tal:attributes="href string:${context/portal_url}/@@plonetabs-controlpanel?action=movedown_action&category=${category}&id=${id}"> 32 ↓ 33 </a> 34 24 35 <span class="url-helper" tal:content="tab/url_expr">Tab Action</span> 25 36 <span class="tab-title" tal:content="tab/title">Tab Name</span>
