project-dropdown.ejs 1.9 KB

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