-
Notifications
You must be signed in to change notification settings - Fork 2
/
submit-post.html
37 lines (34 loc) · 1.1 KB
/
submit-post.html
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
<dv.component name="submit-post">
<sn.navbar />
<dv.tx>
<authentication.logged-in />
<dv.redirect href="/login" params={ callback: '/submit' }
onEvalFailure=true />
</dv.tx>
<div class="main">
<div class="container">
<dv.if condition=sn.navbar.user>
<h1>Submit</h1>
<dv.tx>
<dv.gen-id />
<authentication.authenticate
username=sn.navbar.user.username hidden=true />
<post.create-object
id=dv.gen-id.id
initialValue={ author: sn.navbar.user.username }
showExclude=['author']
buttonLabel="Submit"
newObjectSavedText="Post submitted" />
<!-- use author as sourceId of initial score -->
<!-- also allows database to prevent author from upvoting own post -->
<scoreposts.create-score
sourceId=sn.navbar.user.username
targetId=dv.gen-id.id
value=0
hidden=true />
<dv.link href="/post" params={ id: dv.gen-id.id } hidden=true />
</dv.tx>
</dv.if>
</div>
</div>
</dv.component>