extends ../layouts/main
block content

  - var formAction = category ? `/admin/category/${category._id}` : '/admin/category';

  pre= JSON.stringify(category, null, 2)

  form(method="POST", action= formAction).uk-form
    .uk-margin
      label(for="name").uk-form-label Category Name
      input(id="name", name="name", type="text", placeholder="Enter category name", value= category ? category.name : undefined).uk-input

    .uk-margin
      label(for="description").uk-form-label Description
      textarea(id="description", name="description", rows="3", placeholder="Enter category description").uk-textarea= category ? category.description : undefined
    
    button(type="submit").uk-button.uk-button-primary= category ? 'Update Category' : 'Create Category'