polaris_view_helpers 0.0.4 → 0.0.5
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/views/polaris/_annotated_section.html.erb +19 -0
- data/app/views/polaris/_annotated_section_select.html.erb +35 -0
- data/app/views/polaris/_form_layout_item.html.erb +12 -0
- data/app/views/polaris/_form_layout_item_select.html.erb +15 -0
- data/lib/polaris_view_helpers/helper.rb +52 -0
- data/lib/polaris_view_helpers/version.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 161d564f644bf953820e86a5d0597a35ff618b4b
|
4
|
+
data.tar.gz: 089eac353984a5679fd99da2687d095af1182a69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a21667a767d715a2fd4461a526f173826f8053cb6b3296e5dd6d53a8cbc1f9b307b5241e89ca29d3e70f27b8956fc09fec40a135dae1b19e52222c971a3cd30
|
7
|
+
data.tar.gz: d17ae234153ec6a931ec4941715aba0435ec10774f02b2d9b0bc340714317180d4e331ce885f372649a8069cf9857bc62216f90e0c1532ac717d1e8edd9f6977
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<div class="Polaris-Layout__AnnotatedSection">
|
2
|
+
<div class="Polaris-Layout__AnnotationWrapper">
|
3
|
+
<div class="Polaris-Layout__Annotation">
|
4
|
+
<div class="Polaris-TextContainer">
|
5
|
+
<h2 class="Polaris-Heading"><%= heading %></h2>
|
6
|
+
<%= description %>
|
7
|
+
</div>
|
8
|
+
</div>
|
9
|
+
<div class="Polaris-Layout__AnnotationContent">
|
10
|
+
<div class="Polaris-Card">
|
11
|
+
<div class="Polaris-Card__Section">
|
12
|
+
<div class="Polaris-FormLayout">
|
13
|
+
<%= capture(&block) %>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
</div>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<div class="Polaris-Layout__AnnotatedSection">
|
2
|
+
<div class="Polaris-Layout__AnnotationWrapper">
|
3
|
+
<div class="Polaris-Layout__Annotation">
|
4
|
+
<div class="Polaris-TextContainer">
|
5
|
+
<%= capture(&block) %>
|
6
|
+
</div>
|
7
|
+
</div>
|
8
|
+
<div class="Polaris-Layout__AnnotationContent">
|
9
|
+
<div class="Polaris-Card">
|
10
|
+
<div class="Polaris-Card__Section">
|
11
|
+
<div class="Polaris-FormLayout">
|
12
|
+
|
13
|
+
<% attribute.each do |att| %>
|
14
|
+
<div class="Polaris-FormLayout__Item">
|
15
|
+
<div class="">
|
16
|
+
<div class="Polaris-Labelled__LabelWrapper">
|
17
|
+
<div class="Polaris-Label">
|
18
|
+
<%= form.label att, class: 'Polaris-Label__Text' %>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
<div class="Polaris-Select">
|
22
|
+
<%= form.send(element_type, att, select_options, {}, id: "#{form.object.class.name.tableize.singularize}_#{att}", class: "Polaris-Select__Input") %>
|
23
|
+
<div class="Polaris-Select__Icon"><span class="Polaris-Icon"><svg class="Polaris-Icon__Svg" viewBox="0 0 20 20"><path d="M13 8l-3-3-3 3h6zm-.1 4L10 14.9 7.1 12h5.8z" fill-rule="evenodd"></path></svg></span></div>
|
24
|
+
<div class="Polaris-Select__Backdrop"></div>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
<% end %>
|
29
|
+
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
</div>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<div class="Polaris-FormLayout__Item">
|
2
|
+
<div class="">
|
3
|
+
<div class="Polaris-Labelled__LabelWrapper">
|
4
|
+
<div class="Polaris-Label">
|
5
|
+
<%= form.label att, text, class: 'Polaris-Label__Text' %>
|
6
|
+
</div>
|
7
|
+
</div>
|
8
|
+
<div class="Polaris-TextField">
|
9
|
+
<%= capture(&block) %>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
</div>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<div class="Polaris-FormLayout__Item">
|
2
|
+
<div class="">
|
3
|
+
<div class="Polaris-Labelled__LabelWrapper">
|
4
|
+
<div class="Polaris-Label">
|
5
|
+
<%= form.label att, text, class: 'Polaris-Label__Text' %>
|
6
|
+
</div>
|
7
|
+
</div>
|
8
|
+
<div class="Polaris-Select">
|
9
|
+
<%= capture(&block) %>
|
10
|
+
<div class="Polaris-Select__Icon"><span class="Polaris-Icon"><svg class="Polaris-Icon__Svg" viewBox="0 0 20 20"><path d="M13 8l-3-3-3 3h6zm-.1 4L10 14.9 7.1 12h5.8z" fill-rule="evenodd"></path></svg></span></div>
|
11
|
+
<div class="Polaris-Select__Backdrop"></div>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
|
@@ -65,6 +65,41 @@ module PolarisViewHelpers
|
|
65
65
|
)
|
66
66
|
end
|
67
67
|
|
68
|
+
def polaris_annotated_section(heading:'', description:'', &block)
|
69
|
+
render(
|
70
|
+
partial: 'polaris/annotated_section',
|
71
|
+
locals: {
|
72
|
+
heading: heading,
|
73
|
+
description: description,
|
74
|
+
block: block
|
75
|
+
}
|
76
|
+
)
|
77
|
+
end
|
78
|
+
|
79
|
+
def polaris_form_layout_item(form, att, text = nil, &block)
|
80
|
+
render(
|
81
|
+
partial: 'polaris/form_layout_item',
|
82
|
+
locals: {
|
83
|
+
form: form,
|
84
|
+
att: att,
|
85
|
+
text: text,
|
86
|
+
block: block
|
87
|
+
}
|
88
|
+
)
|
89
|
+
end
|
90
|
+
|
91
|
+
def polaris_form_layout_item_select(form, att, text = nil, &block)
|
92
|
+
render(
|
93
|
+
partial: 'polaris/form_layout_item_select',
|
94
|
+
locals: {
|
95
|
+
form: form,
|
96
|
+
att: att,
|
97
|
+
text: text,
|
98
|
+
block: block
|
99
|
+
}
|
100
|
+
)
|
101
|
+
end
|
102
|
+
|
68
103
|
def polaris_annotated_section_text_field(form, attribute, element_type = :text_field, &block)
|
69
104
|
unless attribute.is_a? Array
|
70
105
|
attribute = [attribute]
|
@@ -81,6 +116,23 @@ module PolarisViewHelpers
|
|
81
116
|
)
|
82
117
|
end
|
83
118
|
|
119
|
+
def polaris_annotated_section_select(form, attribute, select_options = [], element_type = :select, &block)
|
120
|
+
unless attribute.is_a? Array
|
121
|
+
attribute = [attribute]
|
122
|
+
end
|
123
|
+
|
124
|
+
render(
|
125
|
+
partial: 'polaris/annotated_section_select',
|
126
|
+
locals: {
|
127
|
+
form: form,
|
128
|
+
attribute: attribute,
|
129
|
+
element_type: element_type,
|
130
|
+
select_options: select_options,
|
131
|
+
block: block
|
132
|
+
}
|
133
|
+
)
|
134
|
+
end
|
135
|
+
|
84
136
|
def polaris_annotated_section_input(form, attribute, input, &block)
|
85
137
|
unless attribute.is_a? Array
|
86
138
|
attribute = [attribute]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polaris_view_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Green
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -48,12 +48,16 @@ files:
|
|
48
48
|
- MIT-LICENSE
|
49
49
|
- README.rdoc
|
50
50
|
- Rakefile
|
51
|
+
- app/views/polaris/_annotated_section.html.erb
|
51
52
|
- app/views/polaris/_annotated_section_input.html.erb
|
53
|
+
- app/views/polaris/_annotated_section_select.html.erb
|
52
54
|
- app/views/polaris/_annotated_section_text_field.html.erb
|
53
55
|
- app/views/polaris/_banner.html.erb
|
54
56
|
- app/views/polaris/_banner_actions.html.erb
|
55
57
|
- app/views/polaris/_button_link_to.html.erb
|
56
58
|
- app/views/polaris/_button_tag.html.erb
|
59
|
+
- app/views/polaris/_form_layout_item.html.erb
|
60
|
+
- app/views/polaris/_form_layout_item_select.html.erb
|
57
61
|
- app/views/polaris/_model_errors.html.erb
|
58
62
|
- app/views/polaris/_page_actions.html.erb
|
59
63
|
- app/views/polaris/banner_icons/_critical.html.erb
|
@@ -197,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
197
201
|
version: '0'
|
198
202
|
requirements: []
|
199
203
|
rubyforge_project:
|
200
|
-
rubygems_version: 2.
|
204
|
+
rubygems_version: 2.5.1
|
201
205
|
signing_key:
|
202
206
|
specification_version: 4
|
203
207
|
summary: Rails helpers for Shopify Polaris.
|