##// END OF EJS Templates
scm: git: show only filename and filesize if setting of reporting last commit is disable (#8365, #7047)....
Toshi MARUYAMA -
r5655:d65c3d438d28
parent child
Show More
@@ -80,6 +80,10 class Repository < ActiveRecord::Base
80 80 write_attribute(:extra_info, h)
81 81 end
82 82
83 def report_last_commit
84 true
85 end
86
83 87 def supports_cat?
84 88 scm.supports_cat?
85 89 end
@@ -38,6 +38,10 class Repository::Git < Repository
38 38 'Git'
39 39 end
40 40
41 def report_last_commit
42 extra_report_last_commit
43 end
44
41 45 def extra_report_last_commit
42 46 return false if extra_info.nil?
43 47 v = extra_info["extra_report_last_commit"]
@@ -3,10 +3,12
3 3 <tr id="root">
4 4 <th><%= l(:field_name) %></th>
5 5 <th><%= l(:field_filesize) %></th>
6 <th><%= l(:label_revision) %></th>
7 <th><%= l(:label_age) %></th>
8 <th><%= l(:field_author) %></th>
9 <th><%= l(:field_comments) %></th>
6 <% if @repository.report_last_commit %>
7 <th><%= l(:label_revision) %></th>
8 <th><%= l(:label_age) %></th>
9 <th><%= l(:field_author) %></th>
10 <th><%= l(:field_comments) %></th>
11 <% end %>
10 12 </tr>
11 13 </thead>
12 14 <tbody>
@@ -4,7 +4,8
4 4 <% ent_path = Redmine::CodesetUtil.replace_invalid_utf8(entry.path) %>
5 5 <% ent_name = Redmine::CodesetUtil.replace_invalid_utf8(entry.name) %>
6 6 <tr id="<%= tr_id %>" class="<%= h params[:parent_id] %> entry <%= entry.kind %>">
7 <td style="padding-left: <%=18 * depth%>px;" class="filename">
7 <td style="padding-left: <%=18 * depth%>px;" class="<%=
8 @repository.report_last_commit ? "filename" : "filename_no_report" %>";>
8 9 <% if entry.is_dir? %>
9 10 <span class="expander" onclick="<%= remote_function :url => {:action => 'show', :id => @project, :path => to_path_param(ent_path), :rev => @rev, :depth => (depth + 1), :parent_id => tr_id},
10 11 :method => :get,
@@ -19,9 +20,11
19 20 </td>
20 21 <td class="size"><%= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %></td>
21 22 <% changeset = @project.repository.find_changeset_by_name(entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier %>
23 <% if @repository.report_last_commit %>
22 24 <td class="revision"><%= link_to_revision(changeset, @project) if changeset %></td>
23 25 <td class="age"><%= distance_of_time_in_words(entry.lastrev.time, Time.now) if entry.lastrev && entry.lastrev.time %></td>
24 26 <td class="author"><%= changeset.nil? ? h(Redmine::CodesetUtil.replace_invalid_utf8(entry.lastrev.author.to_s.split('<').first)) : changeset.author if entry.lastrev %></td>
25 27 <td class="comments"><%=h truncate(changeset.comments, :length => 50) unless changeset.nil? %></td>
28 <% end %>
26 29 </tr>
27 30 <% end %>
@@ -145,10 +145,12 tr.issue.idnt-9 td.subject {padding-left: 12.5em;}
145 145 tr.entry { border: 1px solid #f8f8f8; }
146 146 tr.entry td { white-space: nowrap; }
147 147 tr.entry td.filename { width: 30%; }
148 tr.entry td.filename_no_report { width: 70%; }
148 149 tr.entry td.size { text-align: right; font-size: 90%; }
149 150 tr.entry td.revision, tr.entry td.author { text-align: center; }
150 151 tr.entry td.age { text-align: right; }
151 152 tr.entry.file td.filename a { margin-left: 16px; }
153 tr.entry.file td.filename_no_report a { margin-left: 16px; }
152 154
153 155 tr span.expander {background-image: url(../images/bullet_toggle_plus.png); padding-left: 8px; margin-left: 0; cursor: pointer;}
154 156 tr.open span.expander {background-image: url(../images/bullet_toggle_minus.png);}
General Comments 0
You need to be logged in to leave comments. Login now