示例#1
0
 class fields(ew_core.NameList):
     project_name = ffw.DisplayOnlyField(
         label='Project', show_label=True, with_hidden_input=False)
     tool = ffw.DisplayOnlyField(
         label='Tool', show_label=True, with_hidden_input=False)
     artifact_title = ew.LinkField(
         label='Item(s)', show_label=True, plaintext_if_no_href=True)
     # unsubscribe = SubmitButton()
     subscribed = ew.Checkbox(suppress_label=True)
 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)
class AnnouncementsTable(DW._ThreadsTable):
    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)

    fields.insert(
        0,
        ew.LinkField(label='Subject',
                     text="${value['subject']}",
                     href="${value['url']()}",
                     show_label=True))
    defaults = dict(DW._ThreadsTable.defaults, div_id='announcements')
    name = 'announcements'
class _ThreadsTable(DW._ThreadsTable):
    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)

    fields.insert(
        0,
        ew.LinkField(label='Subject',
                     text="${value['subject']}",
                     href="${value['url']()}",
                     show_label=True))
    defaults = dict(DW._ThreadsTable.defaults, div_id='forum_threads')
示例#5
0
    def display(self, **kw):
        cat = kw.get('category')

        self.fields = [
            ew.RowField(show_errors=False,
                        show_label=False,
                        fields=[
                            ew.LinkField(text=cat.fullname,
                                         href="/categories/%s" %
                                         cat.trove_cat_id),
                            ew.SubmitButton(show_errors=False,
                                            attrs={'value': 'Remove'})
                        ],
                        hidden_fields=[
                            ew.HiddenField(name='categoryid',
                                           attrs={'value': cat.trove_cat_id})
                        ])
        ]
        return super(ForgeForm, self).display(**kw)
示例#6
0
class _ThreadsTable(ew.TableField):
    template = 'jinja:allura:templates/widgets/threads_table.html'

    class hidden_fields(ew_core.NameList):
        _id = ew.HiddenField(validator=V.Ming(M.Thread))

    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)

    fields.insert(
        0,
        ew.LinkField(label='Subject',
                     text="${value['subject']}",
                     href="${value['url']()}",
                     show_label=True))