Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
561 commits
Select commit Hold shift + click to select a range
9ca1167
posts details
Judobob Feb 2, 2021
1bb2c97
posts details
Judobob Feb 2, 2021
4c17ffb
posts details
Judobob Feb 3, 2021
de886c2
posts details
Judobob Feb 3, 2021
ea5436a
posts details
Judobob Feb 3, 2021
5280b05
posts details
Judobob Feb 3, 2021
7650b18
posts details
Judobob Feb 3, 2021
f836395
posts details
Judobob Feb 3, 2021
5c445a9
posts details
Judobob Feb 3, 2021
c627a92
posts details
Judobob Feb 3, 2021
fe12ba1
posts details
Judobob Feb 3, 2021
d8334ea
posts details
Judobob Feb 3, 2021
fb7a1f7
posts details
Judobob Feb 3, 2021
d56211f
posts details
Judobob Feb 3, 2021
75473df
posts details
Judobob Feb 3, 2021
346debe
posts details
Judobob Feb 3, 2021
d4e6ab1
posts details
Judobob Feb 3, 2021
d7c62e3
posts details
Judobob Feb 3, 2021
e7fe736
posts details
Judobob Feb 3, 2021
7088525
posts details
Judobob Feb 3, 2021
573dfaa
posts details
Judobob Feb 3, 2021
99b4a88
posts details
Judobob Feb 3, 2021
2acb2ec
posts details
Judobob Feb 3, 2021
4b852e5
posts details
Judobob Feb 3, 2021
b8bafd4
posts details
Judobob Feb 3, 2021
d53f24b
posts details
Judobob Feb 3, 2021
ca1767d
posts details
Judobob Feb 3, 2021
6a1c22a
posts details
Judobob Feb 3, 2021
849bf17
dashboard details
Judobob Feb 3, 2021
1329b88
dashboard details
Judobob Feb 4, 2021
0bb45e9
dashboard details
Judobob Feb 4, 2021
96c6f41
dashboard details
Judobob Feb 4, 2021
0ecea12
dashboard details
Judobob Feb 4, 2021
5fb9ab4
dashboard details
Judobob Feb 4, 2021
0d76e68
dashboard details
Judobob Feb 4, 2021
0b17f9a
dashboard details
Judobob Feb 4, 2021
ebb8499
dashboard details
Judobob Feb 4, 2021
41d1f52
dashboard details
Judobob Feb 4, 2021
0fa6c1b
dashboard details
Judobob Feb 4, 2021
6df3fdc
dashboard details
Judobob Feb 4, 2021
c7d0a88
dashboard details
Judobob Feb 4, 2021
32dd94f
dashboard details
Judobob Feb 4, 2021
3274925
dashboard details
Judobob Feb 4, 2021
d2c1d4b
dashboard details
Judobob Feb 4, 2021
1e9ea05
dashboard details
Judobob Feb 4, 2021
ba534d1
dashboard details
Judobob Feb 5, 2021
07f9c37
dashboard details
Judobob Feb 5, 2021
d7a7709
dashboard details
Judobob Feb 5, 2021
d56e306
dashboard details
Judobob Feb 5, 2021
9ec1316
concept eval
Judobob Feb 5, 2021
7867e40
concept eval
Judobob Feb 5, 2021
0461132
concept eval
Judobob Feb 5, 2021
85718d3
concept eval
Judobob Feb 5, 2021
9471c6b
concept eval
Judobob Feb 5, 2021
ca573ec
concept eval
Judobob Feb 5, 2021
ed64ace
concept eval
Judobob Feb 5, 2021
458aa8b
concept eval
Judobob Feb 8, 2021
7a1049d
concept eval
Judobob Feb 8, 2021
d82933a
concept eval
Judobob Feb 8, 2021
ba4f0c0
concept eval
Judobob Feb 8, 2021
e3f7a55
concept eval
Judobob Feb 8, 2021
574dcd0
scale
Judobob Feb 8, 2021
50ee8ff
scale
Judobob Feb 8, 2021
ffabec0
scale
Judobob Feb 8, 2021
deec1d2
scale
Judobob Feb 8, 2021
20e6dde
scale
Judobob Feb 8, 2021
b3e9b91
scale
Judobob Feb 9, 2021
dc07ff6
scale
Judobob Feb 9, 2021
d5f03b2
scale
Judobob Feb 9, 2021
af416d9
move logic from templater
Judobob Feb 11, 2021
e1efe78
image logo
Judobob Feb 11, 2021
3c3243a
image logo
Judobob Feb 11, 2021
884e485
page numbers
Judobob Feb 11, 2021
df2c323
page numbers
Judobob Feb 11, 2021
87bca34
page numbers
Judobob Feb 11, 2021
703dfcb
page numbers
Judobob Feb 11, 2021
6c74fa4
page numbers
Judobob Feb 12, 2021
de8383b
style multi images
Judobob Feb 12, 2021
f2b3416
style multi images
Judobob Feb 12, 2021
10b07b3
style multi images
Judobob Feb 12, 2021
7e5c10d
style multi images
Judobob Feb 12, 2021
eb78db6
style multi images
Judobob Feb 12, 2021
5bc3e19
style multi images
Judobob Feb 12, 2021
93a2dbd
style multi images
Judobob Feb 12, 2021
dd66bb1
style multi images
Judobob Feb 12, 2021
ce8d448
style multi images
Judobob Feb 12, 2021
34f3776
style multi images
Judobob Feb 12, 2021
1bc5048
style multi images
Judobob Feb 12, 2021
7312d11
style multi images
Judobob Feb 12, 2021
6a5d146
style multi images
Judobob Feb 12, 2021
8244feb
style multi images
Judobob Feb 12, 2021
2071dad
style multi images
Judobob Feb 12, 2021
aaefec9
style multi images
Judobob Feb 12, 2021
7295f89
style multi images
Judobob Feb 12, 2021
ff5aa56
style multi images
Judobob Feb 12, 2021
d63bc9c
style multi images
Judobob Feb 12, 2021
9c16484
style multi images
Judobob Feb 12, 2021
418fba0
style multi images
Judobob Feb 12, 2021
3c3b141
style multi images
Judobob Feb 12, 2021
ca1ed67
style multi images
Judobob Feb 12, 2021
7634d51
style multi images
Judobob Feb 12, 2021
2011aa6
style multi images
Judobob Feb 12, 2021
ec4eabe
style multi images
Judobob Feb 12, 2021
48cd9c2
style multi images
Judobob Feb 12, 2021
789401f
style multi images
Judobob Feb 12, 2021
4678e30
style multi images
Judobob Feb 12, 2021
0fb7211
style multi images
Judobob Feb 15, 2021
6b01ffd
style multi images
Judobob Feb 15, 2021
94b3666
style multi images
Judobob Feb 15, 2021
4f06e95
style multi images
Judobob Feb 15, 2021
68e06bf
style multi images
Judobob Feb 15, 2021
f6fa420
style multi images
Judobob Feb 15, 2021
23a7e4c
style multi images
Judobob Feb 15, 2021
c644c12
style multi images
Judobob Feb 15, 2021
10f2618
style multi images
Judobob Feb 15, 2021
539f6f2
style multi images
Judobob Feb 15, 2021
7111279
style multi images
Judobob Feb 15, 2021
6b6988d
style multi images
Judobob Feb 15, 2021
194b4e4
style multi images
Judobob Feb 15, 2021
d9cd7e0
style multi images
Judobob Feb 15, 2021
2689bcf
style multi images
Judobob Feb 15, 2021
6ab1aa9
style multi images
Judobob Feb 15, 2021
26f59fd
style multi images
Judobob Feb 15, 2021
a10abdc
style multi images
Judobob Feb 15, 2021
cb16d1b
style multi images
Judobob Feb 15, 2021
bad8edf
style multi images
Judobob Feb 15, 2021
b2d3d40
style multi images
Judobob Feb 15, 2021
6286776
style multi images
Judobob Feb 15, 2021
353851c
style multi images
Judobob Feb 15, 2021
6fdafae
dashboard
Judobob Feb 16, 2021
36993cb
dashboard
Judobob Feb 16, 2021
94ee937
dashboard
Judobob Feb 16, 2021
c7327b6
dashboard
Judobob Feb 16, 2021
d8fe009
dashboard
Judobob Feb 16, 2021
4e67229
dashboard
Judobob Feb 16, 2021
b106874
dashboard
Judobob Feb 16, 2021
39ea9f2
dashboard
Judobob Feb 16, 2021
1b22448
dashboard
Judobob Feb 16, 2021
b69b678
dashboard
Judobob Feb 16, 2021
f7df2a4
dashboard
Judobob Feb 16, 2021
a351541
dashboard
Judobob Feb 16, 2021
85681f0
dashboard
Judobob Feb 16, 2021
dc051ac
dashboard
Judobob Feb 16, 2021
34642fd
dashboard
Judobob Feb 16, 2021
2286755
dashboard
Judobob Feb 16, 2021
82cafb4
dashboard
Judobob Feb 16, 2021
8e7bec5
dashboard
Judobob Feb 16, 2021
7b92f92
dashboard
Judobob Feb 16, 2021
f47929e
dashboard
Judobob Feb 16, 2021
acd1390
dashboard
Judobob Feb 16, 2021
7900d66
dashboard
Judobob Feb 16, 2021
d304502
dashboard
Judobob Feb 16, 2021
6bfedcf
dashboard
Judobob Feb 16, 2021
b051f5d
dashboard
Judobob Feb 16, 2021
a0823e1
dashboard
Judobob Feb 16, 2021
c5cca29
dashboard
Judobob Feb 16, 2021
d42d8ff
dashboard
Judobob Feb 16, 2021
495409d
dashboard
Judobob Feb 16, 2021
9474b38
dashboard
Judobob Feb 16, 2021
3f950ba
concept height
Judobob Feb 18, 2021
e48cc38
concept height
Judobob Feb 18, 2021
d1a771c
concept height
Judobob Feb 18, 2021
4160b7a
concept height
Judobob Feb 18, 2021
3fee68b
image dimensions
Judobob Feb 19, 2021
8ac67e7
image dimensions
Judobob Feb 19, 2021
40636a7
image dimensions
Judobob Feb 19, 2021
3e57554
image dimensions
Judobob Feb 19, 2021
6d02771
image dimensions
Judobob Feb 19, 2021
c674ac0
image dimensions
Judobob Feb 19, 2021
0d42303
image dimensions
Judobob Feb 19, 2021
438ad8c
image dimensions
Judobob Feb 19, 2021
a6eb85b
image dimensions
Judobob Feb 19, 2021
5f74519
image dimensions
Judobob Feb 19, 2021
0703229
image dimensions
Judobob Feb 19, 2021
35de390
image dimensions
Judobob Feb 19, 2021
b41a3ba
image dimensions
Judobob Feb 19, 2021
04ef0c4
image dimensions
Judobob Feb 19, 2021
562b688
image dimensions
Judobob Feb 19, 2021
f769260
image dimensions
Judobob Feb 19, 2021
0a1e666
image dimensions
Judobob Feb 19, 2021
1ba463d
image dimensions
Judobob Feb 19, 2021
b899b84
image dimensions
Judobob Feb 19, 2021
500f5bc
image dimensions
Judobob Feb 19, 2021
8477e03
image dimensions
Judobob Feb 19, 2021
be513b5
image dimensions
Judobob Feb 19, 2021
61a1f83
image dimensions
Judobob Feb 19, 2021
a7118ca
image dimensions
Judobob Feb 19, 2021
f33ea3f
image dimensions
Judobob Feb 19, 2021
67e0375
image dimensions
Judobob Feb 19, 2021
307114c
image dimensions
Judobob Feb 19, 2021
47880bc
image dimensions
Judobob Feb 19, 2021
d0822a7
image dimensions
Judobob Feb 19, 2021
6e3a72d
image dimensions
Judobob Feb 19, 2021
8bd636e
image dimensions
Judobob Feb 19, 2021
1957840
image dimensions
Judobob Feb 19, 2021
3095a13
image dimensions
Judobob Feb 19, 2021
b9ef3a2
image dimensions
Judobob Feb 19, 2021
13bcf3d
dashboard.xml seconds
Judobob Feb 22, 2021
da5a4c1
update box colour
Judobob Feb 23, 2021
7c8897c
woek sans semi bold
Judobob Feb 25, 2021
b5a8590
woek sans semi bold
Judobob Feb 25, 2021
c11afe5
woek sans semi bold
Judobob Feb 25, 2021
9446d16
woek sans semi bold
Judobob Feb 25, 2021
b137496
font size dashboard user
Judobob Feb 26, 2021
2d3856b
collage filters
Judobob Feb 26, 2021
b43c60f
collage filters
Judobob Feb 26, 2021
505e099
collage filters
Judobob Feb 26, 2021
a14eb2f
collage filters
Judobob Feb 26, 2021
94b66a8
collage filters
Judobob Feb 26, 2021
192ca19
collage filters
Judobob Feb 26, 2021
8d89f72
collage filters
Judobob Feb 26, 2021
62725cd
collage filters
Judobob Feb 26, 2021
a602b56
collage filters
Judobob Feb 26, 2021
faaf5a6
collage filters
Judobob Feb 26, 2021
7f6f2a6
collage filters
Judobob Feb 26, 2021
fa7866e
collage filters
Judobob Feb 26, 2021
e966443
gallery template
Judobob Mar 1, 2021
6de4130
gallery template
Judobob Mar 1, 2021
587f427
gallery template
Judobob Mar 1, 2021
04b9e17
gallery template
Judobob Mar 1, 2021
ad73771
gallery template
Judobob Mar 1, 2021
9498ee6
gallery template
Judobob Mar 1, 2021
edfb88e
gallery template
Judobob Mar 1, 2021
60acc89
gallery template
Judobob Mar 1, 2021
84937ec
comments
Judobob Mar 2, 2021
036094f
comments
Judobob Mar 2, 2021
60ade71
comments
Judobob Mar 2, 2021
3948c47
comments
Judobob Mar 2, 2021
2030c56
post comments in gallery
Judobob Mar 4, 2021
db69d76
post comments in gallery
Judobob Mar 4, 2021
08b6edc
post comments in gallery
Judobob Mar 4, 2021
4d4f5d2
post comments in gallery
Judobob Mar 4, 2021
9eef906
post comments in gallery
Judobob Mar 4, 2021
ae4a3e8
post comments in gallery
Judobob Mar 4, 2021
fee7bd6
post comments in gallery
Judobob Mar 4, 2021
70a92aa
post comments in gallery
Judobob Mar 4, 2021
5b54430
post comments in gallery
Judobob Mar 4, 2021
039e0ee
post comments in gallery
Judobob Mar 4, 2021
38a05ef
post comments in gallery
Judobob Mar 4, 2021
7c1d250
post comments in gallery
Judobob Mar 4, 2021
accf9e0
post questions in gallery
Judobob Mar 5, 2021
d2c15f8
post comments in gallery
Judobob Mar 5, 2021
a82cc1a
post comments in gallery
Judobob Mar 5, 2021
cf4ec9d
post comments in gallery
Judobob Mar 5, 2021
3d92c47
make relationship to layout extend beyond 11
Judobob Mar 8, 2021
40cdf1c
line breaks in gallery
Judobob Mar 8, 2021
ef1b104
line breaks in gallery
Judobob Mar 8, 2021
56f6cd8
page number extend
Judobob Mar 8, 2021
20eb42c
page number extend
Judobob Mar 8, 2021
7ad2e1a
page number extend
Judobob Mar 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/powerpoint.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
require "powerpoint/version"
require 'powerpoint/util'
require 'powerpoint/slide/intro'
require 'powerpoint/slide/extended_intro'
require 'powerpoint/slide/multiple_image'
require 'powerpoint/slide/comment'
require 'powerpoint/slide/gallery'
require 'powerpoint/slide/concept'
require 'powerpoint/slide/collage'
require 'powerpoint/slide/image'
require 'powerpoint/slide/textual'
require 'powerpoint/slide/pictorial'
require 'powerpoint/slide/text_picture_split'
require 'powerpoint/slide/picture_description'
require 'powerpoint/slide/dashboard_user'
require 'powerpoint/slide/dashboard'
require 'powerpoint/compression'
require 'powerpoint/presentation'


