para-seo_tools 0.4.3 → 0.4.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6e220801b91af4f208d0699b1ad222e6da70a14a
4
- data.tar.gz: 038f5d4d193c3dc4cf4b28d4952075e814e2c83c
3
+ metadata.gz: 963b8c1e96cb711ed75e3331dc352557be853672
4
+ data.tar.gz: b22ecd8d54cf19e155e598eaafded1204292e664
5
5
  SHA512:
6
- metadata.gz: e5eae100d8ef70eb4cf1527b523a2390f0b0c797ba4c6a311dbcb20d12a592ea2f636148cc2913a6025aeca2633da888e43f926a0576a1ef461232850e96e38a
7
- data.tar.gz: 2b4f5c397b6638653c7ddc7526aed32ff9b01b723540093fbcddc49d0abcad40024d65359f07aa5764af95afc72de32a17d24663f3b64e63dcbc7aa2f36ab726
6
+ metadata.gz: ec6e122729a5b47932f5659c5a53e11b04360b97819efc6e93939216cab0b412b3bebd4c57aff4913cbfeb74a4c366c34198b9b8f7270fee69f51b5dbfac6bb4
7
+ data.tar.gz: 94f0d7408d3a93399a80e248d84d7947cb300f0cdc97f897a5a55f16b283e630f57b954e8d583ca16652ee5ac7ff3413ac1af8d94569d91a00195c6478c7820f
@@ -53,6 +53,12 @@ module Para
53
53
  Arel::Nodes::SqlLiteral.new(expr.to_sql)
54
54
  end
55
55
 
56
+ ransacker :subdomain do |parent|
57
+ expr = Arel::Nodes::InfixOperation.new('->>', parent.table[:config], Arel::Nodes.build_quoted('subdomain'))
58
+
59
+ Arel::Nodes::SqlLiteral.new(expr.to_sql)
60
+ end
61
+
56
62
  def scope_attributes
57
63
  scope.each_with_object({}) do |attribute, hash|
58
64
  hash[attribute] = if self.class.column_names.include?(attribute.to_s)
@@ -84,7 +90,7 @@ module Para
84
90
  host << Para::SeoTools.host
85
91
  end
86
92
 
87
- host.compact.join('.')
93
+ host = host.compact.join('.')
88
94
 
89
95
  [Para::SeoTools.protocol, host].join('://')
90
96
  end
@@ -112,6 +118,12 @@ module Para
112
118
  end
113
119
  end
114
120
 
121
+ def self.available_subdomains
122
+ select("DISTINCT(config->>'subdomain') AS subdomain").map do |page|
123
+ page.read_attribute(:subdomain)
124
+ end
125
+ end
126
+
115
127
  def method_missing(method_name, *args, &block)
116
128
  if config.key?(method_name.to_s)
117
129
  config[method_name.to_s]
@@ -1,25 +1,18 @@
1
1
  = search_form_for @q, builder: SimpleForm::FormBuilder, url: @component.path, html: { data: { :'filters-form' => true } } do |form|
2
- - if @available_locales.length > 1
3
- .row
4
- .col-md-3
5
- = form.input_field :locale_eq, as: :selectize, collection: @available_locales, class: 'form-control', placeholder: t('para.seo_tools.pages.choose_locale')
6
-
7
- .col-md-7
8
- .input-group
9
- %span.input-group-addon
10
- %i.fa.fa-search
11
-
12
- = form.input_field :identifier_or_path_or_title_or_description_or_keywords_or_canonical_cont, as: :string, placeholder: t('para.shared.search'), class: 'form-control'
13
-
14
- .col-md-2
15
- = form.submit t('para.shared.search'), class: 'btn btn-default btn-block'
16
-
17
- - else
18
- .input-group
19
- %span.input-group-addon
20
- %i.fa.fa-search
21
-
22
- = form.input_field :identifier_or_path_or_title_or_description_or_keywords_or_canonical_cont, as: :string, placeholder: t('para.shared.search'), class: 'form-control'
23
-
24
- %span.input-group-btn
25
- = form.submit t('para.shared.search'), class: 'btn btn-default'
2
+ %table
3
+ %tbody
4
+ %tr
5
+ - if Para::SeoTools.handle_subdomain
6
+ %td{ width: '15%', style: 'padding-right: 10px;' }
7
+ = form.input_field :subdomain_eq, as: :selectize, collection: Para::SeoTools::Page.available_subdomains, class: 'form-control', placeholder: t('para.seo_tools.pages.subdomain')
8
+ - if @available_locales.length > 1
9
+ %td{ width: '15%', style: 'padding-right: 10px;' }
10
+ = form.input_field :locale_eq, as: :selectize, collection: @available_locales, class: 'form-control', placeholder: t('para.seo_tools.pages.choose_locale')
11
+ %td{ width: '80%' }
12
+ .col-sm-12
13
+ .input-group
14
+ %span.input-group-addon
15
+ %i.fa.fa-search
16
+ = form.input_field :identifier_or_path_or_title_or_description_or_keywords_or_canonical_cont, as: :string, placeholder: t('para.shared.search'), class: 'form-control'
17
+ %td{ width: '20%' }
18
+ = form.submit t('para.shared.search'), class: 'btn btn-default btn-block'
@@ -1,5 +1,6 @@
1
1
  = resources_table(model: model, component: component, actions: false) do |table|
2
2
  = table.header do
3
+ = table.header_for(:subdomain, sort: :subdomain) if Para::SeoTools.handle_subdomain
3
4
  = table.header_for(:path)
4
5
  = table.header_for(:title)
5
6
  = table.header_for(:description)
@@ -7,6 +8,7 @@
7
8
  %th
8
9
 
9
10
  = table.rows(resources) do |resource|
11
+ = table.data_for(resource.subdomain) if Para::SeoTools.handle_subdomain
10
12
  = table.data_for(resource, :path)
11
13
  = table.data_for(resource.meta_tag(:title))
12
14
  = table.data_for(resource.meta_tag(:description))
@@ -8,6 +8,7 @@ fr:
8
8
  refresh_skeleton: "Mettre à jour"
9
9
  ping_search_engines: "Envoyer le sitemap aux moteurs de recherche"
10
10
  choose_locale: "Choisissez une langue"
11
+ subdomain: Sous-domaine
11
12
 
12
13
  jobs:
13
14
  para/seo_tools/skeleton/job:
@@ -33,4 +34,5 @@ fr:
33
34
  image: "Image pour le partage sur les réseaux sociaux"
34
35
  canonical: "URL canonique"
35
36
  locale: "Langue"
37
+ subdomain: "Sous-domaine"
36
38
 
@@ -3,7 +3,7 @@ class CreateSeoToolsPages < ActiveRecord::Migration
3
3
  create_table :seo_tools_pages do |t|
4
4
  t.string :identifier
5
5
  t.string :path
6
- t.references :meta_tags_list, index: true, foreign_key: true
6
+ t.references :meta_tags_list, index: true
7
7
 
8
8
  t.timestamps null: false
9
9
  end
@@ -5,6 +5,12 @@ Para::SeoTools.configure do |config|
5
5
  #
6
6
  # config.host = ENV['APP_DOMAIN']
7
7
 
8
+ # Set a regexp to filter path from skeleton
9
+ #
10
+ # Defaults to '.*', matching all path
11
+ #
12
+ # config.sitemap_path_regexp = '.*'
13
+
8
14
  # Default title methods to be checked for title
9
15
  #
10
16
  # config.title_methods = %w(title name)
@@ -18,7 +18,7 @@ module Para
18
18
 
19
19
  def current_seo_tools_page
20
20
  RequestStore.store['para.seo_tools.current_seo_tools_page'] ||=
21
- seo_tools_page_for({ path: request.path }.merge(seo_tools_scope_for(request)))
21
+ seo_tools_page_for({ path: request.path }.reverse_merge(seo_tools_scope_for(request)))
22
22
  end
23
23
 
24
24
  # Retrieve the first page that matches the given scope conditions
@@ -48,7 +48,7 @@ module Para
48
48
 
49
49
  return Para::SeoTools::Page.none unless source_page
50
50
 
51
- scope_hash = scope_hash.merge(seo_tools_scope_for(request))
51
+ scope_hash = scope_hash.reverse_merge(seo_tools_scope_for(request))
52
52
  source_page.siblings.scope_with(scope_hash)
53
53
  end
54
54
 
@@ -10,7 +10,7 @@ module Para
10
10
  prepare
11
11
 
12
12
  SitemapGenerator::Sitemap.create do
13
- Para::SeoTools::Page.find_each do |page|
13
+ Para::SeoTools::Page.where('path ~* ?', Para::SeoTools.sitemap_path_regexp).find_each do |page|
14
14
  add page.path, host: page.host
15
15
  end
16
16
  end
@@ -1,5 +1,5 @@
1
1
  module Para
2
2
  module SeoTools
3
- VERSION = "0.4.3"
3
+ VERSION = "0.4.6"
4
4
  end
5
5
  end
@@ -52,6 +52,9 @@ module Para
52
52
  mattr_accessor :sitemaps_path
53
53
  @@sitemaps_path = 'system/'
54
54
 
55
+ mattr_accessor :sitemap_path_regexp
56
+ @@sitemap_path_regexp = '.*'
57
+
55
58
  def self.configure
56
59
  block_given? ? yield(self) : self
57
60
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency 'rails', '>= 4.0', '< 5.0'
21
+ spec.add_dependency 'rails', '>= 4.0', '< 6.0'
22
22
  spec.add_dependency 'sitemap_generator'
23
23
  spec.add_dependency 'request_store'
24
24
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: para-seo_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Valentin Ballestrino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-07 00:00:00.000000000 Z
11
+ date: 2017-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '4.0'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '5.0'
22
+ version: '6.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '4.0'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '5.0'
32
+ version: '6.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: sitemap_generator
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -89,8 +89,7 @@ dependencies:
89
89
  description: SEO tools for the Para CMS
90
90
  email:
91
91
  - vala@glyph.fr
92
- executables:
93
- - rails
92
+ executables: []
94
93
  extensions: []
95
94
  extra_rdoc_files: []
96
95
  files:
@@ -114,7 +113,6 @@ files:
114
113
  - app/views/admin/para/seo_tools/pages/_form.html.haml
115
114
  - app/views/admin/para/seo_tools/pages/_table.html.haml
116
115
  - app/views/admin/para/seo_tools/skeleton_resources/index.html.haml
117
- - bin/rails
118
116
  - config/locales/para-seo_tools.fr.yml
119
117
  - db/migrate/20150601085253_create_seo_tools_pages.rb
120
118
  - db/migrate/20160610094032_add_meta_tags_to_seo_tools_pages.rb
@@ -177,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
175
  version: '0'
178
176
  requirements: []
179
177
  rubyforge_project:
180
- rubygems_version: 2.6.7
178
+ rubygems_version: 2.6.8
181
179
  signing_key:
182
180
  specification_version: 4
183
181
  summary: SEO tools for the Para CMS
data/bin/rails DELETED
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
3
-
4
- ENGINE_ROOT = File.expand_path('../..', __FILE__)
5
- ENGINE_PATH = File.expand_path('../../lib/para/seo_tools/engine', __FILE__)
6
-
7
- # Set up gems listed in the Gemfile.
8
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
9
- require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
10
-
11
- require 'rails/all'
12
- require 'rails/engine/commands'