tenon 1.0.54 → 1.0.55
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/models/tenon/page.rb +9 -3
- data/app/views/tenon/contacts/index.json.jbuilder +2 -2
- data/lib/tenon/version.rb +1 -1
- data/spec/models/tenon/page_spec.rb +3 -4
- data/spec/spec_helper.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a595eb9d310c421bc5d80fda47abfb6a8ca62b4c
|
|
4
|
+
data.tar.gz: 5bdcfec5911797f26b3cd85f02a0838fe2914f60
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 365e07dd906fa410d382c951ff1cb55dae626af53e34d7a134dbd19ce8cf3846df79171c15c700c0b972dd075afe43d17bf0cf1fec1aca8a9b33cf25c5bdf35a
|
|
7
|
+
data.tar.gz: 8bb06bea0ff9c4992b52a72de04065235366f665335ff6a03cb77dea10d03cf3dfe4736f6b21d26a70f37afd423a0a4d2214495f87c25e1bd591faa258641fee
|
data/app/models/tenon/page.rb
CHANGED
|
@@ -7,8 +7,10 @@ module Tenon
|
|
|
7
7
|
tenon_content :content, i18n: true
|
|
8
8
|
default_scope { order('tenon_pages.lft, tenon_pages.list_order') }
|
|
9
9
|
scope :published, -> { where('publish_at <= ?', Time.now) }
|
|
10
|
-
scope :
|
|
10
|
+
scope :for_menu, -> { published.where(show_in_menu: true) }
|
|
11
11
|
scope :top, -> { where(parent_id: nil) }
|
|
12
|
+
scope :find_for_menu, -> { top.for_menu } # Backwards compatibility
|
|
13
|
+
|
|
12
14
|
|
|
13
15
|
# Relationships
|
|
14
16
|
belongs_to :parent, class_name: 'Page', foreign_key: 'parent_id'
|
|
@@ -30,12 +32,16 @@ module Tenon
|
|
|
30
32
|
if subpages.blank?
|
|
31
33
|
siblings_for_menu
|
|
32
34
|
else
|
|
33
|
-
subpages.
|
|
35
|
+
subpages.for_menu
|
|
34
36
|
end
|
|
35
37
|
end
|
|
36
38
|
|
|
37
39
|
def siblings_for_menu
|
|
38
|
-
|
|
40
|
+
if parent
|
|
41
|
+
parent.subpages_for_menu
|
|
42
|
+
else
|
|
43
|
+
[]
|
|
44
|
+
end
|
|
39
45
|
end
|
|
40
46
|
|
|
41
47
|
def self.reorder!(list, parent_id)
|
|
@@ -2,8 +2,8 @@ json.records do
|
|
|
2
2
|
json.array!(@contacts) do |contact|
|
|
3
3
|
json.extract!(contact, :id, :name, :email, :phone, :content, :sent_date, :user_ip, :user_agent, :referrer)
|
|
4
4
|
json.display_link action_link("View Contact Details", '#', 'eye', 'data-modal-target' => "#contact-#{contact.id}", 'data-modal-title' => 'Contact Details')
|
|
5
|
-
json.read_link toggle_link(contact, 'read', toggle_read_contact_path(contact), ['folder-open-o', '
|
|
6
|
-
json.reply_link toggle_link(contact, 'replied', toggle_replied_contact_path(contact), ['check', '
|
|
5
|
+
json.read_link toggle_link(contact, 'read', toggle_read_contact_path(contact), ['folder-open-o', 'Mark as Unread'], ['folder-o', 'Mark as Read'])
|
|
6
|
+
json.reply_link toggle_link(contact, 'replied', toggle_replied_contact_path(contact), ['check', 'Mark as Pending'], ['reply', 'Mark as Replied'])
|
|
7
7
|
json.delete_link delete_link(contact)
|
|
8
8
|
end
|
|
9
9
|
end
|
data/lib/tenon/version.rb
CHANGED
|
@@ -23,8 +23,7 @@ describe Tenon::Page do
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
it 'should grab the subpages that are available for the menu' do
|
|
26
|
-
|
|
27
|
-
expect(subpages).to receive(:where).with(args)
|
|
26
|
+
expect(subpages).to receive(:for_menu)
|
|
28
27
|
page.subpages_for_menu
|
|
29
28
|
end
|
|
30
29
|
end
|
|
@@ -36,8 +35,8 @@ describe Tenon::Page do
|
|
|
36
35
|
page.stub(:parent) { nil }
|
|
37
36
|
end
|
|
38
37
|
|
|
39
|
-
it 'should return
|
|
40
|
-
expect(page.siblings_for_menu).to
|
|
38
|
+
it 'should return an empty array' do
|
|
39
|
+
expect(page.siblings_for_menu).to eq([])
|
|
41
40
|
end
|
|
42
41
|
end
|
|
43
42
|
|
data/spec/spec_helper.rb
CHANGED
|
@@ -14,7 +14,7 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
|
|
14
14
|
FactoryGirl.definition_file_paths += %W(lib/tenon/factories)
|
|
15
15
|
FactoryGirl.reload
|
|
16
16
|
|
|
17
|
-
ActiveRecord::Migration.
|
|
17
|
+
ActiveRecord::Migration.maintain_test_schema! if defined?(ActiveRecord::Migration)
|
|
18
18
|
|
|
19
19
|
RSpec.configure do |config|
|
|
20
20
|
config.include Tenon::Engine.routes.url_helpers
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tenon
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.55
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- factor[e] design initiative
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-01-
|
|
11
|
+
date: 2015-01-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: better_errors
|