module Powerpoint
ROOT_PATH = File.expand_path("../..", __FILE__)
TEMPLATE_PATH = "#{ROOT_PATH}/template/"
Expand Down
44 changes: 43 additions & 1 deletion lib/powerpoint/presentation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ def add_intro(title, subtitile = nil)
end
end

def add_extended_intro(title, image_path, image_path_2,subtitle = nil,subtitle_2 = nil, coords = {})
existing_intro_slide = @slides.select {|s| s.class == Powerpoint::Slide::ExtendedIntro}[0]
slide = Powerpoint::Slide::ExtendedIntro.new(presentation: self, title: title, subtitle: subtitle, image_path: image_path, image_path_2: image_path_2, subtitle_2: subtitle_2, coords: coords)
if existing_intro_slide
@slides[@slides.index(existing_intro_slide)] = slide
else
@slides.insert 0, slide
end
end

def add_textual_slide(title, content = [])
@slides << Powerpoint::Slide::Textual.new(presentation: self, title: title, content: content)
end
Expand All @@ -38,6 +48,38 @@ def add_picture_description_slide(title, image_path, content = [])
@slides << Powerpoint::Slide::DescriptionPic.new(presentation: self, title: title, image_path: image_path, content: content)
end

def add_multiple_image_slide(title, subtitle = nil, page_number, logo, task_icon ,images)
@slides << Powerpoint::Slide::MultipleImage.new(presentation: self, title: title, subtitle: subtitle, page_number: page_number, task_icon: task_icon, logo: logo, images: images)
end

