<commit_before>extends ../layouts/default

block main
  h1= title

block content
  - var action = '/artworks'
  - action += artwork.isNew? '' : '/' + artwork.id

  .row
    .col-md-12
      form.form-horizontal(method="post", action=action, enctype="multipart/form-data", role="form", class="artwork-edit edit-form")

        input(type="hidden", name="_csrf", value="#{csrf_token}")

        - if (!artwork.isNew)
          input(type="hidden", name="_method", value="PUT")

        .form-group
          label.col-sm-3.control-label(for='title') Short Title
          .col-sm-9
            input.form-control(type='text', name="title", value=artwork.title, placeholder='Enter the title')

        .form-group
          label.col-sm-3.control-label(for='longTitle') Long Title
          .col-sm-9
            textarea.form-control(name="longTitle", placeholder='Long title', rows='5')
              =artwork.longTitle

        .form-group
          label.col-sm-3.control-label(for='medium') Medium
          .col-sm-9
            select.form-control(name="medium")
              for medium in mediums
                option(selected=artwork.medium == medium) #{medium}

        .form-group
          label.col-sm-3.control-label(for='year') Year
          .col-sm-9
            select.form-control(name='year')
              for year in years
                option(selected=artwork.year == year) #{year}

        .form-group
          label.col-sm-3.control-label(for='height') Height
          .col-sm-9
              input.form-control(type='text', name="height", value=artwork.height, placeholder='Enter the height')

        .form-group
          label.col-sm-3.control-label(for='width') Width
          .col-sm-9
              input.form-control(type='text', name="width", value=artwork.width, placeholder='Enter the width')

        .form-group
          label.col-sm-3.control-label(for='price') Price
          .col-sm-9
            input.form-control(type='text', name="price", value=artwork.price, placeholder='Enter the price')

        .form-group
          label.col-sm-3.control-label(for='availableOnEtsy') Available on Etsy?
          .col-sm-9
            input(type='checkbox', value=artwork.availableOnEtsy, name="availableOnEtsy", checked=(artwork.availableOnEtsy ? "checked" : undefined))

        .form-group
          label.col-sm-3.control-label(for='etsyOptions') Etsy title link
          .col-sm-9
            select.form-control(name='etsyOptions')
              option(value="")
              for option in etsyOptions
                option(selected=artwork.etsyOptions == option) #{option}

        .form-group
          label.col-sm-3.control-label(for='sold') Sold?
          .col-sm-9
            input(type='checkbox', value=artwork.sold, name='sold', checked=(artwork.sold ? "checked" : undefined))

        .form-group
          label.col-sm-3.control-label(for='soldAt') Sold Date
          .col-sm-9
            input.form-control(type='date', name="soldAt", value=artwork.soldAt, placeholder='Enter the sold date')

        .form-group
          label.col-sm-3.control-label(for='soldTo') Sold To
          .col-sm-9
            select.form-control(name='soldTo')
              option(value="")
              for party in soldTo
                option(selected=artwork.soldTo == party) #{party}

        .form-group
          label.col-sm-3.control-label(for='amountSalesTaxPaid') Amount of state sales tax paid
          .col-sm-9
            input.form-control(type='text', name="amountSalesTaxPaid", value=artwork.amountSalesTaxPaid, placeholder='Enter the amount of tax paid')

        .form-group
          label.col-sm-3.control-label(for='salesTaxPaidDate') Date state sales tax was paid
          .col-sm-9
            input.form-control(type='date', name="salesTaxPaidDate", value=artwork.salesTaxPaidDate, placeholder='Date state sales tax was paid')

        .form-group
          label.col-sm-3.control-label(for='saleNotes') Sale Notes
          .col-sm-9
            textarea.form-control(name="saleNotes", rows='5')
              =artwork.saleNotes

        .form-group
          label.col-sm-3.control-label(for='notes') Notes
          .col-sm-9
            textarea.form-control(name="notes", rows='5')
              =artwork.notes

        .form-group
          label.col-sm-3.control-label(for='file') Image
          .col-sm-9
            input.form-control#file(type='file', name="image[]")

        - if (!artwork.isNew && artwork.image && artwork.image.files && artwork.image.files.length)
          .form-group
            .col-sm-9.col-sm-offset-3
              img(src=artwork.image.cdnUri + "/artinventory" + "/mini_" + artwork.image.files[0])

        .form-group
          label.col-sm-3.control-label(for='tags') Tags
          .col-sm-9
            input.form-control#tags(type='text', name="tags", value=artwork.tags, placeholder='Enter the tags')

        .form-group
          .col-sm-9.col-sm-offset-3
            h3 Website

        .form-group
          label.col-sm-3.control-label(for='showOnWebsite') Show on website?
          .col-sm-9
            input(type='checkbox', value=artwork.showOnWebsite, name='showOnWebsite', checked=(artwork.showOnWebsite ? "checked" : undefined))

        hr
        .form-group
          .col-sm-offset-2.col-sm-9
            button.btn.btn-primary(type='submit') Save
            | &nbsp;
            a.btn(href='/artworks', title="cancel") Cancel<commit_msg>trying to fix update issues with viewing an editable artwork, adding comment about only using pngs for now due to imagemagick<commit_after>extends ../layouts/default

block main
  h1= title

