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.

90 lines
3.3 KiB

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