Skip to content

Commit

Permalink
Adds a couple of extra wrappers
Browse files Browse the repository at this point in the history
git-svn-id: svn://cherokee-project.com/CTK/trunk@4816 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information
taher committed Apr 13, 2010
1 parent 602c68b commit 3736bb7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion CTK/Druid.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,18 @@ def __init__ (self, url_prev, cancel=True, props={}):
self += DruidButton_Submit (_('Create'))
self += DruidButton_Goto (_('Prev'), url_prev, False)

class DruidButtonsPanel_Create (DruidButtonsPanel):
def __init__ (self, cancel=True, props={}):
DruidButtonsPanel.__init__ (self, props.copy())
if cancel:
self += DruidButton_Close(_('Cancel'))
self += DruidButton_Submit (_('Create'))

class DruidButtonsPanel_Cancel (DruidButtonsPanel):
def __init__ (self, props={}):
DruidButtonsPanel.__init__ (self, props.copy())
self += DruidButton_Close(_('Cancel'))


#
# Helper
Expand Down Expand Up @@ -206,4 +218,3 @@ class DruidButtonsPanel_PrevCreate_Auto (DruidButtonsPanel_PrevCreate):
def __init__ (self, **kwargs):
kwargs['url_prev'] = druid_url_prev(request.url)
DruidButtonsPanel_PrevCreate.__init__ (self, **kwargs)

2 changes: 1 addition & 1 deletion CTK/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
from Button import Button
from TextArea import TextArea
from ToggleButton import ToggleButtonImages, ToggleButtonOnOff
from Druid import Druid, DruidButtonsPanel, DruidButton, DruidButton_Goto, DruidButton_Close, DruidButton_Submit, DruidButtonsPanel_Next, DruidButtonsPanel_PrevNext, DruidButtonsPanel_PrevCreate, DruidButtonsPanel_Next_Auto, DruidButtonsPanel_PrevNext_Auto, DruidButtonsPanel_PrevCreate_Auto
from Druid import Druid, DruidButtonsPanel, DruidButton, DruidButton_Goto, DruidButton_Close, DruidButton_Submit, DruidButtonsPanel_Next, DruidButtonsPanel_PrevNext, DruidButtonsPanel_PrevCreate, DruidButtonsPanel_Create, DruidButtonsPanel_Cancel, DruidButtonsPanel_Next_Auto, DruidButtonsPanel_PrevNext_Auto, DruidButtonsPanel_PrevCreate_Auto
from List import List, ListEntry

# Comodity
Expand Down

0 comments on commit 3736bb7

Please sign in to comment.