コード例 #1
0
ファイル: forms.py プロジェクト: xmonader/allura
    def fields(self):
        provider = plugin.ProjectRegistrationProvider.get()
        tools_options = []
        for ep, tool in six.iteritems(g.entry_points["tool"]):
            if tool.status == 'production' and tool._installable(tool_name=ep,
                                                                 nbhd=c.project.neighborhood,
                                                                 project_tools=[]):
                tools_options.append(ew.Option(label=tool.tool_label, html_value=ep))

        return ew_core.NameList([
            ew.HiddenField(name='project_description', label='Public Description'),
            ew.HiddenField(name='neighborhood', label='Neighborhood'),
            ew.Checkbox(name='private_project', label="", attrs={'class': 'unlabeled'}),
            ew.InputField(name='project_name', label='Project Name',
                          field_type='text',
                          validator=formencode.All(
                              V.UnicodeString(not_empty=True, max=40),
                              V.MaxBytesValidator(max=40)),
                          ),
            ew.InputField(name='project_unixname',
                          label='Short Name', field_type='text',
                          attrs={
                              'title': 'Create a URL name that matches your project name as closely as possible to improve search indexing and maximize visibility.',
                              'class': 'tooltip'
                          },
                          validator=provider.shortname_validator),
            ew.CheckboxSet(name='tools', options=tools_options),
        ])
コード例 #2
0
ファイル: forms.py プロジェクト: johnsca/incubator-allura
 class fields(ew_core.NameList):
     project_description = ew.HiddenField(label='Public Description')
     neighborhood = ew.HiddenField(label='Neighborhood')
     private_project = ew.Checkbox(label="", attrs={'class': 'unlabeled'})
     project_name = ew.InputField(label='Project Name',
                                  field_type='text',
                                  validator=formencode.All(
                                      fev.UnicodeString(not_empty=True,
                                                        max=40),
                                      V.MaxBytesValidator(max=40)))
     project_unixname = ew.InputField(
         label='Short Name',
         field_type='text',
         validator=formencode.All(
             fev.String(not_empty=True), fev.MinLength(3),
             fev.MaxLength(15),
             fev.Regex(
                 r'^[A-z][-A-z0-9]{2,}$',
                 messages={
                     'invalid':
                     'Please use only letters, numbers, and dashes 3-15 characters long.'
                 }), NeighborhoodProjectTakenValidator()))
     tools = ew.CheckboxSet(
         name='tools',
         options=[
             ## Required for Neighborhood functional tests to pass
             ew.Option(label='Wiki', html_value='wiki', selected=True)
         ])
コード例 #3
0
 class fields(ew_core.NameList):
     num_replies = ew.HTMLField(show_label=True, label='Num Replies')
     num_views = ew.HTMLField(show_label=True)
     flags = ew.HTMLField(show_label=True,
                          text="${unicode(', '.join(value))}")
     last_post = ew.HTMLField(text="${value and value.summary()}",
                              show_label=True)
     subscription = ew.Checkbox(suppress_label=True, show_label=True)
コード例 #4
0
 class fields(ew_core.NameList):
     project_name = ffw.DisplayOnlyField(label='Project', show_label=True, with_hidden_input=False)
     mount_point = ffw.DisplayOnlyField(label='App', show_label=True, with_hidden_input=False)
     topic = ffw.DisplayOnlyField(label='Topic', show_label=True, with_hidden_input=False)
     type = ffw.DisplayOnlyField(label='Type', show_label=True, with_hidden_input=False)
     frequency = ffw.DisplayOnlyField(label='Frequency', show_label=True, with_hidden_input=False)
     artifact_title = ew.LinkField(label='Artifact', show_label=True, plaintext_if_no_href=True)
     # unsubscribe = SubmitButton()
     subscribed = ew.Checkbox(suppress_label=True)
コード例 #5
0
ファイル: forms.py プロジェクト: pombredanne/incubator-allura
 class fields(ew_core.NameList):
     project_description = ew.HiddenField(label='Public Description')
     neighborhood = ew.HiddenField(label='Neighborhood')
     private_project = ew.Checkbox(label="", attrs={'class': 'unlabeled'})
     project_name = ew.InputField(label='Project Name',
                                  field_type='text',
                                  validator=formencode.All(
                                      fev.UnicodeString(not_empty=True,
                                                        max=40),
                                      V.MaxBytesValidator(max=40)))
     project_unixname = ew.InputField(
         label='Short Name', field_type='text',
         validator=None)  # will be set in __init__
     tools = ew.CheckboxSet(
         name='tools',
         options=[
             ## Required for Neighborhood functional tests to pass
             ew.Option(label='Wiki', html_value='wiki', selected=True)
         ])
コード例 #6
0
ファイル: forms.py プロジェクト: pombredanne/incubator-allura
 class fields(ew_core.NameList):
     visible = ew.Checkbox(
         label='Make my personal statistics visible to other users.')
コード例 #7
0
 class fields(ew_core.NameList):
     num_topics = ew.HTMLField(show_label=True, label='Topics')
     num_posts = ew.HTMLField(show_label=True, label='Posts')
     last_post = ew.HTMLField(text="${value and value.summary()}",
                              show_label=True)
     subscribed = ew.Checkbox(suppress_label=True, show_label=True)
コード例 #8
0
 class fields(ew_core.NameList):
     num_replies = ew.HTMLField(show_label=True, label='Num Posts')
     num_views = ew.HTMLField(show_label=True)
     last_post = ew.HTMLField(text="${value and value.summary()}",
                              show_label=True)
     subscription = ew.Checkbox(suppress_label=True, show_label=True)