FossilRepo
Fix diff row vertical spacing — collapse template whitespace in pre cells
Commit
ec8c08f6d5fc7579580e24ca7514e0cf277020d41f8d824b2427b53d2c22cffe
Parent
2d4ff6f552c1669…
1 file changed
+2
-40
+2
-40
| --- templates/fossil/checkin_detail.html | ||
| +++ templates/fossil/checkin_detail.html | ||
| @@ -10,11 +10,11 @@ | ||
| 10 | 10 | .diff-line-del { background: rgba(239, 68, 68, 0.1); } |
| 11 | 11 | .diff-line-del td:last-child { color: #fca5a5; } |
| 12 | 12 | .diff-line-hunk { background: rgba(96, 165, 250, 0.08); } |
| 13 | 13 | .diff-line-hunk td { color: #93c5fd; font-weight: 500; } |
| 14 | 14 | .diff-line-header td { color: #6b7280; font-weight: 600; } |
| 15 | - .diff-gutter { width: 1%; user-select: none; color: #4b5563; text-align: right; padding: 0 6px; border-right: 1px solid #374151; cursor: pointer; } | |
| 15 | + .diff-gutter { width: 1%; user-select: none; color: #4b5563; text-align: right; padding: 0 6px; border-right: 1px solid #374151; cursor: pointer; white-space: nowrap; } | |
| 16 | 16 | .diff-gutter:hover { color: #DC394C; } |
| 17 | 17 | .diff-gutter a { color: inherit; text-decoration: none; display: block; } |
| 18 | 18 | .line-row:target { background: rgba(220, 57, 76, 0.15) !important; } |
| 19 | 19 | .line-row:target .diff-gutter { color: #DC394C; font-weight: 600; } |
| 20 | 20 | .line-popover { |
| @@ -132,49 +132,11 @@ | ||
| 132 | 132 | <p class="p-4 text-sm text-gray-500">Binary file</p> |
| 133 | 133 | {% elif fd.diff_lines %} |
| 134 | 134 | <table class="diff-table"> |
| 135 | 135 | <tbody> |
| 136 | 136 | {% for dl in fd.diff_lines %} |
| 137 | - {% if dl.new_num %} | |
| 138 | - <tr class="diff-line-{{ dl.type }} line-row" id="diff-{{ forloop.parentloop.counter }}-R{{ dl.new_num }}"> | |
| 139 | - <td class="diff-gutter">{{ dl.old_num }}</td> | |
| 140 | - <td class="diff-gutter" style="position:relative" | |
| 141 | - x-data="{ pop: false, copied: false }" | |
| 142 | - @click.stop="pop = !pop; window.location.hash = 'diff-{{ forloop.parentloop.counter }}-R{{ dl.new_num }}'" | |
| 143 | - @click.outside="pop = false"> | |
| 144 | - {{ dl.new_num }} | |
| 145 | - <div class="line-popover" x-show="pop" x-transition @click.stop> | |
| 146 | - <button @click="navigator.clipboard.writeText(window.location.origin + window.location.pathname + '#diff-{{ forloop.parentloop.counter }}-R{{ dl.new_num }}'); copied = true; setTimeout(() => { copied = false; pop = false }, 1000)" :class="copied && 'copied'"> | |
| 147 | - <span x-show="!copied">Copy link</span><span x-show="copied">Copied!</span> | |
| 148 | - </button> | |
| 149 | - </div> | |
| 150 | - </td> | |
| 151 | - <td>{{ dl.text }}</td> | |
| 152 | - </tr> | |
| 153 | - {% elif dl.old_num %} | |
| 154 | - <tr class="diff-line-{{ dl.type }} line-row" id="diff-{{ forloop.parentloop.counter }}-L{{ dl.old_num }}"> | |
| 155 | - <td class="diff-gutter" style="position:relative" | |
| 156 | - x-data="{ pop: false, copied: false }" | |
| 157 | - @click.stop="pop = !pop; window.location.hash = 'diff-{{ forloop.parentloop.counter }}-L{{ dl.old_num }}'" | |
| 158 | - @click.outside="pop = false"> | |
| 159 | - {{ dl.old_num }} | |
| 160 | - <div class="line-popover" x-show="pop" x-transition @click.stop> | |
| 161 | - <button @click="navigator.clipboard.writeText(window.location.origin + window.location.pathname + '#diff-{{ forloop.parentloop.counter }}-L{{ dl.old_num }}'); copied = true; setTimeout(() => { copied = false; pop = false }, 1000)" :class="copied && 'copied'"> | |
| 162 | - <span x-show="!copied">Copy link</span><span x-show="copied">Copied!</span> | |
| 163 | - </button> | |
| 164 | - </div> | |
| 165 | - </td> | |
| 166 | - <td class="diff-gutter"></td> | |
| 167 | - <td>{{ dl.text }}</td> | |
| 168 | - </tr> | |
| 169 | - {% else %} | |
| 170 | - <tr class="diff-line-{{ dl.type }}"> | |
| 171 | - <td class="diff-gutter"></td> | |
| 172 | - <td class="diff-gutter"></td> | |
| 173 | - <td>{{ dl.text }}</td> | |
| 174 | - </tr> | |
| 175 | - {% endif %} | |
| 137 | +{% if dl.new_num %}<tr class="diff-line-{{ dl.type }} line-row" id="diff-{{ forloop.parentloop.counter }}-R{{ dl.new_num }}"><td class="diff-gutter">{{ dl.old_num }}</td><td class="diff-gutter" style="position:relative" x-data="{ pop: false, copied: false }" @click.stop="pop = !pop; window.location.hash = 'diff-{{ forloop.parentloop.counter }}-R{{ dl.new_num }}'" @click.outside="pop = false">{{ dl.new_num }}<div class="line-popover" x-show="pop" x-transition @click.stop><button @click="navigator.clipboard.writeText(window.location.origin + window.location.pathname + '#diff-{{ forloop.parentloop.counter }}-R{{ dl.new_num }}'); copied = true; setTimeout(() => { copied = false; pop = false }, 1000)" :class="copied && 'copied'"><span x-show="!copied">Copy link</span><span x-show="copied">Copied!</span></button></div></td><td>{{ dl.text }}</td></tr>{% elif dl.old_num %}<tr class="diff-line-{{ dl.type }} line-row" id="diff-{{ forloop.parentloop.counter }}-L{{ dl.old_num }}"><td class="diff-gutter" style="position:relative" x-data="{ pop: false, copied: false }" @click.stop="pop = !pop; window.location.hash = 'diff-{{ forloop.parentloop.counter }}-L{{ dl.old_num }}'" @click.outside="pop = false">{{ dl.old_num }}<div class="line-popover" x-show="pop" x-transition @click.stop><button @click="navigator.clipboard.writeText(window.location.origin + window.location.pathname + '#diff-{{ forloop.parentloop.counter }}-L{{ dl.old_num }}'); copied = true; setTimeout(() => { copied = false; pop = false }, 1000)" :class="copied && 'copied'"><span x-show="!copied">Copy link</span><span x-show="copied">Copied!</span></button></div></td><td class="diff-gutter"></td><td>{{ dl.text }}</td></tr>{% else %}<tr class="diff-line-{{ dl.type }}"><td class="diff-gutter"></td><td class="diff-gutter"></td><td>{{ dl.text }}</td></tr>{% endif %} | |
| 176 | 138 | {% endfor %} |
| 177 | 139 | </tbody> |
| 178 | 140 | </table> |
| 179 | 141 | {% else %} |
| 180 | 142 | <p class="p-4 text-sm text-gray-500">No diff available</p> |
| 181 | 143 |
| --- templates/fossil/checkin_detail.html | |
| +++ templates/fossil/checkin_detail.html | |
| @@ -10,11 +10,11 @@ | |
| 10 | .diff-line-del { background: rgba(239, 68, 68, 0.1); } |
| 11 | .diff-line-del td:last-child { color: #fca5a5; } |
| 12 | .diff-line-hunk { background: rgba(96, 165, 250, 0.08); } |
| 13 | .diff-line-hunk td { color: #93c5fd; font-weight: 500; } |
| 14 | .diff-line-header td { color: #6b7280; font-weight: 600; } |
| 15 | .diff-gutter { width: 1%; user-select: none; color: #4b5563; text-align: right; padding: 0 6px; border-right: 1px solid #374151; cursor: pointer; } |
| 16 | .diff-gutter:hover { color: #DC394C; } |
| 17 | .diff-gutter a { color: inherit; text-decoration: none; display: block; } |
| 18 | .line-row:target { background: rgba(220, 57, 76, 0.15) !important; } |
| 19 | .line-row:target .diff-gutter { color: #DC394C; font-weight: 600; } |
| 20 | .line-popover { |
| @@ -132,49 +132,11 @@ | |
| 132 | <p class="p-4 text-sm text-gray-500">Binary file</p> |
| 133 | {% elif fd.diff_lines %} |
| 134 | <table class="diff-table"> |
| 135 | <tbody> |
| 136 | {% for dl in fd.diff_lines %} |
| 137 | {% if dl.new_num %} |
| 138 | <tr class="diff-line-{{ dl.type }} line-row" id="diff-{{ forloop.parentloop.counter }}-R{{ dl.new_num }}"> |
| 139 | <td class="diff-gutter">{{ dl.old_num }}</td> |
| 140 | <td class="diff-gutter" style="position:relative" |
| 141 | x-data="{ pop: false, copied: false }" |
| 142 | @click.stop="pop = !pop; window.location.hash = 'diff-{{ forloop.parentloop.counter }}-R{{ dl.new_num }}'" |
| 143 | @click.outside="pop = false"> |
| 144 | {{ dl.new_num }} |
| 145 | <div class="line-popover" x-show="pop" x-transition @click.stop> |
| 146 | <button @click="navigator.clipboard.writeText(window.location.origin + window.location.pathname + '#diff-{{ forloop.parentloop.counter }}-R{{ dl.new_num }}'); copied = true; setTimeout(() => { copied = false; pop = false }, 1000)" :class="copied && 'copied'"> |
| 147 | <span x-show="!copied">Copy link</span><span x-show="copied">Copied!</span> |
| 148 | </button> |
| 149 | </div> |
| 150 | </td> |
| 151 | <td>{{ dl.text }}</td> |
| 152 | </tr> |
| 153 | {% elif dl.old_num %} |
| 154 | <tr class="diff-line-{{ dl.type }} line-row" id="diff-{{ forloop.parentloop.counter }}-L{{ dl.old_num }}"> |
| 155 | <td class="diff-gutter" style="position:relative" |
| 156 | x-data="{ pop: false, copied: false }" |
| 157 | @click.stop="pop = !pop; window.location.hash = 'diff-{{ forloop.parentloop.counter }}-L{{ dl.old_num }}'" |
| 158 | @click.outside="pop = false"> |
| 159 | {{ dl.old_num }} |
| 160 | <div class="line-popover" x-show="pop" x-transition @click.stop> |
| 161 | <button @click="navigator.clipboard.writeText(window.location.origin + window.location.pathname + '#diff-{{ forloop.parentloop.counter }}-L{{ dl.old_num }}'); copied = true; setTimeout(() => { copied = false; pop = false }, 1000)" :class="copied && 'copied'"> |
| 162 | <span x-show="!copied">Copy link</span><span x-show="copied">Copied!</span> |
| 163 | </button> |
| 164 | </div> |
| 165 | </td> |
| 166 | <td class="diff-gutter"></td> |
| 167 | <td>{{ dl.text }}</td> |
| 168 | </tr> |
| 169 | {% else %} |
| 170 | <tr class="diff-line-{{ dl.type }}"> |
| 171 | <td class="diff-gutter"></td> |
| 172 | <td class="diff-gutter"></td> |
| 173 | <td>{{ dl.text }}</td> |
| 174 | </tr> |
| 175 | {% endif %} |
| 176 | {% endfor %} |
| 177 | </tbody> |
| 178 | </table> |
| 179 | {% else %} |
| 180 | <p class="p-4 text-sm text-gray-500">No diff available</p> |
| 181 |
| --- templates/fossil/checkin_detail.html | |
| +++ templates/fossil/checkin_detail.html | |
| @@ -10,11 +10,11 @@ | |
| 10 | .diff-line-del { background: rgba(239, 68, 68, 0.1); } |
| 11 | .diff-line-del td:last-child { color: #fca5a5; } |
| 12 | .diff-line-hunk { background: rgba(96, 165, 250, 0.08); } |
| 13 | .diff-line-hunk td { color: #93c5fd; font-weight: 500; } |
| 14 | .diff-line-header td { color: #6b7280; font-weight: 600; } |
| 15 | .diff-gutter { width: 1%; user-select: none; color: #4b5563; text-align: right; padding: 0 6px; border-right: 1px solid #374151; cursor: pointer; white-space: nowrap; } |
| 16 | .diff-gutter:hover { color: #DC394C; } |
| 17 | .diff-gutter a { color: inherit; text-decoration: none; display: block; } |
| 18 | .line-row:target { background: rgba(220, 57, 76, 0.15) !important; } |
| 19 | .line-row:target .diff-gutter { color: #DC394C; font-weight: 600; } |
| 20 | .line-popover { |
| @@ -132,49 +132,11 @@ | |
| 132 | <p class="p-4 text-sm text-gray-500">Binary file</p> |
| 133 | {% elif fd.diff_lines %} |
| 134 | <table class="diff-table"> |
| 135 | <tbody> |
| 136 | {% for dl in fd.diff_lines %} |
| 137 | {% if dl.new_num %}<tr class="diff-line-{{ dl.type }} line-row" id="diff-{{ forloop.parentloop.counter }}-R{{ dl.new_num }}"><td class="diff-gutter">{{ dl.old_num }}</td><td class="diff-gutter" style="position:relative" x-data="{ pop: false, copied: false }" @click.stop="pop = !pop; window.location.hash = 'diff-{{ forloop.parentloop.counter }}-R{{ dl.new_num }}'" @click.outside="pop = false">{{ dl.new_num }}<div class="line-popover" x-show="pop" x-transition @click.stop><button @click="navigator.clipboard.writeText(window.location.origin + window.location.pathname + '#diff-{{ forloop.parentloop.counter }}-R{{ dl.new_num }}'); copied = true; setTimeout(() => { copied = false; pop = false }, 1000)" :class="copied && 'copied'"><span x-show="!copied">Copy link</span><span x-show="copied">Copied!</span></button></div></td><td>{{ dl.text }}</td></tr>{% elif dl.old_num %}<tr class="diff-line-{{ dl.type }} line-row" id="diff-{{ forloop.parentloop.counter }}-L{{ dl.old_num }}"><td class="diff-gutter" style="position:relative" x-data="{ pop: false, copied: false }" @click.stop="pop = !pop; window.location.hash = 'diff-{{ forloop.parentloop.counter }}-L{{ dl.old_num }}'" @click.outside="pop = false">{{ dl.old_num }}<div class="line-popover" x-show="pop" x-transition @click.stop><button @click="navigator.clipboard.writeText(window.location.origin + window.location.pathname + '#diff-{{ forloop.parentloop.counter }}-L{{ dl.old_num }}'); copied = true; setTimeout(() => { copied = false; pop = false }, 1000)" :class="copied && 'copied'"><span x-show="!copied">Copy link</span><span x-show="copied">Copied!</span></button></div></td><td class="diff-gutter"></td><td>{{ dl.text }}</td></tr>{% else %}<tr class="diff-line-{{ dl.type }}"><td class="diff-gutter"></td><td class="diff-gutter"></td><td>{{ dl.text }}</td></tr>{% endif %} |
| 138 | {% endfor %} |
| 139 | </tbody> |
| 140 | </table> |
| 141 | {% else %} |
| 142 | <p class="p-4 text-sm text-gray-500">No diff available</p> |
| 143 |