Ejemplo n.º 1
0
 class fields(ew_core.NameList):
     open_status_names = ew.TextField(label='Open Statuses')
     closed_status_names = ew.TextField(label='Closed Statuses')
     custom_fields = ffw.SortableRepeatedField(field=CustomFieldAdmin())
Ejemplo n.º 2
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))