Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

csv_diff.tmpl 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <tr>
  2. <td>
  3. {{$result := call .root.CreateCsvDiff .file .blobBase .blobHead}}
  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 not $cell}}
  16. <th></th>
  17. {{else if eq $cell.Type 2}}
  18. <th class="modified"><span class="removed-code">{{.LeftCell}}</span> <span class="added-code">{{.RightCell}}</span></th>
  19. {{else if eq $cell.Type 3}}
  20. <th class="added"><span class="added-code">{{.RightCell}}</span></th>
  21. {{else if eq $cell.Type 4}}
  22. <th class="removed"><span class="removed-code">{{.LeftCell}}</span></th>
  23. {{else if eq $cell.Type 5}}
  24. <th class="moved">{{.RightCell}}</th>
  25. {{else if eq $cell.Type 6}}
  26. <th class="moved"><span class="removed-code">{{.LeftCell}}</span> <span class="added-code">{{.RightCell}}</span></th>
  27. {{else}}
  28. <th>{{.RightCell}}</th>
  29. {{end}}
  30. {{end}}
  31. {{else}}
  32. <td class="line-num">{{if .RowIdx}}{{.RowIdx}}{{end}}</td>
  33. {{range $j, $cell := $row.Cells}}
  34. {{if not $cell}}
  35. <td></td>
  36. {{else if eq $cell.Type 2}}
  37. <td class="modified"><span class="removed-code">{{.LeftCell}}</span> <span class="added-code">{{.RightCell}}</span></td>
  38. {{else if eq $cell.Type 3}}
  39. <td class="added"><span class="added-code">{{.RightCell}}</span></td>
  40. {{else if eq $cell.Type 4}}
  41. <td class="removed"><span class="removed-code">{{.LeftCell}}</span></td>
  42. {{else if eq $cell.Type 5}}
  43. <td class="moved">{{.RightCell}}</td>
  44. {{else if eq $cell.Type 6}}
  45. <td class="moved"><span class="removed-code">{{.LeftCell}}</span> <span class="added-code">{{.RightCell}}</span></td>
  46. {{else}}
  47. <td>{{.RightCell}}</td>
  48. {{end}}
  49. {{end}}
  50. {{end}}
  51. </tr>
  52. {{end}}
  53. </tbody>
  54. {{end}}
  55. </table>
  56. {{end}}
  57. </td>
  58. </tr>