quadro 0.5.4 → 0.5.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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MmU1MWJmZDIwYWJkZWYzZDcyYzIwMzYyYmFmODQ5M2E1ZDRlODM5Mw==
4
+ NTI2OTNmYjgxZmJkNzk0NjQ4YTllNmQxZDBiMzc3NDhkODUxM2RkOQ==
5
5
  data.tar.gz: !binary |-
6
- MjdiMWE3MDkwODYwMmU4MGM1ZDdmMTAzNjAzZDU2YjYyYTM3ZjhiYg==
6
+ NDIxNGFhNjE3ZjkwMjIxMzcwZGYwYjlmMjA0YmY3YzBlYWQxYzM3OQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NGY5OGIyMGZmMzc0MGYxNzQxZWQ1N2Q2Y2ViYTFhOWQyM2M1NTM4YjMyMDc0
10
- ZmI2YWZjMjA3NTNlYWJjOGM4OTgwZmY2OWY1MjBkMWVlZjhhZDg5Zjg3ZWI3
11
- MjE3NGMyNTBlMTViNTA3ZGVmOGViMzRiY2FiMTMxNzY3OTJhMjU=
9
+ ZDYxYjZmZjhhZjFlNmU2NDFiMzUxNDM3MDMwOTEwYjdjZjUyYzliZDA2YjNi
10
+ YzlhNTBkMTc1MDJhZDI3ZTZmYmIyYTcwMWM0MTgyODllYmIzZTg0NDExMzJl
11
+ ZmE4ZTc2ODg0ODhhODM0YThhNjMxY2MzMDk1ZjE4NGNkZjVmMzA=
12
12
  data.tar.gz: !binary |-
13
- YTQ1NzAxMjQxOTU1NWQ1ZTA3ZmQxMWM0ZWE0OGFhOTZiMTAxY2IwMzQyMjBm
14
- MGUzY2Y4MzdiZjI1YWVlMGU3MzA3MTQ3MzJiZDg3YWY1OTg4ZjljNDM2MWMz
15
- NzRjNWQ4ZGYyNmEwZGVkNTRjNmFkYzU2YTlhY2RlZTUwNmRlZDU=
13
+ YTRjOWI4OGQxZTYzOGM3MGM4OGRmMzg2ZGNlODE1NjIzMTZhMDc4ODkxOGY3
14
+ YWM0NmJlMDUyZWY2OGFmY2FlNmY4YzBmMzkwNzRjYjMwZGEyMjUzOTAwNTlh
15
+ ZWQ2YTQyMjViYzBkMTJlNWUzMjA2ZDU3NjJlMjY4ZWViODM5NDk=
data/README.md CHANGED
@@ -13,6 +13,7 @@ With **Quadro** you have the following features:
13
13
  - Create your own templates.
14
14
  - Make any area on your template editable.
15
15
  - Auto-generated sitemap.xml.
16
+ - Manual sitemap.xml ping to search engines (production only).
16
17
  - Upload images for each page.
17
18
  - Use summernote as inline content editor.
18
19
  - Slider with slick carousel.
@@ -115,6 +115,10 @@ module Quadro
115
115
  @geoip ||= MaxMindDB.new(File.join(Rails.root, 'db', 'GeoLite2-Country.mmdb'))
116
116
  end
117
117
 
118
+ def notifier
119
+ @notifier ||= SitemapNotifier::Notifier
120
+ end
121
+
118
122
  def user
119
123
  @user ||= current_user
120
124
  end
@@ -0,0 +1,13 @@
1
+ require_dependency 'quadro/application_controller'
2
+
3
+ module Quadro
4
+ class ToolsController < ApplicationController
5
+ before_filter :authenticate_user!
6
+
7
+ respond_to :js, :json, :xml
8
+
9
+ def sitemap_notifier
10
+ notifier.run(sitemap_url)
11
+ end
12
+ end
13
+ end
@@ -36,7 +36,7 @@ module Quadro
36
36
  delegate :name, :email, to: :author, prefix: true, allow_nil: true
37
37
 
38
38
  # scopes
39
- scope :ordered, order('quadro_pages.created_at DESC')
39
+ scope :ordered, order('quadro_pages.published_at DESC, quadro_pages.created_at DESC')
40
40
  scope :published, where('quadro_pages.published_at IS NOT NULL')
41
41
 
42
42
  # methods
@@ -15,7 +15,7 @@ xml.feed xmlns: "http://www.w3.org/2005/Atom" do
15
15
  xml.id Quadro.railtie_routes_url_helpers.page_url(page)
16
16
  xml.title page.title
17
17
  xml.updated l(page.updated_at, format: :atom, locale: :en)
18
- xml.published l(page.created_at, format: :atom, locale: :en)
18
+ xml.published l(page.published_at, format: :atom, locale: :en)
19
19
  xml.summary page.summary
20
20
  xml.author do
21
21
  xml.name page.author_name
@@ -16,7 +16,7 @@ xml.rss version: "2.0" do
16
16
  xml.title page.title
17
17
  xml.description page.summary
18
18
  xml.link Quadro.railtie_routes_url_helpers.page_url(page)
