redmine-4.2.3-codelines-2022-02-06-20-12.diff

Vitaly vit9696, 2022-02-06 18:16

Download (4.81 KB)

View differences:

app/views/common/_diff.html.erb (working copy)
6 6
<% diff.each do |table_file| -%>
7 7
<div class="autoscroll">
8 8
<% if diff.diff_type == 'sbs' -%>
9
<table class="filecontent">
9
<table class="filecontent diffcontent">
10 10
<thead>
11 11
<tr>
12 12
  <th colspan="4" class="filename">
......
21 21
<% table_file.each_line do |spacing, line| -%>
22 22
<% if spacing -%>
23 23
<tr class="spacing">
24
  <th class="line-num">...</th><td></td><th class="line-num">...</th><td></td>
24
  <th class="line-num" data-txt="..."></th><td></td><th class="line-num" data-txt="..."></th><td></td>
25 25
</tr>
26 26
<% end -%>
27 27
<tr>
28
  <th class="line-num"><%= line.nb_line_left %></th>
28
  <th class="line-num" data-txt="<%= line.nb_line_left %>"></th>
29 29
  <td class="line-code <%= line.type_diff_left %>">
30
    <pre><%= line.html_line_left.html_safe %></pre>
30
    <div><%= line.html_line_left.html_safe %></div>
31 31
  </td>
32
  <th class="line-num"><%= line.nb_line_right %></th>
32
  <th class="line-num" data-txt="<%= line.nb_line_right %>"></th>
33 33
  <td class="line-code <%= line.type_diff_right %>">
34
    <pre><%= line.html_line_right.html_safe %></pre>
34
    <div><%= line.html_line_right.html_safe %></div>
35 35
  </td>
36 36
</tr>
37 37
<% end -%>
......
39 39
</table>
40 40

  
41 41
<% else -%>
42
<table class="filecontent">
42
<table class="filecontent diffcontent">
43 43
<thead>
44 44
  <tr>
45 45
    <th colspan="3" class="filename">
......
58 58
</tr>
59 59
<% end -%>
60 60
<tr>
61
  <th class="line-num"><%= line.nb_line_left %></th>
62
  <th class="line-num"><%= line.nb_line_right %></th>
61
  <th class="line-num" data-txt="<%= line.nb_line_left %>"></th>
62
  <th class="line-num" data-txt="<%= line.nb_line_right %>"></th>
63 63
  <td class="line-code <%= line.type_diff %>">
64
    <pre><%= line.html_line.html_safe %></pre>
64
    <div><%= line.html_line.html_safe %></div>
65 65
  </td>
66 66
</tr>
67 67
<% end -%>
app/views/common/_file.html.erb (working copy)
4 4
<% line_num = 1 %>
5 5
<% syntax_highlight_lines(filename, Redmine::CodesetUtil.to_utf8_by_setting(content)).each do |line| %>
6 6
  <tr id="L<%= line_num %>">
7
    <th class="line-num">
8
      <a href="#L<%= line_num %>"><%= line_num %></a>
9
    </th>
7
    <th class="line-num"><a href="#L<%= line_num %>" data-txt="<%= line_num %>"></a></th>
10 8
    <td class="line-code">
11
      <pre><%= line.html_safe %></pre>
9
      <% if line == "\n" or line == "\r\n" %>
10
      <br>
11
      <% else %>
12
      <div><%= line.html_safe %></div>
13
      <% end %>
12 14
    </td>
13 15
  </tr>
14 16
  <% line_num += 1 %>
app/views/repositories/annotate.html.erb (working copy)
17 17
    <% syntax_highlight_lines(@path, Redmine::CodesetUtil.to_utf8_by_setting(@annotate.content)).each do |line| %>
18 18
      <% revision = @annotate.revisions[line_num - 1] %>
19 19
      <tr id="L<%= line_num %>" class="bloc-<%= revision.nil? ? 0 : colors[revision.identifier || revision.revision] %> <%= previous_revision && revision && revision != previous_revision ? 'bloc-change' : nil%>">
20
        <th class="line-num"><a href="#L<%= line_num %>"><%= line_num %></a></th>
20
        <th class="line-num"><a href="#L<%= line_num %>" data-txt="<%= line_num %>"></a></th>
21 21
        <td class="revision">
22 22
          <% if revision && revision != previous_revision %>
23 23
            <%= revision.identifier ?
......
31 31
            <%= author.split('<').first %>
32 32
          <% end %>
33 33
        </td>
34
        <td class="line-code"><pre><%= line.html_safe %></pre></td>
34
        <% if line == "\n" or line == "\r\n" %>
35
        <td class="line-code"><br></td>
36
        <% else %>
37
        <td class="line-code"><div><%= line.html_safe %></div></td>
38
        <% end %>
35 39
      </tr>
36 40
      <% line_num += 1; previous_revision = revision %>
37 41
    <% end %>
public/stylesheets/scm.css (working copy)
61 61
    text-decoration: none;
62 62
    color: inherit;
63 63
}
64
table.filecontent th.line-num a:after {
65
    content:  attr(data-txt);
66
}
67
table.diffcontent th.line-num:after {
68
    content:  attr(data-txt);
69
}
64 70
table.filecontent td.line-code {padding: 0 0 0 4px;}
65
table.filecontent td.line-code pre {
71
table.filecontent td.line-code pre, table.filecontent td.line-code div {
66 72
    margin: 0px;
67 73
    white-space: pre-wrap;
68 74
    font-family:Consolas, Menlo, "Liberation Mono", Courier, monospace; font-size:12px;