breeze_cms 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/images/breeze/card_preview/faq_item.jpg +0 -0
- data/app/assets/images/breeze/section_preview/section_faq.jpg +0 -0
- data/app/assets/images/breeze/section_preview/section_half_slider.jpg +0 -0
- data/app/assets/stylesheets/breeze/breeze.css +396 -390
- data/app/assets/stylesheets/breeze/breeze.email.css +288 -283
- data/app/assets/stylesheets/breeze_tailwind_styles.css +5 -1
- data/app/controllers/breeze/images_controller.rb +29 -6
- data/app/controllers/breeze/pages_controller.rb +3 -10
- data/app/controllers/breeze/sections_controller.rb +1 -1
- data/app/controllers/breeze/view_controller.rb +6 -1
- data/app/helpers/breeze/images_helper.rb +11 -5
- data/app/helpers/breeze/options_helper.rb +1 -1
- data/app/helpers/breeze/view_helper.rb +25 -0
- data/app/models/breeze/active_yaml.rb +23 -0
- data/app/models/breeze/image.rb +30 -20
- data/app/models/breeze/section.rb +5 -0
- data/app/models/breeze/shared_base.rb +1 -1
- data/app/models/breeze/view_base.rb +11 -2
- data/app/views/breeze/images/_editor.haml +26 -14
- data/app/views/breeze/images/index.haml +6 -4
- data/app/views/breeze/images/show.haml +30 -12
- data/app/views/breeze/pages/show.haml +52 -62
- data/app/views/breeze/view/_form_section.haml +1 -1
- data/app/views/breeze/view/_section_faq.haml +29 -0
- data/app/views/breeze/view/_section_full_image.haml +1 -1
- data/app/views/breeze/view/_section_full_up.haml +1 -1
- data/app/views/breeze/view/_section_half_image.haml +1 -1
- data/app/views/breeze/view/_section_half_slider.haml +67 -0
- data/app/views/breeze/view/_section_large_image.haml +1 -1
- data/app/views/breeze/view/_section_slider.haml +33 -14
- data/app/views/breeze/view/_section_small_image.haml +1 -1
- data/app/views/breeze/view/cards/_card_normal_round.haml +1 -1
- data/app/views/breeze/view/cards/_faq_item.haml +9 -0
- data/app/views/breeze/view/page.haml +2 -0
- data/config/breeze/card_styles.yml +41 -31
- data/config/breeze/option_definitions.yml +14 -2
- data/config/breeze/page_styles.yml +5 -2
- data/config/breeze/section_styles.yml +50 -0
- data/config/initializers/simple_form_tailwind.rb +148 -0
- data/lib/breeze/engine.rb +3 -4
- data/lib/breeze/version.rb +1 -1
- metadata +32 -43
- data/config/initializers/simple_form.rb +0 -212
@@ -48,6 +48,8 @@ module Breeze
|
|
48
48
|
@cards = Card.find_all(:image_id, params[:id].to_i)
|
49
49
|
@used = ((@cards.length > 0) || (@sections.length > 0))
|
50
50
|
@image_data = @image.data
|
51
|
+
@global_scale = get_scale(@image)
|
52
|
+
puts @global_scale
|
51
53
|
end
|
52
54
|
|
53
55
|
def copy
|
@@ -57,25 +59,46 @@ module Breeze
|
|
57
59
|
end
|
58
60
|
|
59
61
|
def create
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
62
|
+
io = params['image_file']
|
63
|
+
if(io)
|
64
|
+
_ , endi = io.original_filename.split("/").last.split(".")
|
65
|
+
if( ["jpg","jpeg","png","webp"].include? endi.downcase)
|
66
|
+
image = Image.create_new(params["filename"] ,params['tags'], params['image_file'])
|
67
|
+
image.add_save current_member_email
|
68
|
+
where_to = determine_redirect(image)
|
69
|
+
redirect_to where_to , notice: "New image created: #{image.name}"
|
70
|
+
else
|
71
|
+
redirect_to new_image_url , alert: "Only jpg, png or tiff allowed"
|
72
|
+
end
|
73
|
+
else
|
74
|
+
redirect_to new_image_url , alert: "No file"
|
75
|
+
end
|
64
76
|
end
|
65
77
|
|
66
78
|
private
|
67
79
|
|
80
|
+
def get_scale(image)
|
81
|
+
x_scale = (image.width / 1700.0).ceil
|
82
|
+
y_scale = (image.height / 1000.0).ceil
|
83
|
+
[x_scale , y_scale].max
|
84
|
+
end
|
85
|
+
|
68
86
|
def get_images
|
69
87
|
images = Image.all
|
70
|
-
return images
|
88
|
+
return images if params[:unused].nil?
|
71
89
|
hash = images.collect{|i| [i.id , i ] }.to_h
|
72
90
|
Section.all.each{ |s| hash.delete(s.image&.id)}
|
73
91
|
Card.all.each{ |s| hash.delete(s.image&.id)}
|
74
|
-
hash.values
|
92
|
+
return hash.values if params[:unused] == "true"
|
93
|
+
all = images.collect{|i| [i.id , i ] }.to_h
|
94
|
+
hash.each_key{|i| all.delete(i)}
|
95
|
+
all.values
|
75
96
|
end
|
97
|
+
|
76
98
|
def set_image
|
77
99
|
@image = Image.find(params[:id] || params[:image_id])
|
78
100
|
end
|
101
|
+
|
79
102
|
def determine_redirect(image)
|
80
103
|
if(params[:section_id])
|
81
104
|
view_context.section_set_image_url(params[:section_id],image_id: image.id )
|
@@ -19,17 +19,10 @@ module Breeze
|
|
19
19
|
def update
|
20
20
|
if( !params[:name].blank? && (params[:name] != @page.name))
|
21
21
|
@page.set_name params[:name]
|
22
|
-
@page.edit_save(current_member_email)
|
23
|
-
message = "Page renamed"
|
24
|
-
end
|
25
|
-
options = params[:option]
|
26
|
-
if options
|
27
|
-
@page.option_definitions.each do |option|
|
28
|
-
@page.set_option(option.name, options[option.name])
|
29
|
-
end
|
30
|
-
@page.edit_save(current_member_email)
|
31
|
-
message = "Options saved"
|
32
22
|
end
|
23
|
+
@page.update_present_options( params[:options])
|
24
|
+
@page.edit_save(current_member_email)
|
25
|
+
message = "Saved"
|
33
26
|
redirect_to page_url(@page) , notice: message
|
34
27
|
end
|
35
28
|
|
@@ -62,7 +62,7 @@ module Breeze
|
|
62
62
|
def set_card_template
|
63
63
|
card_template = params[:card_template]
|
64
64
|
raise "no card template given" if card_template.blank?
|
65
|
-
@section.card_template
|
65
|
+
@section.set_card_template( card_template )
|
66
66
|
@section.edit_save(current_member_email)
|
67
67
|
redirect_to section_url(@section.id)
|
68
68
|
end
|
@@ -5,7 +5,12 @@ module Breeze
|
|
5
5
|
locale = params[:lang] || I18n.default_locale
|
6
6
|
I18n.locale = locale
|
7
7
|
@page = Page.find_by_name(params[:id])
|
8
|
-
|
8
|
+
if @page.nil?
|
9
|
+
redirect_to "/" , alert: "No page #{params[:id]}"
|
10
|
+
else
|
11
|
+
@title = @page.options["title"] if @page.options
|
12
|
+
@description = @page.options["description"] if @page.options
|
13
|
+
end
|
9
14
|
end
|
10
15
|
|
11
16
|
end
|
@@ -5,13 +5,19 @@ module Breeze
|
|
5
5
|
def text_for_index
|
6
6
|
if(section_id)
|
7
7
|
section = Section.find(section_id)
|
8
|
-
"Select image for Section #{section.index} : #{section.header}"
|
9
|
-
|
8
|
+
return "Select image for Section #{section.index} : #{section.header}"
|
9
|
+
end
|
10
|
+
if(card_id)
|
10
11
|
card = Card.find(card_id)
|
11
|
-
"Select image for Card #{card.index} : #{card.header}"
|
12
|
-
|
13
|
-
|
12
|
+
return "Select image for Card #{card.index} : #{card.header}"
|
13
|
+
end
|
14
|
+
if(params[:unused].nil?)
|
15
|
+
return "All Images"
|
16
|
+
end
|
17
|
+
if(params[:unused] == "true")
|
18
|
+
return "Unused Images"
|
14
19
|
end
|
20
|
+
return "Used Images"
|
15
21
|
end
|
16
22
|
|
17
23
|
def text_for_new
|
@@ -2,6 +2,31 @@ module Breeze
|
|
2
2
|
module ViewHelper
|
3
3
|
include BreezeHelper
|
4
4
|
|
5
|
+
def title
|
6
|
+
@page.options ? @page.options["title"] : ""
|
7
|
+
end
|
8
|
+
|
9
|
+
def description
|
10
|
+
@page.options ? @page.options["description"] : ""
|
11
|
+
end
|
12
|
+
|
13
|
+
def breeze_meta_tags
|
14
|
+
metas = "<title> #{title}</title>\n" +
|
15
|
+
"<meta name='description' content='#{description}' />" +
|
16
|
+
breeze_fb_tags
|
17
|
+
metas.html_safe
|
18
|
+
end
|
19
|
+
|
20
|
+
# private, just breaking it up. Returns not safe string
|
21
|
+
def breeze_fb_tags
|
22
|
+
return "" unless @page.options
|
23
|
+
image = Image.find( @page.options["main_image"] )
|
24
|
+
return "" unless image
|
25
|
+
image_path = asset_path("breeze/" + image.id.to_s + "." + image.type)
|
26
|
+
"\n<meta property='og:image' content='http://nomads.feenix.community#{image_path}' />" +
|
27
|
+
"\n<meta property='og:image:secure_url' content='https://nomads.feenix.community#{image_path}' />"
|
28
|
+
end
|
29
|
+
|
5
30
|
def current_lang
|
6
31
|
params[:lang]
|
7
32
|
end
|
@@ -56,6 +56,23 @@ module Breeze
|
|
56
56
|
find_by( :id , id )
|
57
57
|
end
|
58
58
|
|
59
|
+
def next_id(id)
|
60
|
+
dir_id(id , 1)
|
61
|
+
end
|
62
|
+
|
63
|
+
def previous_id(id)
|
64
|
+
dir_id(id , -1)
|
65
|
+
end
|
66
|
+
|
67
|
+
def dir_id(id , inc)
|
68
|
+
while((id > 0) && (id < 300)) do
|
69
|
+
id += inc
|
70
|
+
if(is = find_by(:id , id))
|
71
|
+
return is
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
59
76
|
def find_by( field , value )
|
60
77
|
found = yaml_file.detect { |record| record[field] == value }
|
61
78
|
return nil unless found
|
@@ -114,6 +131,12 @@ module Breeze
|
|
114
131
|
File.join(self.path , full_name )
|
115
132
|
end
|
116
133
|
|
134
|
+
def largest
|
135
|
+
largest = 0
|
136
|
+
yaml_file.each { |item| largest = item[:id] if item[:id] > largest }
|
137
|
+
largest
|
138
|
+
end
|
139
|
+
|
117
140
|
#create a new data point by adding the hash
|
118
141
|
def append(data)
|
119
142
|
largest = 0
|
data/app/models/breeze/image.rb
CHANGED
@@ -43,6 +43,36 @@ module Breeze
|
|
43
43
|
mini.crop( to_size )
|
44
44
|
init_file_size
|
45
45
|
end
|
46
|
+
|
47
|
+
def destroy(editor)
|
48
|
+
File.delete self.full_filename
|
49
|
+
delete_save!(editor)
|
50
|
+
end
|
51
|
+
|
52
|
+
def asset_name
|
53
|
+
Breeze.images_dir + "/" + self.id.to_s + "." + self.type
|
54
|
+
end
|
55
|
+
|
56
|
+
def full_filename
|
57
|
+
full_filename = self.id.to_s + "." + self.type
|
58
|
+
Rails.root.join(Image.asset_root, full_filename)
|
59
|
+
end
|
60
|
+
|
61
|
+
def init_file_size
|
62
|
+
magick_image = MiniMagick::Image.open(full_filename)
|
63
|
+
self.width = magick_image.width
|
64
|
+
self.height = magick_image.height
|
65
|
+
self.size = (magick_image.size/1024).to_i
|
66
|
+
end
|
67
|
+
|
68
|
+
def next_image
|
69
|
+
self.class.next_id(id)
|
70
|
+
end
|
71
|
+
|
72
|
+
def previous_image
|
73
|
+
self.class.previous_id(id)
|
74
|
+
end
|
75
|
+
|
46
76
|
#save an io as new image. The filename is the id, type taken from io
|
47
77
|
def self.create_new(name , tags, io)
|
48
78
|
original , end_ = io.original_filename.split("/").last.split(".")
|
@@ -61,19 +91,6 @@ module Breeze
|
|
61
91
|
new_id = Image.append(image_data)
|
62
92
|
Image.new(image_data)
|
63
93
|
end
|
64
|
-
def destroy(editor)
|
65
|
-
File.delete self.full_filename
|
66
|
-
delete_save!(editor)
|
67
|
-
end
|
68
|
-
|
69
|
-
def asset_name
|
70
|
-
Breeze.images_dir + "/" + self.id.to_s + "." + self.type
|
71
|
-
end
|
72
|
-
|
73
|
-
def full_filename
|
74
|
-
full_filename = self.id.to_s + "." + self.type
|
75
|
-
Rails.root.join(Image.asset_root, full_filename)
|
76
|
-
end
|
77
94
|
|
78
95
|
def self.transform
|
79
96
|
Image.all.each do |image|
|
@@ -89,13 +106,6 @@ module Breeze
|
|
89
106
|
end
|
90
107
|
end
|
91
108
|
|
92
|
-
def init_file_size
|
93
|
-
magick_image = MiniMagick::Image.open(full_filename)
|
94
|
-
self.width = magick_image.width
|
95
|
-
self.height = magick_image.height
|
96
|
-
self.size = (magick_image.size/1024).to_i
|
97
|
-
end
|
98
|
-
|
99
109
|
def self.asset_root
|
100
110
|
"app/assets/images/" + Breeze.images_dir
|
101
111
|
end
|
@@ -51,6 +51,7 @@ module Breeze
|
|
51
51
|
def set_template(new_template)
|
52
52
|
self.template = new_template
|
53
53
|
new_style = template_style
|
54
|
+
add_default_options
|
54
55
|
if(new_style.has_cards?)
|
55
56
|
if card_template.blank?
|
56
57
|
self.card_template = CardStyle.first.template
|
@@ -58,6 +59,10 @@ module Breeze
|
|
58
59
|
end
|
59
60
|
end
|
60
61
|
|
62
|
+
def set_card_template(new_template)
|
63
|
+
self.card_template = new_template
|
64
|
+
end
|
65
|
+
|
61
66
|
def allowed_fields
|
62
67
|
super + [:page_id]
|
63
68
|
end
|
@@ -26,7 +26,7 @@ module Breeze
|
|
26
26
|
last = Time.now
|
27
27
|
last_section = nil
|
28
28
|
elements.each do |section|
|
29
|
-
if( section.updated_at
|
29
|
+
if( section.updated_at > last )
|
30
30
|
last = section.updated_at
|
31
31
|
last_section = section
|
32
32
|
end
|
@@ -58,13 +58,14 @@ module Breeze
|
|
58
58
|
year = value[:year] || Time.new.year
|
59
59
|
value = Time.new( year.to_i , value[:month] , value[:day]).to_date
|
60
60
|
end
|
61
|
-
safe_options[option] = value
|
61
|
+
safe_options[option] = value.to_s
|
62
62
|
end
|
63
63
|
|
64
64
|
def add_default_options( definitions = nil )
|
65
65
|
definitions = option_definitions if definitions.nil?
|
66
66
|
definitions.each do |option|
|
67
67
|
next unless option.default
|
68
|
+
next unless option(option.name).blank?
|
68
69
|
set_option( option.name , option.default)
|
69
70
|
end
|
70
71
|
end
|
@@ -90,6 +91,14 @@ module Breeze
|
|
90
91
|
set_option(option.name, options[option.name])
|
91
92
|
end
|
92
93
|
end
|
94
|
+
def update_present_options( options )
|
95
|
+
return unless options
|
96
|
+
option_definitions.each do |option|
|
97
|
+
next unless options.has_key?(option.name)
|
98
|
+
set_option(option.name, options[option.name])
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
93
102
|
#other may be nil
|
94
103
|
def swap_index_with(other)
|
95
104
|
return unless other
|
@@ -1,19 +1,26 @@
|
|
1
|
-
%script{:src => "https://cdn.jsdelivr.net/npm/vue@2.7.
|
1
|
+
%script{:src => "https://cdn.jsdelivr.net/npm/vue@2.7.16/dist/vue.js"}
|
2
2
|
|
3
3
|
%section.image
|
4
4
|
.flex.justify-between.mx-20
|
5
5
|
.flex.justify-between
|
6
6
|
%div.justify-self-start.ml-20.mr-10
|
7
7
|
%b Scale {{scaled_x}} x {{scaled_y}}
|
8
|
+
%select.ml-4.mb-2.form-control{ "v-on:input": "handle_preset($event)" }
|
9
|
+
%option{ } Select a preset
|
10
|
+
%option{ value: "600", "v-on:input": "handle_preset($event)" } Card 600
|
11
|
+
%option{ value: "800", "v-on:input": "handle_preset($event)" } Half 800
|
12
|
+
%option{ value: "1200", "v-on:input": "handle_preset($event)" } 2/3 1200
|
13
|
+
%option{ value: "1800", "v-on:input": "handle_preset($event)" } Full 1800
|
14
|
+
|
8
15
|
%br/
|
9
16
|
%input{":min": 20 , ":max": 100 , ":step": 0.1 , :type => "range",
|
10
17
|
"v-bind:value": "scale" , "v-on:input" => "handle_scale($event)"}/
|
11
18
|
|
12
19
|
= form_tag( breeze.image_scale_path(image_id: image.id) ) do
|
13
20
|
%input{ hidden: true , id: :scale_id , name: :scale , "v-bind:value": "scale" }
|
14
|
-
%button.
|
21
|
+
%button.button.change Scale {{scale}} %
|
15
22
|
|
16
|
-
%div
|
23
|
+
%div
|
17
24
|
%b.pr-2 Ratio
|
18
25
|
%br/
|
19
26
|
%em {{ratio}} : 1
|
@@ -23,9 +30,9 @@
|
|
23
30
|
%input{ hidden: true , id: :height_id , name: :size_y , "v-bind:value": "size_y" }
|
24
31
|
%input{ hidden: true , id: :off_x_id , name: :off_x , "v-bind:value": "off_x" }
|
25
32
|
%input{ hidden: true , id: :off_y_id , name: :off_y , "v-bind:value": "off_y" }
|
26
|
-
%button.
|
33
|
+
%button.button.change Crop
|
27
34
|
|
28
|
-
%div.
|
35
|
+
%div.ml-32
|
29
36
|
%b.pr-2 Fix ratio to
|
30
37
|
%select{ "@change": "set_ratio"}
|
31
38
|
%option{value: "0" } Any Ratio
|
@@ -36,11 +43,6 @@
|
|
36
43
|
|
37
44
|
.flex.justify-between.mb-5
|
38
45
|
%div.ml-20
|
39
|
-
%b Y Offset {{off_y}}
|
40
|
-
%br/
|
41
|
-
%input.horizontal{":min": 0 , ":max": "#{image.height}", ":step": 1 , :type => "range",
|
42
|
-
"v-bind:value": "off_y" , "v-on:input" => "handle_off_y($event)"}
|
43
|
-
%div
|
44
46
|
%b X Offset {{off_x}}
|
45
47
|
%br/
|
46
48
|
%input{":min": 0 , ":max": "#{image.width}", ":step": 1 , :type => "range",
|
@@ -50,16 +52,21 @@
|
|
50
52
|
%br/
|
51
53
|
%input{":min": 0 , ":max": "#{image.width}", ":step": 1 , :type => "range",
|
52
54
|
"v-bind:value": "size_x" , "v-on:input" => "handle_size_x($event)"}
|
53
|
-
%div
|
55
|
+
%div
|
54
56
|
%b Y Size {{size_y.toFixed(0)}}
|
55
57
|
%br
|
56
58
|
%input.horizontal{":min": 0 , ":max": "#{image.height}", ":step": 1 , :type => "range",
|
57
59
|
"v-bind:value": "size_y" , "v-on:input" => "handle_size_y($event)"}
|
60
|
+
%div.mr-20
|
61
|
+
%b Y Offset {{off_y}}
|
62
|
+
%br/
|
63
|
+
%input.horizontal{":min": 0 , ":max": "#{image.height}", ":step": 1 , :type => "range",
|
64
|
+
"v-bind:value": "off_y" , "v-on:input" => "handle_off_y($event)"}
|
58
65
|
|
59
66
|
.flex.justify-center
|
60
|
-
.image-container.overflow-hidden.relative{ "v-bind:style": "{height: scaled_y + 'px' , width: scaled_x + 'px'} " }
|
61
|
-
= image_tag(image.asset_name , class: "")
|
62
|
-
.absolute.bg-transparent.border-4.border-black{ "v-bind:style": "{height: size_y + 'px' , width: size_x + 'px' , top: off_y + 'px', left: off_x + 'px' }" }
|
67
|
+
.image-container.overflow-hidden.relative{ "v-bind:style": "{height: (scaled_y/global_scale) + 'px' , width: (scaled_x/global_scale) + 'px'} " }
|
68
|
+
= image_tag(image.asset_name , class: "" , width: (@image.width / @global_scale).to_i , height: (@image.height/@global_scale).to_i)
|
69
|
+
.absolute.bg-transparent.border-4.border-black{ "v-bind:style": "{height: (size_y/global_scale).toFixed() + 'px' , width: (size_x/global_scale).toFixed() + 'px' , top: (off_y/global_scale).toFixed() + 'px', left: (off_x/global_scale).toFixed() + 'px' }" }
|
63
70
|
|
64
71
|
:ruby2js
|
65
72
|
class Images < Vue
|
@@ -68,6 +75,7 @@
|
|
68
75
|
@image_data = #{@image_data.to_json.html_safe}
|
69
76
|
@off_x = 0
|
70
77
|
@off_y = 0
|
78
|
+
@global_scale = "#{@global_scale}"
|
71
79
|
@scale = 100
|
72
80
|
@size_x = @image_data[:width]
|
73
81
|
@size_y = @image_data[:height]
|
@@ -111,6 +119,10 @@
|
|
111
119
|
@size_y = new_y
|
112
120
|
end
|
113
121
|
|
122
|
+
def handle_preset(event)
|
123
|
+
@scale = (100 * event.target.value.to_f ) / @size_x
|
124
|
+
end
|
125
|
+
|
114
126
|
def handle_size_x(event)
|
115
127
|
set_size_x(event.target.value.to_f)
|
116
128
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
%script{:src => "https://cdn.jsdelivr.net/npm/vue@2.7.
|
1
|
+
%script{:src => "https://cdn.jsdelivr.net/npm/vue@2.7.16/dist/vue.js"}
|
2
2
|
|
3
3
|
.mx-6.md:mx-12.mx-20.flex.h-16.items-center.gap-16.justify-between
|
4
4
|
.flex.gap-20
|
@@ -7,8 +7,10 @@
|
|
7
7
|
|
8
8
|
= link_to(breeze.new_image_path(new_link_params) ) do
|
9
9
|
.button.action New Image
|
10
|
-
|
11
|
-
|
10
|
+
= link_to(breeze.images_path(unused: false) ) do
|
11
|
+
.button.bg-cyan-100 Show used
|
12
|
+
= link_to(breeze.images_path(unused: true) ) do
|
13
|
+
.button.bg-orange-100 Show unused
|
12
14
|
|
13
15
|
.images
|
14
16
|
.flex.justify-center.gap-4
|
@@ -45,7 +47,7 @@
|
|
45
47
|
%strong.inline-block.rounded.bg-orange-50.px-3.py-1.text-md.font-medium
|
46
48
|
{{image.updated_at}}
|
47
49
|
%strong.rounded.h-10.bg-orange-50.px-5.py-2.font-medium
|
48
|
-
{{image.
|
50
|
+
{{image.type}}
|
49
51
|
|
50
52
|
.hidden.list
|
51
53
|
-@images.each do |image|
|
@@ -1,12 +1,35 @@
|
|
1
|
-
%script{:src => "https://cdn.jsdelivr.net/npm/vue@2.7.
|
1
|
+
%script{:src => "https://cdn.jsdelivr.net/npm/vue@2.7.16/dist/vue.js"}
|
2
2
|
|
3
3
|
.mx-6.md:mx-12.mx-20.flex.h-16.items-center.gap-16
|
4
4
|
.text-xl.font-bold.text-gray-900
|
5
5
|
Image: #{@image.name}
|
6
|
-
|
6
|
+
= @global_scale
|
7
7
|
= form_tag( breeze.image_copy_path(@image.id) , method: :post) do
|
8
8
|
%button.mx-40.button.change Copy
|
9
9
|
|
10
|
+
.grid.grid-cols-3.gap-10
|
11
|
+
%p
|
12
|
+
- if img = @image.previous_image
|
13
|
+
= link_to "Prev #{img.id}" , breeze.image_path(img)
|
14
|
+
-else
|
15
|
+
None
|
16
|
+
%p
|
17
|
+
Current
|
18
|
+
=@image.id
|
19
|
+
%p
|
20
|
+
- if img = @image.next_image
|
21
|
+
= link_to "Next #{img.id}" , breeze.image_path(img)
|
22
|
+
-else
|
23
|
+
None
|
24
|
+
-unless @used
|
25
|
+
%p.align-center Not used
|
26
|
+
= form_tag( breeze.image_path(@image.id) , {method: :delete } ) do
|
27
|
+
%button.button.remove{type: :submit} Delete
|
28
|
+
.m-2.bg-cyan-200
|
29
|
+
- if(@global_scale > 1)
|
30
|
+
Downscaled by
|
31
|
+
= @global_scale
|
32
|
+
|
10
33
|
.flex.m-20
|
11
34
|
.left.flex.gap-2.mt-3
|
12
35
|
%p
|
@@ -37,24 +60,19 @@
|
|
37
60
|
Sections using the image
|
38
61
|
-@sections.each do |section|
|
39
62
|
%p
|
40
|
-
= link_to section.header , breeze.section_path(section)
|
63
|
+
= link_to section.header , breeze.section_path(section) , target: :blank
|
41
64
|
%p
|
42
65
|
%em on Page
|
43
66
|
%p
|
44
|
-
= link_to section.page.name ,
|
67
|
+
= link_to section.page.name , "/#{section.page.name}" , target: :blank
|
45
68
|
.grid.grid-cols-3.gap-10
|
46
69
|
%p.col-span-3.font-bold
|
47
70
|
Cards using the image
|
48
71
|
-@cards.each do |card|
|
49
72
|
%p
|
50
|
-
=
|
73
|
+
- link = card.header.blank? ? "(nil)" : card.header
|
74
|
+
= link_to link , breeze.section_cards_path(card.section) , target: :blank
|
51
75
|
%p
|
52
76
|
%em on Page
|
53
77
|
%p
|
54
|
-
= link_to card.section.page.name ,
|
55
|
-
|
56
|
-
-else
|
57
|
-
%p.align-center Not used, you may delete
|
58
|
-
%p
|
59
|
-
= form_tag( breeze.image_path(@image.id) , {method: :delete } ) do
|
60
|
-
%button.button.remove{type: :submit} Delete
|
78
|
+
= link_to card.section.page.name , "/" + card.section.page.name , target: :blank
|