def add_comment_slide(title, subtitle = nil, user, page_number, logo, task_icon ,comments)
@slides << Powerpoint::Slide::Comment.new(presentation: self, title: title, subtitle: subtitle, user: user, page_number: page_number, task_icon: task_icon, logo: logo, comments: comments)
end

def add_gallery_slide(title, subtitle = nil, question, page_number, logo, task_icon ,images)
@slides << Powerpoint::Slide::Gallery.new(presentation: self, title: title, subtitle: subtitle, question: question, page_number: page_number, task_icon: task_icon, logo: logo, images: images)
end

def add_concept_slide(title, subtitle = nil, page_number, logo, task_icon, image_information ,images, legend)
@slides << Powerpoint::Slide::Concept.new(presentation: self, title: title, subtitle: subtitle, page_number: page_number, logo: logo, task_icon: task_icon, image_information: image_information, images: images, legend: legend)
end

def add_collage_slide(title, subtitle = nil, page_number, logo, task_icon, image_information ,images)
@slides << Powerpoint::Slide::Collage.new(presentation: self, title: title, subtitle: subtitle, page_number: page_number, logo: logo, task_icon: task_icon, image_information: image_information, images: images)
end

def add_image_slide(title, subtitle = nil,images)
@slides << Powerpoint::Slide::Image.new(presentation: self, title: title, subtitle: subtitle)
end

