tr.hbs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <tr id="tr-{{id}}" {{#if swap_oob}}hx-swap-oob="true"{{/if}}>
  2. <td class="original-url right-fade">
  3. <a href="{{target}}" target="_blank" rel="noopener noreferrer">
  4. {{target}}
  5. </a>
  6. <p class="description">
  7. by&nbsp;
  8. {{~#if user_id~}}
  9. <a
  10. aria-label="View user"
  11. data-tooltip="View user"
  12. hx-get="/api/users/admin"
  13. hx-target="closest table"
  14. hx-swap="outerHTML"
  15. hx-sync="this:replace"
  16. hx-indicator="closest table"
  17. hx-vals='{"search":"{{email}}"}'
  18. onclick="setTab(event, 'tab-links')"
  19. >
  20. {{email}}
  21. </a>
  22. {{#ifEquals @root.query.user email}}
  23. {{else}}
  24. &nbsp;(
  25. <a
  26. aria-label="View links by this user"
  27. data-tooltip="View links by this user"
  28. hx-get="/api/links/admin"
  29. hx-target="closest table"
  30. hx-swap="outerHTML"
  31. hx-sync="this:replace"
  32. hx-indicator="closest table"
  33. hx-vals='{"user":"{{email}}"}'
  34. >
  35. view links
  36. </a>)
  37. {{/ifEquals}}
  38. {{~else~}}
  39. <a
  40. aria-label="View anonymous links"
  41. data-tooltip="View anonymous links"
  42. hx-get="/api/links/admin"
  43. hx-target="closest table"
  44. hx-swap="outerHTML"
  45. hx-sync="this:replace"
  46. hx-indicator="closest table"
  47. hx-vals='{"anonymous":"true"}'
  48. >
  49. Anonymous
  50. </a>
  51. {{~/if~}}
  52. &nbsp;{{~#if description~}}· {{description}}{{~/if}}
  53. </p>
  54. </td>
  55. <td class="created-at">
  56. {{relative_created_at}}
  57. {{#if relative_expire_in}}
  58. <p class="expire-in">
  59. Expires in {{relative_expire_in}}
  60. </p>
  61. {{/if}}
  62. </td>
  63. <td class="short-link right-fade">
  64. <div class="short-link-wrapper">
  65. <div class="clipboard small">
  66. <button
  67. aria-label="Copy"
  68. hx-on:click="handleShortURLCopyLink(this);"
  69. data-url="{{link.url}}"
  70. >
  71. {{> icons/copy}}
  72. </button>
  73. {{> icons/check}}
  74. </div>
  75. <a href="{{link.url}}">/{{link.address}}</a>
  76. </div>
  77. <p class="description">
  78. <a
  79. aria-label="View links by this domain"
  80. data-tooltip="View links by this domain"
  81. hx-get="/api/links/admin"
  82. hx-target="closest table"
  83. hx-swap="outerHTML"
  84. hx-sync="this:replace"
  85. hx-vals='{"domain":"{{domain}}"}'
  86. hx-indicator="closest table"
  87. >{{domain}}</a>
  88. </p>
  89. </td>
  90. <td class="views">
  91. {{visit_count}}
  92. </td>
  93. {{> admin/links/actions}}
  94. </tr>
  95. <tr class="edit">
  96. <td class="loading">
  97. {{> icons/spinner}}
  98. </td>
  99. </tr>