Added status attribute to videos; added ability to edit video status and serial independently

This commit is contained in:
2023-03-06 17:59:58 -05:00
parent f243452783
commit 4735047682
5 changed files with 63 additions and 0 deletions

26
assets/coffee/wyrm.coffee Normal file
View 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)