Initial commit

This commit is contained in:
Senad Uka
2020-05-31 22:38:19 +02:00
commit 858fafc3c5
1280 changed files with 65918 additions and 0 deletions

View File

@@ -0,0 +1,128 @@
module ExcelReports
module AudioReports
class AudioConfirmationData
def initialize(audio_confirmation)
@audio_confirmation = audio_confirmation
end
def cue_number
""
end
def timecode_in
audio_confirmation.timecode_in
end
def title_and_source_file_name
[audio_confirmation.title, audio_confirmation.source_file_name].reject(&:blank?).join(" - ")
end
def catalog
audio_confirmation.catalog
end
def use
"#{audio_confirmation.music_type} #{audio_confirmation.music_category}"
end
def interested_parties
"Composers:\n#{audio_confirmation.composer_info}\nPublishers:\n#{audio_confirmation.publisher_info}"
end
def composers
converted_composers.map do |composer|
"#{composer.name} (#{composer.affiliation})"
end.join("\n")
end
def composers_split
converted_composers.map(&:percentage).join("\n")
end
def composers_with_split
converted_composers.map do |composer|
"#{composer.name} (#{composer.affiliation}) #{composer.percentage}%"
end.join("\n")
end
def composers_cae_numbers
converted_composers.map(&:cae_number).join("\n")
end
def publishers
converted_publishers.map do |publisher|
"#{publisher.name} (#{publisher.affiliation})"
end.join("\n")
end
def publishers_split
converted_publishers.map(&:percentage).join("\n")
end
def publishers_with_split
converted_publishers.map do |publisher|
"#{publisher.name} (#{publisher.affiliation}) #{publisher.percentage}%"
end.join("\n")
end
def music_type
audio_confirmation.music_type.to_s.first
end
def music_category
audio_confirmation.music_category.to_s.first
end
def timecode_out
audio_confirmation.timecode_out
end
def duration
audio_confirmation.duration
end
def origin
if audio_confirmation.confirmation_type_library?
"Production Library (Non-affiliated)"
else
"Commissioned"
end
end
def ==(other)
audio_confirmation == other.audio_confirmation
end
protected
attr_reader :audio_confirmation
def converted_composers
composers = audio_confirmation.composer_info.split("|")
composers.map do |composer_info|
parts = composer_info.split(",")
if cae_number_index = parts.index { |part| part.include?("$cae") }
cae_number = parts.delete_at(cae_number_index)
end
Composer.new(
name: parts[0...-2].join(","),
affiliation: parts[-2].strip,
percentage: parts.last,
cae_number: cae_number.to_s.gsub("$cae:", "").strip
)
end
end
def converted_publishers
audio_confirmation.publisher_info.split("|").map do |publisher_info|
parts = publisher_info.split(",")
Publisher.new(
name: parts[0...-2].join(","),
affiliation: parts[-2].strip,
percentage: parts.last,
)
end
end
end
end
end

View File

@@ -0,0 +1,25 @@
module ExcelReports
module AudioReports
class BrayInnovationGroupMusicCueHeaderData
def initialize(video)
@video = video
end
def title
video.name
end
def company_name
video.project.producer_name
end
def company_address
video.project.producer_address
end
private
attr_reader :video
end
end
end

View File

@@ -0,0 +1,40 @@
module ExcelReports
module AudioReports
class BrayInnovationGroupMusicCueReport
def initialize(video)
@video = video
end
def to_xls
BrayInnovationGroupMusicCueSheet.build(workbook, report_data, report_header_data)
package.to_stream.read
end
def filename
"#{video.file.filename.to_s.parameterize}_big-cue-sheet.xlsx"
end
private
attr_reader :video
def report_data
video.audio_confirmations.order(timecode_in: :asc).map do |audio_confirmation|
AudioConfirmationData.new(audio_confirmation)
end
end
def report_header_data
BrayInnovationGroupMusicCueHeaderData.new(video)
end
def workbook
@workbook ||= package.workbook
end
def package
@package ||= Axlsx::Package.new
end
end
end
end

View File

@@ -0,0 +1,97 @@
module ExcelReports
module AudioReports
class BrayInnovationGroupMusicCueSheet < ::ExcelReports::Worksheet
def title
"BiG Music Cue Sheet"
end
def fill_content(sheet)
sheet.add_row ["TITLE", header_data.title]
sheet.add_row ["COMPANY NAME", header_data.company_name]
sheet.add_row ["ADDRESS", header_data.company_address]
sheet.add_row ["LENGTH", ""]
sheet.add_row ["TYPE", ""]
sheet.add_row
sheet.add_row table_headers
sheet.add_row table_subheaders
data.each do |datum|
sheet.add_row [
datum.cue_number,
datum.title_and_source_file_name,
datum.composers,
datum.composers_split,
datum.publishers,
datum.publishers_split,
datum.music_type,
datum.music_category,
datum.timecode_in,
datum.timecode_out,
datum.duration,
]
end
end
def format(sheet)
sheet.merge_cells "G7:H7"
sheet.column_widths *column_widths
end
def style(sheet)
sheet.add_style "A1:A5", Styles::PROGRAM_HEADER
sheet.add_style "B1:B5", Styles::HEADER_DATA
sheet.add_style "A7:K7", Styles::TABLE_HEADER
if data.any?
sheet.add_style "A#{data_start_index}:K#{data_end_index}", Styles::TABLE_DATA
end
end
private
def table_headers
[
"Cue #",
"Cue Title",
"Composer(s)/Affiliation",
"%",
"Publisher(s)/Affiliation",
"%",
"Use",
"",
"In Time",
"Out Time",
"Duration",
]
end
def table_subheaders
[
"",
"",
"",
"",
"",
"",
"I = Instr.\nV = Vocal",
"B = Bckgrnd\nF = Feature\nT = Theme",
"",
"",
"",
]
end
def column_widths
[15, 40, 20, 10, 20, 10, 20, 20, 15, 15, 15]
end
def data_start_index
9
end
def data_end_index
(data_start_index + data.size) - 1
end
end
end
end

View File

@@ -0,0 +1,29 @@
module ExcelReports
module AudioReports
class DiscoveryMusicCueHeaderData
def initialize(video)
@video = video
end
def title
video.name
end
def company_name
video.project.producer_name
end
def client_name
video.project.client_name
end
def episode_number
video.number
end
private
attr_reader :video
end
end
end

View File

@@ -0,0 +1,40 @@
module ExcelReports
module AudioReports
class DiscoveryMusicCueReport
def initialize(video)
@video = video
end
def to_xls
DiscoveryMusicCueSheet.build(workbook, report_data, report_header_data)
package.to_stream.read
end
def filename
"#{video.file.filename.to_s.parameterize}_discovery-cue-sheet.xlsx"
end
private
attr_reader :video
def report_header_data
DiscoveryMusicCueHeaderData.new(video)
end
def report_data
video.audio_confirmations.order(timecode_in: :asc).map do |audio_confirmation|
AudioConfirmationData.new(audio_confirmation)
end
end
def workbook
@workbook ||= package.workbook
end
def package
@package ||= Axlsx::Package.new
end
end
end
end

View File

