<commit_before>= render "projects/commits/head"
.row
  .col-md-3
    = render "projects/branches/filter"
  .col-md-9
    .alert.alert-info
      %p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, class: "vlink"}.
      %p This ability allows:
      %ul
        %li keep stable branches secured
        %li forced code review before merge to protected branches
      %p Read more about project permissions #{link_to "here", help_permissions_path, class: "underlined_link"}

    - if can? current_user, :admin_project, @project
      = form_for [@project, @protected_branch] do |f|
        -if @protected_branch.errors.any?
          .alert.alert-danger
            %ul
              - @protected_branch.errors.full_messages.each do |msg|
                %li= msg

        .entry.clearfix
          = f.label :name, "Branch"
          .col-md-3
            = f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , {include_blank: "Select branch"}, {class: "select2 span3"})
          &nbsp;
          = f.submit 'Protect', class: "btn-create btn"
    - unless @branches.empty?
      %h5 Already Protected:
      %ul.bordered-list.protected-branches-list
        - @branches.each do |branch|
          %li
            %h4
              = link_to project_commits_path(@project, branch.name) do
                %strong= branch.name
                - if @project.root_ref?(branch.name)
                  %span.label.label-info default
                %span.label.label-success
                  %i.icon-lock
              .pull-right
                - if can? current_user, :admin_project, @project
                  = link_to 'Unprotect', [@project, branch], data: { confirm: 'Branch will be writable for developers. Are you sure?' }, method: :delete, class: "btn btn-remove btn-small"

            - if commit = branch.commit
              = link_to project_commit_path(@project, commit.id), class: 'commit_short_id' do
                = commit.short_id
              %span.light
                = gfm escape_once(truncate(commit.title, length: 40))
              #{time_ago_with_tooltip(commit.committed_date)}
            - else
              (branch was removed from repository)
<commit_msg>Fix protected branches page UI<commit_after>= render "projects/commits/head"
.row
  .col-md-3
    = render "projects/branches/filter"
  .col-md-9
    .bs-callout.bs-callout-info
      %p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, class: "vlink"}.
      %p This ability allows:
      %ul
        %li keep stable branches secured
        %li forced code review before merge to protected branches
      %p Read more about project permissions #{link_to "here", help_permissions_path, class: "underlined_link"}

    - if can? current_user, :admin_project, @project
      = form_for [@project, @protected_branch], html: { class: 'form-horizontal' } do |f|
        -if @protected_branch.errors.any?
          .alert.alert-danger
            %ul
              - @protected_branch.errors.full_messages.each do |msg|
                %li= msg

        .form-group
          = f.label :name, "Branch", class: 'control-label'
          .col-sm-10
            = f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , {include_blank: "Select branch"}, {class: "select2"})
        .form-actions
          = f.submit 'Protect', class: "btn-create btn"
    - unless @branches.empty?
      %h5 Already Protected:
      %ul.bordered-list.protected-branches-list
        - @branches.each do |branch|
          %li
            %h4
              = link_to project_commits_path(@project, branch.name) do
                %strong= branch.name
                - if @project.root_ref?(branch.name)
                  %span.label.label-info default
                %span.label.label-success
                  %i.icon-lock
              .pull-right
                - if can? current_user, :admin_project, @project
                  = link_to 'Unprotect', [@project, branch], data: { confirm: 'Branch will be writable for developers. Are you sure?' }, method: :delete, class: "btn btn-remove btn-small"

            - if commit = branch.commit
              = link_to project_commit_path(@project, commit.id), class: 'commit_short_id' do
                = commit.short_id
              %span.light
                = gfm escape_once(truncate(commit.title, length: 40))
              #{time_ago_with_tooltip(commit.committed_date)}
            - else
              (branch was removed from repository)

{'fraction_non_alphanumeric': 0.11130397049251464, 'fraction_numerical': 0.0039054024734215664, 'mean_word_length': 2.0229508196721313, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3866702', 'n_tokens_mistral': 1362, 'n_tokens_neox': 1322, 'n_words': 342}