block content
  - var action = '/artworks'
  - action += artwork.isNew? '' : '/' + artwork.id

  .row
    .col-md-12
      form.form-horizontal(method="post", action=action, enctype="multipart/form-data", role="form", class="artwork-edit edit-form")

        input(type="hidden", name="_csrf", value="#{csrf_token}")

        - if (!artwork.isNew)
          input(type="hidden", name="_method", value="PUT")

        .form-group
          label.col-sm-3.control-label(for='title') Short Title
          .col-sm-9
            input.form-control(type='text', name="title", value=artwork.title, placeholder='Enter the title')

        .form-group
          label.col-sm-3.control-label(for='longTitle') Long Title
          .col-sm-9
            textarea.form-control(name="longTitle", placeholder='Long title', rows='5')
              =artwork.longTitle

        .form-group
          label.col-sm-3.control-label(for='medium') Medium
          .col-sm-9
            select.form-control(name="medium")
              for medium in mediums
                option(selected=artwork.medium == medium) #{medium}

        .form-group
          label.col-sm-3.control-label(for='year') Year
          .col-sm-9
            select.form-control(name='year')
              for year in years
                option(selected=artwork.year == year) #{year}

        .form-group
          label.col-sm-3.control-label(for='height') Height
          .col-sm-9
              input.form-control(type='text', name="height", value=artwork.height, placeholder='Enter the height')

        .form-group
          label.col-sm-3.control-label(for='width') Width
          .col-sm-9
              input.form-control(type='text', name="width", value=artwork.width, placeholder='Enter the width')

        .form-group
          label.col-sm-3.control-label(for='price') Price
          .col-sm-9
            input.form-control(type='text', name="price", value=artwork.price, placeholder='Enter the price')

        .form-group
          label.col-sm-3.control-label(for='availableOnEtsy') Available on Etsy?
          .col-sm-9
            input(type='checkbox', value=artwork.availableOnEtsy, name="availableOnEtsy", checked=(artwork.availableOnEtsy ? "checked" : undefined))

        .form-group
          label.col-sm-3.control-label(for='etsyOptions') Etsy title link
          .col-sm-9
            select.form-control(name='etsyOptions')
              option(value="")
              for option in etsyOptions
                option(selected=artwork.etsyOptions == option) #{option}

        .form-group
          label.col-sm-3.control-label(for='sold') Sold?
          .col-sm-9
            input(type='checkbox', value=artwork.sold, name='sold', checked=(artwork.sold ? "checked" : undefined))

        .form-group
          label.col-sm-3.control-label(for='soldAt') Sold Date
          .col-sm-9
            input.form-control(type='date', name="soldAt", value=artwork.soldAt, placeholder='Enter the sold date')

        .form-group
          label.col-sm-3.control-label(for='soldTo') Sold To
          .col-sm-9
            select.form-control(name='soldTo')
              option(value="")
              for party in soldTo
                option(selected=artwork.soldTo == party) #{party}

        .form-group
          label.col-sm-3.control-label(for='amountSalesTaxPaid') Amount of state sales tax paid
          .col-sm-9
            input.form-control(type='text', name="amountSalesTaxPaid", value=artwork.amountSalesTaxPaid, placeholder='Enter the amount of tax paid')

        .form-group
          label.col-sm-3.control-label(for='salesTaxPaidDate') Date state sales tax was paid
          .col-sm-9
            input.form-control(type='date', name="salesTaxPaidDate", value=artwork.salesTaxPaidDate, placeholder='Date state sales tax was paid')

        .form-group
          label.col-sm-3.control-label(for='saleNotes') Sale Notes
          .col-sm-9
            textarea.form-control(name="saleNotes", rows='5')
              =artwork.saleNotes

        .form-group
          label.col-sm-3.control-label(for='notes') Notes
          .col-sm-9
            textarea.form-control(name="notes", rows='5')
              =artwork.notes

        .form-group
          label.col-sm-3.control-label(for='file') Image - only PNG for now till I fix imagemagick modules
          .col-sm-9
            input.form-control#file(type='file', name="image[]")

        - if (!artwork.isNew && artwork.image && artwork.image.files && artwork.image.files.length)
          .form-group
            .col-sm-9.col-sm-offset-3
              img(src=artwork.image.cdnUri + "/artinventory" + "/mini_" + artwork.image.files[0])

        .form-group
          label.col-sm-3.control-label(for='tags') Tags
          .col-sm-9
            input.form-control#tags(type='text', name="tags", value=artwork.tags, placeholder='Enter the tags')

        .form-group
          .col-sm-9.col-sm-offset-3
            h3 Website

        .form-group
          label.col-sm-3.control-label(for='showOnWebsite') Show on website?
          .col-sm-9
            input(type='checkbox', value=artwork.showOnWebsite, name='showOnWebsite', checked=(artwork.showOnWebsite ? "checked" : undefined))

        hr
        .form-group
          .col-sm-offset-2.col-sm-9
            button.btn.btn-primary(type='submit') Save
            | &nbsp;
            a.btn(href='/artworks', title="cancel") Cancel
{'fraction_non_alphanumeric': 0.1440388419349038, 'fraction_numerical': 0.009350836180543068, 'mean_word_length': 2.115686274509804, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5081408', 'n_tokens_mistral': 3453, 'n_tokens_neox': 3318, 'n_words': 570}