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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
obey rubocop
as-op32ff7de6aff0
diff --git a/app/models/exports/pdf/components/page.rb b/app/models/exports/pdf/components/page.rbindex d2e8d2781e3..9e3e03577f0 100644--- a/app/models/exports/pdf/components/page.rb+++ b/app/models/exports/pdf/components/page.rb@@ -94,21 +94,23 @@ module Exports::PDF::Components::Pagedef draw_footer_on_pagetop = styles.page_footer_offsettext_style = styles.page_footer- spacing = styles.page_footer_horizontal_spacingright_width = footer_page_nr.present? ? draw_text_right(footer_page_nr, text_style, top) : 0left_width = footer_date.present? ? draw_text_left(footer_date, text_style, top) : 0- if footer_title.present?- footer_sides = [left_width, right_width].max + spacing- available_width = pdf.bounds.width - (2 * footer_sides)- draw_text_multiline_center(- text: footer_title,- text_style:,- left: footer_sides,- available_width:,- top:,- max_lines: MAX_NR_OF_PDF_FOOTER_LINES- )- end+ draw_footer_title(left_width, right_width) if footer_title.present?+ end++ def draw_footer_title(left_width, right_width)+ spacing = styles.page_footer_horizontal_spacing+ footer_sides = [left_width, right_width].max + spacing+ available_width = pdf.bounds.width - (2 * footer_sides)+ draw_text_multiline_center(+ text: footer_title,+ text_style:,+ left: footer_sides,+ available_width:,+ top:,+ max_lines: MAX_NR_OF_PDF_FOOTER_LINES+ )enddef footer_page_nrdiff --git a/script/pdf_export/validate_styles b/script/pdf_export/validate_stylesindex 814ec66c986..4196ecff756 100755--- a/script/pdf_export/validate_styles+++ b/script/pdf_export/validate_styles@@ -12,14 +12,18 @@ class SchemaValidatorroot = File.expand_path("../../", __dir__)config = YAML.load_file(File.join(__dir__, "styles.yml"))config["styles"].each do |entry|- puts "Validating #{entry['name']} styles"- schema = JSON::load_file(File.join(root, entry["path"], "schema.json"))- styles_file = File.join(root, entry["path"], "standard.yml")- styles = YAML.load_file(styles_file)- validate_schema!(styles, schema)- puts "Valid: #{styles_file}"+ validate_styles(entry, root)endend++ def validate_styles(entry, root)+ puts "Validating #{entry['name']} styles"+ schema = JSON::load_file(File.join(root, entry["path"], "schema.json"))+ styles_file = File.join(root, entry["path"], "standard.yml")+ styles = YAML.load_file(styles_file)+ validate_schema!(styles, schema)+ puts "Valid: #{styles_file}"+ endendSchemaValidator.new.validatediff --git a/spec/models/work_package/pdf_export/common/badge_spec.rb b/spec/models/exports/pdf/common/badge_spec.rbsimilarity index 100%rename from spec/models/work_package/pdf_export/common/badge_spec.rbrename to spec/models/exports/pdf/common/badge_spec.rbdiff --git a/spec/models/work_package/pdf_export/common/macro_spec.rb b/spec/models/exports/pdf/common/macro_spec.rbsimilarity index 100%rename from spec/models/work_package/pdf_export/common/macro_spec.rbrename to spec/models/exports/pdf/common/macro_spec.rb