Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: amnis-invictus/ikt.edu.vn.ua
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4842bdc74ec7749ed1491ff288b2af8ae585a8b6
Choose a base ref
..
head repository: amnis-invictus/ikt.edu.vn.ua
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1de0127191607a7f2fa5b362aade6a8905ffa312
Choose a head ref
Showing with 23 additions and 23 deletions.
  1. +4 −4 Gemfile.lock
  2. +19 −19 app/services/spreadsheet/public.rb
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -155,7 +155,7 @@ GEM
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (2.6.3)
json (2.7.0)
kaminari (1.2.2)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.2)
@@ -193,7 +193,7 @@ GEM
minitest (5.20.0)
msgpack (1.7.2)
nested_form (0.3.2)
net-imap (0.4.6)
net-imap (0.4.7)
date
net-protocol
net-pop (0.1.2)
@@ -295,15 +295,15 @@ GEM
rspec-mocks (~> 3.12)
rspec-support (~> 3.12)
rspec-support (3.12.1)
rubocop (1.57.2)
rubocop (1.58.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
38 changes: 19 additions & 19 deletions app/services/spreadsheet/public.rb
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ def build
Rails.logger.debug { "Processing #{grade} grade of contest ##{@contest.id}..." }

workbook.add_worksheet name: "#{grade} клас" do |sheet|
add_header_if_required sheet, style: title_style
add_header_if_required sheet, title_style

# Merge only after all data, otherwise will be ignored
sheet.merge_cells "A1:#{place_column}1"
@@ -53,14 +53,14 @@ def build
sheet.merge_cells "#{sum_column}3:#{sum_column}4"
sheet.merge_cells "#{place_column}3:#{place_column}4"

add_result_table_if_required sheet, grade, style: data_style
add_result_table_if_required sheet, grade, data_style

sheet.add_row []

add_main_judge_if_required sheet, style: judges_style
add_judge_list_if_required sheet, judges, style: judges_style
add_orgcom_head_if_required sheet, style: judges_style
add_orgcom_secretary_if_required sheet, style: judges_style
add_main_judge_if_required sheet, judges_style
add_judge_list_if_required sheet, judges, judges_style
add_orgcom_head_if_required sheet, judges_style
add_orgcom_secretary_if_required sheet, judges_style

# Set only after all data, otherwise will be ignored
sheet.column_widths(*column_widths)
@@ -78,40 +78,40 @@ def user_data_row user
[user.secret, user.judge_secret, user.name, user.institution]
end

def add_header_if_required(sheet, **)
sheet.add_row([@config.header], **) if @config.header.present?
def add_header_if_required sheet, style_options
sheet.add_row [@config.header], style: style_options if @config.header.present?
end

def add_result_table_if_required(sheet, grade, **)
def add_result_table_if_required sheet, grade, style_options
return unless @config.result_table

generate_data_rows(grade).each { |row| sheet.add_row row, ** }
generate_data_rows(grade).each { |row| sheet.add_row row, style: style_options }
end

def add_main_judge_if_required(sheet, **)
def add_main_judge_if_required sheet, style_options
return unless @config.main_judge

sheet.add_row ['', 'Голова журі', SIGNATURE, @contest.main_judge], **
sheet.add_row ['', 'Голова журі', SIGNATURE, @contest.main_judge], style: style_options
end

def add_judge_list_if_required(sheet, judges, **)
def add_judge_list_if_required sheet, judges, style_options
return unless @config.judge_list

first_judge, *judges = judges
sheet.add_row ['', 'Члени журі', SIGNATURE, first_judge], **
judges.each { sheet.add_row ['', '', SIGNATURE, _1], ** }
sheet.add_row ['', 'Члени журі', SIGNATURE, first_judge], style: style_options
judges.each { sheet.add_row ['', '', SIGNATURE, _1], style: style_options }
end

def add_orgcom_head_if_required(sheet, **)
def add_orgcom_head_if_required sheet, style_options
return unless @config.orgcom_head

sheet.add_row ['', 'Голова оргкомітету', SIGNATURE, @contest.head_of_organizing_committee], **
sheet.add_row ['', 'Голова оргкомітету', SIGNATURE, @contest.head_of_organizing_committee], style: style_options
end

def add_orgcom_secretary_if_required(sheet, **)
def add_orgcom_secretary_if_required sheet, style_options
return unless @config.orgcom_secretary

sheet.add_row ['', 'Секретар оргкомітету', SIGNATURE, @contest.secretary_of_organizing_committee], **
sheet.add_row ['', 'Секретар оргкомітету', SIGNATURE, @contest.secretary_of_organizing_committee], style: style_options
end
end
end