@@ -0,0 +1,90 @@
module ExcelReports
module AudioReports
class DiscoveryMusicCueSheet < ::ExcelReports::Worksheet
def title
"Discovery Music Cue Sheet"
end
def fill_content(sheet)
sheet.add_row ["Original Production Title", header_data.title, "Original Series Title", "", "Broadcaster", ""]
sheet.add_row ["Alternative Production Title", "", "Alternative Series Title", "", "Production Company", header_data.company_name]
sheet.add_row ["Local Production Title", "", "Local Series Title", "", "", ""]
sheet.add_row ["Working Production Title", "", "Working Series Title", "", "Production Number", ""]
sheet.add_row ["Version Production Title", "", "Version Series Title", "", "Director", ""]
sheet.add_row ["Episode No.", header_data.episode_number, "Season No.", "", "Production Parent Identifier", ""]
sheet.add_row ["Year", "", "Country", "", "Soundmouse Legacy Identifier", ""]
sheet.add_row ["Duration", "", "Type", "", "Production ID", ""]
sheet.add_row ["First Transmission", "", "Source", ""]
sheet.add_row ["Product Name", ""]
sheet.add_row ["Client Name", header_data.client_name]
sheet.add_row ["Narrative", ""]
sheet.add_row ["End Line", ""]
sheet.add_row ["Clock Number", ""]
sheet.add_row ["ISAN", ""]
sheet.add_row
sheet.add_row table_headers
data.each_with_index do |datum, index|
sheet.add_row [
index + 1,
datum.timecode_in,
datum.title_and_source_file_name,
datum.catalog,
datum.use,
datum.interested_parties,
"",
datum.duration,
]
end
end
def format(sheet)
sheet.column_widths *column_widths
end
def style(sheet)
sheet.add_style "A1:A15", Styles::PROGRAM_HEADER
sheet.add_style "C1:C9", Styles::PROGRAM_HEADER
sheet.add_style "E1:E8", Styles::PROGRAM_HEADER
sheet.add_style "B1:B15", Styles::HEADER_DATA
sheet.add_style "D1:D9", Styles::HEADER_DATA
sheet.add_style "F1:F8", Styles::HEADER_DATA
sheet.add_style "A17:H17", Styles::TABLE_HEADER
if data.any?
sheet.add_style "A#{data_start_index}:H#{data_end_index}", Styles::TABLE_DATA
end
end
private
def table_headers
[
"No.",
"Timecode",
"Title",
"Music Origin",
"Use (Theme/Description)",
"Interested Parties",
"Identifiers",
"Duration",
]
end
def column_widths
[20, 20, 40, 20, 20, 20, 20, 20]
end
def data_start_index
18
end
def data_end_index
(data_start_index + data.size) - 1
end
end
end
end

View File

@@ -0,0 +1,36 @@
module ExcelReports
module AudioReports
class NatGeoMusicCueSheet
def initialize(video)
@video = video
end
def to_xls
NatGeoMusicCueSheets::MainSheet.build(workbook, report_data)
package.to_stream.read
end
def filename
"#{video.file.filename.to_s.parameterize}_music-cue-sheet.xlsx"
end
private
attr_reader :video
def report_data
video.audio_confirmations.order(timecode_in: :asc).map do |audio_confirmation|
AudioConfirmationData.new(audio_confirmation)
end
end
def workbook
@workbook ||= package.workbook
end
def package
@package ||= Axlsx::Package.new
end
end
end
end

View File

@@ -0,0 +1,97 @@
module ExcelReports
module AudioReports
module NatGeoMusicCueSheets
class MainSheet < Worksheet
def title
"Nat Geo Music Cue Sheet"
end
def fill_content(sheet)
sheet.add_row ["National Geographic", "", "", "", "", "", "", "", "", ""]
sheet.add_row ["Music Cue Sheet", "", "", "", "", "", "", "", "", ""]
sheet.add_row
sheet.add_row table_headers
data.each_with_index do |datum, index|
sheet.add_row [
index + 1,
datum.title_and_source_file_name,
datum.timecode_in,
datum.timecode_out,
datum.composers_with_split,
datum.publishers_with_split,
datum.catalog,
datum.origin,
datum.use,
datum.duration,
]
end
sheet.add_row ["", "", "", "", "", "", "", "", "Total Music Duration:", total_duration]
end
def format(sheet)
sheet.column_widths *column_widths
cells_to_merge.each { |cell| sheet.merge_cells cell }
end
def style(sheet)
sheet.add_style "A1:J1", Styles::BOLD, { sz: 18 }
sheet.add_style "A2:J2", Styles::BOLD, Styles::FULLY_CENTERED, { sz: 16 }
sheet.add_style "A#{data_start_index-1}:J#{data_start_index-1}", Styles::BOLD, Styles::THIN_BLACK_BORDER, Styles::WRAP_TEXT
if data.any?
sheet.add_style "A#{data_start_index}:J#{data_end_index}", Styles::THIN_BLACK_BORDER
sheet.add_style "E#{data_start_index}:F#{data_end_index}", Styles::WRAP_TEXT
sheet.add_style "I#{data_start_index}:I#{data_end_index}", Styles::WRAP_TEXT
end
sheet.add_style "I#{data_end_index + 1}", Styles::BOLD, Styles::WRAP_TEXT
end
private
def table_headers
[
"No.",
"Title",
"In",
"Out",
"Composer",
"Publisher",
"Record Label / Library",
"Music Origin",
"Use",
"Duration",
]
end
def column_widths
[10, 30, 20, 20, 50, 50, 20, 25, 25, 20]
end
def cells_to_merge
%w(A1:J1 A2:J2)
end
def data_start_index
5
end
def data_end_index
(data_start_index + data.size) - 1
end
def total_duration
data.map do |datum|
begin
DurationTimecode.parse(datum.duration)
rescue ArgumentError
DurationTimecode.new(0, 0, 0)
end
end.sum.to_s
end
end
end
end
end

View File

@@ -0,0 +1,36 @@
module ExcelReports
module AudioReports
class NatGeoOriginalMusicLog
def initialize(video)
@video = video
end
def to_xls
NatGeoOriginalMusicLogs::MainSheet.build(workbook, report_data)
package.to_stream.read
end
def filename
"#{video.file.filename.to_s.parameterize}_original-music-log.xlsx"
end
private
attr_reader :video
def report_data
video.audio_confirmations.original.order(timecode_in: :asc).map do |audio_confirmation|
AudioConfirmationData.new(audio_confirmation)
end
end
def workbook
@workbook ||= package.workbook
end
def package
@package ||= Axlsx::Package.new
end
end
end
end

View File

@@ -0,0 +1,74 @@
module ExcelReports
module AudioReports
module NatGeoOriginalMusicLogs
class MainSheet < Worksheet
def title
"Nat Geo Original Music Log"
end
def fill_content(sheet)
sheet.add_row ["National Geographic", "", "", "",]
sheet.add_row ["National Geographic Music", "", "", "",]
sheet.add_row ["Original Music Log", "", "", "",]
sheet.add_row ["[PROGRAM]", "", "", ""]
sheet.add_row ["[SEASON #]", "", "", ""]
sheet.add_row [BigMediaTime.time_zone_now.to_date.strftime("%D"), "", "", ""]
sheet.add_row table_headers
data.each_with_index do |datum, index|
sheet.add_row [
datum.title_and_source_file_name,
datum.composers_with_split,
datum.composers_cae_numbers,
datum.publishers_with_split,
]
end
end
def format(sheet)
sheet.column_widths *column_widths
cells_to_merge.each { |cell| sheet.merge_cells cell }
end
def style(sheet)
sheet.add_style "A1:D1", Styles::BOLD, { sz: 18 }
sheet.add_style "A2:D2", Styles::BOLD, Styles::FULLY_CENTERED, { sz: 16 }
sheet.add_style "A3:D3", Styles::FULLY_CENTERED, { sz: 14 }
sheet.add_style "A#{data_start_index-1}:D#{data_start_index-1}", Styles::BOLD, Styles::THIN_BLACK_BORDER, Styles::WRAP_TEXT, Styles::BG_GRAY
if data.any?
sheet.add_style "A#{data_start_index}:D#{data_end_index}", Styles::THIN_BLACK_BORDER
sheet.add_style "A#{data_start_index}:D#{data_end_index}", Styles::WRAP_TEXT
end
end
private
def table_headers
[
"CUE TITLE",
"COMPOSER(S), % SPLIT & PRO",
"COMPOSER CAE/IPI#",
"PUBLISHER(S), % SPLIT & PRO",
]
end
def column_widths
[25, 45, 25, 80]
end
def cells_to_merge
%w(A1:D1 A2:D2 A3:D3)
end
def data_start_index
8
end
def data_end_index
(data_start_index + data.size) - 1
end
end
end
end
end

View File

@@ -0,0 +1,68 @@
module ExcelReports
module GraphicReports
class DiscoveryGfxCueList
def initialize(video)
@video = video
end
def to_xls
DiscoveryGfxCueLists::TextedElementsSheet.build(workbook, graphics_elements_data, graphics_elements_header_data)
package.to_stream.read
end
def filename(format = "xlsx")
name = [@video.file.filename.to_s, "gfx-cue-list"].map(&:parameterize).join("_")
[name, format].join(".")
end
private
attr_reader :video
def graphics_elements_data
video.graphics_elements.order(timecode_in: :asc).map do |graphics_element|
GraphicsElementsData.new(
graphics_element.text,
graphics_element.timecode_in,
graphics_element.timecode_out,
graphics_element.duration,
)
end
end
def graphics_elements_header_data
GraphicsElementsHeaderData.new(
video.name,
video.number,
video.project.client_name,
video.project.account.name,
)
end
def workbook
@workbook ||= package.workbook
end
def package
@package ||= Axlsx::Package.new
end
class GraphicsElementsData < Struct.new(
:text,
:timecode_in,
:timecode_out,
:duration,
)
end
class GraphicsElementsHeaderData < Struct.new(
:program_title,
:episode,
:network,
:company,
)
end
end
end
end

View File

@@ -0,0 +1,56 @@
module ExcelReports
module GraphicReports
module DiscoveryGfxCueLists
class TextedElementsSheet < ::ExcelReports::Worksheet
def title
"Texted Elements List"
end
def fill_content(sheet)
sheet.add_row ["Texted Element / CG List"]
sheet.add_row
sheet.add_row ["Program Title", header_data.program_title]
sheet.add_row ["Episode", header_data.episode]
sheet.add_row ["Network", header_data.network]
sheet.add_row ["Executive Producer", ""]
sheet.add_row ["Production Company", header_data.company]
sheet.add_row
sheet.add_row ["Title/Subtitle/Graphics", "T/C IN", "T/C OUT", "TRT"]
data.each do |graphics_data|
sheet.add_row [graphics_data.text, graphics_data.timecode_in, graphics_data.timecode_out, graphics_data.duration]
end
end
def format(sheet)
sheet.column_widths *column_widths
end
def style(sheet)
sheet.add_style "A1", Styles::BOLD, { sz: 12 }
sheet.add_style "A9:D9", Styles::TABLE_HEADER
sheet.add_style "A3:A7", Styles::PROGRAM_HEADER
sheet.add_style "B3:B7", Styles::HEADER_DATA
if data.any?
sheet.add_style "A#{data_start_index}:D#{data_end_index}", Styles::TABLE_DATA
end
end
private
def column_widths
[60, 20, 20]
end
def data_start_index
10
end
def data_end_index
(data_start_index + data.size) - 1
end
end
end
end
end

View File

@@ -0,0 +1,42 @@
module ExcelReports
module GraphicReports
class NatGeoTextGraphicsLog
def initialize(video)
@video = video
end
def to_xls
NatGeoTextGraphicsLogs::InternalProgramGfxLogSheet.build(
workbook, graphics_elements_data, graphics_elements_header_data
)
package.to_stream.read
end
def filename(format = "xlsx")
name = [@video.file.filename.to_s, "text-graphics-log"].map(&:parameterize).join("_")
[name, format].join(".")
end
private
attr_reader :video
def graphics_elements_data
video.graphics_elements.order(timecode_in: :asc)
end
def graphics_elements_header_data
video
end
def workbook
@workbook ||= package.workbook
end
def package
@package ||= Axlsx::Package.new
end
end
end
end

View File

@@ -0,0 +1,78 @@
module ExcelReports
module GraphicReports
module NatGeoTextGraphicsLogs
class InternalProgramGfxLogSheet < Worksheet
def title
"Internal Program GFX Log"
end
def fill_content(sheet)
sheet.add_row ["NATIONAL GEOGRAPHIC", "", "", "", "", "", ""]
sheet.add_row ["Text-Graphics Log", "", "", "", "", "", ""]
sheet.add_row ["(Title Sequence, Maps, Lower Thirds, CGI, Subtitles, Captions, Text Identifiers, Chyrons, Credits etc. )", "", "", "", "", "", ""]
sheet.add_row
sheet.add_row ["", "Series Name:", "", "", "", "", ""]
sheet.add_row ["", "Episode Title:", header_data.name, "", "", "", ""]
sheet.add_row ["", "Episode Number:", header_data.number, "", "", "", ""]
sheet.add_row ["", "Traffic Code(s):", "", "", "", "", ""]
sheet.add_row ["", "Date:", BigMediaTime.time_zone_now.to_date.strftime("%D"), "", "", "", ""]
sheet.add_row
sheet.add_row table_headers
data.each do |graphics_data|
sheet.add_row [graphics_data.graphic_type, graphics_data.text, graphics_data.timecode_in, graphics_data.timecode_out, "", "", ""]
end
sheet.add_row(["*Clean Graphics should appear at the end of the program master. If all shots do not fit on the program master, a separate graphics master should be delivered."])
sheet.add_row(["*If delivering textless masters & no clean graphics at the end, denote N/A in the clean scene timecode section."])
end
def format(sheet)
sheet.column_widths *column_widths
cells_to_merge.each { |cell| sheet.merge_cells cell }
end
def style(sheet)
sheet.add_style "A1:A2", Styles::BOLD, Styles::FULLY_CENTERED, { sz: 12 }
sheet.add_style "A3", Styles::FULLY_CENTERED, { sz: 12 }
sheet.add_style "B5:B9", Styles::BOLD, Styles::HORIZONTAL_RIGHT
sheet.add_style "A11:G11", Styles::BOLD, Styles::FULLY_CENTERED, Styles::THIN_BLACK_BORDER, Styles::WRAP_TEXT
if data.any?
sheet.add_style "A#{data_start_index}:G#{data_end_index}", Styles::THIN_BLACK_BORDER
end
end
private
def table_headers
[
"Element\n(Ex: Title, Lower Third, Subtitle, Graphic, Credits, etc.)",
"Description",
"Program Timecode In",
"Program Timecode Out",
"Clean Scene Timecode In",
"Clean Scene Timecode Out",
"Font Information\n(Include Font Name, Style, Color, & Opacity)"
]
end
def column_widths
[25, 36, 18, 18, 18, 18, 23]
end
def cells_to_merge
%w(A1:G1 A2:G2 A3:G3 C5:E5 C6:E6 C7:E7 C8:E8 C9:E9)
end
def data_start_index
12
end
def data_end_index
(data_start_index + data.size) - 1
end
end
end
end
end

View File

@@ -0,0 +1,33 @@
module ExcelReports
module IssuesAndConcernsReports
class IssuesAndConcernsReport
def initialize(video)
@video = video
end
def to_xls
IssuesAndConcernsWorksheet.new(
workbook,
IssuesAndConcernsReportPresenter.new(video)
).build
package.to_stream.read
end
def filename
"#{video.file.filename.to_s.parameterize}_issues-and-concerns.xlsx"
end
private
attr_reader :video
def workbook
@workbook ||= package.workbook
end
def package
@package ||= Axlsx::Package.new
end
end
end
end

View File

