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

4.7 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.

++#%>

<% html_title(t(:label_administration), t(:label_information_plural)) -%>

<%=
  render(Primer::OpenProject::PageHeader.new) do |header|
    header.with_title { t(:label_information_plural) }
    header.with_breadcrumbs(
      [{ href: admin_index_path, text: t(:label_administration) },
       t(:label_information_plural)]
    )
  end
%>

<%= call_hook(:view_admin_info_top) %>

<%= render(AttributeGroups::AttributeGroupComponent.new) do |component|
  if Setting.show_product_version?
    core_link = linked_sha_reference(OpenProject::VERSION.core_sha, OpenProject::VERSION.core_url)
    component.with_attribute(key: t(:label_core_build), value: core_link) if core_link.present?

    product_link = linked_sha_reference(OpenProject::VERSION.product_sha, OpenProject::VERSION.product_url)
    component.with_attribute(key: t(:label_product_version), value: product_link) if product_link.present?
  end

  component.with_attribute(key: t(:label_core_version), value: OpenProject::Info.versioned_name)
  component.with_attribute(key: t(:label_database_version), value: @db_version)

  if OpenProject::Database.version_deprecated?
    value = render(Primer::Alpha::Banner.new(
      scheme: :warning,
      icon: :alert
    )) do
      <<~STR.html_safe
        Starting with OpenProject 16.0, PostgreSQL 16 is required to use OpenProject.
        Your installation will remain functional with your current database, but anticipate incompatability
        in future releases.
        <br/>
        We have prepared #{static_link_to(:postgres_17_upgrade, label: 'upgrade guides for all installation methods')}.
        You can perform the upgrade ahead of the next release at any time by following the guides.
      STR
    end
    component.with_attribute(key: "Deprecation warning", value:)
  end

  if display_security_badge_graphic?
    content = content_tag :object, nil, data: security_badge_url, type: "image/svg+xml"
    content += link_to "",
                       ::OpenProject::Static::Links.url_for(:security_badge_documentation),
                       title: t(:label_what_is_this),
                       class: "security-badge--help-icon icon-context icon-help1",
                       target: "_blank"
    component.with_attribute(key: "", value: content)
  end

  if (updated_on = OpenProject::VERSION.updated_on).present?
    component.with_attribute(key: t(:label_last_change_on), value: format_time(updated_on))
  end
end %>

<%= render(AttributeGroups::AttributeGroupComponent.new) do |component|
  component.with_header(title: I18n.t(:label_system))

  @checklist.each do |label, result|
    aria_label = result ? t(:general_text_Yes) : t(:general_text_No)
    icon = result ? "check-circle-fill" : "circle"
    value = render Primer::Beta::Octicon.new(icon:, "aria-label": aria_label)
    component.with_attribute(key: I18n.t(label), value:)
  end
end %>

<% @storage_information.each_with_index do |(_, entries), i| %>
  <%=
    render(AttributeGroups::AttributeGroupComponent.new) do |component|
      component.with_header(title: t(:label_storage_group, identifier: i + 1))

      component.with_attribute(
        key: t(:label_storage_for),
        value: safe_join(entries[:labels], "<br/>".html_safe)
      )

      component.with_attribute(
        key: t(:label_storage_free_space),
        value: number_to_human_size(entries[:data][:free], precision: 2)
      )

      value = number_to_human_size(entries[:data][:used], precision: 2)
      value += "(#{entries[:data][:percent_used].round(2)})"
      component.with_attribute(key: t(:label_storage_used_space), value:)
    end
  %>
<% end %>

<%= call_hook(:view_admin_info_bottom) %>