19
- xml.pubDate l(page.created_at, format: :rss, locale: :en)
19
+ xml.pubDate l(page.published_at, format: :rss, locale: :en)
20
20
  xml.author page.author_email
21
21
  xml.guid Quadro.railtie_routes_url_helpers.page_url(page), isPermaLink: true
22
22
  end
@@ -59,6 +59,11 @@
59
59
  = current_user.email
60
60
  %b.caret
61
61
  %ul.dropdown-menu
62
+ - unless Rails.env.development?
63
+ %li
64
+ = link_to sitemap_notifier_path, remote: true do
65
+ %i.fa.fa-sitemap
66
+ Notify sitemap.xml
62
67
  %li
63
68
  = link_to edit_user_path, remote: true do
64
69
  %i.fa.fa-user
@@ -5,5 +5,5 @@
5
5
  .media-body
6
6
  %h4.media-heading
7
7
  = link_to page.title, page_path(page)
8
- %small.text-muted= l(page.created_at, format: :short)
8
+ %small.text-muted= l(page.published_at, format: :short)
9
9
  %p= page.summary
@@ -5,5 +5,5 @@
5
5
  .caption
6
6
  %h2
7
7
  = link_to page.title, page_path(page)
8
- %small.text-muted= l(page.created_at, format: :short)
8
+ %small.text-muted= l(page.published_at, format: :short)
9
9
  %p= page.summary
@@ -0,0 +1 @@
1
+ new Message('Sitemap notified');
@@ -0,0 +1,16 @@
1
+ SitemapNotifier::Notifier.configure do |config|
2
+ # Set URL to your sitemap. This is required.
3
+ # config.sitemap_url = Quadro.railtie_routes_url_helpers.sitemap_url
4
+
5
+ # Enabled in which environments – default is [:production]
6
+ # config.environments = [:development, :production]
7
+
8
+ # Delay to wait between notifications – default is 10 minutes
9
+ config.delay = 2.minutes
10
+
11
+ # Additional urls to ping
12
+ # config.ping_urls << "http://localhost:3000/ping?sitemap=%{sitemap_url}"
13
+
14
+ # If you don't want the notifications to run in the background
15
+ config.background = false
16
+ end
data/config/routes.rb CHANGED
@@ -10,6 +10,8 @@ Quadro::Engine.routes.draw do
10
10
  match 'sitemap.xml', to: 'sitemaps#sitemap', as: 'sitemap', format: 'xml'
11
11
  match 'robots.txt', to: 'robots#index', as: 'robots', format: 'txt'
12
12
 
13
+ get 'tools/sitemap_notifier', to: 'tools#sitemap_notifier', as: 'sitemap_notifier'
14
+
13
15
  resources :pages, path: '/' do
14
16
  member do
15
17
  post :form
@@ -5,5 +5,5 @@
5
5
  .media-body
6
6
  %h4.media-heading
7
7
  = link_to page.title, page_path(page)
8
- %small.text-muted= l(page.created_at, format: :short)
8
+ %small.text-muted= l(page.published_at, format: :short)
9
9
  %p= page.summary
@@ -5,5 +5,5 @@
5
5
  .caption
6
6
  %h2
7
7
  = link_to page.title, page_path(page)
8
- %small.text-muted= l(page.created_at, format: :short)
8
+ %small.text-muted= l(page.published_at, format: :short)
9
9
  %p= page.summary
data/lib/quadro/loader.rb CHANGED
@@ -10,6 +10,7 @@ require "devise"
10
10
  require "paperclip"
11
11
  require "configatron/core"
12
12
  require "dynamic_sitemaps"
13
+ require "sitemap_notifier"
13
14
  require "jquery-rails"
14
15
  require "remotipart"
15
16
  require "coffee-rails"
@@ -1,3 +1,3 @@
1
1
  module Quadro
2
- VERSION = "0.5.4"
2
+ VERSION = "0.5.5"
3
3
  end
@@ -5,5 +5,5 @@
5
5
  .media-body
6
6
  %h4.media-heading
7
7
  = link_to page.title, page_path(page)
8
- %small.text-muted= l(page.created_at, format: :short)
8
+ %small.text-muted= l(page.published_at, format: :short)
9
9
  %p= page.summary
@@ -5,5 +5,5 @@
5
5
  .caption
6
6
  %h2
7
7
  = link_to page.title, page_path(page)
8
- %small.text-muted= l(page.created_at, format: :short)
8
+ %small.text-muted= l(page.published_at, format: :short)
9
9
  %p= page.summary
File without changes
@@ -0,0 +1,6 @@
1
+ # This migration comes from quadro (originally 20160619171134)
2
+ class AddPublishedAtFieldOnQuadroPages < ActiveRecord::Migration
3
+ def change
4
+ add_column :quadro_pages, :published_at, :timestamp
5
+ end
6
+ end
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended to check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20160615055721) do
14
+ ActiveRecord::Schema.define(:version => 20160619183944) do
15
15
 
16
16
  create_table "quadro_assets", :force => true do |t|
17
17
  t.integer "assetable_id"
@@ -52,6 +52,7 @@ ActiveRecord::Schema.define(:version => 20160615055721) do
52
52
  t.datetime "deleted_at"
53
53
  t.datetime "created_at", :null => false
54
54
  t.datetime "updated_at", :null => false
55
+ t.datetime "published_at"
55
56
  end
56
57
 
57
58
  add_index "quadro_pages", ["ancestry"], :name => "index_quadro_pages_on_ancestry"
@@ -0,0 +1,2 @@
1
+ Connecting to database specified by database.yml
2
+ Connecting to database specified by database.yml
@@ -1,3 +0,0 @@
1
- Connecting to database specified by database.yml
2
-  (0.3ms) begin transaction
3
-  (0.1ms) rollback transaction
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quadro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hugo Gilmar Erazo
@@ -206,6 +206,20 @@ dependencies:
206
206
  - - '='
207
207
  - !ruby/object:Gem::Version
208
208
  version: 1.0.8
209
+ - !ruby/object:Gem::Dependency
210
+ name: sitemap_notifier
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ~>
214
+ - !ruby/object:Gem::Version
215
+ version: 1.0.0
216
+ type: :runtime
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ~>
221
+ - !ruby/object:Gem::Version
222
+ version: 1.0.0
209
223
  - !ruby/object:Gem::Dependency
210
224
  name: jquery-rails
211
225
  requirement: !ruby/object:Gem::Requirement
@@ -547,6 +561,7 @@ files:
547
561
  - app/controllers/quadro/feeds_controller.rb
548
562
  - app/controllers/quadro/pages_controller.rb
549
563
  - app/controllers/quadro/robots_controller.rb
564
+ - app/controllers/quadro/tools_controller.rb
550
565
  - app/controllers/quadro/users_controller.rb
551
566
  - app/controllers/quadro/widgets_controller.rb
552
567
  - app/helpers/quadro/application_helper.rb
@@ -602,6 +617,7 @@ files:
602
617
  - app/views/quadro/shared/templates/_sidebar.html.haml
603
618
  - app/views/quadro/shared/templates/page/_list.html.haml
604
619
  - app/views/quadro/shared/templates/page/_thumbnail.html.haml
620
+ - app/views/quadro/tools/sitemap_notifier.js.erb
605
621
  - app/views/quadro/users/_edit.html.haml
606
622
  - app/views/quadro/users/edit.js.erb
607
623
  - app/views/quadro/users/update.js.erb
@@ -654,6 +670,7 @@ files:
654
670
  - config/initializers/simple_form.rb
655
671
  - config/initializers/simple_form_bootstrap.rb
656
672
  - config/initializers/sitemap.rb
673
+ - config/initializers/sitemap_notifier.rb
657
674
  - config/locales/devise.en.yml
658
675
  - config/locales/kaminari.en.yml
659
676
  - config/locales/quadro.en.yml
@@ -728,13 +745,14 @@ files:
728
745
  - test/dummy/config/locales/en.yml
729
746
  - test/dummy/config/routes.rb
730
747
  - test/dummy/db/GeoLite2-Country.mmdb
748
+ - test/dummy/db/development.sqlite3
731
749
  - test/dummy/db/migrate/20160615055717_create_quadro_widgets.quadro.rb
732
750
  - test/dummy/db/migrate/20160615055718_create_quadro_pages.quadro.rb
733
751
  - test/dummy/db/migrate/20160615055719_create_quadro_assets.quadro.rb
734
752
  - test/dummy/db/migrate/20160615055720_devise_create_quadro_users.quadro.rb
735
753
  - test/dummy/db/migrate/20160615055721_create_quadro_interactions.quadro.rb
754
+ - test/dummy/db/migrate/20160619183944_add_published_at_field_on_quadro_pages.quadro.rb
736
755
  - test/dummy/db/schema.rb
737
- - test/dummy/db/test.sqlite3
738
756
  - test/dummy/log/development.log
739
757
  - test/dummy/log/test.log
740
758
  - test/dummy/public/404.html
@@ -813,12 +831,13 @@ test_files:
813
831
  - test/dummy/config/initializers/session_store.rb
814
832
  - test/dummy/config/initializers/secret_token.rb
815
833
  - test/dummy/db/migrate/20160615055717_create_quadro_widgets.quadro.rb
834
+ - test/dummy/db/migrate/20160619183944_add_published_at_field_on_quadro_pages.quadro.rb
816
835
  - test/dummy/db/migrate/20160615055721_create_quadro_interactions.quadro.rb
817
836
  - test/dummy/db/migrate/20160615055720_devise_create_quadro_users.quadro.rb
818
837
  - test/dummy/db/migrate/20160615055718_create_quadro_pages.quadro.rb
819
838
  - test/dummy/db/migrate/20160615055719_create_quadro_assets.quadro.rb
839
+ - test/dummy/db/development.sqlite3
820
840
  - test/dummy/db/schema.rb
821
- - test/dummy/db/test.sqlite3
822
841
  - test/dummy/db/GeoLite2-Country.mmdb
823
842
  - test/test_helper.rb
824
843
  - test/integration/navigation_test.rb