Added status attribute to videos; added ability to edit video status and serial independently
This commit is contained in:
26
assets/coffee/wyrm.coffee
Normal file
26
assets/coffee/wyrm.coffee
Normal file
@ -0,0 +1,26 @@
|
||||
$(document).ready(() ->
|
||||
$('.video-status').click((e) ->
|
||||
newStatus = prompt('New video status').toLowerCase()
|
||||
payload =
|
||||
status: newStatus
|
||||
videoId = $('#video-id').val()
|
||||
$.post('/video/' + videoId + '/edit/status', payload, (data) ->
|
||||
if data == 'success'
|
||||
$('.video-status span').text(capitalizeWord(newStatus))
|
||||
)
|
||||
)
|
||||
|
||||
$('.video-serial').click((e) ->
|
||||
newSerial = prompt('New video serial number')
|
||||
payload =
|
||||
serial: newSerial
|
||||
videoId = $('#video-id').val()
|
||||
$.post('/video/' + videoId + '/edit/serial', payload, (data) ->
|
||||
if data == 'success'
|
||||
$('.video-serial span').text(newSerial)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
capitalizeWord = (str) ->
|
||||
return str.charAt(0).toUpperCase() + str.slice(1)
|
Reference in New Issue
Block a user