def renderEdit(self, style): """ Returns an XHTML string with the form elements for editing this block """ log.debug("renderEdit") html = "<div class=\"iDevice\"><br/>\n" html += common.textInput("title"+self.id, self.idevice.title) html += u"<br/><br/>\n" html += common.textInput("path"+self.id, "", 50) html += u'<input type="button" onclick="addFile(\'%s\')"' % self.id html += u'value="%s" />\n' % _(u"Add files") html += u'<input type="submit" name="%s" value="%s"' % ("upload"+self.id, _(u"Upload")) html += common.elementInstruc(self.idevice.fileInstruc) html += u'<br/>\n' html += u'<b>%s</b>\n' % _(u'Applet Code:') html += common.elementInstruc(self.idevice.codeInstruc) html += u'<br/>\n' html += common.textArea('code'+self.id, self.idevice.appletCode) if self.idevice.userResources: html += '<table>' for resource in self.idevice.userResources: html += '<tr><td>%s</td><td>' % resource.storageName html += common.submitImage(self.id, resource.storageName, "/images/stock-cancel.png", _("Delete File")) html += '</td></tr>\n' html += '</table>' html += u'<br/>\n' html += self.renderEditButtons() html += u'\n</div>\n' return html
def renderEdit(self, style): """ Returns an XHTML string with the form elements for editing this block """ log.debug("renderEdit") html = u'<div class="iDevice">\n' html += common.textInput("path"+self.id, "", 50) html += u'<input type="button" onclick="addFile(\'%s\')"' % self.id html += u' value="%s" />\n' % _(u"Select a file") html += common.elementInstruc(self.idevice.filenameInstruc) html += u'<div class="block">\n' html += u'\n<b>%s</b>\n' % _(u'Label') html += common.elementInstruc(self.idevice.labelInstruc) html += u'</div>\n' html += common.textInput(u'label'+self.id, self.idevice.label) html += common.formField('richTextArea',u'Description:','description', self.id, self.idevice.descriptionInstruc, self.idevice.description) if self.idevice.userResources: html += u'<span style="text-decoration:underline">' html += self.idevice.userResources[0].storageName html += u'</span>\n' html += u'<div class="block">\n' html += self.renderEditButtons() html += u'</div>\n' html += u'\n</div>\n' return html
def renderEdit(self, style): """ Returns an XHTML string with the form elements for editing this block """ log.debug("renderEdit") html = u"<div class=\"iDevice\"><br/>\n" html += common.textInput("title" + self.id, self.idevice.title) html += '<br/><br/>RSS URL ' + common.textInput("url" + self.id, self.idevice.url) html += common.submitButton(u"loadRss"+self.id, _(u"Load")) html += common.elementInstruc(self.idevice.urlInstruc) html += u"<br/>\n" html += self.rssElement.renderEdit() emphasisValues = [(_(u"No emphasis"), Idevice.NoEmphasis), (_(u"Some emphasis"), Idevice.SomeEmphasis)] this_package = None if self.idevice is not None and self.idevice.parentNode is not None: this_package = self.idevice.parentNode.package html += common.formField('select', this_package, _('Emphasis'), 'emphasis', self.id, '', # TODO: Instructions emphasisValues, self.idevice.emphasis) html += self.renderEditButtons(undo=self.idevice.undo) html += u"</div>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form elements for editing this block """ log.debug("renderEdit") html = u"<div class=\"iDevice\"><br/>\n" html += common.textInput("title" + self.id, self.idevice.title) html += '<br/><br/>RSS URL ' + common.textInput( "url" + self.id, self.idevice.url) html += common.submitButton(u"loadRss" + self.id, _(u"Load")) html += common.elementInstruc(self.idevice.urlInstruc) html += u"<br/>\n" html += self.rssElement.renderEdit() emphasisValues = [(_(u"No emphasis"), Idevice.NoEmphasis), (_(u"Some emphasis"), Idevice.SomeEmphasis)] this_package = None if self.idevice is not None and self.idevice.parentNode is not None: this_package = self.idevice.parentNode.package html += common.formField( 'select', this_package, _('Emphasis'), 'emphasis', self.id, '', # TODO: Instructions emphasisValues, self.idevice.emphasis) html += self.renderEditButtons(undo=self.idevice.undo) html += u"</div>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form elements for editing this block """ log.debug("renderEdit") html = "<div class=\"iDevice\"><br/>\n" html += common.textInput("title"+self.id, self.idevice.title) html += u"<br/><br/>\n" types = [(_(u"Geogebra"), "geogebra"), (_(u"Other"), "other")] html += u"<b>%s</b>" % _("Applet Type") html += '<select onchange="submitChange(\'changeType%s\', \'type%s\')";' % (self.id, self.id) html += 'name="type%s" id="type%s">\n' % (self.id, self.id) for type, value in types: html += "<option value=\""+value+"\" " if self.idevice.type == value: html += "selected " html += ">" + type + "</option>\n" html += "</select> \n" html += common.elementInstruc(self.idevice.typeInstruc) + "<br/><br/>" if self.idevice.message <> "": html += '<p style="color:red"><b>' + self.idevice.message + '</b></p>' html += common.textInput("path"+self.id, "", 50) html += u'<input type="button" onclick="addFile(\'%s\')"' % self.id html += u'value="%s" />\n' % _(u"Add files") html += u'<input type="submit" name="%s" value="%s"' % ("upload"+self.id, _(u"Upload")) html += common.elementInstruc(self.idevice.fileInstruc) html += u'<br/>\n' html += u'<b>%s</b>\n' % _(u'Applet Code:') html += common.elementInstruc(self.idevice.codeInstruc) html += u'<br/>\n' html += common.textArea('code'+self.id, self.idevice.appletCode,rows="12") if self.idevice.userResources: html += '<table>' for resource in self.idevice.userResources: html += '<tr><td>%s</td><td>' % resource.storageName html += common.submitImage(self.id, resource.storageName, "/images/stock-cancel.png", _("Delete File")) html += '</td></tr>\n' html += '</table>' html += u'<br/>\n' html += self.renderEditButtons(undo=self.idevice.undo) html += u'\n</div>\n' return html
def renderEdit(self): """ Returns an XHTML string with the form element for editing this field """ if self.lms.lms == "": return "" if self.lms.lms == "moodle": typeArr = [[_(u'A single simple discussion'), 'single'], [_(u'Each person posts one discussion'), 'eachuser'], [_(u'Standard forum for general use'), 'general']] postArr = [[_(u'Discussions and replies are allowed'), '2'], [_(u'No discussions, but replies are allowed'), '1'], [_(u'No discussions, no replies'), '0']] subscArr = [[_(u'No'), '0'], [_(u'Yes, forever'), '1'], [_(u'Yes, initially'), '2']] groupArr = [[_(u'No groups'), '0'], [_(u'Separate groups'), '1'], [_(u'Visible groups'), '2']] visibleArr = [[_(u'Show'), '1'], [_(u'Hide'), '0']] html = common.formField('select', _(u"Forum type:"), "type" + self.id, '', self.lms.typeInstruc, typeArr, self.lms.type) html += common.formField('select', _(u"Can a student post to this forum?:"), "studentpost" + self.id, '', self.lms.postInstruc, postArr, self.lms.studentpost) html += common.formField('select', _(u"Force everyone to be subscribed?:"), "subscription" + self.id, '', self.lms.subscInstruc, subscArr, self.lms.subscription) html += common.formField('select', _(u"Group mode:"), "groupmode" + self.id, '', self.lms.groupInstruc, groupArr, self.lms.groupmode) html += common.formField('select', _(u"Visible to students:"), "visible" + self.id, '', self.lms.visibleInstruc, visibleArr, self.lms.visible) else: html = common.textInput("other"+self.id, self.lms.otherLabel) html += u"http://" + common.textInput("url"+self.id, self.lms.otherUrl) + u"<br/>" return html
def renderEdit(self, style): """ Returns an XHTML string with the form elements for editing this block """ log.debug("renderEdit") html = u"<div class=\"iDevice\"><br/>\n" html += common.textInput("title" + self.id, self.idevice.title) + "<br/><br/>" sites = [(_(u"English Wikipedia Article"), "http://en.wikipedia.org/wiki/"), (_(u"Catalan Wikipedia Article"), "http://ca.wikipedia.org/wiki/"), (_(u"Chinese Wikipedia Article"), "http://zh.wikipedia.org/wiki/"), (_(u"Dutch Wikipedia Article"), "http://nl.wikipedia.org/wiki/"), (_(u"French Wikipedia Article"), "http://fr.wikipedia.org/wiki/"), (_(u"German Wikipedia Article"), "http://de.wikipedia.org/wiki/"), (_(u"Greek Wikipedia Article"), "http://el.wikipedia.org/wiki/"), (_(u"Italian Wikipedia Article"), "http://it.wikipedia.org/wiki/"), (_(u"Japanese Wikipedia Article"),"http://ja.wikipedia.org/wiki/"), (_(u"Magyar Wikipedia Article"),"http://hu.wikipedia.org/wiki/"), (_(u"Polish Wikipedia Article"), "http://pl.wikipedia.org/wiki/"), (_(u"Portugese Wikipedia Article"), "http://pt.wikipedia.org/wiki/"), (_(u"Slovenian Wikipedia Article"), "http://sl.wikipedia.org/wiki/"), (_(u"Spanish Wikipedia Article"), "http://es.wikipedia.org/wiki/"), (_(u"Swedish Wikipedia Article"), "http://sv.wikipedia.org/wiki/"), (_(u"Wikibooks Article"), "http://en.wikibooks.org/wiki/"), (_(u"Wikiversity"), "http://en.wikiversity.org/wiki/"), (_(u"Wiktionary"), "http://en.wiktionary.org/wiki/"), (_(u"Wikieducator Content"), "http://wikieducator.org/"), (_(u"Other"), "")] this_package = None if self.idevice is not None and self.idevice.parentNode is not None: this_package = self.idevice.parentNode.package html += common.formField('select', this_package, _('Site'),'s', 'site'+self.id, self.idevice.langInstruc, sites, self.idevice.site) url = "none" if self.idevice.site == "": url = "block" html += '<div style="display:%s"> %s: <br/>' % (url, _("Own site")) html += common.textInput("ownUrl"+self.id, self.idevice.ownUrl) + '<br/></div>' html += "<br/>" html += common.textInput("article", self.idevice.articleName) html += common.elementInstruc(self.idevice.searchInstruc) html += common.submitButton(u"loadWikipedia"+self.id, _(u"Load")) html += u"<br/>\n" html += self.articleElement.renderEdit() emphasisValues = [(_(u"No emphasis"), Idevice.NoEmphasis), (_(u"Some emphasis"), Idevice.SomeEmphasis)] html += common.formField('select', this_package, _('Emphasis'), 'emphasis', self.id, '', # TODO: Instructions emphasisValues, self.idevice.emphasis) html += self.renderEditButtons(undo=self.idevice.undo) html += u"</div>\n" return html
def renderEdit(self): """ Returns an XHTML string with the form element for editing this field """ html = "" if self.idevice.message <> "": html += '<p style="color: red; font-weight: bold;">' html += '%s</p>' % self.idevice.message html += u'<p>' html += common.textInput("name"+ self.id, self.idevice.title) html += u'</p>' forums = [(_(u"New Forum"), 'newForum')] forums += [(pt.forumName, pt.forumName) for pt in self.idevice.forumsCache.getForums()] if self.idevice.isNewForum: selected = 'newForum' else: selected = self.forum.forumName html = common.formField('select', _(u"Forum Name:"), 'changeForum', 'forumSelect'+self.id, '', forums, selected) if not self.idevice.noForum: introduction = self.forum.introduction.replace("\r", "") introduction = introduction.replace("\n","\\n") html += common.textInput("fName"+ self.id, self.forum.forumName) html += common.elementInstruc(self.forum.nameInstruc) html += "<p><b>%s</b></p>" % _("Introduction") html += common.richTextArea("fIntro"+self.id, introduction) topics = [(_('None'), 'none'), (_('New Topic'), 'newTopic')] topics += [(pt.topic, pt.topic) for pt in self.forum.discussions] if self.idevice.isNewTopic: selected = 'newTopic' else: selected = self.idevice.discussion.topic html = common.formField('select', _(u"Discussion Topic/Thread:"), 'changeTopic', 'topicSelect'+self.id, '', topics, selected) html += self.discussionElement.renderEdit() lmss = [(_(u"Please select a LMS"), ''), (_('Moodle'), 'moodle'), (_('Other'), 'other')] html = common.formField('select', _(u"Learning Management System:"), 'changeLms', 'lmsSelect'+self.id, self.forum.lmsInstruc, lmss, self.forum.lms.lms) html += self.lmsElement.renderEdit() return html
def renderEdit(self, style): """ Returns an XHTML string with the form elements for editing this block """ log.debug("renderEdit") html = u"<div class=\"iDevice\">\n" html += common.textInput("title"+self.id, self.idevice.title) + '<br/><br/>' html += self.mediaElement.renderEdit() floatArr = [[_(u'Left'), 'left'], [_(u'Right'), 'right'], [_(u'None'), 'none']] html += common.formField('select', _("Align:"), "float" + self.id, '', self.idevice.alignInstruc, floatArr, self.idevice.float) html += "<br/>" + self.textElement.renderEdit() emphasisValues = [(_(u"No emphasis"), Idevice.NoEmphasis), (_(u"Some emphasis"), Idevice.SomeEmphasis)] html += common.formField('select', _('Emphasis'), 'emphasis', self.id, '', # TODO: Instructions emphasisValues, self.idevice.emphasis) html += self.renderEditButtons() html += u"</div>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = u'<div><div class="block">' html += common.textInput("title" + self.id, self.idevice.title) html += common.hiddenField("iconiDevice" + self.id, self.idevice.icon) html += u'<a class="js-show-icon-panel-button" href="javascript:showMessageBox(\'iconpanel\');">%s</a>' % _( 'Select an icon') # Get icon source (if it exists) icon = self.idevice.icon icon_exists = False if icon != '': idevice_icon = Path(G.application.config.stylesDir / style / 'icon_' + self.idevice.icon + '.gif') if idevice_icon.exists(): icon_exists = True else: idevice_icon = Path(G.application.config.stylesDir / style / "icon_" + self.idevice.icon + ".png") if idevice_icon.exists(): icon_exists = True # Icon HTML element html += u'<img class="js-idevide-icon-preview" name="iconiDevice%s" id="iconiDevice"' % ( self.id) if icon_exists: html += u' src="/style/%s/icon_%s%s"' % (style, icon, idevice_icon.ext) else: html += u' src="/images/empty.gif"' html += u'/>' # Delete button html += u'<a href="javascript:deleteIcon(%s);" id="deleteIcon%s" class="deleteIcon" title="%s"' % ( self.id, self.id, _('Delete')) # If the icon doesn't exists if not icon_exists: html += u' style="display: none;"' html += u'>' html += u'<img class="js-delete-icon" alt="%s" src="%s"/>' % ( _('Delete'), '/images/stock-delete.png') html += u'</a>' html += u'<div class="js-icon-panel-container">' html += u'<div id="iconpaneltitle">%s</div>' % _("Icons") html += u'<div id="iconpanelcontent">' html += self.__renderIcons(style) html += u'</div>' html += u'</div>' html += u"</div>" for element in self.elements: html += element.renderEdit() + u'<br />' html += self.renderEditButtons() html += u"</div>" return html
def renderEdit(self, style): """ Returns an XHTML string with the form elements for editing this block """ log.debug("renderEdit") html = u'<div class="iDevice">\n' html += u'<div class="block">\n' label = _(u"Filename") if self.idevice.userResources: label += u": " label += u'<span style="text-decoration:underline">' label += self.idevice.userResources[0].storageName label += u"</span>\n" html += common.formField("textInput", label, "path" + self.id, "", self.idevice.filenameInstruc, size=50) html += u'<input type="button" onclick="addFile(\'%s\')"' % self.id html += u' value="%s" />\n' % _(u"Select a file") html += u"</div>\n" html += u'<div class="block">\n' html += u"\n<b>%s</b>\n" % _(u"Label") html += common.elementInstruc(self.idevice.labelInstruc) html += u"</div>\n" html += common.textInput(u"label" + self.id, self.idevice.label) html += common.formField( "richTextArea", _(u"Description:"), "description", self.id, self.idevice.descriptionInstruc, self.idevice.description, ) html += u'<div class="block">\n' html += self.renderEditButtons() html += u"</div>\n" html += u"\n</div>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form elements for editing this block """ log.debug("renderEdit") html = u'<div class="iDevice">\n' html += common.textInput("title" + self.id, self.idevice.title) + "<br/><br/>" html += self.mediaElement.renderEdit() floatArr = [[_(u"Left"), "left"], [_(u"Right"), "right"], [_(u"None"), "none"]] html += common.formField( "select", _("Align:"), "float" + self.id, "", self.idevice.alignInstruc, floatArr, self.idevice.float ) html += "<br/>" + self.textElement.renderEdit() emphasisValues = [(_(u"No emphasis"), Idevice.NoEmphasis), (_(u"Some emphasis"), Idevice.SomeEmphasis)] html += common.formField( "select", _("Emphasis"), "emphasis", self.id, "", # TODO: Instructions emphasisValues, self.idevice.emphasis, ) html += self.renderEditButtons() html += u"</div>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = u'<p class="exe-text-field">\n' html += u"<label for='url%s'>%s</label> " % (self.id, _('URL:')) html += common.elementInstruc(self.idevice.urlInstruc) html += common.textInput("url" + self.id, self.idevice.url) html += ' <span class="exe-field-instructions">' + _( "Remember that HTTP pages cannot be included into HTTPS websites." ) + '</span>' heightArr = [[_('small'), '200'], [_('medium'), '300'], [_('large'), '500'], [_('super-size'), '800']] html += u"</p>\n" this_package = None if self.idevice is not None and self.idevice.parentNode is not None: this_package = self.idevice.parentNode.package html += common.formField('select', this_package, _('Frame Height:'), "height" + self.id, options=heightArr, selection=self.idevice.height) html += self.renderEditButtons() return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = u'<div class="block">\n' html += u"<strong>%s</strong> " % _('URL:') html += common.elementInstruc(self.idevice.urlInstruc) html += u"</div>\n" html += u'<div class="block">\n' html += common.textInput("url"+self.id, self.idevice.url) heightArr = [['small', '200'], ['medium', '300'], ['large', '500'], ['super-size', '800']] html += u"</div>\n" html += u'<div class="block">\n' this_package = None if self.idevice is not None and self.idevice.parentNode is not None: this_package = self.idevice.parentNode.package html += common.formField('select', this_package, _('Frame Height:'), "height"+self.id, options = heightArr, selection = self.idevice.height) html += u"</div>\n" html += self.renderEditButtons() return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = "<div class=\"iDevice\"><br/>\n" if self.idevice.message<>"": html += common.editModeHeading(self.idevice.message) title_val = self.idevice.title if title_val == _("Multi-choice"): title_val = "" html += common.textInput("title"+self.id, title_val, default_prompt=_("Type your title here")) + '<br/>' for element in self.questionElements: html += element.renderEdit() html += "<br/>" html += "<br/>" value = _("Add another question") html += common.submitButton("addQuestion"+unicode(self.id), value, extra_classes="add_item_button") html += "<br /><br />" html += self.renderEditButtons(undo=self.idevice.undo) html += "</div>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = "<div class=\"iDevice\">\n" # JRJ # Quitamos el prefijo "FPD -" # (let's remove the "FPD -" prefix) if self.idevice.title.find("FPD - ") == 0: self.idevice.title = x_(u"Now it's your turn") html += common.textInput("title"+self.id, self.idevice.title) html += u"<br/><br/>\n" for element in self.questionElements: html += element.renderEdit() value = _("Add another Question") html += "<br/>" html += common.submitButton("addQuestion"+self.id, value) html += "<br/><br/>" html += self.renderEditButtons(undo=self.idevice.undo) html += "</div>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form elements for editing this block """ log.debug("renderEdit") html = u"<div class=\"iDevice\">\n" html += self.imageElement.renderEdit() floatArr = [[_(u'Left'), 'left'], [_(u'Right'), 'right'], [_(u'None'), 'none']] this_package = None if self.idevice is not None and self.idevice.parentNode is not None: this_package = self.idevice.parentNode.package html += common.formField('select', this_package, _("Align:"), "float" + self.id, '', '', floatArr, self.idevice.float) html += u'<div class="block"><b>%s</b></div>' % _(u"Caption:") html += common.textInput("caption" + self.id, self.idevice.caption) html += common.elementInstruc(self.idevice.captionInstruc) html += "<br/>" + self.textElement.renderEdit() html += self.renderEditButtons() html += u"</div>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form elements for editing this block """ log.debug("renderEdit") html = u'<div class="iDevice">\n' html += u'<div class="block">\n' label = _(u'Filename:') if self.idevice.userResources: label += u': ' label += u'<span style="text-decoration:underline">' label += self.idevice.userResources[0].userName label += u'</span>\n' html += u'<div>' html += common.formField('textInput', label, 'path'+self.id, '', self.idevice.filenameInstruc, size=50) html += u'</div"><div style="padding-top:28px;" >' html += u'<input type="button" onclick="addFile(\'%s\')"' % self.id html += u' value="%s" />\n' % _(u"Select a file") html += u'</div><br style="clear:both;" />' html += u'</div>\n' html += u'<div class="block">\n' html += u'\n<b>%s</b>\n' % _(u'Label:') html += common.elementInstruc(self.idevice.labelInstruc) html += u'</div>\n' html += common.textInput(u'label'+self.id, self.idevice.label) html += self.descriptionElement.renderEdit() html += u'<div class="block">\n' html += self.renderEditButtons() html += u'</div>\n' html += u'\n</div>\n' return html
def renderEdit(self): """ Returns an XHTML string with the form element for editing this field """ log.debug("renderEdit") html = u'<div class="block">' html += u"<b>"+self.field.name+":</b>\n" html += common.elementInstruc(self.field.instruc) html += u"</div>\n" html += common.textInput("path"+self.id, "", 50) html += u'<input type="button" onclick="addFlash(\'%s\')"' % self.id html += u' value="%s" />' % _(u"Select Flash Object") html += common.elementInstruc(self.field.fileInstruc) html += u'<div class="block"><b>%s</b></div>\n' % _(u"Display as:") html += u"<input type=\"text\" " html += u"id=\"width"+self.id+"\" " html += u"name=\"width"+self.id+"\" " html += u"value=\"%s\" " % self.field.width html += u"size=\"4\" />px\n" html += u"by \n" html += u"<input type=\"text\" " html += u"id=\"height"+self.id+"\" " html += u"name=\"height"+self.id+"\" " html += u"value=\"%s\" " % self.field.height html += u"size=\"4\" />px\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form elements for editing this block """ log.debug("renderEdit") html = u"<div class=\"iDevice\">\n" html += self.flashMovieElement.renderEdit() floatArr = [[_(u'Left'), 'left'], [_(u'Right'), 'right'], [_(u'None'), 'none']] html += common.formField('select', _("Align:"), "float" + self.id, options = floatArr, selection = self.idevice.float) html += u'<div class="block">' html += u"<b>%s </b>" % _(u"Caption:") html += common.elementInstruc(self.idevice.captionInstruc) html += u'</div>\n' html += u'<div class="block">' html += common.textInput("caption" + self.id, self.idevice.caption) html += u'</div>\n' html += u'<div class="block">' html += self.textElement.renderEdit() html += self.renderEditButtons() html += u'</div>\n' html += u"</div>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form elements for editing this block """ log.debug("renderEdit") html = u"<div class=\"iDevice\">\n" html += common.textInput("title"+self.id, self.idevice.title) + '<br/><br/>' html += self.mediaElement.renderEdit() floatArr = [[_(u'Left'), 'left'], [_(u'Right'), 'right'], [_(u'None'), 'none']] this_package = None if self.idevice is not None and self.idevice.parentNode is not None: this_package = self.idevice.parentNode.package html += common.formField('select', this_package, _("Align:"), "float" + self.id, '', self.idevice.alignInstruc, floatArr, self.idevice.float) #html += u'<div class="block">' #<b>%s</b></div>' % _(u"Caption:") #html += common.textInput("caption" + self.id, self.idevice.media.caption) #html += common.elementInstruc(self.idevice.media.captionInstruc) html += "<br/>" + self.textElement.renderEdit() emphasisValues = [(_(u"No emphasis"), Idevice.NoEmphasis), (_(u"Some emphasis"), Idevice.SomeEmphasis)] html += common.formField('select', this_package, _('Emphasis'), 'emphasis', self.id, '', # TODO: Instructions emphasisValues, self.idevice.emphasis) html += self.renderEditButtons() html += u"</div>\n" return html
def renderPreview(self): """ Returns an XHTML string with the form element for previewing this field """ html = "<b>" + self.field.name + "</b> " html += "<br/>" html += common.textInput("path"+self.id, "", 50) html += u'<input type="button" ' html += u' value="%s" />' % _(u"Select MP3 file") if self.field.instruc != "": html += common.elementInstruc(self.field.instruc) html += '<br/><b>%s</b><br/>' % _(u"Caption:") html += common.textInput("", "") html += common.elementInstruc(self.field.captionInstruc) html += "<br/>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = "<div class=\"iDevice\">\n" if not self.idevice.isAnswered: html += common.editModeHeading( _("Please select a correct answer for each question.")) html += common.textInput("title" + self.id, self.idevice.title) html += u"<br/><br/>\n" for element in self.questionElements: html += element.renderEdit() value = _("Add another Question") html += "<br/>" html += common.submitButton("addQuestion" + unicode(self.id), value) html += "<br/><br/>" + _("Select pass rate: ") html += "<select name=\"passrate\">\n" template = ' <option value="%s0"%s>%s0%%</option>\n' for i in range(1, 11): if str(i) + "0" == self.idevice.passRate: html += template % (str(i), ' selected="selected"', str(i)) else: html += template % (str(i), '', str(i)) html += "</select>\n" html += "<br /><br />" + self.renderEditButtons(undo=self.idevice.undo) html += "</div>\n" self.idevice.isAnswered = True return html
def renderEdit(self): html = u"<div>\n" html += common.textInput("path"+self.id, "", 50, \ onclick="addFile('%s')" % self.id, readonly="readonly" ) html += u'<input type="button" onclick="addFile(\'%s\')"' % self.id html += u'value="%s" />\n' % _(u"Browse") buttonName = _(u"Replace") if self.field.fileResource is None: buttonName = _(u"Upload") html += u'<input type="submit" name="%s" value="%s" />' % ("upload"+self.id, buttonName) html += common.elementInstruc(self.field.fileInstruc) html += self.fileDescriptionElement.renderEdit() if self.field.fileResource is not None: html += "<div class='block'><strong>" html += _("File") + ": %s " % self.field.fileResource.storageName if self.showDelFile: html += common.submitImage("delfile" + self.id, self.field.fileResource.storageName, "/images/stock-cancel.png", _("Delete File")) html += "</strong></div>" else: html += "<i>"+_("No File Uploaded Currently") + "</i>" html += "<br/></div>" html += field_engine_make_delete_button(self) return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = "<div class=\"iDevice\"><br/>\n" if self.idevice.message<>"": html += common.editModeHeading(self.idevice.message) # JR # Quitamos el prefijo "FPD -" if self.idevice.title.find("FPD - ") == 0: self.idevice.title = x_(u"Autoevaluacion") # html += common.textInput("title"+self.id, self.idevice.title) + '<br/>' html += common.textInput("title"+self.id, self.idevice.title) for element in self.questionElements: html += element.renderEdit() # html += "<br/>" html += "<br/>" value = _("Add another question") html += common.submitButton("addQuestion"+unicode(self.id), value) html += "<br /><br />" html += self.renderEditButtons(undo=self.idevice.undo) html += "</div>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = "<div class=\"iDevice\"><br/>\n" if self.idevice.message <> "": html += common.editModeHeading(self.idevice.message) # html += common.textInput("title"+self.id, self.idevice.title) + '<br/>' html += common.textInput( "title" + self.id, self.idevice.alt_title) + '<br/>' #changed kthamm 111221 for element in self.questionElements: html += element.renderEdit() html += "<br/>" html += "<br/>" value = _("Add another question") html += common.submitButton("addQuestion" + unicode(self.id), value) html += "<br /><br />" html += self.renderEditButtons(undo=self.idevice.undo) html += "</div>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ self.previewing = True html = u'<div class="iDevice"><br/>\n' # JRJ # Quitamos el prefijo "FPD -" # (let's remove the "FPD -" prefix) if self.idevice.title.find("FPD - ") == 0: self.idevice.title = x_(u"Translation") html += common.textInput("title"+self.id, self.idevice.title) html += self.storyElement.renderEdit() for element in self.questionElements: html += element.renderEdit() html += u"</table>\n" value = _(u"Add another activity") html += common.submitButton(u"addQuestion"+unicode(self.id), value) html += u"<br /><br />" + self.renderEditButtons(undo=self.idevice.undo) html += u"</div>\n" return html
def renderEdit(self): """ Returns an XHTML string with the form element for editing this field """ html = "<b>%s</b><br/>" % _("Feedback") html += "<b>%s </b>" % _("Button Caption") html += common.textInput("btnCaption" + self.id, self.field.buttonCaption, 25) html += "<br/><br/>" html += common.textInput("name" + self.id, self.field.name, 25) html += common.submitImage("deleteField", self.id, "/images/stock-cancel.png", _("Delete"), 1) html += "<br/>\n" this_package = None html += common.formField("richTextArea", this_package, "", "instruc", self.id, "", self.field.instruc) html += "<br/>" return html
def renderEdit(self, style): """ Returns an XHTML string with the form elements for editing this block """ log.debug("renderEdit") html = u"<div class=\"iDevice\">\n" html += self.flashElement.renderEdit() floatArr = [[_(u'Left'), 'left'], [_(u'Right'), 'right'], [_(u'None'), 'none']] this_package = None if self.idevice is not None and self.idevice.parentNode is not None: this_package = self.idevice.parentNode.package html += common.formField('select', this_package, _("Align:"), "float" + self.id, options=floatArr, selection=self.idevice.float) html += u"\n" html += u"<b>%s </b>" % _(u"Caption:") html += common.textInput("caption" + self.id, self.idevice.caption) html += common.elementInstruc(self.idevice.captionInstruc) html += "<br/>" + self.textElement.renderEdit() html += self.renderEditButtons() html += u"</div>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = u'<div class="block">\n' html += u"<strong>%s</strong> " % _('URL:') html += common.elementInstruc(self.idevice.urlInstruc) html += u"</div>\n" html += u'<div class="block">\n' html += common.textInput("url" + self.id, self.idevice.url) heightArr = [['small', '200'], ['medium', '300'], ['large', '500'], ['super-size', '800']] html += u"</div>\n" html += u'<div class="block">\n' this_package = None if self.idevice is not None and self.idevice.parentNode is not None: this_package = self.idevice.parentNode.package html += common.formField('select', this_package, _('Frame Height:'), "height" + self.id, options=heightArr, selection=self.idevice.height) html += u"</div>\n" html += self.renderEditButtons() return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = "<div class=\"iDevice\">\n" if not self.idevice.isAnswered: html += common.editModeHeading( _("Please select a correct answer for each question.")) html += common.textInput("title"+self.id, self.idevice.title) html += u"<br/><br/>\n" for element in self.questionElements: html += element.renderEdit() value = _("Add another Question") html += "<br/>" html += common.submitButton("addQuestion"+unicode(self.id), value) html += "<br/><br/>" + _("Select pass rate: ") html += "<select name=\"passrate\">\n" template = ' <option value="%s0"%s>%s0%%</option>\n' for i in range(1, 11): if str(i)+ "0" == self.idevice.passRate: html += template % (str(i), ' selected="selected"', str(i)) else: html += template % (str(i), '', str(i)) html += "</select>\n" html += "<br /><br />" + self.renderEditButtons() html += "</div>\n" self.idevice.isAnswered = True return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = u'<div class="block">\n' html += u"<strong>%s</strong> " % _("URL:") html += common.elementInstruc(self.idevice.urlInstruc) html += u"</div>\n" html += u'<div class="block">\n' html += common.textInput("url" + self.id, self.idevice.url) heightArr = [[_("small"), "200"], [_("medium"), "300"], [_("large"), "500"], [_("super-size"), "800"]] html += u"</div>\n" html += u'<div class="block">\n' this_package = None if self.idevice is not None and self.idevice.parentNode is not None: this_package = self.idevice.parentNode.package html += common.formField( "select", this_package, _("Frame Height:"), "height" + self.id, options=heightArr, selection=self.idevice.height, ) html += u"</div>\n" html += self.renderEditButtons() return html
def renderEdit(self, style): """ Renders a screen that allows the user to enter paragraph text and choose which words are hidden. """ """ html = [ u'<div class="iDevice">', u'<div class="block">', # common.textInput("title"+self.id, self.idevice.title), common.textInput("title"+self.id, "Autoevaluación"), u'</div>', self.instructionElement.renderEdit(), self.clozeElement.renderEdit(), self.feedbackElement.renderEdit(), self.renderEditButtons(), u'</div>' ] return u'\n '.join(html)""" html = "<div class=\"iDevice\"><br/>\n" html = "<div class=\"block\">" # JR # Quitamos el prefijo "FPD -" if self.idevice.title.find("FPD - ") == 0: self.idevice.title = x_(u"Autoevaluacion") html += common.textInput("title" + self.id, self.idevice.title) html += "</div>" html += self.instructionElement.renderEdit() html += self.clozeElement.renderEdit() html += self.feedbackElement.renderEdit() html += self.renderEditButtons() html += "</div>" return html
def renderEdit(self, style): """ Renders a screen that allows the user to enter paragraph text and choose which words are hidden. """ """ html = [ u'<div class="iDevice">', u'<div class="block">', # common.textInput("title"+self.id, self.idevice.title), common.textInput("title"+self.id, "Autoevaluación"), u'</div>', self.instructionElement.renderEdit(), self.clozeElement.renderEdit(), self.feedbackElement.renderEdit(), self.renderEditButtons(), u'</div>' ] return u'\n '.join(html)""" html = "<div class=\"iDevice\"><br/>\n" html = "<div class=\"block\">" # JR # Quitamos el prefijo "FPD -" if self.idevice.title.find("FPD - ") == 0: self.idevice.title = x_(u"Autoevaluacion") html += common.textInput("title"+self.id, self.idevice.title) html += "</div>" html += self.instructionElement.renderEdit() html += self.clozeElement.renderEdit() html += self.feedbackElement.renderEdit() html += self.renderEditButtons() html += "</div>" return html
def renderEdit(self, style): """ Returns an XHTML string with the form elements for editing this block """ log.debug("renderEdit") html = u"<div class=\"iDevice\"><br/>\n" print self.idevice.message if self.idevice.message != "": html += common.editModeHeading(self.idevice.message) html += common.elementInstruc(self.idevice.kpseInstruc_) html += common.textInput("kpse" + self.id, self.idevice.latexpath) html += u'<input type="button" onclick="addKpsepath(\'%s\')"' % self.id html += u"value=\"%s\"/>\n" % _(u"Search") html += u"<br/><br/>\n" html += common.textInput("title" + self.id, self.idevice.title) + "<br/><br/>" this_package = None if self.idevice is not None and self.idevice.parentNode is not None: this_package = self.idevice.parentNode.package html += common.textInput("path" + self.id, self.idevice.source) html += u'<input type="button" onclick="addTeX(\'%s\')"' % self.id html += u"value=\"%s\"/>\n" % _(u"Add file") html += common.submitButton(u"loadSource" + self.id, _(u"Load")) html += u"<br/>\n" html += self.articleElement.renderEdit() emphasisValues = [(_(u"No emphasis"), Idevice.NoEmphasis), (_(u"Some emphasis"), Idevice.SomeEmphasis)] html += common.formField( 'select', this_package, _('Emphasis'), 'emphasis', self.id, '', # TODO: Instructions emphasisValues, self.idevice.emphasis) html += self.renderEditButtons(undo=self.idevice.undo) html += u"</div>\n" return html
def renderEdit(self): """ Returns an XHTML string with the form element for editing this field """ log.debug("renderEdit") html = "" html += u'<b>'+self.field.name+':</b>\n' html += common.elementInstruc(self.field.instruc)+'<br/>' html += common.textInput("path"+self.id, "", 50) html += u'<input type="button" onclick="addMp3(\'%s\')"' % self.id html += u' value="%s" />' % _(u"Select an MP3") if self.field.mediaResource: html += '<p style="color: red;">'+ self.field.mediaResource.storageName + '</P>' html += '<br/><b>%s</b><br/>' % _(u"Caption:") html += common.textInput("caption" + self.id, self.field.caption) html += common.elementInstruc(self.field.captionInstruc) return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = u'<div>' html += '<span class="js-idevice-title-label">' html += '<label for="title'+self.id+'">'+_('Title')+':</label> ' html += common.elementInstruc(_('The title and the icon are not required. If you leave them empty the iDevice will have no emphasis.')) html += '</span>' html += common.hiddenField("iconiDevice" + self.id, self.idevice.icon) html += u'<a class="js-show-icon-panel-button" href="javascript:showMessageBox(\'iconpanel\');" title="%s"><img src="/images/stock-insert-image.png" alt="%s" width="16" height="16" /></a>' % (_('Select an icon'),_('Choose an Image')) # Get icon source (if it exists) icon = self.idevice.icon icon_exists = False if icon != '': idevice_icon = Path(G.application.config.stylesDir / style / 'icon_' + self.idevice.icon + '.gif') if idevice_icon.exists(): icon_exists = True else: idevice_icon = Path(G.application.config.stylesDir/style/"icon_" + self.idevice.icon + ".png") if idevice_icon.exists(): icon_exists = True # Icon HTML element html += u'<img class="js-idevide-icon-preview" name="iconiDevice%s" id="iconiDevice"' % (self.id) if icon_exists: html += u' src="/style/%s/icon_%s%s"' % (style, icon, idevice_icon.ext) else: html += u' src="/images/empty.gif"' html += u'/>' # Delete button html += u'<a href="javascript:deleteIcon(%s);" id="deleteIcon%s" class="deleteIcon" title="%s"' % (self.id, self.id, _('Delete')) # If the icon doesn't exists if not icon_exists: html += u' style="display: none;"' html += u'>' html += u'<img class="js-delete-icon" alt="%s" src="%s"/>' % (_('Delete'), '/images/stock-delete.png') html += u'</a>' html += common.textInput("title" + self.id, self.idevice.title) html += u'<div class="js-icon-panel-container">' html += u'<div id="iconpaneltitle">%s</div>' % _("Icons") html += u'<div id="iconpanelcontent">' html += self.__renderIcons(style) html += u'</div>' html += u"</div>" for element in self.elements: html += element.renderEdit() html += self.renderEditButtons() html += u"</div>" return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = "<div class=\"iDevice\"><br/>\n" html += common.textInput("title" + self.id, self.idevice.title) html += self.commentElement.renderEdit() html += "<br/>" + self.renderEditButtons() html += "</div>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = "<div class=\"iDevice\"><br/>\n" html += common.textInput("title"+self.id, self.idevice.title) html += self.commentElement.renderEdit() html += "<br/>" + self.renderEditButtons() html += "</div>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form elements for editing this block """ log.debug("renderEdit") html = u"<div class=\"iDevice\"><br/>\n" print self.idevice.message if self.idevice.message != "": html += common.editModeHeading(self.idevice.message) html += common.elementInstruc(self.idevice.kpseInstruc_) html += common.textInput("kpse" + self.id, self.idevice.latexpath) html += u'<input type="button" onclick="addKpsepath(\'%s\')"' % self.id html += u"value=\"%s\"/>\n" % _(u"Search") html += u"<br/><br/>\n" html += common.textInput("title" + self.id, self.idevice.title) + "<br/><br/>" this_package = None if self.idevice is not None and self.idevice.parentNode is not None: this_package = self.idevice.parentNode.package html += common.textInput("path" + self.id, self.idevice.source) html += u'<input type="button" onclick="addTeX(\'%s\')"' % self.id html += u"value=\"%s\"/>\n" % _(u"Add file") html += common.submitButton(u"loadSource"+self.id, _(u"Load")) html += u"<br/>\n" html += self.articleElement.renderEdit() emphasisValues = [(_(u"No emphasis"), Idevice.NoEmphasis), (_(u"Some emphasis"), Idevice.SomeEmphasis)] html += common.formField('select', this_package, _('Emphasis'), 'emphasis', self.id, '', # TODO: Instructions emphasisValues, self.idevice.emphasis) html += self.renderEditButtons(undo=self.idevice.undo) html += u"</div>\n" return html
def renderPreview(self): """ Returns an XHTML string with the form element for previewing this field """ html = "<b>" + self.field.name + "</b> " if self.field.instruc != "": html += common.elementInstruc(self.field.instruc) html += "<br/>\n" html += common.textInput(self.id, self.field.content) html += "<br/>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = u'<div><div class="block">\n' html += common.textInput("title"+self.id, self.idevice.title) html += u"</div>\n" for element in self.elements: html += element.renderEdit() + "<br/>" html += self.renderEditButtons() html += u"</div>\n" return html
def renderEdit(self): """ Returns an XHTML string with the form element for editing this field """ html = "<b>%s</b><br/>" % _("Feedback") html += "<b>%s </b>" % _("Button Caption") html += common.textInput("btnCaption"+self.id, self.field.buttonCaption, 25) html += "<br/><br/>" html += common.textInput("name"+self.id, self.field.name, 25) html += common.submitImage("deleteField", self.id, "/images/stock-cancel.png", _("Delete"), 1) html += "<br/>\n" this_package = None html += common.formField('richTextArea', this_package, '','instruc', self.id, '', self.field.instruc) html += "<br/>" return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = u'<div><div class="block">\n' html += common.elementInstruc(self.idevice.instruc) html += common.textInput("title"+self.id, self.idevice.title) html += u"</div>\n" html += u"<div class=\"block\">" html += u"<div class=\"block\">" html += u"<strong>%s</strong>" % _("Email Address") html += common.elementInstruc(_("Enter the email address you want\ feedback to be sent to")) html += u"</div>\n" if self.idevice.address == "": self.idevice.address = self.package.email html += common.textInput("address"+self.id, self.idevice.address) html += u"<div class=\"block\">\n" html += u"<strong>%s</strong>" % _("Subject") if self.idevice.subject == "": if self.package.title == "": self.idevice.subject = _("Feedback on ") + \ self.package.name + " - " + self.idevice.parentNode.title else: self.idevice.subject = \ _("Feedback on ") + self.package.title + " - " + \ self.idevice.parentNode.title html += common.elementInstruc(_("Enter default subject of feedback")) html += u"</div>\n" html += common.textInput("subject"+self.id, self.idevice.subject) html += u"<div class=\"block\">\n" html += u"<strong>%s</strong>" % _("Comment") html += u"<div>\n" html += common.textInput("comment"+self.id, self.idevice.subject) html += "</div>\n" for element in self.elements: html += element.renderEdit() + "<br/>" html += self.renderEditButtons() html += u"</div>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ heightArr = [['small', '300'], ['normal', '500'], ['large', '700']] html = u'<div><div class="block">\n' html += u"<strong>%s</strong>" % _("PDF import") html += common.elementInstruc(self.idevice.appletInstruc) html += u'</div>' html += u'<div class="block">\n' html += u"<strong>%s</strong>" % _("Path to PDF file") html += u'</div>\n' html += u'<div class="block">\n' html += common.textInput("path"+self.id, self.idevice.path, 50) html += u'<input type="button" onclick="addPdf(\'%s\')"' % self.id html += u"value=\"%s\"/>\n" % _(u"Add file") html += u'</div>' html += u'<div class="block">\n' html += u"<strong>%s</strong>" % _("Pages to import") html += common.elementInstruc(self.idevice.pagesInstruc) html += u'</div>\n' html += u'<div class="block">\n' html += common.textInput("pages"+self.id, self.idevice.pages, 10) html += u"</div>\n" html += u"<div>\n" this_package = None if self.idevice is not None and self.idevice.parentNode is not None: this_package = self.idevice.parentNode.package html += common.formField('select', this_package, _('Frame Height:'), "height" + self.id, options = heightArr, selection = self.idevice.height) html += u"</div>\n" for element in self.elements: html += element.renderEdit() + "<br/>" html += u"</div>\n" html += self.renderEditButtons() return html
def renderEdit(self, style): """ Renders a screen that allows the user to enter paragraph text and choose which words are hidden. """ html = [ u'<div class="iDevice">', u'<div class="block">', common.textInput("title" + self.id, self.idevice.title), u'</div>', self.instructionElement.renderEdit(), self.clozeElement.renderEdit(), self.feedbackElement.renderEdit(), self.renderEditButtons(), u'</div>' ] return u'\n '.join(html)
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = "<div class=\"iDevice\"><br/>\n" # JR # Quitamos el prefijo "FPD -" if self.idevice.title.find("FPD - ") == 0: self.idevice.title = x_(u"Orientaciones para el alumnado") html += common.textInput("title" + self.id, self.idevice.title) html += self.activityElement.renderEdit() html += "<br/>" + self.renderEditButtons() html += "</div>\n" return html
def renderEdit(self): """ Returns an XHTML string with the form element for editing this field """ html = "<b>%s</b><br/>" % _("Text Line") html += common.textInput("name"+self.id, self.field.name, 25) html += common.submitImage("deleteField", self.id, "/images/stock-cancel.png", _("Delete"), 1) html += "<br/>\n" this_package = None html += common.richTextArea("instruc"+self.id, self.field.instruc, package=this_package) html += "<br/>" return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = "<div class=\"iDevice\"><br/>\n" # JRJ # Quitamos el prefijo "FPD -" # (let's remove the "FPD -" prefix) if self.idevice.title.find("FPD - ") == 0: self.idevice.title = x_(u"You Should Know") html += common.textInput("title" + self.id, self.idevice.title) html += self.activityElement.renderEdit() html += "<br/>" + self.renderEditButtons() html += "</div>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = u'<div class="iDevice">\n' html += common.textInput("title" + self.id, self.idevice.title) html += "<br/><br/>\n" value = _("Add another Term") html += common.submitButton("addTerm" + self.id, value) for element in self.termElements: html += element.renderEdit() html += "<br/>" html += self.renderEditButtons() html += u"</div>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = "<div class=\"iDevice\">\n" html += common.textInput("title" + self.id, self.idevice.title) html += u"<br/><br/>\n" for element in self.questionElements: html += element.renderEdit() #value = _("Add another Question") #html += "<br/>" #html += common.submitButton("addQuestion"+self.id, value) html += "<br/><br/>" + self.renderEditButtons() html += "</div>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ self.previewing = True html = u'<div class="iDevice"><br/>\n' html += common.textInput("title"+self.id, self.idevice.title) html += self.storyElement.renderEdit() for element in self.questionElements: html += element.renderEdit() html += u"</table>\n" value = _(u"Add another activity") html += common.submitButton(u"addQuestion"+unicode(self.id), value) html += u"<br /><br />" + self.renderEditButtons(undo=self.idevice.undo) html += u"</div>\n" return html
def renderEdit(self, style): """ Returns an XHTML string with the form element for editing this block """ html = u"<div class=\"iDevice\"><br/>\n" html += common.textInput("title"+self.id, self.idevice.title) html += u"<br/><br/>\n" html += self.instructionElement.renderEdit() for element in self.questionElements: html += element.renderEdit() value = _(u"Add another question") html += common.submitButton("addQuestion"+unicode(self.id), value) html += u"<br /><br />" + self.renderEditButtons(undo=self.idevice.undo) html += u"</div>\n" return html
def renderEdit(self): """ Returns an XHTML string with the form element for editing this field """ html = common.textInput("name"+self.id, self.field.name, 25) html += common.submitImage("deleteField", self.id, "/images/stock-cancel.png", _("Delete"), 1) html += "<br/>\n" html += common.image("img"+self.id, "/images/"+ImageEditorElement.DefaultImage, self.field.width, self.field.height) html += "<br/>\n" this_package = None html += common.formField('richTextArea', this_package, '','instruc', self.id, '', self.field.instruc) return html