Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
37 lines (34 sloc)
1.1 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |