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.6KB

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