<div class="container" id="addFormDiv">
  <div class="row">
    <div class="col-sm">
      <div class="container text-left">
        <form id="addForm">
          <h3>Edit a news:</h3>
          <div class="mb-1">
            <input type="hidden" id="idField" value="{{ news.id }}" />
            <label for="titleField" class="form-label">Title: </label
            ><input
              type="text"
              id="titleField"
              class="form-control"
              required
              pattern="[0-9A-Za-z-.\:;]{5,30}"
              value="{{ news.title }}"
            />
          </div>
          <div class="mb-1">
            <label for="contentField" class="form-label">Content: </label
            ><input
              type="text"
              id="contentField"
              class="form-control"
              required
              pattern="[0-9A-Za-z-.\:;]{10,256}"
              value="{{ news.news_text }}"
            />
          </div>
          <div class="mb-1">
            <label for="dateField" class="form-label">Date: </label
            ><input
              type="date"
              id="dateField"
              class="form-control"
              required
              value="{{ news.date }}"
            />
          </div>
          <div class="mb-1">
            <label for="producerField" class="form-label">Producer: </label
            ><input
              type="text"
              id="producerField"
              class="form-control"
              required
              pattern="[0-9A-Za-z-]{5,30}"
              value="{{ news.producer }}"
            />
          </div>
          <div class="mb-1">
            <label for="categoryField" class="form-label">Category: </label
            ><input
              type="text"
              id="categoryField"
              class="form-control"
              required
              pattern="[0-9A-Za-z-]{5,30}"
              value="{{ news.category }}"
            />
          </div>

          <button
            id="insertNewsButton"
            type="submit"
            class="btn btn-success mb-1"
            (click)="editNews($event)"
          >
            Edit News
          </button>
        </form>
        <button
          type="submit"
          class="btn btn-secondary mb-1"
          name="returnButton"
          (click)="returnToAdmin()"
        >
          Return to admin
        </button>
      </div>
    </div>
  </div>
</div>
