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.

93 lines
3.3 KiB

  1. {% extends "admin/admin_base.html" %}
  2. {% load static %}
  3. {% block content-area %}
  4. <div class="card">
  5. <header class="card-header">
  6. <p class="card-header-title">
  7. Label editor
  8. </p>
  9. <a href="#" class="card-header-icon" aria-label="more options">
  10. <span class="icon">
  11. <i class="fas fa-angle-down" aria-hidden="true"></i>
  12. </span>
  13. </a>
  14. </header>
  15. <div class="card-content">
  16. <div class="has-text-right">
  17. <div class="field is-grouped is-grouped-multiline has-text-weight-bold" style="padding-bottom:.75rem;">
  18. <div class="control" v-for="label in labels">
  19. <div class="tags has-addons">
  20. <span class="tag is-medium" v-bind:style="{ color: label.text_color, 'background-color': label.background_color }">
  21. <button class="delete is-small" style="margin-right:.25rem;margin-left:-.375rem;" @click="removeLabel(label)"></button>
  22. [[ label.text ]]
  23. </span>
  24. <span class="tag is-medium">[[ label.shortcut ]]</span>
  25. </div>
  26. </div>
  27. </div>
  28. <div class="field is-horizontal bordered-row">
  29. <label class="label column is-3" style="margin-bottom:0;">Preview</label>
  30. <div class="control column is-6">
  31. <div class="tags has-addons" style="font-weight:700;">
  32. <a class="tag is-medium" v-bind:style="{ color: textColor, backgroundColor: backgroundColor }">
  33. [[ labelText ]]
  34. </a>
  35. <span class="tag is-medium">[[ selectedShortkey ]]</span>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="field is-horizontal bordered-row">
  40. <label class="label column is-3" style="margin-bottom:0;">Label Name</label>
  41. <div class="control column is-6">
  42. <input class="input" type="text" placeholder="Text input" v-model="labelText">
  43. </div>
  44. </div>
  45. <div class="field is-horizontal bordered-row">
  46. <label class="label column is-3" style="margin-bottom:0;">Shortcut Key</label>
  47. <div class="control column is-6">
  48. <div class="select">
  49. <select v-model="selectedShortkey">
  50. <option disabled value="">Please select one</option>
  51. {% for ch in 'abcdefghijklmnopqrstuvwxyz' %}
  52. <option>{{ ch }}</option>
  53. {% endfor %}
  54. </select>
  55. </div>
  56. </div>
  57. </div>
  58. <div class="field is-horizontal bordered-row">
  59. <label class="label column is-3" style="margin-bottom:0;">Background Color</label>
  60. <div class="control column is-6">
  61. <input class="input" type="color" v-model="backgroundColor">
  62. </div>
  63. </div>
  64. <div class="field is-horizontal bordered-row">
  65. <label class="label column is-3" style="margin-bottom:0;">Text Color</label>
  66. <div class="control column is-6">
  67. <input class="input" type="color" v-model="textColor">
  68. </div>
  69. </div>
  70. <div class="field is-grouped">
  71. <div class="control">
  72. <button class="button is-primary" @click="addLabel()">Add label</button>
  73. </div>
  74. <div class="control">
  75. <button class="button is-text" @click="reset()">Reset</button>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. {% endblock %}
  82. {% block footer %}
  83. <script src="{% static 'bundle/label.js' %}"></script>
  84. {% endblock %}