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

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

++#%>

<p><%= I18n.t("label_custom_export_images_instructions") %></p>

<%=
  render(Primer::Beta::Button.new(
    target: "_blank",
    data: { turbo: false },
    tag: :a,
    href: export_demo_pdf_download_custom_style_path
  )) do |_c|
    t("export.demo.button_text")
  end
%>

<%= render partial: "custom_styles/uploads/image",  locals: { image:{
  field: :export_logo,
  label: I18n.t(:label_custom_export_logo),
  present: @custom_style.id && @custom_style.export_logo.present?,
  source: @custom_style.id && @custom_style.export_logo.present? ?
            custom_style_export_logo_path(digest: @custom_style.digest, filename: @custom_style.export_logo_identifier) :
            nil,
  img_class: "custom-export-logo-preview",
  accept: "image/png, image/jpg",
  delete_path: custom_style_export_logo_delete_path,
  instructions: I18n.t("text_custom_export_logo_instructions")
} } %>

<%= render partial: "custom_styles/uploads/image",  locals: { image:{
  field: :export_cover,
  label: I18n.t(:label_custom_export_cover),
  present: @custom_style.id && @custom_style.export_cover.present?,
  source: @custom_style.id && @custom_style.export_cover.present? ?
            custom_style_export_cover_path(digest: @custom_style.digest, filename: @custom_style.export_cover_identifier) :
            nil,
  img_class: "custom-export-cover-preview",
  accept: "image/png, image/jpg",
  delete_path: custom_style_export_cover_delete_path,
  instructions: I18n.t("text_custom_export_cover_instructions")
} } %>

<%= form_tag update_custom_style_export_cover_text_color_path, html: { multipart: true, class: "form -vertical" } do |f| %>
  <section class="form--section">
    <fieldset class="form--fieldset">
      <legend class="form--fieldset-legend"><%= I18n.t(:label_custom_export_cover_overlay) %></legend>
      <div class="form--field">
        <label class="form--label"><%= I18n.t(:label_custom_export_cover_text_color) %>:</label>
        <span class="form--field-container">
          <div class="form--field-affix">
            <% design_color_name = "export_cover_text_color" %>
            <% design_color_hex = @custom_style.export_cover_text_color.presence %>
            <%= icon_for_color(
                  Color.new(
                    hexcode: design_color_hex || "#000"
                  ),
                  data: { target: "#" + design_color_name }
                ) %>
          </div>
          <span class="form--text-field-container">
            <%= styled_text_field_tag design_color_name,
                                      design_color_hex || "",
                                      placeholder: "#000" %>
          </span>
        </span>
        <div class="form--field-instructions">
          <% instruction_key = "admin.custom_styles.instructions.#{design_color_name}" %>
          <% if I18n.exists?(instruction_key, :en) %>
            <%= I18n.t(instruction_key) %>
          <% end %>
        </div>
      </div>
      <%=
        render(Primer::Beta::Button.new(
          type: :submit,
          data: {
            "test-selector": "text-color-change"
          }
        )) do |button|
          I18n.t(:button_save)
        end
      %>
    </fieldset>
  </section>
<% end %>

<%  if OpenProject::FeatureDecisions.minutes_styling_meeting_pdf_active? %>
  <%= render partial: "custom_styles/uploads/image",  locals: { image:{
    field: :export_footer,
    label: I18n.t(:label_custom_export_footer),
    present: @custom_style.id && @custom_style.export_footer.present?,
    source: @custom_style.id && @custom_style.export_footer.present? ?
              custom_style_export_footer_path(digest: @custom_style.digest, filename: @custom_style.export_footer_identifier) :
              nil,
    img_class: "custom-export-footer-preview",
    accept: "image/png, image/jpg",
    delete_path: custom_style_export_footer_delete_path,
    instructions: I18n.t("text_custom_export_footer_instructions")
  } } %>
<% end %>