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.

_revisions.html.erb 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <div class="autoscroll">
  2. <% show_revision_graph = ( @repository.supports_revision_graph? && path.blank? ) %>
  3. <%= if show_revision_graph && revisions && revisions.any?
  4. indexed_commits, graph_space = index_commits(revisions, @repository.branches) do |scmid|
  5. url_for(
  6. :controller => 'repositories',
  7. :action => 'revision',
  8. :id => project,
  9. :repository_id => @repository.identifier_param,
  10. :rev => scmid)
  11. end
  12. render :partial => 'revision_graph',
  13. :locals => {
  14. :commits => indexed_commits,
  15. :space => graph_space
  16. }
  17. end %>
  18. <%= form_tag(
  19. {:controller => 'repositories', :action => 'diff', :id => project,
  20. :repository_id => @repository.identifier_param, :path => to_path_param(path)},
  21. :method => :get
  22. ) do %>
  23. <% show_diff = revisions.size > 1 %>
  24. <%= submit_tag(l(:label_view_diff), :name => nil) if show_diff %>
  25. <table class="list changesets">
  26. <thead><tr>
  27. <th>#</th>
  28. <th></th>
  29. <th></th>
  30. <th><%= l(:label_date) %></th>
  31. <th><%= l(:field_author) %></th>
  32. <th><%= l(:field_comments) %></th>
  33. </tr></thead>
  34. <tbody>
  35. <% line_num = 1 %>
  36. <% revisions.each do |changeset| %>
  37. <tr class="changeset">
  38. <% id_style = (show_revision_graph ? "padding-left:#{(graph_space + 1) * 20}px" : nil) %>
  39. <%= content_tag(:td, :class => 'id', :style => id_style) do %>
  40. <%= link_to_revision(changeset, @repository) %>
  41. <% end %>
  42. <td class="checkbox"><%= radio_button_tag('rev', changeset.identifier, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').prop('checked',true);") if show_diff && (line_num < revisions.size) %></td>
  43. <td class="checkbox"><%= radio_button_tag('rev_to', changeset.identifier, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('#cb-#{line_num}').prop('checked')) {$('#cb-#{line_num-1}').prop('checked',true);}") if show_diff && (line_num > 1) %></td>
  44. <td class="committed_on"><%= format_time(changeset.committed_on) %></td>
  45. <td class="author"><%= changeset.user.blank? ? changeset.author.to_s.truncate(30) : link_to_user(changeset.user) %></td>
  46. <td class="comments"><%= textilizable(truncate_at_line_break(changeset.comments), :formatting => Setting.commit_logs_formatting?) %></td>
  47. </tr>
  48. <% line_num += 1 %>
  49. <% end %>
  50. </tbody>
  51. </table>
  52. <%= submit_tag(l(:label_view_diff), :name => nil) if show_diff %>
  53. <% end %>
  54. </div>