Add line type class to diff line num cells

This commit is contained in:
Douwe Maan 2019-03-23 15:58:46 +01:00
parent 38b69557e8
commit f95838800f
No known key found for this signature in database
GPG key ID: 5976703F65143D36
2 changed files with 8 additions and 8 deletions

View file

@ -81,8 +81,8 @@ export default {
:key="line.line_code"
class="line_holder"
>
<td class="diff-line-num old_line">{{ line.old_line }}</td>
<td class="diff-line-num new_line">{{ line.new_line }}</td>
<td :class="line.type" class="diff-line-num old_line">{{ line.old_line }}</td>
<td :class="line.type" class="diff-line-num new_line">{{ line.new_line }}</td>
<td :class="line.type" class="line_content" v-html="line.rich_text"></td>
</tr>
</template>

View file

@ -7,14 +7,14 @@
- unless @diff_lines.empty?
%table.text-file.code.js-syntax-highlight
- @diff_lines.each do |line|
%tr.line_holder{ class: "#{line.type}" }
%tr.line_holder{ class: line.type }
- if line.type == "match"
%td.old_line.diff-line-num= "..."
%td.new_line.diff-line-num= "..."
%td.old_line.diff-line-num.match= "..."
%td.new_line.diff-line-num.match= "..."
%td.line_content.match= line.text
- else
%td.old_line.diff-line-num
%td.new_line.diff-line-num
%td.line_content{ class: "#{line.type}" }= diff_line_content(line.text)
%td.old_line.diff-line-num{ class: line.type }
%td.new_line.diff-line-num{ class: line.type }
%td.line_content{ class: line.type }= diff_line_content(line.text)
- else
.nothing-here-block No changes.