diff-list.ejs
1,206 bytes
| 1 | <div class="diff-summary"> |
|---|---|
| 2 | <p> |
| 3 | <strong><%= files.length %></strong> changed <%= files.length === 1 ? "file" : "files" %> |
| 4 | with <strong class="diff-added">+<%= diffAdditions %></strong> |
| 5 | and <strong class="diff-removed">−<%= diffDeletions %></strong> |
| 6 | </p> |
| 7 | <% if (files.length) { %> |
| 8 | <div class="diff-actions"> |
| 9 | <button class="quiet-button" type="button" data-diff-wrap aria-pressed="false">Wrap lines</button> |
| 10 | <button class="quiet-button" type="button" data-diff-toggle-all>Collapse all</button> |
| 11 | </div> |
| 12 | <% } %> |
| 13 | </div> |
| 14 | <% if (files.length > 1) { %> |
| 15 | <details class="diff-index"> |
| 16 | <summary>Jump to a changed file</summary> |
| 17 | <ol> |
| 18 | <% files.forEach((changed, index) => { %> |
| 19 | <li> |
| 20 | <a href="#diff-<%= index %>"><%= changed.filename %></a> |
| 21 | <span><span class="diff-added">+<%= changed.additions %></span> <span class="diff-removed">−<%= changed.deletions %></span></span> |
| 22 | </li> |
| 23 | <% }) %> |
| 24 | </ol> |
| 25 | </details> |
| 26 | <% } %> |
| 27 | <% files.forEach((changed, index) => { %> |
| 28 | <%- include("diff-file", { changed, diffIndex: index }) %> |
| 29 | <% }) %> |
| 30 | <% if (!files.length) { %> |
| 31 | <p class="empty-state"><%= emptyMessage %></p> |
| 32 | <% } %> |
| 33 | |