polaris_view_helpers 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ffb4874256c1072a5148ff4b2637e6554629dd1
4
- data.tar.gz: d08189d0f3f2b830eb356630434b4743d71f4895
3
+ metadata.gz: 5c3748555b4c3a22d0cabe1552387577b4ba8c14
4
+ data.tar.gz: 80e24b8191c24799b028809f39202cfacbb25086
5
5
  SHA512:
6
- metadata.gz: 71fc47724d5faddcf01e47d2bc749344e959cc0287cd177bdf6cd1c3393a2b36141675be7d4150777fb8a23f7534e977939c0cf94565bfc2a42e92202a96dde0
7
- data.tar.gz: 9f086d43e4e1c459554c12df33bff08763b9f8f587b27bfbac34c8463232117d1cfe953f928c2f53309b656e611fd56eaa872175330a3fc101566e958dfcb523
6
+ metadata.gz: cdec0d069d36a97cde752090dbbfedaaf3b0d3ec7af43be1690f8edbc4760449a036187c238caad1fad9138134543ac2af1873e3cd4613d774143c3e97139ca8
7
+ data.tar.gz: 97db3d61d02332b0769e1eaed3e1d13281dbdffcc2e99d521eca625f308fb63c0dcbecb31354290732805b06eb75216cb115b82a4ae5f19ec04b0272c7f3f5de
@@ -1,83 +1,85 @@
1
- module PolarisViewHelpers::Helper
1
+ module PolarisViewHelpers
2
+ module Helper
2
3
 
3
- def polaris_banner(options, &block)
4
- render(
5
- partial: 'polaris/banner',
6
- locals: { options: options, block: block }
7
- )
8
- end
4
+ def polaris_banner(options, &block)
5
+ render(
6
+ partial: 'polaris/banner',
7
+ locals: { options: options, block: block }
8
+ )
9
+ end
9
10
 
10
- def polaris_banner_actions(&block)
11
- render(
12
- partial: 'polaris/banner_actions',
13
- locals: { block: block }
14
- )
15
- end
11
+ def polaris_banner_actions(&block)
12
+ render(
13
+ partial: 'polaris/banner_actions',
14
+ locals: { block: block }
15
+ )
16
+ end
17
+
18
+ def polaris_button_link_to(name = nil, link_destination = nil, button_options = nil, &block)
19
+ if block_given?
20
+ button_options, link_destination, name = link_destination, name, nil
21
+ end
22
+ button_options ||= {}
16
23
 
17
- def polaris_button_link_to(name = nil, link_destination = nil, button_options = nil, &block)
18
- if block_given?
19
- button_options, link_destination, name = link_destination, name, nil
24
+ additional_classes = ""
25
+ (button_options[:modifiers] || []).each do |modifier|
26
+ additional_classes += "Polaris-Button--#{modifier} "
27
+ end
28
+ render(
29
+ partial: 'polaris/button_link_to',
30
+ locals: {
31
+ name: name,
32
+ block: block,
33
+ additional_classes: additional_classes,
34
+ link_destination: link_destination,
35
+ method: button_options[:method]
36
+ }
37
+ )
20
38
  end
21
- button_options ||= {}
22
39
 
23
- additional_classes = ""
24
- (button_options[:modifiers] || []).each do |modifier|
25
- additional_classes += "Polaris-Button--#{modifier} "
40
+ def polaris_model_errors model
41
+ render(
42
+ partial: 'polaris/model_errors',
43
+ locals: { model: model }
44
+ )
26
45
  end
27
- render(
28
- partial: 'polaris/button_link_to',
29
- locals: {
30
- name: name,
31
- block: block,
32
- additional_classes: additional_classes,
33
- link_destination: link_destination,
34
- method: button_options[:method]
35
- }
36
- )
37
- end
38
46
 
39
- def polaris_model_errors model
40
- render(
41
- partial: 'polaris/model_errors',
42
- locals: { model: model }
43
- )
44
- end
47
+ def polaris_page_actions(options)
48
+ render(
49
+ partial: 'polaris/page_actions',
50
+ locals: options
51
+ )
52
+ end
45
53
 
46
- def polaris_page_actions(options)
47
- render(
48
- partial: 'polaris/page_actions',
49
- locals: options
50
- )
51
- end
54
+ def polaris_button_tag(name, button_options)
55
+ additional_classes = ""
56
+ (button_options[:modifiers] || []).each do |modifier|
57
+ additional_classes += "Polaris-Button--#{modifier} "
58
+ end
52
59
 
53
- def polaris_button_tag(name, button_options)
54
- additional_classes = ""
55
- (button_options[:modifiers] || []).each do |modifier|
56
- additional_classes += "Polaris-Button--#{modifier} "
60
+ button_options[:additional_classes] = additional_classes
61
+ button_options[:name] = name
62
+ render(
63
+ partial: 'polaris/button_tag',
64
+ locals: button_options
65
+ )
57
66
  end
58
67
 
59
- button_options[:additional_classes] = additional_classes
60
- button_options[:name] = name
61
- render(
62
- partial: 'polaris/button_tag',
63
- locals: button_options
64
- )
65
- end
68
+ def polaris_annotated_section_text_field(form, attribute, element_type = :text_field, &block)
69
+ unless attribute.is_a? Array
70
+ attribute = [attribute]
71
+ end
66
72
 
67
- def polaris_annotated_section_text_field(form, attribute, element_type = :text_field, &block)
68
- unless attribute.is_a? Array
69
- attribute = [attribute]
73
+ render(
74
+ partial: 'polaris/annotated_section_text_field',
75
+ locals: {
76
+ form: form,
77
+ attribute: attribute,
78
+ element_type: element_type,
79
+ block: block
80
+ }
81
+ )
70
82
  end
71
83
 
72
- render(
73
- partial: 'polaris/annotated_section_text_field',
74
- locals: {
75
- form: form,
76
- attribute: attribute,
77
- element_type: element_type,
78
- block: block
79
- }
80
- )
81
84
  end
82
-
83
85
  end
@@ -1,3 +1,3 @@
1
1
  module PolarisViewHelpers
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polaris_view_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Green