<commit_before>- if current_user
  .project-action-button.dropdown.inline
    %a.btn.dropdown-toggle.has-tooltip{ href: '#', title: _('Create new...'), 'data-toggle' => 'dropdown', 'data-container' => 'body', 'aria-label' => _('Create new...') }
      = icon('plus')
      = icon("caret-down")
    %ul.dropdown-menu.dropdown-menu-align-right.project-home-dropdown
      - can_create_issue = can?(current_user, :create_issue, @project)
      - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project))
      - can_create_snippet = can?(current_user, :create_snippet, @project)

      - if can_create_issue
        %li
          = link_to new_project_issue_path(@project) do
            #{ _('New issue') }

      - if merge_project
        %li
          = link_to project_new_merge_request_path(merge_project) do
            #{ _('New merge request') }

      - if can_create_snippet
        %li
          = link_to new_project_snippet_path(@project) do
            #{ _('New snippet') }

      - if can_create_issue || merge_project || can_create_snippet
        %li.divider

      - if can?(current_user, :push_code, @project)
        %li
          = link_to project_new_blob_path(@project, @project.default_branch || 'master') do
            #{ _('New file') }
        - unless @project.empty_repo?
          %li
            = link_to new_project_branch_path(@project) do
              #{ _('New branch') }
          %li
            = link_to new_project_tag_path(@project) do
              #{ _('New tag') }
      - elsif current_user && current_user.already_forked?(@project)
        %li
          = link_to project_new_blob_path(@project, @project.default_branch || 'master') do
            #{ _('New file') }
      - elsif can?(current_user, :fork_project, @project)
        %li
          - continue_params = { to:         project_new_blob_path(@project, @project.default_branch || 'master'),
                                notice:     edit_in_new_fork_notice,
                                notice_now: edit_in_new_fork_notice_now }
          - fork_path = project_forks_path(@project, namespace_key:  current_user.namespace.id,
                                                                                  continue:       continue_params)
          = link_to fork_path, method: :post do
            #{ _('New file') }
<commit_msg>Refactor of buttons _dropdown partial<commit_after>- if current_user
  .project-action-button.dropdown.inline
    %a.btn.dropdown-toggle.has-tooltip{ href: '#', title: _('Create new...'), 'data-toggle' => 'dropdown', 'data-container' => 'body', 'aria-label' => _('Create new...') }
      = icon('plus')
      = icon("caret-down")
    %ul.dropdown-menu.dropdown-menu-align-right.project-home-dropdown
      - can_create_issue = can?(current_user, :create_issue, @project)
      - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project))
      - can_create_snippet = can?(current_user, :create_snippet, @project)

      - if can_create_issue
        %li
          = link_to _('New issue'), new_project_issue_path(@project)
      - if merge_project
        %li
          = link_to _('New merge request'), project_new_merge_request_path(merge_project)
      - if can_create_snippet
        %li
          = link_to _('New snippet'), new_project_snippet_path(@project)

      - if can_create_issue || merge_project || can_create_snippet
        %li.divider

      - if can?(current_user, :push_code, @project)
        %li
          = link_to _('New file'), project_new_blob_path(@project, @project.default_branch || 'master')
        - unless @project.empty_repo?
          %li
            = link_to _('New branch'), new_project_branch_path(@project)
          %li
            = link_to _('New tag'), new_project_tag_path(@project)
      - elsif current_user && current_user.already_forked?(@project)
        %li
          = link_to _('New file'), project_new_blob_path(@project, @project.default_branch || 'master')
      - elsif can?(current_user, :fork_project, @project)
        %li
          - continue_params = { to:         project_new_blob_path(@project, @project.default_branch || 'master'),
                                notice:     edit_in_new_fork_notice,
                                notice_now: edit_in_new_fork_notice_now }
          - fork_path = project_forks_path(@project, namespace_key:  current_user.namespace.id,
                                                                                  continue:       continue_params)
          = link_to _('New file'), fork_path, method: :post

{'fraction_non_alphanumeric': 0.1221796509152831, 'fraction_numerical': 0.0, 'mean_word_length': 2.26546212647672, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6193502', 'n_tokens_mistral': 1399, 'n_tokens_neox': 1390, 'n_words': 252}