app/helpers/commits_helper.rb
def revert_commit_link(commit, continue_to_path, btn_class: nil)
    return unless current_user

    tooltip = "Revert this #{commit.change_type_title} in a new merge request"

    if can_collaborate_with_project?
      link_to 'Revert', '#modal-revert-commit', 'data-toggle' => 'modal', 'data-container' => 'body', title: tooltip, class: "btn btn-default btn-grouped btn-#{btn_class} has-tooltip"
    elsif can?(current_user, :fork_project, @project)
      continue_params = {
        to: continue_to_path,
        notice: edit_in_new_fork_notice + ' Try to revert this commit again.',
        notice_now: edit_in_new_fork_notice_now
      }
      fork_path = namespace_project_forks_path(@project.namespace, @project,
        namespace_key: current_user.namespace.id,
        continue: continue_params)

      link_to 'Revert', fork_path, class: 'btn btn-grouped btn-close', method: :post, 'data-toggle' => 'tooltip', 'data-container' => 'body', title: tooltip
    end
  end
# Returns a link to the commit author. If the author has a matching user and
# is a member of the current @project it will link to the team member page.
# Otherwise it will link to the author email as specified in the commit.
#
# options:
#  avatar: true will prepend the avatar image
#  size:   size of the avatar image in px
Returns a link to the commit author. If the author has a matching user and
is a member of the current @project it will link to the team member page.
Otherwise it will link to the author email as specified in the commit.

true will prepend the avatar image
size:   size of the avatar image in px
Returns a link to the commit author . If the author has a matching user and is a member of the current @project it will link to the team member page . Otherwise it will link to the author email as specified in the commit . true will prepend the avatar image size : size of the avatar image in px
def revert_commit_link(commit, continue_to_path, btn_class: nil)
    return unless current_user
    tooltip = "Revert this #{commit.change_type_title} in a new merge request"
    if can_collaborate_with_project?
      link_to 'Revert', '#modal-revert-commit', 'data-toggle' => 'modal', 'data-container' => 'body', title: tooltip, class: "btn btn-default btn-grouped btn-#{btn_class} has-tooltip"
    elsif can?(current_user, :fork_project, @project)
      continue_params = {
        to: continue_to_path,
        notice: edit_in_new_fork_notice + ' Try to revert this commit again.',
        notice_now: edit_in_new_fork_notice_now
      }
      fork_path = namespace_project_forks_path(@project.namespace, @project,
        namespace_key: current_user.namespace.id,
        continue: continue_params)
      link_to 'Revert', fork_path, class: 'btn btn-grouped btn-close', method: :post, 'data-toggle' => 'tooltip', 'data-container' => 'body', title: tooltip
    end
  end
def revert_commit_link ( commit , continue_to_path , btn_class : nil ) return unless current_user tooltip = "Revert this #{commit.change_type_title} in a new merge request" if can_collaborate_with_project? link_to 'Revert' , '#modal-revert-commit' , 'data-toggle' => 'modal' , 'data-container' => 'body' , title : tooltip , class : "btn btn-default btn-grouped btn-#{btn_class} has-tooltip" elsif can? ( current_user , :fork_project , @project ) continue_params = { to : continue_to_path , notice : edit_in_new_fork_notice + ' Try to revert this commit again.' , notice_now : edit_in_new_fork_notice_now } fork_path = namespace_project_forks_path ( @project . namespace , @project , namespace_key : current_user . namespace . id , continue : continue_params ) link_to 'Revert' , fork_path , class : 'btn btn-grouped btn-close' , method : :post , 'data-toggle' => 'tooltip' , 'data-container' => 'body' , title : tooltip end end
Returns a link to the commit author.
Returns a link to the commit author .
commit
continue_to_path
btn_class