-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c6a6b8e
commit a03a1b0
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
[templates.add main] | ||
|
||
<div class="container [module.get slug /]-submit-poetry"> | ||
<h2 class="[module.get slug /]-heading">Submit</h2> | ||
|
||
[aw2.get token set='module.form_token' /] //** dynamic token creation - security reasons **// | ||
|
||
<form class='[module.form_token /]'> | ||
<div class="form-group"> | ||
<label for="title"> Title:</label> | ||
<input type="text" class="form-control width-100" id="dataa-title" name="dataa-title"> | ||
</div> | ||
<div class="form-group"> | ||
<label for="description">Description:</label> | ||
[form_control.textarea id="dataa-description" name="dataa-description" /] | ||
</div> | ||
<button type="submit" class="btn btn-success [module.form_token /]-submit" | ||
id="[module.get slug /]-submit" >Submit</button> | ||
</form> | ||
|
||
//** to send the form data **// | ||
[session_ticket.create nonce=yes set=module.ticket_id /] | ||
[arr.create set="module.collection"] | ||
[post_type]m_psuedo_poetry[/post_type] | ||
[/arr.create] | ||
|
||
[session_ticket.set {module.ticket_id} field="email" value="[email protected]" /] | ||
[session_ticket.set {module.ticket_id} field="address" value="pune" /] | ||
|
||
[session_ticket.set_activity {module.ticket_id} | ||
collection='{module.collection}' module='{module.slug}.save_form' /] | ||
|
||
<script type="spa/axn" axn='form.ajax' | ||
bind='submit' | ||
bind_selector='.[module.form_token /]' | ||
disable_selector='.[module.form_token /]-submit' | ||
route_ajax='t/[module.ticket_id /]' > </script> | ||
|
||
</div> | ||
|
||
[/templates.add] | ||
|
||
//** save form function **// | ||
[templates.add save_form] | ||
|
||
[session_ticket.get main="{template.ticket_id}" set=template.tkt_data /] | ||
[aw2.get template.tkt_data dump=t /] | ||
|
||
[/templates.add] |