Parent: [875040] (diff)

Child: [bb39a3] (diff)

Download this file

subscriptions.py    50 lines (41 with data), 1.6 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from pylons import c
import ew as ew_core
import ew.jinja2_ew as ew
from allura.lib import validators as V
from allura import model as M
from .form_fields import SubmitButton
# Discussion forms
class _SubscriptionTable(ew.TableField):
class hidden_fields(ew_core.NameList):
_id = ew.HiddenField(validator=V.Ming(M.Mailbox))
topic = ew.HiddenField()
artifact_index_id = ew.HiddenField()
class fields(ew_core.NameList):
project_name = ew.HTMLField(label='Project', show_label=True)
mount_point = ew.HTMLField(label='App', show_label=True)
topic = ew.HTMLField(label='Topic', show_label=True)
type = ew.HTMLField(label='Type', show_label=True)
frequency = ew.HTMLField(label='Frequency', show_label=True)
artifact_title = ew.HTMLField(label='Artifact', show_label=True)
# unsubscribe = SubmitButton()
unsubscribe = ew.Checkbox(suppress_label=True, show_label=True)
class SubscriptionForm(ew.SimpleForm):
defaults=dict(
ew.SimpleForm.defaults,
submit_text='Unsubscribe from marked artifacts')
class fields(ew_core.NameList):
subscriptions=_SubscriptionTable()
class SubscribeForm(ew.SimpleForm):
template='jinja:allura:templates/widgets/subscribe.html'
defaults=dict(
ew.SimpleForm.defaults,
thing='tool',
style='text',
tool_subscribed=False,
value=None)
class fields(ew_core.NameList):
subscribe=SubmitButton()
unsubscribe=SubmitButton()
shortname=ew.HiddenField()
def from_python(self, value, state):
return value