Skip to content

Instantly share code, notes, and snippets.

@sakal
Created February 15, 2012 16:35
Show Gist options
  • Save sakal/1837166 to your computer and use it in GitHub Desktop.
Save sakal/1837166 to your computer and use it in GitHub Desktop.
Spine = require('spine')
Milk = require('milk/milk')
$ = Spine.$
class Payforms extends Spine.Controller
constructor: ->
super
@current = null
# include view is here!!!!
@tpl_bayticket = require('views/bayticket')('')
$("#modal_box").on('hidden', =>
@navigate '/games', @current.id
)
@routes {
"/sandpay": ->
}
show: (current) ->
params = {
name: current.params.name,
tickets: current.params.tickets
}
@current = current
console.log params
form_tpl = Milk.render @tpl_bayticket, params
$("#modal_box").html(form_tpl)
#$("@")
$("#modal_box").modal('show')
module.exports = Payforms
<form action="{{action}}" method="POST">
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h3>{{name}}</3>
</div>
<div class="modal-body">
<div class="controls">
{{#tickets}}
<label class="radio" for="t{{ticket_id}}"><input type="radio" name="price" id="t{{ticket_id}}" value="{{ticket_id}}"/> {{{price}}}</label>
{{/tickets}}
</div>
</div>
<div class="modal-footer">
<a href="#" class="btn btn-primary">Купить</a>
<a href="#" class="btn">Отмена</a>
</div>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment