Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into issue_448
Browse files Browse the repository at this point in the history
# Conflicts:
#	db/schema.rb
  • Loading branch information
IgorMonardez committed Dec 10, 2024
2 parents 02798f2 + 2ba309e commit 8b7a655
Show file tree
Hide file tree
Showing 81 changed files with 1,664 additions and 147 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.1
3.2.5
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# ruby=3.2.1
# ruby=3.2.5
# frozen_string_literal: true

source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

# The following line is necessary to allow RVM choosing the correct ruby version. RVM 2.0 will probably be able to interpret the "~>" symbol and we will be able to safely remove the "#ruby=3.2.2" line.
ruby "~> 3.2.1"
ruby "~> 3.2.5"

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.0.8.1"
Expand Down Expand Up @@ -89,6 +89,7 @@ gem "prawn"
gem "prawn-table"
gem "prawn-rails"
gem "matrix", "~> 0.4.2"
gem "prawn-qrcode"

# Redcarpet for Readme MarkDown (or README.md) - Credits Page
gem "redcarpet"
Expand Down
129 changes: 68 additions & 61 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,76 +29,76 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.8.4)
actionpack (= 7.0.8.4)
activesupport (= 7.0.8.4)
actioncable (7.0.8.5)
actionpack (= 7.0.8.5)
activesupport (= 7.0.8.5)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.8.4)
actionpack (= 7.0.8.4)
activejob (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
actionmailbox (7.0.8.5)
actionpack (= 7.0.8.5)
activejob (= 7.0.8.5)
activerecord (= 7.0.8.5)
activestorage (= 7.0.8.5)
activesupport (= 7.0.8.5)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.8.4)
actionpack (= 7.0.8.4)
actionview (= 7.0.8.4)
activejob (= 7.0.8.4)
activesupport (= 7.0.8.4)
actionmailer (7.0.8.5)
actionpack (= 7.0.8.5)
actionview (= 7.0.8.5)
activejob (= 7.0.8.5)
activesupport (= 7.0.8.5)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.8.4)
actionview (= 7.0.8.4)
activesupport (= 7.0.8.4)
actionpack (7.0.8.5)
actionview (= 7.0.8.5)
activesupport (= 7.0.8.5)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.8.4)
actionpack (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
actiontext (7.0.8.5)
actionpack (= 7.0.8.5)
activerecord (= 7.0.8.5)
activestorage (= 7.0.8.5)
activesupport (= 7.0.8.5)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.8.4)
activesupport (= 7.0.8.4)
actionview (7.0.8.5)
activesupport (= 7.0.8.5)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_scaffold_duplicate (1.1.4)
active_scaffold (>= 3.6.0.pre)
activejob (7.0.8.4)
activesupport (= 7.0.8.4)
activejob (7.0.8.5)
activesupport (= 7.0.8.5)
globalid (>= 0.3.6)
activemodel (7.0.8.4)
activesupport (= 7.0.8.4)
activerecord (7.0.8.4)
activemodel (= 7.0.8.4)
activesupport (= 7.0.8.4)
activemodel (7.0.8.5)
activesupport (= 7.0.8.5)
activerecord (7.0.8.5)
activemodel (= 7.0.8.5)
activesupport (= 7.0.8.5)
activerecord-session_store (2.1.0)
actionpack (>= 6.1)
activerecord (>= 6.1)
cgi (>= 0.3.6)
multi_json (~> 1.11, >= 1.11.2)
rack (>= 2.0.8, < 4)
railties (>= 6.1)
activestorage (7.0.8.4)
actionpack (= 7.0.8.4)
activejob (= 7.0.8.4)
activerecord (= 7.0.8.4)
activesupport (= 7.0.8.4)
activestorage (7.0.8.5)
actionpack (= 7.0.8.5)
activejob (= 7.0.8.5)
activerecord (= 7.0.8.5)
activesupport (= 7.0.8.5)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.8.4)
activesupport (7.0.8.5)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -148,6 +148,7 @@ GEM
childprocess (5.1.0)
logger (~> 1.5)
choice (0.2.0)
chunky_png (1.4.0)
cocoon (1.2.15)
coderay (1.1.3)
coffee-rails (5.0.0)
Expand Down Expand Up @@ -206,7 +207,7 @@ GEM
globalid (1.2.1)
activesupport (>= 6.1)
htmlentities (4.3.4)
i18n (1.14.5)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
image_processing (1.12.2)
Expand Down Expand Up @@ -262,7 +263,7 @@ GEM
mini_magick (4.12.0)
mini_mime (1.1.5)
mini_portile2 (2.8.7)
minitest (5.25.0)
minitest (5.25.1)
msgpack (1.7.2)
multi_json (1.15.0)
mysql2 (0.5.5)
Expand All @@ -277,7 +278,7 @@ GEM
timeout
net-smtp (0.5.0)
net-protocol
nio4r (2.5.9)
nio4r (2.7.3)
nokogiri (1.16.7)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
Expand All @@ -295,6 +296,9 @@ GEM
prawn (2.4.0)
pdf-core (~> 0.9.0)
ttfunk (~> 1.7)
prawn-qrcode (0.5.2)
prawn (>= 1)
rqrcode (>= 1.0.0)
prawn-rails (1.4.2)
actionview (>= 3.1.0)
prawn
Expand All @@ -307,27 +311,27 @@ GEM
psych (5.1.2)
stringio
public_suffix (6.0.1)
puma (6.4.2)
puma (6.4.3)
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.8.1)
rack (2.2.8.1)
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.8.4)
actioncable (= 7.0.8.4)
actionmailbox (= 7.0.8.4)
actionmailer (= 7.0.8.4)
actionpack (= 7.0.8.4)
actiontext (= 7.0.8.4)
actionview (= 7.0.8.4)
activejob (= 7.0.8.4)
activemodel (= 7.0.8.4)
activerecord (= 7.0.8.4)
activestorage (= 7.0.8.4)
activesupport (= 7.0.8.4)
rails (7.0.8.5)
actioncable (= 7.0.8.5)
actionmailbox (= 7.0.8.5)
actionmailer (= 7.0.8.5)
actionpack (= 7.0.8.5)
actiontext (= 7.0.8.5)
actionview (= 7.0.8.5)
activejob (= 7.0.8.5)
activemodel (= 7.0.8.5)
activerecord (= 7.0.8.5)
activestorage (= 7.0.8.5)
activesupport (= 7.0.8.5)
bundler (>= 1.15.0)
railties (= 7.0.8.4)
railties (= 7.0.8.5)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
Expand All @@ -340,9 +344,9 @@ GEM
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.0.8.4)
actionpack (= 7.0.8.4)
activesupport (= 7.0.8.4)
railties (7.0.8.5)
actionpack (= 7.0.8.5)
activesupport (= 7.0.8.5)
method_source
rake (>= 12.2)
thor (~> 1.0)
Expand All @@ -363,9 +367,12 @@ GEM
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.3.6)
strscan
rexml (3.3.9)
rouge (4.2.0)
rqrcode (2.2.0)
chunky_png (~> 1.0)
rqrcode_core (~> 1.0)
rqrcode_core (1.2.0)
rspec-collection_matchers (1.2.1)
rspec-expectations (>= 2.99.0.beta1)
rspec-core (3.12.2)
Expand Down Expand Up @@ -465,7 +472,6 @@ GEM
sqlite3 (1.6.8-x86_64-linux)
ssrf_filter (1.1.2)
stringio (3.1.1)
strscan (3.1.0)
thor (1.3.1)
tilt (2.3.0)
timeliness (0.4.5)
Expand Down Expand Up @@ -537,6 +543,7 @@ DEPENDENCIES
nokogiri (>= 1.16.5)
paper_trail
prawn
prawn-qrcode
prawn-rails
prawn-table
pry
Expand Down Expand Up @@ -568,7 +575,7 @@ DEPENDENCIES
web-console

RUBY VERSION
ruby 3.2.2p53
ruby 3.2.5p208

BUNDLED WITH
2.4.19
2 changes: 1 addition & 1 deletion app/controllers/admissions/admission_phases_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Admissions::AdmissionPhasesController < ApplicationController
form_columns = [
:name, :member_form, :shared_form, :consolidation_form, :candidate_form, :can_edit_candidate,
:candidate_can_edit, :candidate_can_see_member, :candidate_can_see_shared,
:candidate_can_see_consolidation,
:candidate_can_see_consolidation, :committee_can_see_other_individual,
:approval_condition, :keep_in_phase_condition, :admission_phase_committees,
]

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admissions/filled_forms_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Admissions::FilledFormsController < ApplicationController
protected
def self.filled_form_params_definition
[
:id, :is_filled, :form_template_id, :disable_submission,
:id, :is_filled, :form_template_id, :enable_submission,
fields_attributes: [
:id, :form_field_id, :value, :_destroy, :remove_file, :file,
list: [],
Expand Down
6 changes: 4 additions & 2 deletions app/controllers/concerns/shared_pdf_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def render_course_classes_summary_pdf(course_class)
)
end

def render_enrollments_academic_transcript_pdf(enrollment)
def render_enrollments_academic_transcript_pdf(enrollment, filename = "transcript.pdf")
class_enrollments = enrollment.class_enrollments
.where(situation: ClassEnrollment::APPROVED)
.joins(:course_class)
Expand All @@ -47,6 +47,7 @@ def render_enrollments_academic_transcript_pdf(enrollment)
type: "application/pdf",
formats: [:pdf],
assigns: {
filename: filename,
enrollment: enrollment,
class_enrollments: class_enrollments,
accomplished_phases: accomplished_phases,
Expand All @@ -55,7 +56,7 @@ def render_enrollments_academic_transcript_pdf(enrollment)
)
end

def render_enrollments_grades_report_pdf(enrollment)
def render_enrollments_grades_report_pdf(enrollment, filename = "grades_report.pdf")
class_enrollments = enrollment.class_enrollments
.where(situation: ClassEnrollment::APPROVED)
.joins(:course_class)
Expand All @@ -67,6 +68,7 @@ def render_enrollments_grades_report_pdf(enrollment)
type: "application/pdf",
formats: [:pdf],
assigns: {
filename: filename,
enrollment: enrollment,
class_enrollments: class_enrollments,
accomplished_phases: accomplished_phases,
Expand Down
11 changes: 7 additions & 4 deletions app/controllers/enrollments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class EnrollmentsController < ApplicationController
:thesis_title,
:thesis_defense_date,
:obs,
:obs_to_academic_transcript,

:advisements,
:scholarship_durations,
Expand Down Expand Up @@ -219,8 +220,9 @@ def academic_transcript_pdf
format.pdf do
title = I18n.t("pdf_content.enrollment.academic_transcript.title")
student = enrollment.student.name
send_data render_enrollments_academic_transcript_pdf(enrollment),
filename: "#{title} - #{student}.pdf",
filename = "#{title} - #{student}.pdf"
send_data render_enrollments_academic_transcript_pdf(enrollment, filename),
filename: filename,
type: "application/pdf"
end
end
Expand All @@ -232,8 +234,9 @@ def grades_report_pdf
format.pdf do
title = I18n.t("pdf_content.enrollment.grades_report.title")
student = enrollment.student.name
send_data render_enrollments_grades_report_pdf(enrollment),
filename: "#{title} - #{student}.pdf",
filename = "#{title} - #{student}.pdf"
send_data render_enrollments_grades_report_pdf(enrollment, filename),
filename: filename,
type: "application/pdf"
end
end
Expand Down
33 changes: 33 additions & 0 deletions app/controllers/grants_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) Universidade Federal Fluminense (UFF).
# This file is part of SAPOS. Please, consult the license terms in the LICENSE file.

# frozen_string_literal: true

class GrantsController < ApplicationController
authorize_resource

active_scaffold :grant do |config|
config.create.label = :create_grant_label
config.columns = [:title, :start_year, :end_year, :professor, :kind, :funder, :amount]
config.actions.swap :search, :field_search
config.columns[:professor].form_ui = :record_select
config.columns[:kind].form_ui = :select
config.columns[:kind].options = {
options: Grant::KINDS,
default: Grant::PUBLIC,
include_blank: I18n.t("active_scaffold._select_")
}
config.columns[:amount].options[:format] = :currency
config.columns[:start_year].options[:format] = "%d"
config.columns[:end_year].options[:format] = "%d"
config.actions.exclude :deleted_records
end

protected
def do_new
super
unless current_user.professor.blank?
@record.professor = current_user.professor
end
end
end
Loading

0 comments on commit 8b7a655

Please sign in to comment.