@@ -0,0 +1,58 @@
module ExcelReports
module IssuesAndConcernsReports
class IssuesAndConcernsWorksheet < ::ExcelReports::Worksheet
def title
"Issues and Concerns Report"
end
def fill_content(sheet)
sheet.add_row ["ISSUES AND CONCERNS REPORT"]
sheet.add_row ["Project Name", data.project_name]
sheet.add_row ["Video Name", data.video_name]
sheet.add_row ["Date of Report", data.date_of_report]
sheet.add_row []
sheet.add_row ["Track", "TC In", "TC Out", "Clip Name", "Source File Name", "Notes"]
data.unreleased_appearances.each do |unreleased_appearance|
sheet.add_row [
unreleased_appearance.channel,
unreleased_appearance.timecode_in,
unreleased_appearance.timecode_out,
unreleased_appearance.clip_name,
unreleased_appearance.source_file_name,
unreleased_appearance.note_text
]
end
end
def format(sheet)
sheet.column_widths *column_widths
end
def style(sheet)
sheet.add_style "A1", Styles::BOLD, { sz: 14 }
sheet.add_style "A2:A4", Styles::PROGRAM_HEADER
sheet.add_style "B2:B4", Styles::HEADER_DATA
sheet.add_style "A6:F6", Styles::TABLE_HEADER
if data.unreleased_appearances.any?
sheet.add_style "A#{data_start_index}:F#{data_end_index}", Styles::TABLE_DATA
end
end
private
def data_start_index
7
end
def data_end_index
(data_start_index + data.unreleased_appearances.size) - 1
end
def column_widths
[15, 15, 15, 15, 15, 50]
end
end
end
end

View File

@@ -0,0 +1,74 @@
module ExcelReports
module VideoReports
class DiscoveryProductionElementsLog
attr_reader :video
def initialize(video)
@video = video
end
def to_xls
build
package.to_stream.read
end
def filename(format = "xlsx")
name = [video.file.filename.to_s, "production-elements-log"].map(&:parameterize).join("_")
[name, format].join(".")
end
private
def talent_data
@talent_data ||= data_for("TalentRelease")
end
def appearance_data
@appearance_data ||= data_for("AppearanceRelease")
end
def location_data
@location_data ||= data_for("LocationRelease")
end
def acquired_media_data
@acquired_media_data ||= data_for("AcquiredMediaRelease")
end
def music_data
@music_data ||= data_for("MusicRelease")
end
def material_data
@material_data ||= data_for("MaterialRelease")
end
def data_for(release_type)
video.
video_release_confirmations.
where(releasable_type: release_type).
order(timecode_in: :asc).
map { |confirmation| ReleasableDataAdapter.new(confirmation) }
end
def build
DiscoveryProductionElementsLogs::MediaRightsCertificationSheet.build(workbook)
DiscoveryProductionElementsLogs::AcquiredFootageAndStillsSheet.build(workbook, acquired_media_data)
DiscoveryProductionElementsLogs::MusicSheet.build(workbook, music_data)
DiscoveryProductionElementsLogs::TalentSheet.build(workbook, talent_data)
DiscoveryProductionElementsLogs::AppearanceSheet.build(workbook, appearance_data)
DiscoveryProductionElementsLogs::LocationSheet.build(workbook, location_data)
DiscoveryProductionElementsLogs::NameProductLogoSheet.build(workbook, material_data)
DiscoveryProductionElementsLogs::ProductIntegrationSheet.build(workbook)
end
def workbook
@workbook ||= package.workbook
end
def package
@package ||= Axlsx::Package.new
end
end
end
end

View File

@@ -0,0 +1,104 @@
module ExcelReports
module VideoReports
module DiscoveryProductionElementsLogs
class AcquiredFootageAndStillsSheet < ::ExcelReports::Worksheet
def title
"Acquired Footage & Stills"
end
def fill_content(sheet)
sheet.add_row ["ACQUIRED FOOTAGE/STILLS/ PUBLIC DOMAIN LOG (for all episodes/programs)"]
sheet.add_row [instructions]
sheet.add_row
sheet.add_row table_headers
sheet.add_row table_subheaders
data.each do |confirmation_data|
sheet.add_row [
confirmation_data.episode_number,
confirmation_data.episode_title,
confirmation_data.source_file_and_clip_names,
confirmation_data.timecode_in,
confirmation_data.timecode_out,
confirmation_data.duration,
confirmation_data.description,
licensor_with_phone_number(confirmation_data),
confirmation_data.applicable_media,
confirmation_data.territory,
confirmation_data.term,
confirmation_data.restrictions,
]
end
end
def format(sheet)
sheet.column_widths *column_widths
cells_to_merge.each { |cell| sheet.merge_cells cell }
end
def style(sheet)
sheet.add_style "A1", Styles::BOLD, { sz: 14 }
sheet.add_style "A2", { sz: 10 }
sheet.add_style "A4:L4", Styles::TABLE_HEADER
sheet.add_style "B5:L5", Styles::TABLE_HEADER
sheet.add_style "A4", Styles::WRAP_TEXT
sheet.add_style "L4", Styles::WRAP_TEXT
if data.any?
sheet.add_style "A#{data_start_index}:L#{data_end_index}", Styles::TABLE_DATA
end
end
private
def licensor_with_phone_number(confirmation)
[
confirmation.name,
confirmation.confirmation.releasable.person_phone
].reject(&:blank?)
.join("\n")
end
def data_start_index
6
end
def data_end_index
(data_start_index + data.size) - 1
end
def instructions
<<~INSTRUCTIONS
All licenses must conform to the DCI contractual requirements and must be fully executed.
Releases, licenses and agreements should only be logged once, based on the order of their appearance in the program.
If an image does not appear in the final Program, log that release after those in the final Program; indicate on the Log sheet NOT IN FINAL PROGRAM and list the camera tape only.
Refer to the source of all third party footage in the exact form as it appears on the release.
Please note that if it is not possible to deliver an English language agreement, an English language translation must accompany any agreement delivered in a foreign language (if applicable).
INSTRUCTIONS
end
def table_headers
["EPISODE NUMBER", "EPISODE TITLE", "CLIP #", "PROGRAM MASTER TC", "", "TOTAL TIME", "BRIEF VIDEO DESCRIPTION", "LICENSOR\n(incl phone number)", "EXPLOITABLE RIGHTS", "", "", "DCL Rights Waiver Uploaded?"]
end
def table_subheaders
["", "", "", "IN", "OUT", "", "", "", "MEDIA", "TERRITORY", "TERM", ""]
end
def column_widths
[10, 20, 25, 15, 15, 15, 20, 15, 15, 15, 15, 10]
end
def cells_to_merge
%w(
A1:M1 A2:M2 A4:A5 B4:B5 C4:C5 D4:E4 F4:F5 G4:G5 H4:H5 I4:K4 L4:L5
)
end
end
end
end
end

View File

@@ -0,0 +1,77 @@
module ExcelReports
module VideoReports
module DiscoveryProductionElementsLogs
class AppearanceSheet < ::ExcelReports::Worksheet
def title
"Appearance"
end
def fill_content(sheet)
sheet.add_row ["APPEARANCE LOG (for all episodes/programs)", "", "", "", "", ""]
sheet.add_row [instructions]
sheet.add_row
sheet.add_row ["EPISODE NUMBER(S) or LIST \"ALL\"", "EPISODE TITLE(S) or LIST \"ALL\"", "TIMECODE IN", "SOURCE TAPE / HARD DRIVE NUMBER", "NAME", "BRIEF VIDEO DESCRIPTION"]
data.each do |confirmation|
sheet.add_row [
confirmation.episode_number,
confirmation.episode_title,
confirmation.timecode_in,
confirmation.source_file_and_clip_names,
confirmation.name,
confirmation.description
]
end
sheet.add_row
sheet.add_row ["*On co-productions, releases & logs retained by Producer. Deliver upon request."]
end
def format(sheet)
sheet.column_widths *column_widths
cells_to_merge.each { |cell| sheet.merge_cells cell }
end
def style(sheet)
sheet.add_style "A1", Styles::BOLD, { sz: 14 }
sheet.add_style "A2", sz: 9
sheet.add_style "A4:F4", Styles::TABLE_HEADER
if data.any?
sheet.add_style "A#{data_start_index}:F#{data_end_index}", Styles::TABLE_DATA
end
end
private
def instructions
<<~INSTRUCTIONS
All licenses must conform to the DCI contractual requirements and must be fully executed.
Releases, licenses and agreements should only be logged once, based on the order of their appearance in the program.
If an image does not appear in the final Program, log that release after those in the final Program; indicate on the Log sheet NOT IN FINAL PROGRAM and list the camera tape only.
Please note that if it is not possible to deliver an English language agreement, an English language translation must accompany any agreement delivered in a foreign language (if applicable)."
INSTRUCTIONS
end
def data_start_index
5
end
def data_end_index
(data_start_index + data.size) - 1
end
def column_widths
[20, 25, 20, 20, 25, 30]
end
def cells_to_merge
%w[ A2:F2 ]
end
end
end
end
end

