project-dropdown.ejs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <% if (links != undefined) { %>
  2. <% links.forEach(link => { %>
  3. <% if(link.dropdown) { %>
  4. <div class="dropdown" style="display: inline;">
  5. <button class="btn btn-outline-secondary dropdown-toggle <%- link.disabled %>" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  6. <%= link.name %>
  7. </button>
  8. <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">
  9. <% link.links.forEach(sublink => { %>
  10. <% if(has_s3_link(sublink, project)) { %>
  11. <a class="dropdown-item <%- link.disabled %>"
  12. href="<%= get_s3_link(sublink, project) %>"
  13. v-on:click="mixpanelTrack('Download Link', {'file': '<%= get_s3_link(sublink, project) %>', 'project': '<%= project.title %>'})"
  14. target="_blank" rel="noopener noreferrer">
  15. <%= sublink.name %>
  16. </a>
  17. <% } else { %>
  18. <a class="dropdown-item <%- link.disabled %>"
  19. href="<%= sublink.url %>"
  20. v-on:click="mixpanelTrack('External Link', {'url': '<%= sublink.url %>', 'project': '<%= project.title %>'})"
  21. target="_blank" rel="noopener noreferrer">
  22. <%= sublink.name %>
  23. </a>
  24. <% } %>
  25. <% }); %>
  26. </div>
  27. </div>
  28. <% } else { %>
  29. <a role="button" class="btn btn-outline-secondary <%- link.disabled %>"
  30. href="<%- link.url %>"
  31. v-on:click="mixpanelTrack('External Link', {'url': '<%= link.url %>', 'project': '<%= project.title %>'})"
  32. target="_blank" rel="noopener noreferrer">
  33. <%= link.name %>
  34. </a>
  35. <% } %>
  36. <% }); %>
  37. <% } %>