diff options
-rw-r--r-- | app/models/repository.rb | 4 | ||||
-rw-r--r-- | app/models/repository/git.rb | 4 | ||||
-rw-r--r-- | app/views/repositories/_dir_list.rhtml | 10 | ||||
-rw-r--r-- | app/views/repositories/_dir_list_content.rhtml | 5 | ||||
-rw-r--r-- | public/stylesheets/application.css | 2 |
5 files changed, 20 insertions, 5 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index de2720661..00d80fb31 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -80,6 +80,10 @@ class Repository < ActiveRecord::Base write_attribute(:extra_info, h) end + def report_last_commit + true + end + def supports_cat? scm.supports_cat? end diff --git a/app/models/repository/git.rb b/app/models/repository/git.rb index 3c89ba6d5..51a2ca82d 100644 --- a/app/models/repository/git.rb +++ b/app/models/repository/git.rb @@ -38,6 +38,10 @@ class Repository::Git < Repository 'Git' end + def report_last_commit + extra_report_last_commit + end + def extra_report_last_commit return false if extra_info.nil? v = extra_info["extra_report_last_commit"] diff --git a/app/views/repositories/_dir_list.rhtml b/app/views/repositories/_dir_list.rhtml index 5590652f5..84efcfc27 100644 --- a/app/views/repositories/_dir_list.rhtml +++ b/app/views/repositories/_dir_list.rhtml @@ -3,10 +3,12 @@ <tr id="root"> <th><%= l(:field_name) %></th> <th><%= l(:field_filesize) %></th> -<th><%= l(:label_revision) %></th> -<th><%= l(:label_age) %></th> -<th><%= l(:field_author) %></th> -<th><%= l(:field_comments) %></th> +<% if @repository.report_last_commit %> +<th><%= l(:label_revision) %></th> +<th><%= l(:label_age) %></th> +<th><%= l(:field_author) %></th> +<th><%= l(:field_comments) %></th> +<% end %> </tr> </thead> <tbody> diff --git a/app/views/repositories/_dir_list_content.rhtml b/app/views/repositories/_dir_list_content.rhtml index a4e08b046..be7e48a34 100644 --- a/app/views/repositories/_dir_list_content.rhtml +++ b/app/views/repositories/_dir_list_content.rhtml @@ -4,7 +4,8 @@ <% ent_path = Redmine::CodesetUtil.replace_invalid_utf8(entry.path) %> <% ent_name = Redmine::CodesetUtil.replace_invalid_utf8(entry.name) %> <tr id="<%= tr_id %>" class="<%= h params[:parent_id] %> entry <%= entry.kind %>"> -<td style="padding-left: <%=18 * depth%>px;" class="filename"> +<td style="padding-left: <%=18 * depth%>px;" class="<%= + @repository.report_last_commit ? "filename" : "filename_no_report" %>";> <% if entry.is_dir? %> <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}, :method => :get, @@ -19,9 +20,11 @@ </td> <td class="size"><%= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %></td> <% changeset = @project.repository.find_changeset_by_name(entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier %> +<% if @repository.report_last_commit %> <td class="revision"><%= link_to_revision(changeset, @project) if changeset %></td> <td class="age"><%= distance_of_time_in_words(entry.lastrev.time, Time.now) if entry.lastrev && entry.lastrev.time %></td> <td class="author"><%= changeset.nil? ? h(Redmine::CodesetUtil.replace_invalid_utf8(entry.lastrev.author.to_s.split('<').first)) : changeset.author if entry.lastrev %></td> <td class="comments"><%=h truncate(changeset.comments, :length => 50) unless changeset.nil? %></td> +<% end %> </tr> <% end %> diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 862ba460b..47eb839c8 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -145,10 +145,12 @@ tr.issue.idnt-9 td.subject {padding-left: 12.5em;} tr.entry { border: 1px solid #f8f8f8; } tr.entry td { white-space: nowrap; } tr.entry td.filename { width: 30%; } +tr.entry td.filename_no_report { width: 70%; } tr.entry td.size { text-align: right; font-size: 90%; } tr.entry td.revision, tr.entry td.author { text-align: center; } tr.entry td.age { text-align: right; } tr.entry.file td.filename a { margin-left: 16px; } +tr.entry.file td.filename_no_report a { margin-left: 16px; } tr span.expander {background-image: url(../images/bullet_toggle_plus.png); padding-left: 8px; margin-left: 0; cursor: pointer;} tr.open span.expander {background-image: url(../images/bullet_toggle_minus.png);} |