rooftop-rails-extras 0.2.0 → 0.2.1.1

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: 146aac62fdbc7ca8d90c1751b3ea0677c50d267e
4
- data.tar.gz: 476df8a7cd38c68d0b1b71d748076ab4c813fd7b
3
+ metadata.gz: 76589a59cb36a9526dc3eacaf59330d6e4197cfe
4
+ data.tar.gz: fc103d0debc030915a8dc5183ae205b40d8618a1
5
5
  SHA512:
6
- metadata.gz: 564b6903a2805f46de117e36ce67a7779119aa604e263c0602e65c6f462d07f99faaf8aa0f0d192e8fc56c952c36a1c6ad61e1ca1f1945bacf19670606439f3c
7
- data.tar.gz: cb430ca435d51dbf74e181091a67c4b8d6afe61fa4890bf60f71ca043d25f41cf251d3cbd6a7a3c5062827b7870ebd223c21faebc79a2a132ce1a1d34fbadce0
6
+ metadata.gz: 3cfa877b3df97a12d9a6d8bdcf7c90a6ad45b0fdc454e3a805960b24ea52c5532efb3fea601315c306b38484c77d0d90d27adf09de456a625e8cad8aa38350fd
7
+ data.tar.gz: 48deb5ff95bbf3e1e2407b9700e73adc221a9568abe5dd263ec56464af657c752f71c62edbf133321a9a3a10fb018df6b3f2a2119d636e10337e8b85a9624520
data/README.md CHANGED
@@ -108,6 +108,8 @@ How you build the form is up to you, but here's a quick way to use the fields yo
108
108
  <!-- these hidden tags tell the controller how to redirect the user. If there's an error, we'll redirect back to this page, with get params for the errors and each completed field. If there isn't, the user is redirected to the thankyou page -->
109
109
  <%= hidden_field_tag :from_page, page.id %>
110
110
  <%= hidden_field_tag :to_page, page.thankyou_page_id %>
111
+ <!-- This tag can be included if you want, it's a honeypot so make sure you leave it empty -->
112
+ <%= text_field_tag :human_check, "", class: "somethinghidden" %>
111
113
 
112
114
  <p><input type="submit" id="submit" value="Send" /></p>
113
115
  <% end %>
@@ -28,6 +28,10 @@ module Rooftop
28
28
  raise ArgumentError, "You need to call contact_form=(YourClass) in your controller, which must inherit from Rooftop::Rails::Extras::ContactForm" unless self.class.contact_form.ancestors.include?(Rooftop::Rails::Extras::ContactForm)
29
29
  raise ArgumentError, "You need to include hidden fields for from_page and to_page IDs, so this controller can redirect appropriately" unless params.has_key?(:from_page) && params.has_key?(:to_page)
30
30
  form = self.class.contact_form.new(contact_form_params)
31
+ if params.has_key?(:human_check) && params[:human_check].present?
32
+ # the honeypot has been hit - raise an error
33
+ raise ActionController::RoutingError, "you posted a human_check parameter, which is never supposed to be filled in (it's a honeypot)"
34
+ end
31
35
  from_page, to_page = *self.class.page_class.where(post__in: [params[:from_page], params[:to_page]], orderby: :post__in)
32
36
  if form.deliver
33
37
  redirect_to Rooftop::Rails::RouteResolver.new(:page, to_page.nested_path).resolve
@@ -12,6 +12,7 @@ module Rooftop
12
12
  raise ArgumentError, "You passed a current #{entity.class.to_s.downcase} which isn't a #{entity.class} object" unless (default_opts[:current].nil? || default_opts[:current].is_a?(entity.class))
13
13
  resolved_children = entity.resolved_children
14
14
  if resolved_children.any?
15
+ # byebug
15
16
  content_tag(:ul, class: default_opts[:class]) do
16
17
  items = resolved_children.collect do |child|
17
18
  subnavigation_item_for(child, default_opts)
@@ -41,10 +42,6 @@ module Rooftop
41
42
  }.merge(opts)
42
43
  item_path = path_for_menu_item(item)
43
44
  item_class = path_matches?(item_path) ? default_opts[:current_class] : ""
44
- # add the status into the item class
45
- if item.respond_to?(:status)
46
- item_class += " status-#{item.status}"
47
- end
48
45
  content_tag :li, class: item_class do
49
46
  link = content_tag :a, href: item_path do
50
47
  item.title.html_safe
@@ -90,10 +87,6 @@ module Rooftop
90
87
  list_opts = {}
91
88
  opts.reverse_merge!({level: 1})
92
89
  list_opts[:class] = opts[:current_class] if opts[:current].present? && opts[:current].id == entity.id
93
- # add the status if the item as a class
94
- if entity.respond_to?(:status)
95
- list_opts[:class] += " status-#{entity.status}"
96
- end
97
90
  # The link to the entity
98
91
  content_tag :li, list_opts do
99
92
 
@@ -1,7 +1,7 @@
1
1
  module Rooftop
2
2
  module Rails
3
3
  module Extras
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1.1"
5
5
  end
6
6
  end
7
7
  end
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["ed@errorstudio.co.uk"]
11
11
  spec.summary = %q{A selection of handy mixins for building Rails sites quickly with Rooftop}
12
12
  spec.description = %q{A selection of handy mixins for building Rails sites quickly with Rooftop}
13
- spec.homepage = ""
14
- spec.license = "GPLv3"
13
+ spec.homepage = "https://github.org/rooftopcms/rooftop-rails-extras"
14
+ spec.license = "GPL-3.0"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rooftop-rails-extras
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ed Jones
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-27 00:00:00.000000000 Z
11
+ date: 2016-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.6'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.6'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: require_all
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.3'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rooftop-rails
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 0.1.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.1.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: mail_form
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.5'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.5'
83
83
  description: A selection of handy mixins for building Rails sites quickly with Rooftop
@@ -87,7 +87,7 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
- - .gitignore
90
+ - ".gitignore"
91
91
  - Gemfile
92
92
  - LICENSE.txt
93
93
  - README.md
@@ -115,9 +115,9 @@ files:
115
115
  - lib/rooftop/rails/extras/engine.rb
116
116
  - lib/rooftop/rails/extras/version.rb
117
117
  - rooftop-rails-extras.gemspec
118
- homepage: ''
118
+ homepage: https://github.org/rooftopcms/rooftop-rails-extras
119
119
  licenses:
120
- - GPLv3
120
+ - GPL-3.0
121
121
  metadata: {}
122
122
  post_install_message:
123
123
  rdoc_options: []
@@ -125,17 +125,17 @@ require_paths:
125
125
  - lib
126
126
  required_ruby_version: !ruby/object:Gem::Requirement
127
127
  requirements:
128
- - - '>='
128
+ - - ">="
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
131
  required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  requirements:
133
- - - '>='
133
+ - - ">="
134
134
  - !ruby/object:Gem::Version
135
135
  version: '0'
136
136
  requirements: []
137
137
  rubyforge_project:
138
- rubygems_version: 2.2.2
138
+ rubygems_version: 2.5.1
139
139
  signing_key:
140
140
  specification_version: 4
141
141
  summary: A selection of handy mixins for building Rails sites quickly with Rooftop