def add_dashboard_slide(title, subtitle = nil, page_number, graph_1_title, graph_1_subtitle, graph_2_title, image_1, image_2, image_3, image_4, logo, data)
@slides << Powerpoint::Slide::Dashboard.new(presentation: self, title: title, subtitle: subtitle, page_number: page_number, graph_1_title: graph_1_title, graph_1_subtitle: graph_1_subtitle, graph_2_title: graph_2_title, image_path: image_1, image_path_2: image_2, image_path_3: image_3, image_path_4: image_4, logo: logo, data: data)
end

def add_dashboard_user_slide(title, subtitle = nil, page_number, logo, images)
@slides << Powerpoint::Slide::DashboardUser.new(presentation: self, title: title, subtitle: subtitle,page_number: page_number, logo: logo, images: images)
end

def save(path)
Dir.mktmpdir do |dir|
extract_path = "#{dir}/extract_#{Time.now.strftime("%Y-%m-%d-%H%M%S")}"
Expand Down Expand Up @@ -70,7 +112,7 @@ def save(path)
end

def file_types
slides.map {|slide| slide.file_type if slide.respond_to? :file_type }.compact.uniq

end
end
end
47 changes: 47 additions & 0 deletions lib/powerpoint/slide/collage.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
require 'zip/filesystem'
require 'fileutils'
require 'fastimage'
require 'erb'

module Powerpoint
module Slide
class Collage
include Powerpoint::Util

attr_reader :title, :subtitle,:page_number,:logo, :task_icon, :image_information, :images

def initialize(options={})
require_arguments [:title, :subtitle,:page_number,:logo, :task_icon, :image_information, :images], options
options.each {|k, v| instance_variable_set("@#{k}", v)}
@images = images
@image_y_scale = image_information[1]
@image_x_scale = image_information[0]
@image_x_offset = image_information[2]
@image_y_offset = image_information[3]
end

def save(extract_path, index)
@images.each do |image|
copy_media(extract_path, image)
end

copy_media(extract_path, logo)
copy_media(extract_path, task_icon)

save_rel_xml(extract_path, index)
save_slide_xml(extract_path, index)
end


def save_rel_xml(extract_path, index)
render_view('collage_rel.xml.erb', "#{extract_path}/ppt/slides/_rels/slide#{index}.xml.rels", index: index)
end
private :save_rel_xml

def save_slide_xml(extract_path, index)
render_view('collage.xml.erb', "#{extract_path}/ppt/slides/slide#{index}.xml")
end
private :save_slide_xml
end
end
end
39 changes: 39 additions & 0 deletions lib/powerpoint/slide/comment.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
require 'zip/filesystem'
require 'fileutils'
require 'fastimage'
require 'erb'

