extends ../node_modules/maki/views/layouts/default

block content

  h1 #{item.title}

  h2 Preview
  .preview !{ markdown( item.description ) }
  
  h2 Edit
  
  form.ui.form(action="/recordings/#{item.slug}", method="POST")
    input(type="hidden", name="method", value="PATCH")
    
    .field
      label Title
      input(type="text", name="title", value="#{item.title}")
    
    .field
      label Description
      textarea(name="description", style="height: 20em;") #{item.description}
      
    .field
      label YouTube Video ID
      input(type="text", name="youtube", value="#{item.youtube || ''}")

    .field
      label Soundcloud ID
      input(type="text", name="soundcloud", value="#{item.soundcloud || ''}")

    button.ui.submit.button(type="submit") Edit &raquo;

block scripts
  script(src="/js/marked.min.js")
  script.
    $('textarea[name=description]').keyup( renderPreview );
    
    function renderPreview() {
      var value = this.value;
      var rendered = marked( value );
      $('.preview').html( rendered );
    }

extends ../node_modules/maki/views/layouts/default

block content

  h1 #{item.title}

  h2 Preview
  .preview !{ markdown( item.description ) }
  
  h2 Edit
  
  form.ui.form(action="/recordings/#{item.slug}", method="POST")
    input(type="hidden", name="method", value="PATCH")
    
    .field
      label Title
      input(type="text", name="title", value="#{item.title}")
    
    .field
      label Description
      textarea(name="description", style="height: 20em;") #{item.description}
    
    .two.fields
      .field
        label YouTube Video ID
        input(type="text", name="youtube", value="#{item.youtube || ''}")

      .field
        label Soundcloud ID
        input(type="text", name="soundcloud", value="#{item.soundcloud || ''}")

    button.ui.submit.button(type="submit") Edit &raquo;

block scripts
  script(src="/js/marked.min.js")
  script.
    $('textarea[name=description]').keyup( renderPreview );
    
    function renderPreview() {
      var value = this.value;
      var rendered = marked( value );
      $('.preview').html( rendered );
    }

Tidy up already verbose form.
Tidy up already verbose form.
