card-mod-bar_and_box 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/stylesheets/style_image_box.scss +79 -0
- data/set/abstract/media.rb +17 -0
- data/set/abstract/media/media_snippet.haml +9 -0
- data/set/all/bar.haml +12 -0
- data/set/all/bar.rb +103 -0
- data/set/all/box.haml +12 -0
- data/set/all/box.rb +16 -0
- data/set/all/expanded_bar.haml +10 -0
- data/set/self/style_media.rb +6 -0
- data/set/type/image.rb +38 -0
- metadata +84 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b7ae413ff2d6c14e0f8f2b04e2d393ce8aa047f07a2e0c6317b0513d8ca924f8
|
4
|
+
data.tar.gz: 4a3777d434f5a8fd4db04d7cb97c9f90bbf3429258e3f1cff9fac8d009017c69
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9a97cdb229fea762a1576e2a5df90b15aabba3a93f5bb6dfbfb3d45d67a240613a4e24a1074a5fd5626236fa4ef6c7851ce5d437233b5d1bbebf1ac912a236ea
|
7
|
+
data.tar.gz: 594751797ff184ef4684500e5b59f11726e9f10d7ca8d781641d5f427c32cb6b9eebb6d7c5672af6e95219214008bbf131242a132b00a99b544cd729f135b5ab
|
@@ -0,0 +1,79 @@
|
|
1
|
+
//images
|
2
|
+
|
3
|
+
@mixin image-box-size($sizename, $sidelength) {
|
4
|
+
&.#{$sizename} {
|
5
|
+
width: $sidelength;
|
6
|
+
height: $sidelength;
|
7
|
+
min-width: $sidelength;
|
8
|
+
min-height: $sidelength;
|
9
|
+
i {
|
10
|
+
font-size: $sidelength / 2;
|
11
|
+
}
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
.image-box {
|
16
|
+
display: flex;
|
17
|
+
align-items: center;
|
18
|
+
justify-content: center;
|
19
|
+
|
20
|
+
width: 94px;
|
21
|
+
height: 94px;
|
22
|
+
min-width: 94px;
|
23
|
+
min-height: 94px;
|
24
|
+
|
25
|
+
box-sizing: border-box;
|
26
|
+
-webkit-box-sizing: border-box;
|
27
|
+
-moz-box-sizing: border-box;
|
28
|
+
|
29
|
+
border: 1px solid #eee;
|
30
|
+
border-radius: 0;
|
31
|
+
|
32
|
+
background-color: #f8f9fa;
|
33
|
+
|
34
|
+
margin-right: 0.5rem;
|
35
|
+
overflow: hidden;
|
36
|
+
|
37
|
+
//text-align: center;
|
38
|
+
@include image-box-size(icon, 16px);
|
39
|
+
@include image-box-size(small, 40px);
|
40
|
+
@include image-box-size(medium, 64px);
|
41
|
+
@include image-box-size(large, 94px);
|
42
|
+
@include image-box-size(xlarge, 150px);
|
43
|
+
|
44
|
+
a, i {
|
45
|
+
width: 100%;
|
46
|
+
text-align: center;
|
47
|
+
}
|
48
|
+
i {
|
49
|
+
color: $text-muted;
|
50
|
+
}
|
51
|
+
&.icon a {
|
52
|
+
line-height: 0;
|
53
|
+
height: 8px;
|
54
|
+
}
|
55
|
+
img {
|
56
|
+
max-width: 100%;
|
57
|
+
max-height: 100%;
|
58
|
+
height: auto;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
@media (max-width: 1260px) {
|
63
|
+
.image-box {
|
64
|
+
@include image-box-size(large, 120px);
|
65
|
+
}
|
66
|
+
.media-body {
|
67
|
+
padding: 6px;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
@include media-breakpoint-down(sm) {
|
72
|
+
.image-box {
|
73
|
+
@include image-box-size(xlarge, 100px);
|
74
|
+
@include image-box-size(large, 80px);
|
75
|
+
}
|
76
|
+
.media-body {
|
77
|
+
padding: 4px;
|
78
|
+
}
|
79
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
format :html do
|
2
|
+
def image_card
|
3
|
+
@image_card ||= card.fetch(:image, new: {})
|
4
|
+
end
|
5
|
+
|
6
|
+
def text_with_image opts={}
|
7
|
+
class_up "media-left", "m-2"
|
8
|
+
@image_card = Card.cardish(opts[:image]) if opts[:image]
|
9
|
+
haml :media_snippet, normalized_text_with_image_opts(opts)
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def normalized_text_with_image_opts opts
|
15
|
+
opts.reverse_merge! title: _render_title, text: "", size: voo.size, media_opts: {}
|
16
|
+
end
|
17
|
+
end
|
data/set/all/bar.haml
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
.collapsed-bar.nodblclick{ class: classy("bar") }
|
2
|
+
%div{ class: classy("bar-body") }
|
3
|
+
- if voo.show? :bar_left
|
4
|
+
%div{ class: classy("bar-left") }
|
5
|
+
= render :bar_left
|
6
|
+
- if voo.show? :bar_middle
|
7
|
+
%div{ class: classy("bar-middle") }
|
8
|
+
= render :bar_middle
|
9
|
+
- if voo.show? :bar_right
|
10
|
+
%div{ class: classy("bar-right") }
|
11
|
+
= render :bar_right
|
12
|
+
= render :bar_nav
|
data/set/all/bar.rb
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
format :html do
|
2
|
+
setting :bar_cols
|
3
|
+
setting :info_bar_cols
|
4
|
+
|
5
|
+
view :info_bar do
|
6
|
+
render_bar show: :bar_middle
|
7
|
+
end
|
8
|
+
|
9
|
+
before :bar do
|
10
|
+
class_up "bar", card.safe_set_keys
|
11
|
+
voo.hide! :bar_collapse_link
|
12
|
+
voo.hide :edit_link, :full_page_link, :bridge_link
|
13
|
+
end
|
14
|
+
|
15
|
+
view :bar, unknown: :unknown_bar do
|
16
|
+
voo.hide :bar_middle
|
17
|
+
voo.hide :bar_bottom # needed for toggle
|
18
|
+
class_up_bar_sides(voo.show?(:bar_middle))
|
19
|
+
# note: above cannot be in `before`, because before blocks run before viz processing
|
20
|
+
wrap { haml :bar }
|
21
|
+
end
|
22
|
+
|
23
|
+
bar_cols 9, 3
|
24
|
+
info_bar_cols 5, 4, 3
|
25
|
+
|
26
|
+
view :unknown_bar, unknown: true do
|
27
|
+
voo.hide! :bar_middle, :bar_bottom, :bar_nav
|
28
|
+
wrap { haml :bar }
|
29
|
+
end
|
30
|
+
|
31
|
+
before :expanded_bar do
|
32
|
+
class_up "bar", card.safe_set_keys
|
33
|
+
voo.hide! :bar_expand_link
|
34
|
+
end
|
35
|
+
|
36
|
+
view :expanded_bar do
|
37
|
+
class_up_bar_sides(false)
|
38
|
+
wrap { haml :expanded_bar }
|
39
|
+
end
|
40
|
+
|
41
|
+
def class_up_bar_sides middle
|
42
|
+
class_up_cols %w[bar-left bar-right], bar_cols
|
43
|
+
class_up_cols %w[bar-left bar-middle bar-right], info_bar_cols, "md" if middle
|
44
|
+
end
|
45
|
+
|
46
|
+
def class_up_cols classes, cols, context=nil
|
47
|
+
classes.each_with_index do |cls, i|
|
48
|
+
class_up cls, ["col", context, cols[i]].compact.join("-")
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
view :bar_left do
|
53
|
+
bar_title
|
54
|
+
end
|
55
|
+
|
56
|
+
def bar_title
|
57
|
+
return render_missing if card.unknown?
|
58
|
+
|
59
|
+
if voo.show?(:toggle)
|
60
|
+
link_to_view bar_title_toggle_view, render_title
|
61
|
+
else
|
62
|
+
render_title
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def bar_title_toggle_view
|
67
|
+
voo.show?(:bar_bottom) ? :bar : :expanded_bar
|
68
|
+
end
|
69
|
+
|
70
|
+
view :bar_right, unknown: :blank do
|
71
|
+
[(render(:short_content) unless voo.show?(:bar_middle)),
|
72
|
+
render(:edit_button, optional: :hide)]
|
73
|
+
end
|
74
|
+
|
75
|
+
view :bar_middle, unknown: :blank do
|
76
|
+
render :short_content
|
77
|
+
end
|
78
|
+
|
79
|
+
view :bar_bottom do
|
80
|
+
render(nest_mode == :edit ? :edit : :core)
|
81
|
+
end
|
82
|
+
|
83
|
+
view :bar_nav, unknown: true, wrap: { div: { class: "bar-nav" } } do
|
84
|
+
[render_bar_expand_link,
|
85
|
+
render_bar_collapse_link,
|
86
|
+
render_full_page_link,
|
87
|
+
render_edit_link,
|
88
|
+
render_bridge_link]
|
89
|
+
end
|
90
|
+
|
91
|
+
view :bar_expand_link, unknown: true do
|
92
|
+
link_to_view :expanded_bar, icon_tag(:keyboard_arrow_down)
|
93
|
+
end
|
94
|
+
|
95
|
+
view :bar_collapse_link, unknown: true do
|
96
|
+
link_to_view :bar, icon_tag(:keyboard_arrow_up)
|
97
|
+
end
|
98
|
+
|
99
|
+
view :edit_button do
|
100
|
+
view = voo.edit == :inline ? :edit_inline : :edit
|
101
|
+
link_to_view view, "Edit", class: "btn btn-sm btn-outline-primary mr-2"
|
102
|
+
end
|
103
|
+
end
|
data/set/all/box.haml
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
- box_classes = css_classes classy("box"), card.safe_set_keys
|
2
|
+
.card.p-0.drop-shadow.rounded-0.mb-4.nodblclick{class: box_classes}
|
3
|
+
- if voo.show? :box_top
|
4
|
+
.card-header.text-center{class: classy("box-top")}
|
5
|
+
= render :box_top
|
6
|
+
= render :menu
|
7
|
+
- if voo.show? :box_middle
|
8
|
+
.card-body{class: classy("box-middle")}
|
9
|
+
= render :box_middle
|
10
|
+
- if voo.show? :box_bottom
|
11
|
+
.card-footer.text-center{class: classy("box-bottom")}
|
12
|
+
= render :box_bottom
|
data/set/all/box.rb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
.expanded-bar
|
2
|
+
%div{ class: classy("bar-body") }
|
3
|
+
.nodblclick{ class: classy("bar") }
|
4
|
+
%div{ class: classy("bar-left") }
|
5
|
+
= naming { render :bar_left }
|
6
|
+
%div{ class: classy("bar-right") }
|
7
|
+
= render :bar_right, hide: :short_content
|
8
|
+
.bar-bottom
|
9
|
+
= render :bar_bottom
|
10
|
+
= render :bar_nav
|
data/set/type/image.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
IMAGE_BOX_SIZE_MAP = {
|
2
|
+
icon: :icon, small: :small, medium: :small, large: :medium, xlarge: :medium
|
3
|
+
}.freeze
|
4
|
+
|
5
|
+
format :html do
|
6
|
+
view :boxed, unknown: true do
|
7
|
+
image_box { |size| render_core size: size }
|
8
|
+
end
|
9
|
+
|
10
|
+
view :boxed_link, unknown: true do
|
11
|
+
image_box { |size| link_to_card image_box_link_target, render_core(size: size) }
|
12
|
+
end
|
13
|
+
|
14
|
+
def image_box
|
15
|
+
voo.size ||= :medium
|
16
|
+
wrap_with :div, title: image_box_title, class: "image-box #{voo.size}" do
|
17
|
+
yield image_box_size
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
## METHODS FOR OVERRIDE
|
22
|
+
|
23
|
+
def image_box_size
|
24
|
+
IMAGE_BOX_SIZE_MAP[voo.size.to_sym] || :medium
|
25
|
+
end
|
26
|
+
|
27
|
+
def image_box_card_name
|
28
|
+
card.name.junction? ? card.name.left : card.name
|
29
|
+
end
|
30
|
+
|
31
|
+
def image_box_link_target
|
32
|
+
image_box_card_name
|
33
|
+
end
|
34
|
+
|
35
|
+
def image_box_title
|
36
|
+
voo.title || image_box_card_name
|
37
|
+
end
|
38
|
+
end
|
metadata
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: card-mod-bar_and_box
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.11.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ethan McCutchen
|
8
|
+
- Philipp Kühl
|
9
|
+
- Gerry Gleason
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2020-12-24 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: card
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - '='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.101.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - '='
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: 1.101.0
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: card-mod-style
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - '='
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: 0.11.0
|
36
|
+
type: :runtime
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - '='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 0.11.0
|
43
|
+
description: ''
|
44
|
+
email:
|
45
|
+
- info@decko.org
|
46
|
+
executables: []
|
47
|
+
extensions: []
|
48
|
+
extra_rdoc_files: []
|
49
|
+
files:
|
50
|
+
- lib/stylesheets/style_image_box.scss
|
51
|
+
- set/abstract/media.rb
|
52
|
+
- set/abstract/media/media_snippet.haml
|
53
|
+
- set/all/bar.haml
|
54
|
+
- set/all/bar.rb
|
55
|
+
- set/all/box.haml
|
56
|
+
- set/all/box.rb
|
57
|
+
- set/all/expanded_bar.haml
|
58
|
+
- set/self/style_media.rb
|
59
|
+
- set/type/image.rb
|
60
|
+
homepage: http://decko.org
|
61
|
+
licenses:
|
62
|
+
- GPL-3.0
|
63
|
+
metadata:
|
64
|
+
card-mod: bar_and_box
|
65
|
+
post_install_message:
|
66
|
+
rdoc_options: []
|
67
|
+
require_paths:
|
68
|
+
- lib
|
69
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '2.5'
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
requirements: []
|
80
|
+
rubygems_version: 3.0.3
|
81
|
+
signing_key:
|
82
|
+
specification_version: 4
|
83
|
+
summary: bar and box views
|
84
|
+
test_files: []
|