View File

@@ -0,0 +1,74 @@
module ExcelReports
module VideoReports
module DiscoveryProductionElementsLogs
class LocationSheet < ::ExcelReports::Worksheet
def title
"Location"
end
def fill_content(sheet)
sheet.add_row ["LOCATION LOG (for all episodes/programs)"]
sheet.add_row [instructions]
sheet.add_row
sheet.add_row table_headers
data.each do |confirmation|
sheet.add_row [
confirmation.episode_number,
confirmation.episode_title,
confirmation.timecode_in,
confirmation.source_file_and_clip_names,
[confirmation.name, confirmation.description].join(" ")
]
end
end
def format(sheet)
sheet.column_widths *column_widths
end
def style(sheet)
sheet.add_style "A1", Styles::BOLD, { sz: 14 }
sheet.add_style "A2", { sz: 9 }
sheet.add_style "A4:E4", Styles::TABLE_HEADER
sheet.add_style "A4:B4", Styles::WRAP_TEXT
sheet.add_style "D4", Styles::WRAP_TEXT
if data.any?
sheet.add_style "A#{data_start_index}:E#{data_end_index}", Styles::TABLE_DATA
end
end
private
def instructions
<<~INSTRUCTIONS
All licenses must conform to the DCI contractual requirements and must be fully executed.
Releases, licenses and agreements should only be logged once, based on the order of their appearance in the program.
If an image does not appear in the final Program, log that release after those in the final Program; indicate on the Log sheet "NOT IN FINAL PROGRAM" and list the camera tape only.
Please note that if it is not possible to deliver an English language agreement, an English language translation must accompany any agreement delivered in a foreign language (if applicable).
INSTRUCTIONS
end
def table_headers
["EPISODE NUMBER(S) or LIST \"ALL\"", "EPISODE TITLE(S) or LIST \"ALL\"", "TIMECODE IN", "SOURCE TAPE / HARD DRIVE NUMBER", "LOCATION NAME and BRIEF VIDEO DESCRIPTION"]
end
def column_widths
[20, 20, 15, 20, 40]
end
def data_start_index
5
end
def data_end_index
(data_start_index + data.size) - 1
end
end
end
end
end

View File

@@ -0,0 +1,61 @@
module ExcelReports
module VideoReports
module DiscoveryProductionElementsLogs
class MediaRightsCertificationSheet < ::ExcelReports::Worksheet
def title
"Media Rights Certification"
end
def fill_content(sheet)
sheet.add_row ["MEDIA RIGHTS CERTIFICATION (Required for final payment)", "", "", "", "", "", "", "", "", ""]
sheet.add_row ["By uploading this file I certify that:"]
sheet.add_row ["1) Check one"]
sheet.add_row ["", "Rights waivers have been submitted and approved by DCL for all Program elements with any restriction or limitation not permitted by the Programming Agreement (including, without limitation, all music, footage, photographic stills, graphics, talent, and releases)."]
sheet.add_row ["", "OR"]
sheet.add_row ["", "No rights waivers are required because all the Program elements are fully cleared or subject only to the restrictions or limitations permitted by the Programming Agreement."]
sheet.add_row ["AND"]
sheet.add_row ["2) Check one\n\nIn the event the Programming Agreement permits that third-party stills or stock footage can be licensed with certain term or media restrictions (e.g., 10 year license or no theatrical rights or US standard television rights), it is further certified that this Program (check one):"]
sheet.add_row ["", "Does contain third-party stills or stock footage secured subject to those restrictions."]
sheet.add_row ["", "OR"]
sheet.add_row ["", "Does not contain third-party stills or stock footage secured subject to those restrictions."]
sheet.add_row ["", "OR"]
sheet.add_row ["", "This Program does NOT contain any third-party stills or stock footage."]
sheet.add_row ["Submitted By _____________________________"]
sheet.add_row ["Uploading this document to the Producers Portal constitutes electronic signature"]
end
def format(sheet)
sheet.column_widths *column_widths
cells_to_merge.each { |cell| sheet.merge_cells cell }
end
def style(sheet)
sheet.add_style "A1", { sz: 18 }, Styles::BOLD, Styles::UNDERLINE
sheet.add_style "A2", { sz: 16 }, Styles::BOLD
sheet.add_style "A2", { sz: 12 }, Styles::BOLD
sheet.add_style "A7", { sz: 12 }, Styles::BOLD
sheet.add_style "A14", { sz: 12 }, Styles::BOLD
sheet.add_style "A15", { sz: 12 }, Styles::ITALIC, Styles::BOLD, Styles::COLOR_RED
sheet.add_style "B5", Styles::COLOR_BLUE
sheet.add_style "B10", Styles::COLOR_BLUE
sheet.add_style "B12", Styles::COLOR_BLUE
sheet.add_style "A8", Styles::WRAP_TEXT
sheet.add_style "B4", Styles::WRAP_TEXT
sheet.add_style "B6", Styles::WRAP_TEXT
end
private
def column_widths
[10, 20, 10, 10, 10, 10, 10, 10, 10, 10]
end
def cells_to_merge
%w[
A1:J1 A2:J2 A3:J3 B4:J4 B5:J5 B6:J6 A8:J8 B9:J9 B10:J10 B11:J11 B12:J12 B13:J13 A14:J14 A15:J15
]
end
end
end
end
end

View File

@@ -0,0 +1,67 @@
module ExcelReports
module VideoReports
module DiscoveryProductionElementsLogs
class MusicSheet < ::ExcelReports::Worksheet
def title
"Music"
end
def fill_content(sheet)
sheet.add_row ["MUSIC LOG (for all episodes/programs) for commissioned work-for-hire music only"]
sheet.add_row ["Not applicable if program contains 100% library"]
sheet.add_row ["Episode Title(s) or list \"All\"", "TRACK TITLE", "COMPOSER", "PUBLISHER"]
data.each do |confirmation_data|
sheet.add_row [
confirmation_data.episode_title,
confirmation_data.source_file_name,
composers(confirmation_data),
publishers(confirmation_data),
]
end
end
def format(sheet)
sheet.column_widths *column_widths
end
def style(sheet)
sheet.add_style "A1", Styles::BOLD, { sz: 14 }
sheet.add_style "A2", { sz: 14 }
sheet.add_style "A3:D3", Styles::TABLE_HEADER
sheet.add_style "A3", Styles::WRAP_TEXT
if has_data?
sheet.add_style "A#{data_start_index}:D#{data_end_index}", Styles::TABLE_DATA
end
end
private
def column_widths
[20, 20, 30, 60]
end
def has_data?
data.any?
end
def data_start_index
4
end
def data_end_index
(data_start_index + data.size) - 1
end
def composers(confirmation_data)
confirmation_data.confirmation.composer_info.split("|").join("\n")
end
def publishers(confirmation_data)
confirmation_data.confirmation.publisher_info.split("|").join("\n")
end
end
end
end
end

View File

@@ -0,0 +1,74 @@
module ExcelReports
module VideoReports
module DiscoveryProductionElementsLogs
class NameProductLogoSheet < ::ExcelReports::Worksheet
def title
"Name Product Logo"
end
def fill_content(sheet)
sheet.add_row ["NAME/PRODUCT/LOGO LOG (for all episodes/programs)"]
sheet.add_row [instructions]
sheet.add_row
sheet.add_row table_headers
data.each do |confirmation|
sheet.add_row [
confirmation.episode_number,
confirmation.episode_title,
confirmation.timecode_in,
confirmation.source_file_and_clip_names,
confirmation.name
]
end
end
def format(sheet)
sheet.column_widths *column_widths
end
def style(sheet)
sheet.add_style "A1", Styles::BOLD, { sz: 14 }
sheet.add_style "A2", { sz: 9 }
sheet.add_style "A4:E4", Styles::TABLE_HEADER
sheet.add_style "A4:B4", Styles::WRAP_TEXT
sheet.add_style "D4", Styles::WRAP_TEXT
if data.any?
sheet.add_style "A#{data_start_index}:E#{data_end_index}", Styles::TABLE_DATA
end
end
private
def instructions
<<~INSTRUCTIONS
All licenses must conform to the DCI contractual requirements and must be fully executed.
Releases, licenses and agreements should only be logged once, based on the order of their appearance in the program.
If an image does not appear in the final Program, log that release after those in the final Program; indicate on the Log sheet "NOT IN FINAL PROGRAM" and list the camera tape only.
Please note that if it is not possible to deliver an English language agreement, an English language translation must accompany any agreement delivered in a foreign language (if applicable).
INSTRUCTIONS
end
def table_headers
["EPISODE NUMBER(S) or LIST \"ALL\"", "EPISODE TITLE(S) or LIST \"ALL\"", "TIMECODE IN", "SOURCE TAPE / HARD DRIVE NUMBER", "PRODUCT/LOGO NAME"]
end
def column_widths
[15, 25, 15, 20, 40]
end
def data_start_index
5
end
def data_end_index
(data_start_index + data.size) - 1
end
end
end
end
end

View File

@@ -0,0 +1,56 @@
module ExcelReports
module VideoReports
module DiscoveryProductionElementsLogs
class ProductIntegrationSheet < ::ExcelReports::Worksheet
def title
"Product Integration"
end
def fill_content(sheet)
sheet.add_row ["Product Integration / Trade-Out Log"]
sheet.add_row [instructions]
sheet.add_row
sheet.add_row table_headers
sheet.add_row table_headers2
end
def format(sheet)
sheet.column_widths *column_widths
cells_to_merge.each { |cell| sheet.merge_cells cell }
end
def style(sheet)
sheet.add_style "A1", Styles::BOLD, { sz: 14 }
sheet.add_style "A2", Styles::BOLD, { sz: 12 }
sheet.add_style "A4:J4", Styles::TABLE_HEADER
sheet.add_style "A5:J5", Styles::TABLE_HEADER
sheet.add_style "A4:J4", Styles::WRAP_TEXT
sheet.add_style "A5:J5", Styles::WRAP_TEXT
sheet.add_style "I4:J4", Styles::BG_YELLOW
end
private
def instructions
"All contract agreements with companies providing trade-outs must be uploaded to the Producer's Portal"
end
def table_headers
["EPISODE #\nTitle\n(if applicable)", "PRODUCT ITEM(S)\n(ex: free airfare)", "COMPANY PROVIDING TRADE-OUT\n(ex: United Airlines)", "PRODUCT VALUE", "BUDGETED VALUE\nItem & Category in production budget", "OBLIGATIONS\n(ex: \"thanks to\" credit)", "AGREEMENT WITH COMPANY EXECUTION DATE", "DATE APPROVED BY DCI", "SELECT \"A\" OR \"B\"", ""]
end
def table_headers2
["", "", "", "", "", "", "", "", "A\nTrade will be savings to program List amount", "B\nTrade will be added value to program List amount"]
end
def column_widths
[15, 15, 15, 15, 15, 15, 15, 15, 15, 15]
end
def cells_to_merge
%w[ A4:A5 B4:B5 C4:C5 D4:D5 E4:E5 F4:F5 G4:G5 H4:H5 I4:J4 ]
end
end
end
end
end

View File

@@ -0,0 +1,49 @@
module ExcelReports
module VideoReports
module DiscoveryProductionElementsLogs
class TalentSheet < ::ExcelReports::Worksheet
def title
"Talent"
end
def fill_content(sheet)
sheet.add_row ["TALENT AGREEMENT LOG (for all episodes/programs)"]
sheet.add_row
sheet.add_row ["Episode Number(s) or list \"All\"", "Episode Title(s) or list \"All\"", "SERVICES", "NAME/COMPANY"]
data.each do |confirmation|
sheet.add_row [confirmation.episode_number, confirmation.episode_title, "", confirmation.name]
end
end
def format(sheet)
sheet.column_widths *column_widths
end
def style(sheet)
sheet.add_style "A1", Styles::BOLD, { sz: 14 }
sheet.add_style "A3:D3", Styles::TABLE_HEADER
sheet.add_style "A3", Styles::WRAP_TEXT
if data.any?
sheet.add_style "A#{data_start_index}:D#{data_end_index}", Styles::TABLE_DATA
end
end
private
def column_widths
[20, 20, 30, 60]
end
def data_start_index
4
end
def data_end_index
(data_start_index + data.size) - 1
end
end
end
end
end

View File

@@ -0,0 +1,61 @@
module ExcelReports
module VideoReports
class NatGeoLegalBinderLog
attr_reader :video
def initialize(video)
@video = video
end
def to_xls
build
package.to_stream.read
end
def filename
name = [video.file.filename.to_s, "legal-binder-log"].map(&:parameterize).join("_")
[name, "xlsx"].join(".")
end
private
def appearance_data
@appearance_data ||= data_for("AppearanceRelease")
end
def location_data
@location_data ||= data_for("LocationRelease")
end
def acquired_media_data
@acquired_media_data ||= data_for("AcquiredMediaRelease")
end
def data_for(release_type)
video.
video_release_confirmations.
where(releasable_type: release_type).
order(timecode_in: :asc).
map { |confirmation| ExcelReports::VideoReports::ReleasableDataAdapter.new(confirmation) }
end
def build
NatGeoLegalBinderLogs::LegalBinderChecklistSheet.build(workbook, [], video)
NatGeoLegalBinderLogs::AppearanceReleaseLogSheet.build(workbook, appearance_data)
NatGeoLegalBinderLogs::LocationReleaseLogSheet.build(workbook, location_data)
NatGeoLegalBinderLogs::AcquiredFootageLogSheet.build(workbook, acquired_media_data)
NatGeoLegalBinderLogs::ThirdPartyContractLogSheet.build(workbook, [])
NatGeoLegalBinderLogs::ProductionPersonnelLogSheet.build(workbook, [])
end
def workbook
@workbook ||= package.workbook
end
def package
@package ||= Axlsx::Package.new
end
end
end
end

View File

