From 27751dece993212369d96dfac22b30af6a7a06d6 Mon Sep 17 00:00:00 2001 From: Anderson Meireles Date: Tue, 14 Jan 2025 20:34:37 -0300 Subject: [PATCH] change watermark to also show for students in case the report is not qr code signed --- app/helpers/pdf_helper.rb | 6 +++--- app/models/ability.rb | 1 - config/locales/pt-BR.yml | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/helpers/pdf_helper.rb b/app/helpers/pdf_helper.rb index 3c9b7a0c..ec31d084 100644 --- a/app/helpers/pdf_helper.rb +++ b/app/helpers/pdf_helper.rb @@ -345,15 +345,15 @@ def new_document(name, title, options = {}, &block) pdf.create_stamp("watermark") do pdf.rotate(60, origin: [0, 0]) do pdf.fill_color "993333" - pdf.font("FreeMono", size: 22) do + pdf.font("FreeMono", size: 25) do pdf.draw_text( - I18n.t("pdf_content.professor_watermark"), at: [0, 0] + I18n.t("pdf_content.watermark"), at: [0, 0] ) end pdf.fill_color "000000" end end - pdf.repeat(:all, dynamic: true) do + pdf.repeat(:all) do pdf.stamp_at "watermark", [80, 0] end end diff --git a/app/models/ability.rb b/app/models/ability.rb index 054cecac..fd04a125 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -281,7 +281,6 @@ def initialize_student_pages(user, roles) enrollment.dismissal&.dismissal_reason&.thesis_judgement === DismissalReason::APPROVED end can :grades_report_pdf, Enrollment, student_id: user.student.id - can :generate_report_without_watermark, Enrollment, student_id: user.student.id else cannot [:show, :enroll, :save_enroll], :student_enrollment end diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index c25a8864..66591643 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -143,7 +143,7 @@ pt-BR: justification_grade_not_count_in_gpr: " Justificativa " pdf_content: - professor_watermark: "DOCUMENTO VÁLIDO APENAS PARA USO INTERNO E PESSOAL DO PROFESSOR" + watermark: "DOCUMENTO PARA USO INTERNO E SEM VALOR OFICIAL" rescue_blank_text: "Não informado"