Пример #1
0
 class fields(ew_core.NameList):
     name = ew.InputField(field_type='text',
                          label='Name',
                          validator=formencode.All(
                             fev.UnicodeString(not_empty=True, max=40),
                             V.MaxBytesValidator(max=40)),
                          attrs=dict(maxlength=40,
                                     title="This is the publicly viewable name of the project, and will appear on project listings. It should be what you want to see as the project title in search listing."))
     summary = ew.InputField(field_type="text", label='Short Summary',
                             validator=formencode.All(
                                fev.UnicodeString(max=70),
                                V.MaxBytesValidator(max=70)),
                             attrs=dict(maxlength=70))
     short_description = ew.TextArea(label='Full Description',
                                     validator=formencode.All(
                                         fev.UnicodeString(max=1000),
                                         V.MaxBytesValidator(max=1000)),
                                     attrs=dict(title="Add a few paragraphs describing your project to new users."))
     icon = ew.FileField(label='Icon')
     external_homepage = ew.InputField(field_type="text", label='Homepage')
     support_page = ew.InputField(field_type="text", label='Support Page')
     support_page_url = ew.InputField(field_type="text", label='Support Page URL')
     removal = ew.InputField(field_type="text", label='Removal')
     moved_to_url = ew.InputField(field_type="text", label='Moved Project to URL')
     export_controlled = ew.InputField(field_type="text", label='Export Control')
     delete = ew.InputField(field_type="hidden", label='Delete')
     delete_icon = ew.InputField(field_type="hidden", label='Delete Icon')
     undelete = ew.InputField(field_type="hidden", label='Undelete')
     tracking_id = ew.InputField(field_type="text", label="Analytics Tracking ID")
Пример #2
0
 def fields(self):
     return [
         ew.SingleSelectField(name='grant',
                              label='Award',
                              options=self.award_options()),
         ffw.NeighborhoodProjectSelect(self._project_select_url,
                                       name='recipient'),
         ew.TextField(name='url', label='Award URL', validator=fev.URL()),
         ew.TextArea(name='comment',
                     label='Comment',
                     validator=fev.UnicodeString(not_empty=False),
                     attrs={
                         'rows': 5,
                         'cols': 30
                     }),
     ]
Пример #3
0
    class fields(ew_core.NameList):
        subject = ew.TextField(validator=fev.UnicodeString(
            not_empty=True, messages={'empty': "You must provide a Subject"}),
                               attrs=dict(
                                   placeholder='Enter your subject here',
                                   title='Enter your subject here',
                                   style='width: 425px'),
                               label='Subject')

        message = ew.TextArea(validator=fev.UnicodeString(
            not_empty=True, messages={'empty': "You must provide a Message"}),
                              attrs=dict(placeholder='Enter your message here',
                                         title='Enter your message here',
                                         style='width: 425px; height:200px'),
                              label='Message')

        cc = ew.Checkbox(label='Send me a copy')
Пример #4
0
 class fields(ew_core.NameList):
     selected_skill = ew.HiddenField(
         attrs={'value': ''},
         show_errors=False,
         validator=V.UnicodeString(not_empty=True))
     level = ew.SingleSelectField(
         label="Level of knowledge",
         options=[
             ew.Option(py_value="low", label="Low level"),
             ew.Option(py_value="medium", label="Medium level"),
             ew.Option(py_value="high", label="Advanced level")],
         validator=formencode.All(
             V.OneOfValidator(['low', 'medium', 'high']),
             V.UnicodeString(not_empty=True)))
     comment = ew.TextArea(
         label="Additional comments",
         validator=V.UnicodeString(not_empty=False),
         attrs={'rows': 5, 'cols': 30})
Пример #5
0
 class fields(ew_core.NameList):
     name = ew.InputField(
         field_type='text',
         label='Name',
         validator=formencode.All(fev.UnicodeString(not_empty=True, max=40),
                                  V.MaxBytesValidator(max=40)),
         attrs={
             'maxlength': 40,
             'title':
             "This is the publicly viewable name of the project, and will appear on project listings. It should be what you want to see as the project title in search listing.",
             'class': 'tooltip',
         })
     summary = ew.InputField(
         field_type="text",
         label='Short Summary',
         validator=formencode.All(fev.UnicodeString(max=70),
                                  V.MaxBytesValidator(max=70)),
         attrs={
             'maxlength': 70,
             'title':
             'Briefly state what your project is and what it does without repeating the project name. This summary appears in Google search results beneath the project name.',
             'class': 'tooltip',
         })
     short_description = ew.TextArea(
         label='Full Description',
         validator=formencode.All(fev.UnicodeString(max=1000),
                                  V.MaxBytesValidator(max=1000)),
         attrs={
             'title':
             'Describe the full functionality of your project using related keywords. The first sentence has the most impact on search. Provide unique content that calls out keywords and describes the merits of your project.',
             'class': 'tooltip'
         })
     # Apparently, child field must be CompoundField with custom template
     # for SortableRepeatedField to work properly, that's why FeaturesField
     # is not just ew.TextField
     features = ffw.SortableRepeatedField(
         label='Features',
         show_msg=False,
         show_button=False,
         append_to='bottom',
         extra_field_on_focus_name='feature',
         field=FeaturesField())
     icon = ew.FileField(label='Icon',
                         attrs={'accept': 'image/*'},
                         validator=V.IconValidator())
     external_homepage = ew.InputField(field_type="text",
                                       label='Homepage',
                                       validator=fev.URL(add_http=True))
     video_url = ew.InputField(field_type="text",
                               label="Video (YouTube)",
                               validator=V.YouTubeConverter())
     support_page = ew.InputField(field_type="text", label='Support Page')
     support_page_url = ew.InputField(field_type="text",
                                      label='Support Page URL',
                                      validator=fev.URL(add_http=True,
                                                        if_empty=''))
     removal = ew.InputField(field_type="text", label='Removal')
     moved_to_url = ew.InputField(field_type="text",
                                  label='Moved Project to URL',
                                  validator=fev.URL(add_http=True,
                                                    if_empty=''))
     export_controlled = ew.InputField(field_type="text",
                                       label='Export Control')
     export_control_type = ew.InputField(field_type="text",
                                         label='Export Control Type')
     delete = ew.InputField(field_type="hidden", label='Delete')
     delete_icon = ew.InputField(field_type="hidden", label='Delete Icon')
     undelete = ew.InputField(field_type="hidden", label='Undelete')
     tracking_id = ew.InputField(field_type="text",
                                 label="Google Analytics ID",
                                 attrs=(dict(placeholder='UA-123456-0',
                                             pattern='UA-[0-9]+-[0-9]+')))
     twitter_handle = ew.InputField(field_type="text",
                                    label='Twitter Handle')
     facebook_page = ew.InputField(field_type="text",
                                   label='Facebook page',
                                   validator=fev.URL(add_http=True))
Пример #6
0
 class fields(ew_core.NameList):
     key = ew.TextArea(label='SSH Public Key')