@@ -0,0 +1,78 @@
module ExcelReports
module VideoReports
module NatGeoLegalBinderLogs
class AcquiredFootageLogSheet < Worksheet
def title
"Acquired Footage-Stills Log"
end
def fill_content(sheet)
sheet.add_row
sheet.add_row
sheet.add_row(["", "", "", "", "", "RIGHTS OBTAINED", "", "", ""])
sheet.add_row(table_headers)
data.each_with_index do |confirmation, index|
sheet.add_row [
index + 1,
confirmation.description,
confirmation.timecode_in,
confirmation.timecode_out,
[confirmation.name, confirmation.contact_address].join("\n"),
confirmation.applicable_media,
confirmation.territory,
confirmation.term,
confirmation.restrictions,
]
end
end
def format(sheet)
sheet.column_widths *column_widths
cells_to_merge.each { |cell| sheet.merge_cells cell }
end
def style(sheet)
sheet.add_style "F3", Styles::BOLD, Styles::FULLY_CENTERED, Styles::BG_GRAY, Styles::THIN_BLACK_BORDER
sheet.add_style "A4:I4", Styles::BOLD, Styles::FULLY_CENTERED, Styles::THIN_BLACK_BORDER, Styles::WRAP_TEXT
if data.any?
sheet.add_style "A#{data_start_index}:I#{data_end_index}", Styles::THIN_BLACK_BORDER
end
end
private
def table_headers
[
"Contract Number",
"Brief description of footage or stills",
"Program Master Timecode IN",
"Program Master Timecode OUT",
"Vendor Name and Contact Information",
"Media",
"Territory",
"Term",
"Restrictions",
]
end
def data_start_index
5
end
def data_end_index
(data_start_index + data.size) - 1
end
def column_widths
[12, 25, 22, 22, 28, 18, 22, 22, 25]
end
def cells_to_merge
%w(F3:I3)
end
end
end
end
end

View File

@@ -0,0 +1,82 @@
module ExcelReports
module VideoReports
module NatGeoLegalBinderLogs
class AppearanceReleaseLogSheet < Worksheet
def title
"Appearance Release Log"
end
def fill_content(sheet)
instructions1 = "PLEASE ARRANGE CONTRACTS IN ORDER OF FIRST APPEARANCE IN FINAL PROGRAM."
instructions2 = "PLEASE INCLUDE ALL CONTRACTS SECURED FOR THE PROGRAM INCLUDING THOSE FOR ALL DIGITAL SOCIAL CONTENT."
instructions3 = "IF INDIVIDUAL DID NOT APPEAR IN THE FINAL SHOW, PLEASE INDICATE \"NOT IN FINAL PROGRAM\" UNDER TIME CODE COLUMN & LIST ALPHABETICALLY."
sheet.add_row([instructions1])
sheet.add_row([instructions2])
sheet.add_row([instructions3])
sheet.add_row
sheet.add_row(["", "", "", "RIGHTS OBTAINED", "", "", "", "", ""])
sheet.add_row(table_headers)
data.each_with_index do |confirmation, index|
sheet.add_row [
index + 1,
confirmation.timecode_in,
[confirmation.name, confirmation.contact_address].join("\n"),
confirmation.applicable_media,
confirmation.territory,
confirmation.term,
"",
confirmation.restrictions,
]
end
end
def format(sheet)
sheet.column_widths *column_widths
cells_to_merge.each { |cell| sheet.merge_cells cell }
end
def style(sheet)
sheet.add_style "D5", Styles::BOLD, Styles::FULLY_CENTERED, Styles::BG_GRAY, Styles::THIN_BLACK_BORDER
sheet.add_style "A6:H6", Styles::BOLD, Styles::FULLY_CENTERED, Styles::THIN_BLACK_BORDER, Styles::WRAP_TEXT
if data.any?
sheet.add_style "A#{data_start_index}:H#{data_end_index}", Styles::THIN_BLACK_BORDER
end
end
private
def table_headers
[
"Contract Number",
"Program Master Timecode",
"Person's Name and Contact Information",
"Media",
"Territory",
"Term",
"Program Specific Y/N",
"Restrictions"
]
end
def data_start_index
7
end
def data_end_index
(data_start_index + data.size) - 1
end
def column_widths
[12, 25, 30, 30, 30, 30, 15, 30]
end
def cells_to_merge
%w(A1:F1 A2:F2 A3:F3 D5:H5)
end
end
end
end
end

View File

@@ -0,0 +1,50 @@
module ExcelReports
module VideoReports
module NatGeoLegalBinderLogs
class LegalBinderChecklistSheet < Worksheet
def title
"Legal Binder Checklist"
end
def fill_content(sheet)
sheet.add_row ["SERIES TITLE:", ""]
sheet.add_row ["EPISODE NUMBER:", header_data.number]
sheet.add_row ["EPISODE TITLE:", header_data.name]
sheet.add_row
sheet.add_row
sheet.add_row ["", "INCLUDED", "PENDING", "N/A", "COMMENTS"]
sheet.add_row ["COPY OF CREDIT LIST", "", "", "", ""]
sheet.add_row ["COPY OF MUSIC CUE SHEET", "", "", "", ""]
sheet.add_row ["COPY OF E&O CERTIFICATE", "", "", "", ""]
sheet.add_row ["APPEARANCE RELEASES + LOG", "", "", "", ""]
sheet.add_row ["LOCATION RELEASES/PERMITS + LOG", "", "", "", ""]
sheet.add_row ["ACQUIRED FOOTAGE/STILLS CONTRACTS + LOG", "", "", "", ""]
sheet.add_row ["THIRD PARTY CONTRACTS (GRAPHICS, COMPOSER, MUSIC LIBRARY, NARRATOR, TALENT) + LOG", "", "", "", ""]
sheet.add_row ["PRODUCTION PERSONNEL LOG", "", "", "", ""]
end
def format(sheet)
sheet.column_widths *column_widths
cells_to_merge.each { |cell| sheet.merge_cells cell }
end
def style(sheet)
sheet.add_style "A1:A3", Styles::BOLD, { sz: 14 }
sheet.add_style "B6:E6", Styles::BOLD, Styles::THIN_BLACK_BORDER, Styles::FULLY_CENTERED, { sz: 10 }
sheet.add_style "A7:A14", Styles::BOLD, Styles::THIN_BLACK_BORDER, Styles::WRAP_TEXT, { sz: 10 }
sheet.add_style "B7:E14", Styles::THIN_BLACK_BORDER
end
private
def column_widths
[30, 12, 12, 10, 25]
end
def cells_to_merge
%w(B1:D1 B2:D2 B3:D3)
end
end
end
end
end

View File

@@ -0,0 +1,84 @@
module ExcelReports
module VideoReports
module NatGeoLegalBinderLogs
class LocationReleaseLogSheet < Worksheet
def title
"Location Release Log"
end
def fill_content(sheet)
instructions1 = "PLEASE ARRANGE CONTRACTS IN ORDER OF FIRST APPEARANCE IN FINAL PROGRAM."
instructions2 = "PLEASE INCLUDE ALL CONTRACTS SECURED FOR THE PROGRAM INCLUDING THOSE FOR ALL DIGITAL SOCIAL CONTENT."
instructions3 = "IF INDIVIDUAL DID NOT APPEAR IN THE FINAL SHOW, PLEASE INDICATE \"NOT IN FINAL PROGRAM\" UNDER TIME CODE COLUMN & LIST ALPHABETICALLY."
sheet.add_row([instructions1])
sheet.add_row([instructions2])
sheet.add_row([instructions3])
sheet.add_row
sheet.add_row(["", "", "", "RIGHTS OBTAINED", "", "", "", "", ""])
sheet.add_row(table_headers)
data.each_with_index do |confirmation, index|
sheet.add_row [
index + 1,
confirmation.timecode_in,
[confirmation.name, confirmation.confirmation.releasable.address].join("\n"),
"",
confirmation.applicable_media,
confirmation.territory,
confirmation.term,
"",
confirmation.restrictions,
]
end
end
def format(sheet)
sheet.column_widths *column_widths
cells_to_merge.each { |cell| sheet.merge_cells cell }
end
def style(sheet)
sheet.add_style "D5", Styles::BOLD, Styles::FULLY_CENTERED, Styles::BG_GRAY, Styles::THIN_BLACK_BORDER
sheet.add_style "A6:I6", Styles::BOLD, Styles::FULLY_CENTERED, Styles::THIN_BLACK_BORDER, Styles::WRAP_TEXT
if data.any?
sheet.add_style "A#{data_start_index}:I#{data_end_index}", Styles::THIN_BLACK_BORDER
end
end
private
def table_headers
[
"Contract Number",
"Program Master Timecode",
"Location's Name and Contact Information",
"Permit and/or Location Cost",
"Media",
"Territory",
"Term",
"Program Specific Y/N",
"Restrictions"
]
end
def data_start_index
7
end
def data_end_index
(data_start_index + data.size) - 1
end
def column_widths
[12, 25, 35, 35, 30, 30, 30, 15, 30]
end
def cells_to_merge
%w(A1:F1 A2:F2 A3:F3 D5:I5)
end
end
end
end
end