module Powerpoint
module Slide
class Comment
include Powerpoint::Util

attr_reader :title, :subtitle, :user, :page_number, :logo, :task_icon, :comments

def initialize(options={})
require_arguments [:title, :subtitle, :user, :page_number, :logo, :task_icon, :comments], options
options.each {|k, v| instance_variable_set("@#{k}", v)}

end

def save(extract_path, index)

copy_media(extract_path, logo)
copy_media(extract_path, task_icon)

save_rel_xml(extract_path, index)
save_slide_xml(extract_path, index)
end

def save_rel_xml(extract_path, index)
render_view('comment_rel.xml.erb', "#{extract_path}/ppt/slides/_rels/slide#{index}.xml.rels", index: index)
end
private :save_rel_xml

def save_slide_xml(extract_path, index)
render_view('comment.xml.erb', "#{extract_path}/ppt/slides/slide#{index}.xml")
end
private :save_slide_xml
end
end
end
48 changes: 48 additions & 0 deletions lib/powerpoint/slide/concept.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
require 'zip/filesystem'
require 'fileutils'
require 'fastimage'
require 'erb'

module Powerpoint
module Slide
class Concept
include Powerpoint::Util

attr_reader :title, :subtitle,:page_number,:logo, :task_icon, :image_information, :images, :legend

def initialize(options={})
require_arguments [:title, :subtitle, :page_number, :logo, :task_icon, :image_information, :images, :legend], options
options.each {|k, v| instance_variable_set("@#{k}", v)}
@legend = legend
@images = images
@image_y_scale = image_information[1]
@image_x_scale = image_information[0]
@image_x_offset = image_information[2]
@image_y_offset = image_information[3]
end

def save(extract_path, index)
@images.each do |image|
copy_media(extract_path, image)
end

copy_media(extract_path, logo)
copy_media(extract_path, task_icon)

save_rel_xml(extract_path, index)
save_slide_xml(extract_path, index)
end


def save_rel_xml(extract_path, index)
render_view('concept_rel.xml.erb', "#{extract_path}/ppt/slides/_rels/slide#{index}.xml.rels", index: index)
end
private :save_rel_xml

def save_slide_xml(extract_path, index)
render_view('concept.xml.erb', "#{extract_path}/ppt/slides/slide#{index}.xml")
end
private :save_slide_xml
end
end
end
45 changes: 45 additions & 0 deletions lib/powerpoint/slide/dashboard.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
require 'zip/filesystem'
require 'fileutils'
require 'fastimage'
require 'erb'

