class CommentsForm(ListForm): template = 'admin/box-form.html' id = 'settings-form' css_class = 'form' submit_text = None fields = [ RadioButtonList('comments_engine', label_text=N_('Comment Engine'), options=comments_enable_disable, validator=comments_enable_validator, ), ListFieldSet('builtin', suppress_label=True, legend=N_('Built-in Comments:'), css_classes=['details_fieldset'], children=[ CheckBox('req_comment_approval', label_text=N_('Moderation'), help_text=N_('Require comments to be approved by an admin'), css_classes=['checkbox-inline-help'], validator=Bool(if_missing='')), TextField('akismet_key', label_text=N_('Akismet Key')), TextField('akismet_url', label_text=N_('Akismet URL')), TextArea('vulgarity_filtered_words', label_text=N_('Filtered Words'), attrs=dict(rows=3, cols=15), help_text=N_('Enter words to be filtered separated by a comma.')), ]), ListFieldSet('facebook', suppress_label=True, legend=N_('Facebook Comments:'), css_classes=['details_fieldset'], children=[ TextField('facebook_appid', label_text=N_('Application ID'), help_text=N_('See: https://developers.facebook.com/apps')), ]), SubmitButton('save', default=N_('Save'), css_classes=['btn', 'btn-save', 'blue', 'f-rgt']), ]
class SiteMapsForm(ListForm): template = 'admin/box-form.html' id = 'settings-form' css_class = 'form' submit_text = None event = events.Admin.Settings.SiteMapsForm fields = [ ListFieldSet('rss', suppress_label=True, legend='', css_classes=['details_fieldset'], children=[ CheckBox('sitemaps_display', css_classes=['checkbox-left'], label_text=N_('Site Maps'), validator=Bool(if_missing='')), CheckBox('rss_display', css_classes=['checkbox-left'], label_text=N_('RSS Feeds'), validator=Bool(if_missing='')), ]), ListFieldSet( 'feeds', suppress_label=True, css_classes=['details_fieldset'], legend=N_('RSS Feed Defaults:'), children=[ TextField( u'default_feed_results', validator=Int(not_empty=True, min=1, if_missing=30), label_text=N_(u'number of items'), help_text=N_( u'The number of items in the feed can be overriden per request ' U'if you add "?limit=X" to the feed URL. If the "limit" parameter ' u'is absent, the default above is used.'), ), ]), SubmitButton('save', default=N_('Save'), css_classes=['btn', 'btn-save', 'blue', 'f-rgt']), ]
class SiteMapsForm(ListForm): template = 'admin/box-form.html' id = 'settings-form' css_class = 'form' submit_text = None fields = [ ListFieldSet('rss', suppress_label=True, legend='', css_classes=['details_fieldset'], children=[ CheckBox('sitemaps_display', css_classes=['checkbox-left'], label_text=N_('Site Maps'), validator=Bool(if_missing='')), CheckBox('rss_display', css_classes=['checkbox-left'], label_text=N_('RSS Feeds'), validator=Bool(if_missing='')), ] ), SubmitButton('save', default=N_('Save'), css_classes=['btn', 'btn-save', 'blue', 'f-rgt']), ]
class TipoItemAddForm(AddRecordForm): __model__ = TipoItem __omit_fields__ = ['id_tipo_item', 'id_proyecto', 'codigo', 'hijos', 'atributos', 'items', 'roles', 'id_fase'] __check_if_unique__ = True __field_order__ = ['nombre', 'siglas', 'descripcion', 'id_padre', 'id_importado', 'mezclar'] __field_attrs__ = {'descripcion' : {'row': '1'}, 'nombre': { 'maxlength' : '50'} } __add_fields__ = {"siglas": None} __require_fields__ = ['nombre', 'id_padre'] siglas = TextField("siglas", label_text="Siglas") id_padre = TipoPadreField("id_padre", accion="new", label_text="Tipo Padre") id_importado = TipoImportadoField("id_importado", accion="new", label_text="Importar De") descripcion = TextArea mezclar = CheckBox("mezclar", label_text="Mezclar Estructuras")
class ProyectoForm(TableForm): hover_help = True show_errors = True fields = [ HiddenField('id_proyecto', label_text='Id', help_text='Id del Proyecto'), HiddenField('id_usuario', label_text='id_usuario', help_text='Id del Usuario.'), Spacer(), TextField('nombre', validator=NotEmpty, label_text='Nombre', size=38, help_text='Introduzca su Nombre completo.'), Spacer(), TextArea('descripcion', label_text='Descripcion', attrs=dict(rows=10, cols=50), help_text='Introduzca una descripcion del Proyecto'), Spacer(), CalendarDatePicker('fecha', date_format='%d/%m/%Y', help_text='Seleccione la fecha de Creacion del Proyecto'), Spacer(), CheckBox('iniciado', disabled='False', label_text='Iniciado', help_text='Indica si el proyecto se ha iniciado')] submit_text = 'Guardar Proyecto'
class AppearanceForm(ListForm): template = 'admin/box-form.html' id = 'settings-form' css_class = 'form' submit_text = None event = events.Admin.Settings.AppearanceForm fields = [ ListFieldSet('general', suppress_label=True, legend=N_('General'), css_classes=['details_fieldset'], children=[ FileField('appearance_logo', label_text=N_('Logo'), validator=FieldStorageUploadConverter(not_empty=False, label_text=N_('Upload Logo')), css_classes=[], default=lambda: request.settings.get('appearance_logo', \ 'logo.png'), template='./admin/settings/appearance_input_field.html'), FileField('appearance_background_image', label_text=N_('Background Image'), validator=FieldStorageUploadConverter(not_empty=False, label_text=N_('Upload Background')), css_classes=[], default=lambda: request.settings.get('appearance_background_image', \ 'bg_image.png'), template='./admin/settings/appearance_input_field.html'), TextField('appearance_background_color', maxlength=255, label_text=N_('Background color'), validator=Regex(hex_validation_regex, strip=True)), TextField('appearance_link_color', maxlength=255, label_text=N_('Link color'), validator=Regex(hex_validation_regex, strip=True)), TextField('appearance_visited_link_color', maxlength=255, label_text=N_('Visited Link color'), validator=Regex(hex_validation_regex, strip=True)), TextField('appearance_text_color', maxlength=255, validator=Regex(hex_validation_regex, strip=True), label_text=N_('Text color')), TextField('appearance_heading_color', maxlength=255, label_text=N_('Heading color'), validator=Regex(hex_validation_regex, strip=True)), SingleSelectField('appearance_navigation_bar_color', label_text=N_('Color Scheme'), options=navbar_colors), ] ), ListFieldSet('options', suppress_label=True, legend=N_('Options'), css_classes=['details_fieldset'], children=[ CheckBox('appearance_enable_cooliris', css_classes=['checkbox-left'], label_text=N_('Enable Cooliris on the Explore Page'), help_text=N_('Cooliris support is deprecated and will be ' + \ 'removed in the next major version of MediaDrop ' + \ 'unless someone is interested in maintaining it.'), validator=Bool(if_missing='')), CheckBox(u'appearance_display_login', css_classes=['checkbox-left'], label_text=N_('Display login link for all users'), validator=Bool(if_missing='')), CheckBox('appearance_enable_featured_items', label_text=N_('Enable Featured Items on the Explore Page'), css_classes=['checkbox-left'], validator=Bool(if_missing='')), CheckBox('appearance_enable_podcast_tab', label_text=N_('Enable Podcast Tab'), css_classes=['checkbox-left'], validator=Bool(if_missing='')), CheckBox('appearance_enable_user_uploads', label_text=N_('Enable User Uploads'), css_classes=['checkbox-left'], validator=Bool(if_missing='')), CheckBox('appearance_enable_widescreen_view', label_text=N_('Enable widescreen media player by default'), css_classes=['checkbox-left'], validator=Bool(if_missing='')), CheckBox('appearance_display_logo', label_text=N_('Display Logo'), css_classes=['checkbox-left'], validator=Bool(if_missing='')), CheckBox('appearance_display_background_image', label_text=N_('Display Background Image'), css_classes=['checkbox-left'], validator=Bool(if_missing='')), CheckBox('appearance_display_mediadrop_footer', label_text=N_('Display MediaDrop Footer'), css_classes=['checkbox-left'], validator=Bool(if_missing='')), CheckBox('appearance_display_mediadrop_credits', label_text=N_('Display MediaDrop Credits in Footer'), css_classes=['checkbox-left'], validator=Bool(if_missing='')), ], template='./admin/settings/appearance_list_fieldset.html', ), ListFieldSet('player', suppress_label=True, legend=N_('Player Menu Options'), css_classes=['details_fieldset'], children=[ CheckBox('appearance_show_download', css_classes=['checkbox-left'], label_text=N_('Enable Download button on player menu bar.'), validator=Bool(if_missing='')), CheckBox('appearance_show_share', css_classes=['checkbox-left'], label_text=N_('Enable Share button on player menu bar.'), validator=Bool(if_missing='')), CheckBox('appearance_show_embed', css_classes=['checkbox-left'], label_text=N_('Enable Embed button on player menu bar.'), validator=Bool(if_missing='')), CheckBox('appearance_show_widescreen', css_classes=['checkbox-left'], label_text=N_('Enable Widescreen toggle button on player menu bar.'), validator=Bool(if_missing='')), CheckBox('appearance_show_popout', css_classes=['checkbox-left'], label_text=N_('Enable Popout button on player menu bar.'), validator=Bool(if_missing='')), CheckBox('appearance_show_like', css_classes=['checkbox-left'], label_text=N_('Enable Like button on player menu bar.'), validator=Bool(if_missing='')), CheckBox('appearance_show_dislike', css_classes=['checkbox-left'], label_text=N_('Enable Dislike button on player menu bar.'), validator=Bool(if_missing='')), ], template='./admin/settings/appearance_list_fieldset.html', ), ListFieldSet('advanced', suppress_label=True, legend=N_('Advanced'), css_classes=['details_fieldset'], children=[ TextArea('appearance_custom_css', label_text=N_('Custom CSS'), attrs=dict(rows=15, cols=25)), TextArea('appearance_custom_header_html', label_text=N_('Custom Header HTML'), attrs=dict(rows=15, cols=25)), TextArea('appearance_custom_footer_html', label_text=N_('Custom Footer HTML'), attrs=dict(rows=15, cols=25)), TextArea('appearance_custom_head_tags', label_text=N_('Custom <head> Tags'), help_text=N_('These HTML tags are inserted into the HTML ' '<head> section. Bad input can cause ugly rendering of ' 'your site. You can always restore your page by ' 'the box above.'), attrs=dict(rows=15, cols=25)), ], ), SubmitButton('save', default=N_('Save'), css_classes=['btn', 'btn-save', 'blue', 'f-rgt']), SubmitButton('reset', default=N_('Reset to Defaults'), css_classes=['btn', 'btn-cancel', 'reset-confirm']), ]