You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

csv_diff.tmpl 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <tr>
  2. <td>
  3. {{$result := call .root.CreateCsvDiff .file .root.BaseCommit .root.HeadCommit}}
  4. {{if $result.Error}}
  5. <div class="ui center">{{$result.Error}}</div>
  6. {{else if $result.Sections}}
  7. <table class="data-table">
  8. {{range $i, $section := $result.Sections}}
  9. <tbody {{if gt $i 0}}class="section"{{end}}>
  10. {{range $j, $row := $section.Rows}}
  11. <tr>
  12. {{if and (eq $i 0) (eq $j 0)}}
  13. <th class="line-num">{{.RowIdx}}</th>
  14. {{range $j, $cell := $row.Cells}}
  15. {{if eq $cell.Type 2}}
  16. <th class="modified"><span class="removed-code">{{.LeftCell}}</span> <span class="added-code">{{.RightCell}}</span></th>
  17. {{else if eq $cell.Type 3}}
  18. <th class="added"><span class="added-code">{{.LeftCell}}</span></th>
  19. {{else if eq $cell.Type 4}}
  20. <th class="removed"><span class="removed-code">{{.LeftCell}}</span></th>
  21. {{else}}
  22. <th>{{.RightCell}}</th>
  23. {{end}}
  24. {{end}}
  25. {{else}}
  26. <td class="line-num">{{if .RowIdx}}{{.RowIdx}}{{end}}</td>
  27. {{range $j, $cell := $row.Cells}}
  28. {{if eq $cell.Type 2}}
  29. <td class="modified"><span class="removed-code">{{.LeftCell}}</span> <span class="added-code">{{.RightCell}}</span></td>
  30. {{else if eq $cell.Type 3}}
  31. <td class="added"><span class="added-code">{{.LeftCell}}</span></td>
  32. {{else if eq $cell.Type 4}}
  33. <td class="removed"><span class="removed-code">{{.LeftCell}}</span></td>
  34. {{else}}
  35. <td>{{.RightCell}}</td>
  36. {{end}}
  37. {{end}}
  38. {{end}}
  39. </tr>
  40. {{end}}
  41. </tbody>
  42. {{end}}
  43. </table>
  44. {{end}}
  45. </td>
  46. </tr>