module Powerpoint
module Slide
class Dashboard
include Powerpoint::Util

attr_reader :title, :subtitle,:page_number, :graph_1_title, :graph_1_subtitle, :graph_2_title, :image_path, :image_path_2,:image_path_3,:image_path_4, :image_name, :logo, :data

def initialize(options={})
require_arguments [:title, :subtitle,:page_number, :graph_1_title, :graph_1_subtitle, :graph_2_title, :image_path, :image_path_2,:image_path_3, :image_path_4, :logo, :data], options
options.each {|k, v| instance_variable_set("@#{k}", v)}
@data = data
@image_name = File.basename(image_path)
@image_name_2 = File.basename(image_path_2)
@image_name_3 = File.basename(image_path_3)
@image_name_4 = File.basename(image_path_4)
@logo_name = File.basename(logo)
end

def save(extract_path, index)
copy_media(extract_path, image_path)
copy_media(extract_path, image_path_2)
copy_media(extract_path, image_path_3)
copy_media(extract_path, image_path_4)
copy_media(extract_path, logo)
save_rel_xml(extract_path, index)
save_slide_xml(extract_path, index)
end

def save_rel_xml(extract_path, index)
render_view('dashboard_rel.xml.erb', "#{extract_path}/ppt/slides/_rels/slide#{index}.xml.rels", index: index)
end
private :save_rel_xml

def save_slide_xml(extract_path, index)
render_view('dashboard.xml.erb', "#{extract_path}/ppt/slides/slide#{index}.xml")
end
private :save_slide_xml
end
end
end
40 changes: 40 additions & 0 deletions lib/powerpoint/slide/dashboard_user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
require 'zip/filesystem'
require 'fileutils'
require 'fastimage'
require 'erb'

module Powerpoint
module Slide
class DashboardUser
include Powerpoint::Util

attr_reader :title, :subtitle,:page_number,:logo, :images

def initialize(options={})
require_arguments [:title, :subtitle,:page_number,:logo, :images], options
options.each {|k, v| instance_variable_set("@#{k}", v)}
@images = images
@logo_name = File.basename(logo)
end

def save(extract_path, index)
@images.each do |image|
copy_media(extract_path, image[1])
end
copy_media(extract_path, logo)
save_rel_xml(extract_path, index)
save_slide_xml(extract_path, index)
end

def save_rel_xml(extract_path, index)
render_view('dashboard_user_rel.xml.erb', "#{extract_path}/ppt/slides/_rels/slide#{index}.xml.rels", index: index)
end
private :save_rel_xml

def save_slide_xml(extract_path, index)
render_view('dashboard_user.xml.erb', "#{extract_path}/ppt/slides/slide#{index}.xml")
end
private :save_slide_xml
end
end
end
38 changes: 38 additions & 0 deletions lib/powerpoint/slide/extended_intro.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
require 'zip/filesystem'
require 'fileutils'
require 'fastimage'
require 'erb'

module Powerpoint
module Slide
class ExtendedIntro
include Powerpoint::Util

attr_reader :title, :subtitle, :subtitle_2, :coords, :image_path, :image_path_2, :image_name

def initialize(options={})
require_arguments [:title, :subtitle, :image_path, :image_path_2, :subtitle_2], options
options.each {|k, v| instance_variable_set("@#{k}", v)}
@image_name = File.basename(@image_path)
@image_name_2 = File.basename(@image_path_2)
end

def save(extract_path, index)
copy_media(extract_path, @image_path)
copy_media(extract_path, @image_path_2)
save_rel_xml(extract_path, index)
save_slide_xml(extract_path, index)
end

def save_rel_xml(extract_path, index)
render_view('extended_intro_slide_rel.xml.erb', "#{extract_path}/ppt/slides/_rels/slide#{index}.xml.rels", index: index)
end
private :save_rel_xml

def save_slide_xml(extract_path, index)
render_view('extended_intro_slide.xml.erb', "#{extract_path}/ppt/slides/slide#{index}.xml")
end
private :save_slide_xml
end
end
end
Loading