View File

@@ -0,0 +1,50 @@
module ExcelReports
module VideoReports
module NatGeoLegalBinderLogs
class ProductionPersonnelLogSheet < Worksheet
def title
"Production Personnel Log"
end
def fill_content(sheet)
sheet.add_row
sheet.add_row
sheet.add_row(table_headers)
sheet.add_row(["Producer", "", "", ""])
sheet.add_row(["Director", "", "", ""])
sheet.add_row(["Writer", "", "", ""])
sheet.add_row(["Editor", "", "", ""])
sheet.add_row(["Assistant Producer", "", "", ""])
sheet.add_row(["Production Manager", "", "", ""])
sheet.add_row(["Camera", "", "", ""])
sheet.add_row(["Audio", "", "", ""])
sheet.add_row(["Local Coordinator/Location Manager", "", "", ""])
end
def format(sheet)
sheet.column_widths *column_widths
end
def style(sheet)
sheet.add_style "A3:D3", Styles::BOLD, Styles::FULLY_CENTERED, Styles::THIN_BLACK_BORDER
sheet.add_style "A4:D12", Styles::FULLY_CENTERED, Styles::THIN_BLACK_BORDER, Styles::WRAP_TEXT
end
private
def table_headers
[
"Title",
"Name",
"Company",
"Contact Info (Address/Email/Phone)",
]
end
def column_widths
[30, 30, 35, 35]
end
end
end
end
end

View File

@@ -0,0 +1,61 @@
module ExcelReports
module VideoReports
module NatGeoLegalBinderLogs
class ThirdPartyContractLogSheet < Worksheet
def title
"Third Party Contract Log"
end
def fill_content(sheet)
sheet.add_row
sheet.add_row
sheet.add_row(["", "", "RIGHTS OBTAINED", "", "", "", ""])
sheet.add_row(table_headers)
sheet.add_row(["Graphics", "", "", "", "", "", ""])
sheet.add_row(["Composer", "", "", "", "", "", ""])
sheet.add_row(["Music Library", "", "", "", "", "", ""])
sheet.add_row(["Narrator", "", "", "", "", "", ""])
sheet.add_row(["Talent", "", "", "", "", "", ""])
sheet.add_row(["Equipment and/or Vehicle Rental (only applicable if equipment/vehicle appears on camera and contract contains rights language)", "", "", "", "", "", ""])
sheet.add_row(["Production Facility (only applicable if contract contains rights language)", "", "", "", "", "", ""])
sheet.add_row(["Post Production Facility (only applicable if contract contains rights language)", "", "", "", "", "", ""])
sheet.add_row(["Other Facilities (only applicable if contract contains rights language)", "", "", "", "", "", ""])
end
def format(sheet)
sheet.column_widths *column_widths
cells_to_merge.each { |cell| sheet.merge_cells cell }
end
def style(sheet)
sheet.add_style "C3", Styles::BOLD, Styles::FULLY_CENTERED, Styles::BG_GRAY, Styles::THIN_BLACK_BORDER
sheet.add_style "A4:G4", Styles::BOLD, Styles::FULLY_CENTERED, Styles::THIN_BLACK_BORDER
sheet.add_style "A5:A13", Styles::FULLY_CENTERED, Styles::THIN_BLACK_BORDER, Styles::WRAP_TEXT
sheet.add_style "B5:G13", Styles::FULLY_CENTERED, Styles::THIN_BLACK_BORDER
end
private
def table_headers
[
"Brief Description of Services",
"3rd Party Name and Contact Information",
"Media",
"Territory",
"Term",
"Program Specific Y/N",
"Restrictions",
]
end
def column_widths
[25, 30, 20, 20, 20, 15, 20]
end
def cells_to_merge
%w(C3:G3)
end
end
end
end
end

View File

@@ -0,0 +1,73 @@
module ExcelReports
module VideoReports
class ReleasableDataAdapter
attr_reader :confirmation
delegate :video, to: :confirmation
def initialize(release_confirmation)
@confirmation = release_confirmation
end
def description
confirmation.description || confirmation.video.project.description
end
def episode_number
video.number
end
def episode_title
video.name
end
def name
confirmation.releasable.name
end
def source_file_name
confirmation.source_file_name
end
def clip_name
confirmation.clip_name
end
def source_file_and_clip_names
[source_file_name, clip_name].reject(&:blank?).join(" - ")
end
def timecode_in
confirmation.timecode_in
end
def timecode_out
confirmation.timecode_out
end
def duration
confirmation.duration
end
def contact_address
confirmation.releasable.contact_person.address.to_s
end
def applicable_media
confirmation.releasable.applicable_medium_value
end
def territory
confirmation.releasable.territory_value
end
def term
confirmation.releasable.term_value
end
def restrictions
confirmation.releasable.restriction_value
end
end
end
end

View File

@@ -0,0 +1,53 @@
module ExcelReports
class Worksheet
attr_accessor :workbook, :data, :header_data
def self.build(workbook, data = nil, header_data = nil)
new(workbook, data, header_data).tap do |worksheet|
worksheet.build
end
end
def initialize(workbook, data = nil, header_data = nil)
@workbook = workbook
@data = data
@header_data = header_data
end
def build
workbook.add_worksheet(name: title) do |sheet|
fill_content(sheet)
format(sheet)
style(sheet)
end
end
module Styles
def self.merge_all(*styles)
styles.each_with_object({}) { |style, combined| combined.deep_merge!(style) }
end
BOLD = { b: true }
ITALIC = { i: true }
UNDERLINE = { u: true }
BG_GRAY = { bg_color: "C0C0C0" }
BG_LIGHT_BLUE = { bg_color: "97CBFC" }
BG_YELLOW = { bg_color: "FFFF9E" }
COLOR_WHITE = { fg_color: "FFFFFF" }
COLOR_BLUE = { fg_color: "0000FF" }
COLOR_RED = { fg_color: "FF0000" }
THIN_BLACK_BORDER = { border: { style: :thin, color: "000000" } }
THICK_BLACK_BORDER = { border: { style: :thick, color: "000000" } }
VERTICAL_CENTER = { alignment: { vertical: :center } }
HORIZONTAL_CENTER = { alignment: { horizontal: :center } }
HORIZONTAL_LEFT = { alignment: { horizontal: :left } }
HORIZONTAL_RIGHT = { alignment: { horizontal: :right } }
FULLY_CENTERED = merge_all(HORIZONTAL_CENTER, VERTICAL_CENTER)
WRAP_TEXT = { alignment: { wrap_text: true } }
TABLE_HEADER = merge_all(Styles::BG_LIGHT_BLUE, Styles::BOLD, Styles::THICK_BLACK_BORDER, Styles::FULLY_CENTERED, Styles::WRAP_TEXT, { sz: 8 })
TABLE_DATA = merge_all(Styles::THICK_BLACK_BORDER, Styles::WRAP_TEXT, { sz: 10 })
PROGRAM_HEADER = merge_all(Styles::BG_LIGHT_BLUE, Styles::BOLD, Styles::THICK_BLACK_BORDER, Styles::HORIZONTAL_CENTER, Styles::WRAP_TEXT, { sz: 12 })
HEADER_DATA = merge_all(Styles::THICK_BLACK_BORDER, Styles::WRAP_TEXT, Styles::HORIZONTAL_LEFT, { sz: 10 })
end
end
end