Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (34 sloc) 1.1 KB
<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>
You can’t perform that action at this time.