forked from nko2/website
/
form.jade
73 lines (64 loc) · 2.73 KB
/
form.jade
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
!= _csrf
!= partial('errors', { errors: person.errors })
.name.tabular
label( for='name' ) Name
input( type='text', name='name', id='name', value=person.name )
.email.tabular
label( for='email' ) Email
input( type='text', name='email', id='email', value=person.email )
.note
- if (person.role === 'contestant')
| Only visible to team members.
- else if (person === req.user)
| Only visible to you.
- if (admin)
.role.tabular
label( for='role' ) Role
select( name='role', id='role' )
- each role in ['nomination', 'contestant', 'judge', 'voter']
option( value=role, selected=(person.role === role) )= role.charAt(0).toUpperCase() + role.slice(1)
span.technical
input( type='hidden', name='technical', value=0 )
input( type='checkbox', name='technical', checked=person.technical, id='technical' )
label( for='technical' ) Technical
.admin
input( type='hidden', name='admin', value=0 )
input( type='checkbox', name='admin', checked=person.admin, id='admin' )
label( for='admin' ) Admin
- if (person.role !== 'voter')
h2.optional Optional
.twitter.tabular
label( for='twitter' ) Twitter
| http://twitter.com/
input( type='text', name='twitterScreenName', id='twitter', value=person.twitterScreenName, placeholder='username' )
img.spinner( src='/images/spinner.gif' )
- if (!person.contestant)
.image_url.tabular
label( for='imageURL' ) Picture
- image_url = avatar_url(person, 80)
img.avatar( src=image_url )
input( type='hidden', name='imageURL', value=person.imageURL )
button Change
img.spinner( src='/images/spinner.gif' )
.transloadit
iframe( scrolling='no', frameborder=0 )
script( type='application/html-xtmpl' )
form( action="http://api2.transloadit.com/assemblies", enctype="multipart/form-data", method="POST" )
- transloadit_params = { auth: { key: '86197da4c28a498fb7a3796c17dc3ce3' }, 'template_id': '898ee2cd0e904c7c8c62fd5ded92e501' }
input( type='hidden', name='params', value=JSON.stringify(transloadit_params))
input( type='file', name='file' )
.location.tabular
label( for='location' ) Location
input( type='text', name='location', id='location', value=person.location )
.company.tabular
label( for='company' ) Company
input( type='text', name='company', id='company', value=person.company )
.bio.tabular
label( for='bio' ) Bio
textarea( name='bio', id='bio' )= person.bio
.note
- if (person.judge || person.nomination)
| A 2-3 sentence bio for the
!= ' <a href="/judging">judges page</a>. '
a( href='http://daringfireball.net/projects/markdown/syntax' ) Markdown
| ok.