Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

3.1 KB
Raw Blame
<%#-- copyright
OpenProject is an open source project management software.
Copyright (C) the OpenProject GmbH

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 3.

OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
Copyright (C) 2006-2013 Jean-Philippe Lang
Copyright (C) 2010-2013 the ChiliProject Team

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

See COPYRIGHT and LICENSE files for more details.

++#%>

<opce-persistent-toggle data-identifier="repository.checkout_instructions"></opce-persistent-toggle>

<%= render(Repositories::PageHeaderComponent.new(repository: @repository, empty: empty, path: @path, rev: @rev, project: @project)) %>
<% if @instructions && @instructions.available? %>
  <%=
    render(Primer::OpenProject::FlexLayout.new(align_items: :flex_end, mb: 2)) do |container|
      container.with_column(mr: 2, classes: "repository--checkout-container") do
        render(Primer::OpenProject::InputGroup.new(input_width: :large)) do |group|
          group.with_text_input(
            id: "repository-checkout-url",
            name: "repository-checkout-url",
            label: @instructions.checkout_command,
            value: @instructions.checkout_url(true),
            readonly: true
          )
          group.with_trailing_action_clipboard_copy_button(
            value: @instructions.checkout_url(true),
            aria: { label: t(:button_copy_to_clipboard) }
          )
        end
      end

      container.with_column do
        render(
          Primer::Beta::IconButton.new(
            icon: :info,
            tag: :a,
            id: "repository--checkout-instructions-toggle",
            classes: "persistent-toggle--click-handler",
            aria: { label: t("repositories.checkout.show_instructions") },
            title: t("repositories.checkout.show_instructions")
          )
        )
      end
    end
  %>
<% end %>

<%= call_hook(
      :repositories_navigation_toolbar,
      { repository: @repository, project: @project, repository_empty: empty }
    ) %>

<%
  # @rev is revision or git branch or tag.
  rev_text = @changeset.nil? ? @rev : format_revision(@changeset)
%>
<span>
  <%= "(#{t('repositories.at_identifier', identifier: rev_text)})" if rev_text.present? %>
</span>
<% if @instructions %>
  <%= render partial: "checkout_instructions",
             locals: { repository: @repository, instructions: @instructions } %>
<% end %>