opf/openproject

View on GitHub
modules/storages/app/views/storages/storages_mailer/_health_status_notification.html.erb

Summary

Maintainability
Test Coverage
<%#-- copyright
OpenProject is an open source project management software.
Copyright (C) 2012-2024 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.

++#%>

<a style="text-decoration: none;display: block;" href="<%= url %>" target="_blank">
  <%= render layout: 'mailer/border_table' do %>
    <tr>
      <td>
        <table <%= placeholder_table_styles(width: '100%', style: 'width:100%;font-size:14px;') %>>
          <tr>
            <%= placeholder_cell('12px', vertical: true) %>
            <td>
              <table <%= placeholder_table_styles %>>
                <tr>
                  <td>
                    <% if state == :unhealthy %>
                      <%= render Mailer::LabelComponent.new(scheme: :danger, text: 'Error') %>
                    <% else %>
                      <%= render Mailer::LabelComponent.new(scheme: :success, text: 'Healthy') %>
                    <% end %>
                  </td>

                  <%= placeholder_cell('8px', vertical: true) %>

                  <td style="color: #878787; font-size: 12px; font-weight: 700;">
                    <%= I18n.t("storages.provider_types.#{storage.short_provider_type}.name") %> - <%= storage.host %>
                  </td>
                </tr>
              </table>
            </td>
            <%= placeholder_cell('12px', vertical: true) %>
          </tr>

          <tr>
            <%= placeholder_cell('8px', vertical: false) %>
          </tr>

          <tr>
            <%= placeholder_cell('12px', vertical: true) %>
            <td style="font-weight: 700; line-height: 20px; color: black;"><%= storage.name %></td>
            <%= placeholder_cell('12px', vertical: true) %>
          </tr>

          <tr>
            <%= placeholder_cell('8px', vertical: false) %>
          </tr>

          <tr id="reason">
            <%= placeholder_cell('12px', vertical: true) %>
            <td style="color: #878787; font-size: 12px; font-weight: 400; line-height: 16px;">
              <% if state == :unhealthy %>
                <%= reason %> <%= I18n.t('mail.storages.health.unhealthy.since') %> <%= format_time(storage.health_changed_at) %>
              <% else %>
                <%= reason %> <%= I18n.t('mail.storages.health.healthy.solved_at') %> <%= format_time(storage.health_changed_at) %>
              <% end %>
            </td>
            <%= placeholder_cell('12px', vertical: true) %>
          </tr>

          <% if storage.provider_type == ::Storages::Storage::PROVIDER_TYPE_NEXTCLOUD && state == :unhealthy %>
            <tr id="troubleshooting">
              <%= placeholder_cell('12px', vertical: true) %>

              <td style="color: #878787; font-size: 12px; font-weight: 400; line-height: 16px;">
                <%= I18n.t('mail.storages.health.unhealthy.troubleshooting.text') %>
                <a href="<%= ::OpenProject::Static::Links[:storage_docs][:troubleshooting][:href] %>"><%= I18n.t('mail.storages.health.unhealthy.troubleshooting.link_text') %></a>.
              </td>

              <%= placeholder_cell('12px', vertical: true) %>
            </tr>
          <% end %>
        </table>
      </td>
    </tr>
  <% end %>
</a>

<table <%= placeholder_table_styles(width: '100%', style: "width:100%;") %>>
  <tr>
    <%= placeholder_cell('12px', vertical: false) %>
  </tr>

  <tr>
    <td>
      <a style="text-decoration: none; line-height: 24px; font-size: 14px"
         href="<%= url %>"
         target="_blank"
         rel="noopener noreferrer">
        <%= I18n.t('mail.work_packages.open_in_browser') %>
      </a>
    </td>
  </tr>

  <tr>
    <%= placeholder_cell('20px', vertical: false) %>
  </tr>
</table>