summaryrefslogtreecommitdiff
path: root/app/views/projects/protected_tags/_protected_tag.html.haml
blob: 54249ec0db1f0843aa8d93a51fef5c9b2c309806 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
%tr.js-protected-tag-edit-form{ data: { url: namespace_project_protected_tag_path(@project.namespace, @project, protected_tag) } }
  %td
    %span.ref-name= protected_tag.name

    - if @project.root_ref?(protected_tag.name)
      %span.label.label-info.prepend-left-5 default
  %td
    - if protected_tag.wildcard?
      - matching_tags = protected_tag.matching(repository.tags)
      = link_to pluralize(matching_tags.count, "matching tag"), namespace_project_protected_tag_path(@project.namespace, @project, protected_tag)
    - else
      - if commit = protected_tag.commit
        = link_to(commit.short_id, namespace_project_commit_path(@project.namespace, @project, commit.id), class: 'commit-sha')
        = time_ago_with_tooltip(commit.committed_date)
      - else
        (tag was removed from repository)

  = render partial: 'projects/protected_tags/update_protected_tag', locals: { protected_tag: protected_tag }

  - if can_admin_project
    %td
      = link_to 'Unprotect', [@project.namespace.becomes(Namespace), @project, protected_tag], data: { confirm: 'tag will be writable for developers. Are you sure?' }, method: :delete, class: 'btn btn-warning'