def __init__ (self): CTK.Box.__init__ (self, {'id': 'support-box', 'class': 'sidebar-box'}) qlist = CTK.List () self += CTK.RawHTML('<h2>%s</h2>' % _('Support')) self += qlist # Help link = CTK.LinkWindow (LINK_HELP, CTK.RawHTML (_('Getting started'))) qlist += link # Mailing List link = CTK.Link ('#', CTK.RawHTML (_('Subscribe to mailing lists'))) dialog = MailingListDialog() link.bind ('click', dialog.JS_to_show()) self += dialog qlist += link # Bug report link = CTK.LinkWindow (LINK_BUGTRACKER, CTK.RawHTML (_('Report a bug'))) qlist += link # Commercial Support link = CTK.LinkWindow (LINK_SUPPORT, CTK.RawHTML (_('Purchase commercial support'))) qlist += link # About.. dialog = CTK.DialogProxyLazy (About.URL_ABOUT_CONTENT, {'title': _("About Cherokee"), 'width': 600}) dialog.AddButton (_('Close'), 'close') self += dialog link = CTK.Link ('#', CTK.RawHTML (_('About Cherokee'))) link.bind ('click', dialog.JS_to_show()) qlist += link
def __init__(self, title, headers=[], body_id=None, **kwargs): # Look for the theme file srcdir = os.path.dirname(os.path.realpath(__file__)) theme_file = os.path.join(srcdir, 'theme.html') # Set up the template template = CTK.Template(filename=theme_file) template['title'] = title template['save'] = _('Save') template['home'] = _('Home') template['status'] = _('Status') template['general'] = _('General') template['vservers'] = _('vServers') template['sources'] = _('Sources') template['advanced'] = _('Advanced') template['help'] = _('Help') template['updating'] = _('Updating...') template['HELP_HTML'] = 'helps' in kwargs and HELP_HTML or '' template['HELP_JS'] = 'helps' in kwargs and HELP_JS or '' # <body> property if body_id: template['body_props'] = ' id="body-%s"' % (body_id) # Save dialog dialog = CTK.DialogProxyLazy( URL_SAVE, { 'title': _(SAVED_NOTICE), 'autoOpen': False, 'draggable': False, 'width': 500 }) CTK.publish(URL_SAVE, Save, dialog=dialog) # Default headers heads = copy.copy(headers) heads.append( '<link rel="stylesheet" type="text/css" href="/static/css/cherokee-admin.css" />' ) # Help translation if 'helps' in kwargs: helps = [(x[0], _(x[1])) for x in kwargs['helps']] kwargs['helps'] = helps # Parent's constructor CTK.Page.__init__(self, template, heads, **kwargs) # Add the 'Save' dialog js = SAVE_BUTTON % ({'show_dialog_js': dialog.JS_to_show()}) if CTK.cfg.has_changed(): js += ".removeClass('saved');" else: js += ".addClass('saved');" self += dialog self += CTK.RawHTML(js=js)
def __init__ (self): CTK.Box.__init__ (self, {'id': 'proud-users', 'class': 'sidebar-box'}) # Dialog dialog = CTK.DialogProxyLazy ('/proud/apply', {'title': _('Proud Cherokee User List Submission'), 'width': 480}) dialog.AddButton (_('Close'), "close") self += CTK.RawHTML('<h2>%s</h2>' %(_('Proud Cherokee Users'))) self += CTK.Box ({'id': 'proud-notice'}, CTK.RawHTML (_(PROUD_USERS_NOTICE))) self += CTK.Box ({'id': 'proud-link'}, CTK.RawHTML ('<a target="_blank" href="%s">%s</a> | <a id="proud-a">%s</a>' %(_(PROUD_USERS_WEB), _('View list…'), _('Send your domains')))) self += CTK.RawHTML (js=JS_PROUD %(dialog.JS_to_show())) self += dialog
def __init__ (self): CTK.Box.__init__ (self, {'id': 'sprint'}) dialog = CTK.DialogProxyLazy (URL_LEARN_MORE) # Banner body box = CTK.Box ({'id': 'mainmsg'}) box += CTK.RawHTML ('<h1>%s</h1>'%(self.H1)) box += CTK.RawHTML ('<p>%s</p>'%(self.P1)) # Download link = CTK.Link (None, props={'id': "overview"}) link += CTK.RawHTML ("Learn More") link.bind ('click', dialog.JS_to_show()) box += link self += box self += dialog