You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.5 KiB

  1. {% extends "admin/admin_base.html" %}
  2. {% load static %}
  3. {% block content-area %}
  4. <div class="columns">
  5. <div class="column is-12">
  6. <div class="card">
  7. <header class="card-header">
  8. <p class="card-header-title">
  9. Import text items
  10. </p>
  11. <a href="#" class="card-header-icon" aria-label="more options">
  12. <span class="icon">
  13. <i class="fas fa-angle-down" aria-hidden="true"></i>
  14. </span>
  15. </a>
  16. </header>
  17. <div class="card-content">
  18. <p>
  19. <b>To annotate texts, you first need to import a set of text items to annotate it.</b>
  20. </p>
  21. <ul.is-unstyled>
  22. <li>CSV file: file must contain a header with a text column or be one-column csv file.</li>
  23. <li>JSON file: each line should contain a json object with at least one key 'text', which contains a text.</li>
  24. </ul.is-unstyled>
  25. <form action="" method="post" enctype="multipart/form-data">
  26. {% csrf_token %}
  27. <div class="section">
  28. <div class="control">
  29. <label class="radio mb10">
  30. <input type="radio" name="format" value="csv" checked> Upload a CSV file from your computer<br>
  31. <input type="radio" name="format" value="json" checked> Upload a JSON file from your computer<br>
  32. </label>
  33. <div class="file has-name is-small mb20">
  34. <label class="file-label">
  35. <input class="file-input" type="file" ref="file" name="file" required v-on:change="handleFileUpload()">
  36. <span class="file-cta">
  37. <span class="file-icon">
  38. <i class="fas fa-upload"></i>
  39. </span>
  40. <span class="file-label">
  41. Select a file…
  42. </span>
  43. </span>
  44. <span class="file-name">
  45. [[ file ]]
  46. </span>
  47. </label>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="field is-grouped">
  52. <div class="control">
  53. <button type="submit" class="button is-primary">Upload dataset</button>
  54. </div>
  55. <div class="control">
  56. <button class="button is-text">Cancel</button>
  57. </div>
  58. </div>
  59. </form>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. {% endblock %}
  65. {% block footer %}
  66. <script src="{% static 'bundle/upload.js' %}"></script>
  67. {% endblock %}