quadro 0.5.8 → 0.6.0
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 +5 -13
- data/MIT-LICENSE +1 -1
- data/Rakefile +8 -10
- data/app/assets/javascripts/quadro/widget.js.coffee +12 -9
- data/app/controllers/quadro/application_controller.rb +22 -4
- data/app/controllers/quadro/assets_controller.rb +1 -1
- data/app/controllers/quadro/pages_controller.rb +1 -1
- data/app/controllers/quadro/{tools_controller.rb → sitemaps_controller.rb} +2 -2
- data/app/controllers/quadro/users_controller.rb +1 -1
- data/app/controllers/quadro/widgets_controller.rb +1 -1
- data/app/models/quadro/asset.rb +1 -1
- data/app/models/quadro/asset/cover.rb +2 -2
- data/app/models/quadro/asset/image.rb +2 -2
- data/app/models/quadro/asset/slide.rb +2 -2
- data/app/models/quadro/interaction.rb +1 -2
- data/app/models/quadro/page.rb +2 -3
- data/app/models/quadro/user.rb +2 -2
- data/app/models/quadro/widget.rb +0 -3
- data/app/models/quadro/widget/gallery.rb +0 -1
- data/app/models/quadro/widget/html.rb +0 -1
- data/app/models/quadro/widget/slider.rb +0 -1
- data/app/views/quadro/assets/image/_image.html.haml +1 -1
- data/app/views/quadro/assets/slide/_slide.html.haml +1 -1
- data/app/views/quadro/shared/_navigation.html.haml +2 -2
- data/app/views/quadro/shared/_toolbar.html.haml +2 -2
- data/app/views/quadro/shared/templates/_demo.html.haml +2 -0
- data/app/views/quadro/sitemaps/index.xml.builder +18 -0
- data/app/views/quadro/{tools/sitemap_notifier.js.erb → sitemaps/ping.js.erb} +0 -0
- data/config/initializers/simple_form.rb +46 -23
- data/config/initializers/simple_form_bootstrap.rb +124 -54
- data/config/locales/en.yml +1 -0
- data/config/locales/simple_form.en.yml +31 -0
- data/config/routes.rb +5 -5
- data/lib/generators/quadro/install/templates/app/views/quadro/shared/_navigation.html.haml +1 -1
- data/lib/generators/quadro/install/templates/app/views/quadro/shared/templates/_demo.html.haml +2 -0
- data/lib/quadro/loader.rb +1 -3
- data/lib/quadro/version.rb +1 -1
- data/lib/templates/erb/scaffold/_form.html.erb +13 -0
- data/test/dummy/README.rdoc +15 -248
- data/test/dummy/Rakefile +1 -2
- data/test/dummy/app/assets/javascripts/application.js +4 -6
- data/test/dummy/app/assets/stylesheets/application.css +6 -4
- data/test/dummy/app/controllers/application_controller.rb +3 -1
- data/test/dummy/app/views/layouts/application.html.erb +2 -2
- data/test/dummy/app/views/quadro/shared/_navigation.html.haml +2 -2
- data/test/dummy/app/views/quadro/shared/templates/_demo.html.haml +2 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +29 -0
- data/test/dummy/config.ru +2 -2
- data/test/dummy/config/application.rb +3 -35
- data/test/dummy/config/boot.rb +4 -9
- data/test/dummy/config/database.yml +8 -8
- data/test/dummy/config/environment.rb +3 -3
- data/test/dummy/config/environments/development.rb +22 -18
- data/test/dummy/config/environments/production.rb +46 -34
- data/test/dummy/config/environments/test.rb +19 -14
- data/test/dummy/config/initializers/assets.rb +11 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +6 -5
- data/test/dummy/config/initializers/mime_types.rb +0 -1
- data/test/dummy/config/initializers/session_store.rb +1 -6
- data/test/dummy/config/initializers/wrap_parameters.rb +6 -6
- data/test/dummy/config/locales/en.yml +20 -2
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/db/migrate/{20160615055717_create_quadro_widgets.quadro.rb → 20160701222828_create_quadro_widgets.quadro.rb} +0 -0
- data/test/dummy/db/migrate/{20160615055718_create_quadro_pages.quadro.rb → 20160701222829_create_quadro_pages.quadro.rb} +0 -0
- data/test/dummy/db/migrate/{20160615055719_create_quadro_assets.quadro.rb → 20160701222830_create_quadro_assets.quadro.rb} +0 -0
- data/test/dummy/db/migrate/{20160615055720_devise_create_quadro_users.quadro.rb → 20160701222831_devise_create_quadro_users.quadro.rb} +0 -0
- data/test/dummy/db/migrate/{20160615055721_create_quadro_interactions.quadro.rb → 20160701222832_create_quadro_interactions.quadro.rb} +0 -0
- data/test/dummy/db/migrate/{20160619183944_add_published_at_field_on_quadro_pages.quadro.rb → 20160701222833_add_published_at_field_on_quadro_pages.quadro.rb} +0 -0
- data/test/dummy/db/schema.rb +36 -36
- data/test/integration/navigation_test.rb +0 -2
- data/test/test_helper.rb +9 -6
- metadata +201 -232
- data/README.md +0 -221
- data/app/assets/stylesheets/bootstrap/_mixins.scss +0 -40
- data/config/initializers/sitemap.rb +0 -9
- data/test/dummy/config/initializers/secret_token.rb +0 -7
- data/test/dummy/log/test.log +0 -0
- data/test/dummy/script/rails +0 -6
checksums.yaml
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
|
|
5
|
-
data.tar.gz: !binary |-
|
|
6
|
-
Y2RlYzQxZDFmNTdiMzAxYjk2YmYxMDhlZDdjNmEyYjg4OTFhMzY5Yg==
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: bb73dbba9bba95e0a98de38a88a54825627196bb
|
|
4
|
+
data.tar.gz: 44dc4d9378f2bab776475b435db9a5d9f7e24033
|
|
7
5
|
SHA512:
|
|
8
|
-
metadata.gz:
|
|
9
|
-
|
|
10
|
-
ODljYjI4ZWVhZWQ2MDE5MTNkN2QzYzg3YjFjNjY0YTYwZmQ3MTQ0MTA3NDVh
|
|
11
|
-
OGFhNjhhZGU0OWU2NWFkODc4ZTFmODEyZWM4ODk2Yjc3MzRkYjg=
|
|
12
|
-
data.tar.gz: !binary |-
|
|
13
|
-
MTU3NGVlZDkxYjRiZTBiYzdjM2UxOTU1ODk5NmU4MzYzMWJjYmVkOGM2NGQx
|
|
14
|
-
ZDM0YTlhNDIzODBlYzkyODA0ZTM5MjFlNWVmOWM1NjNkZjk2ZTZkOTU0OTRm
|
|
15
|
-
YTc3NzA5NzEyMGFlNDZiMWI1MGVkNDZiOGVjZThjN2E0YzAyMzc=
|
|
6
|
+
metadata.gz: 7928d0cbf90829226ff70643fc40bb226441e1cbe3acca801f1c1030b26dec330161660b786e1498c809b5580524ec89408e46c87bcbc035f31f1b6dcf84431e
|
|
7
|
+
data.tar.gz: 7e5f1abeb88f5045751e5c568b315f078951b8317cd775f93455c79a3db044c72578173a6b3afdcb3f56d89fe9b60d393f12e2510829835df7c2ec1d2d3cef92
|
data/MIT-LICENSE
CHANGED
data/Rakefile
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
#!/usr/bin/env rake
|
|
2
1
|
begin
|
|
3
2
|
require 'bundler/setup'
|
|
4
3
|
rescue LoadError
|
|
5
4
|
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
|
6
5
|
end
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
rescue LoadError
|
|
10
|
-
require 'rdoc/rdoc'
|
|
11
|
-
require 'rake/rdoctask'
|
|
12
|
-
RDoc::Task = Rake::RDocTask
|
|
13
|
-
end
|
|
6
|
+
|
|
7
|
+
require 'rdoc/task'
|
|
14
8
|
|
|
15
9
|
RDoc::Task.new(:rdoc) do |rdoc|
|
|
16
10
|
rdoc.rdoc_dir = 'rdoc'
|
|
@@ -20,9 +14,14 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
|
20
14
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
21
15
|
end
|
|
22
16
|
|
|
23
|
-
APP_RAKEFILE = File.expand_path(
|
|
17
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
|
24
18
|
load 'rails/tasks/engine.rake'
|
|
25
19
|
|
|
20
|
+
|
|
21
|
+
load 'rails/tasks/statistics.rake'
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
26
25
|
Bundler::GemHelper.install_tasks
|
|
27
26
|
|
|
28
27
|
require 'rake/testtask'
|
|
@@ -34,6 +33,5 @@ Rake::TestTask.new(:test) do |t|
|
|
|
34
33
|
t.verbose = false
|
|
35
34
|
end
|
|
36
35
|
|
|
37
|
-
require 'turnout/rake_tasks'
|
|
38
36
|
|
|
39
37
|
task default: :test
|
|
@@ -19,21 +19,24 @@ class Widget
|
|
|
19
19
|
tabSize: 2
|
|
20
20
|
mode: 'htmlmixed'
|
|
21
21
|
theme: 'monokai'
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
callbacks:
|
|
23
|
+
onChange: =>
|
|
24
|
+
console.log "summernote:change"
|
|
25
|
+
@setChanged()
|
|
26
|
+
return
|
|
27
|
+
onfocus: =>
|
|
28
|
+
@setFocus()
|
|
29
|
+
return
|
|
27
30
|
return
|
|
28
31
|
|
|
29
32
|
switchAirmodeOn: ->
|
|
30
|
-
@element.destroy
|
|
33
|
+
@element.summernote('destroy')
|
|
31
34
|
@airmode = true
|
|
32
35
|
@summernote()
|
|
33
36
|
return
|
|
34
37
|
|
|
35
38
|
switchAirmodeOff: ->
|
|
36
|
-
@element.destroy
|
|
39
|
+
@element.summernote('destroy')
|
|
37
40
|
@airmode = false
|
|
38
41
|
@summernote()
|
|
39
42
|
return
|
|
@@ -47,7 +50,7 @@ class Widget
|
|
|
47
50
|
update: ->
|
|
48
51
|
$.ajax
|
|
49
52
|
url: "#{@path}"
|
|
50
|
-
type:
|
|
53
|
+
type: 'PUT'
|
|
51
54
|
data:
|
|
52
55
|
widget:
|
|
53
56
|
content: @content
|
|
@@ -58,7 +61,7 @@ class Widget
|
|
|
58
61
|
return
|
|
59
62
|
|
|
60
63
|
getContent: ->
|
|
61
|
-
@content = $(".widget-html[data-name=#{@name}]").code
|
|
64
|
+
@content = $(".widget-html[data-name=#{@name}]").summernote('code')
|
|
62
65
|
return
|
|
63
66
|
|
|
64
67
|
setFocus: ->
|
|
@@ -46,7 +46,7 @@ module Quadro
|
|
|
46
46
|
asset_type = params[:type]
|
|
47
47
|
if Quadro.available_assets.include?(asset_type)
|
|
48
48
|
klass = asset_type.constantize
|
|
49
|
-
new_asset = klass.new(
|
|
49
|
+
new_asset = klass.new(asset_params)
|
|
50
50
|
if widget.present?
|
|
51
51
|
widget.assets << new_asset
|
|
52
52
|
elsif page.present?
|
|
@@ -87,7 +87,7 @@ module Quadro
|
|
|
87
87
|
when %w(new).include?(action_name)
|
|
88
88
|
parent.children.new
|
|
89
89
|
when %w(create).include?(action_name)
|
|
90
|
-
parent.children.new(
|
|
90
|
+
parent.children.new(page_params)
|
|
91
91
|
when %w(edit update form publish unpublish).include?(action_name)
|
|
92
92
|
root.subtree.find_by_slug(params[:id]) rescue nil
|
|
93
93
|
else
|
|
@@ -106,9 +106,9 @@ module Quadro
|
|
|
106
106
|
|
|
107
107
|
def subpages
|
|
108
108
|
if user_signed_in?
|
|
109
|
-
@subpages ||= page.children.ordered.page(params[:page])
|
|
109
|
+
@subpages ||= page.children.ordered.page(params[:page]).per(1)
|
|
110
110
|
else
|
|
111
|
-
@subpages ||= page.children.published.ordered.page(params[:page])
|
|
111
|
+
@subpages ||= page.children.published.ordered.page(params[:page]).per(1)
|
|
112
112
|
end
|
|
113
113
|
end
|
|
114
114
|
|
|
@@ -135,5 +135,23 @@ module Quadro
|
|
|
135
135
|
def not_found_page
|
|
136
136
|
render file: 'public/404', status: :not_found, layout: false
|
|
137
137
|
end
|
|
138
|
+
|
|
139
|
+
private
|
|
140
|
+
|
|
141
|
+
def page_params
|
|
142
|
+
params.require(:page).permit(:title, :summary, :template, :frequency, :priority, :cover_attributes, :author_id, :published_at)
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
def widget_params
|
|
146
|
+
params.require(:widget).permit(:name, :type, :content, :width, :height)
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
def asset_params
|
|
150
|
+
params.require(:asset).permit(:attachment, :width, :height, :alt, :href)
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
def user_params
|
|
154
|
+
params.require(:user).permit(:email, :password, :password_confirmation, :remember_me, :name)
|
|
155
|
+
end
|
|
138
156
|
end
|
|
139
157
|
end
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
require_dependency 'quadro/application_controller'
|
|
2
2
|
|
|
3
3
|
module Quadro
|
|
4
|
-
class
|
|
4
|
+
class SitemapsController < ApplicationController
|
|
5
5
|
before_filter :authenticate_user!
|
|
6
6
|
|
|
7
7
|
respond_to :js, :json, :xml
|
|
8
8
|
|
|
9
|
-
def
|
|
9
|
+
def ping
|
|
10
10
|
notifier.run(sitemap_url)
|
|
11
11
|
flash[:notice] = t('quadro.flash.notified')
|
|
12
12
|
end
|
data/app/models/quadro/asset.rb
CHANGED
|
@@ -2,8 +2,8 @@ module Quadro
|
|
|
2
2
|
class Asset::Cover < Asset
|
|
3
3
|
# attributes
|
|
4
4
|
store :settings, accessors: [:width, :height, :alt]
|
|
5
|
-
attr_accessible :width, :height, :alt
|
|
6
|
-
has_attached_file :attachment, styles: { thumb: '200x200#', small: '800x600>', medium: '1024x768>', large: '1280x1024>' }, default_url: '
|
|
5
|
+
# attr_accessible :width, :height, :alt
|
|
6
|
+
has_attached_file :attachment, styles: { thumb: '200x200#', small: '800x600>', medium: '1024x768>', large: '1280x1024>' }, default_url: 'quadro/missing/cover/:style.png'
|
|
7
7
|
|
|
8
8
|
# validations
|
|
9
9
|
validates :alt, length: { maximum: 60 }
|
|
@@ -2,8 +2,8 @@ module Quadro
|
|
|
2
2
|
class Asset::Image < Asset
|
|
3
3
|
# attributes
|
|
4
4
|
store :settings, accessors: [:width, :height, :alt]
|
|
5
|
-
attr_accessible :width, :height, :alt
|
|
6
|
-
has_attached_file :attachment, styles: { thumb: '200x200#', small: '320x240>', medium: '640x480>', large: '800x600>' }, default_url: '
|
|
5
|
+
# attr_accessible :width, :height, :alt
|
|
6
|
+
has_attached_file :attachment, styles: { thumb: '200x200#', small: '320x240>', medium: '640x480>', large: '800x600>' }, default_url: 'quadro/missing/image/:style.png'
|
|
7
7
|
|
|
8
8
|
# validations
|
|
9
9
|
validates :alt, length: { maximum: 60 }
|
|
@@ -2,8 +2,8 @@ module Quadro
|
|
|
2
2
|
class Asset::Slide < Asset
|
|
3
3
|
# attributes
|
|
4
4
|
store :settings, accessors: [:width, :height, :alt, :href]
|
|
5
|
-
attr_accessible :width, :height, :alt, :href
|
|
6
|
-
has_attached_file :attachment, styles: { thumb: '200x200#', small: '640x480>', medium: '800x600>', large: '1024x768>' }, default_url: '
|
|
5
|
+
# attr_accessible :width, :height, :alt, :href
|
|
6
|
+
has_attached_file :attachment, styles: { thumb: '200x200#', small: '640x480>', medium: '800x600>', large: '1024x768>' }, default_url: 'quadro/missing/slide/:style.png'
|
|
7
7
|
|
|
8
8
|
# validations
|
|
9
9
|
validates :alt, length: { maximum: 60 }
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
module Quadro
|
|
2
2
|
class Interaction < ActiveRecord::Base
|
|
3
3
|
# attributes
|
|
4
|
-
attr_accessible :content, :ip_address, :user_agent
|
|
5
4
|
serialize :content, Hash
|
|
6
5
|
|
|
7
6
|
# associations
|
|
8
7
|
belongs_to :interactable, polymorphic: true
|
|
9
8
|
|
|
10
9
|
# scopes
|
|
11
|
-
default_scope order('quadro_interactions.created_at DESC')
|
|
10
|
+
default_scope -> { order('quadro_interactions.created_at DESC') }
|
|
12
11
|
end
|
|
13
12
|
end
|
data/app/models/quadro/page.rb
CHANGED
|
@@ -6,7 +6,6 @@ module Quadro
|
|
|
6
6
|
SITEMAP_PRIORITY = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0].freeze
|
|
7
7
|
|
|
8
8
|
# attributes
|
|
9
|
-
attr_accessible :title, :summary, :template, :frequency, :priority, :cover_attributes, :author_id, :published_at
|
|
10
9
|
store :settings, accessors: [:template, :frequency, :priority]
|
|
11
10
|
|
|
12
11
|
# validations
|
|
@@ -36,8 +35,8 @@ module Quadro
|
|
|
36
35
|
delegate :name, :email, to: :author, prefix: true, allow_nil: true
|
|
37
36
|
|
|
38
37
|
# scopes
|
|
39
|
-
scope :ordered, order('quadro_pages.published_at DESC, quadro_pages.created_at DESC')
|
|
40
|
-
scope :published, where('quadro_pages.published_at IS NOT NULL')
|
|
38
|
+
scope :ordered, -> { order('quadro_pages.published_at DESC, quadro_pages.created_at DESC') }
|
|
39
|
+
scope :published, -> { where('quadro_pages.published_at IS NOT NULL') }
|
|
41
40
|
|
|
42
41
|
# methods
|
|
43
42
|
def publish!
|
data/app/models/quadro/user.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Quadro
|
|
2
2
|
class User < ActiveRecord::Base
|
|
3
3
|
# attributes
|
|
4
|
-
attr_accessible :email, :password, :password_confirmation, :remember_me, :name
|
|
4
|
+
# attr_accessible :email, :password, :password_confirmation, :remember_me, :name
|
|
5
5
|
|
|
6
6
|
# behaviours
|
|
7
7
|
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable, :lockable
|
|
@@ -14,6 +14,6 @@ module Quadro
|
|
|
14
14
|
has_many :pages, dependent: :destroy
|
|
15
15
|
|
|
16
16
|
# scopes
|
|
17
|
-
scope :ordered, order('quadro_users.name ASC')
|
|
17
|
+
scope :ordered, -> { order('quadro_users.name ASC') }
|
|
18
18
|
end
|
|
19
19
|
end
|
data/app/models/quadro/widget.rb
CHANGED
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
|
|
7
7
|
= link_to (widget.present? ? edit_page_widget_asset_path(page_id: page.id, widget_id: widget.id, id: asset.id) : edit_page_asset_path(id: asset.id, page_id: page.id)), remote: true, class: "btn btn-link btn-xs" do
|
|
8
8
|
%i.fa.fa-pencil.text-muted
|
|
9
|
-
= link_to (widget.present? ? page_widget_asset_path(page_id: page.id, widget_id: widget.id, id: asset.id) : page_asset_path(id: asset.id, page_id: page.id)), method: "delete", confirm: t('quadro.confirmation.image'), remote: true, class: "btn btn-link btn-xs" do
|
|
9
|
+
= link_to (widget.present? ? page_widget_asset_path(page_id: page.id, widget_id: widget.id, id: asset.id) : page_asset_path(id: asset.id, page_id: page.id)), method: "delete", data: { confirm: t('quadro.confirmation.image') }, remote: true, class: "btn btn-link btn-xs" do
|
|
10
10
|
%i.fa.fa-trash-o.text-danger
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
.pull-right
|
|
6
6
|
= link_to edit_page_widget_asset_path(id: asset.id, widget_id: widget.id, page_id: page.id), remote: true, class: "btn btn-link btn-xs" do
|
|
7
7
|
%i.fa.fa-pencil.text-muted
|
|
8
|
-
= link_to page_widget_asset_path(id: asset.id, widget_id: widget.id, page_id: page.id), method: "delete", confirm: t('quadro.confirmation.slide'), remote: true, class: "btn btn-link btn-xs" do
|
|
8
|
+
= link_to page_widget_asset_path(id: asset.id, widget_id: widget.id, page_id: page.id), method: "delete", data: { confirm: t('quadro.confirmation.slide') }, remote: true, class: "btn btn-link btn-xs" do
|
|
9
9
|
%i.fa.fa-trash-o.text-danger
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
= link_to root_path, class: 'navbar-brand' do
|
|
9
9
|
= Quadro.config.site
|
|
10
10
|
#navigation.collapse.navbar-collapse
|
|
11
|
-
= navigation_for root, class: "nav navbar-nav navbar-right"
|
|
12
11
|
- unless user_signed_in?
|
|
13
12
|
%ul.nav.navbar-nav.navbar-right
|
|
14
13
|
%li
|
|
15
14
|
= link_to new_user_session_path, rel: "nofollow" do
|
|
16
|
-
= t('
|
|
15
|
+
= t('navigation.sign_in')
|
|
16
|
+
= navigation_for root, class: "nav navbar-nav navbar-right"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
= link_to edit_page_path(page.slug), remote: true, id: "quadro-edit", class: "btn btn-default btn-sm" do
|
|
15
15
|
%i.fa.fa-pencil
|
|
16
16
|
%span.hidden-xs.hidden-sm= t('quadro.toolbar.edit')
|
|
17
|
-
= link_to page_path(page.slug), remote: true, method: "delete", confirm: t('quadro.confirmation.page'), id: "quadro-delete", class: "btn btn-default btn-sm" do
|
|
17
|
+
= link_to page_path(page.slug), remote: true, method: "delete", data: { confirm: t('quadro.confirmation.page') }, id: "quadro-delete", class: "btn btn-default btn-sm" do
|
|
18
18
|
%i.fa.fa-trash-o.text-danger
|
|
19
19
|
%span.hidden-xs.hidden-sm.text-danger= t('quadro.toolbar.delete')
|
|
20
20
|
- unless page.is_root?
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
%ul.dropdown-menu
|
|
45
45
|
- unless Rails.env.development?
|
|
46
46
|
%li
|
|
47
|
-
= link_to
|
|
47
|
+
= link_to ping_path, remote: true do
|
|
48
48
|
%i.fa.fa-sitemap
|
|
49
49
|
= t('quadro.toolbar.sitemap')
|
|
50
50
|
%li
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
xml.instruct! :xml, version: "1.0", encoding: "utf-8"
|
|
2
|
+
xml.urlset xmlns: "http://www.sitemaps.org/schemas/sitemap/0.9" do
|
|
3
|
+
xml.url do
|
|
4
|
+
xml.loc root_url
|
|
5
|
+
xml.lastmod l(root.updated_at, format: :sitemap, locale: :en)
|
|
6
|
+
xml.changefreq root.frequency
|
|
7
|
+
xml.priority root.priority
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
root.descendants.published.ordered.each do |page|
|
|
11
|
+
xml.url do
|
|
12
|
+
xml.loc page_url(page)
|
|
13
|
+
xml.lastmod l(page.updated_at, format: :sitemap, locale: :en)
|
|
14
|
+
xml.changefreq page.frequency
|
|
15
|
+
xml.priority page.priority
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
File without changes
|
|
@@ -5,8 +5,8 @@ SimpleForm.setup do |config|
|
|
|
5
5
|
# wrapper, change the order or even add your own to the
|
|
6
6
|
# stack. The options given below are used to wrap the
|
|
7
7
|
# whole input.
|
|
8
|
-
config.wrappers :default, :
|
|
9
|
-
:
|
|
8
|
+
config.wrappers :default, class: :input,
|
|
9
|
+
hint_class: :field_with_hint, error_class: :field_with_errors do |b|
|
|
10
10
|
## Extensions enabled by default
|
|
11
11
|
# Any of these extensions can be disabled for a
|
|
12
12
|
# given input by passing: `f.input EXTENSION_NAME => false`.
|
|
@@ -18,13 +18,13 @@ SimpleForm.setup do |config|
|
|
|
18
18
|
b.use :html5
|
|
19
19
|
|
|
20
20
|
# Calculates placeholders automatically from I18n
|
|
21
|
-
# You can also pass a string as f.input :
|
|
21
|
+
# You can also pass a string as f.input placeholder: "Placeholder"
|
|
22
22
|
b.use :placeholder
|
|
23
23
|
|
|
24
24
|
## Optional extensions
|
|
25
|
-
# They are disabled unless you pass `f.input EXTENSION_NAME =>
|
|
25
|
+
# They are disabled unless you pass `f.input EXTENSION_NAME => true`
|
|
26
26
|
# to the input. If so, they will retrieve the values from the model
|
|
27
|
-
# if any exists. If you want to enable
|
|
27
|
+
# if any exists. If you want to enable any of those
|
|
28
28
|
# extensions by default, you can change `b.optional` to `b.use`.
|
|
29
29
|
|
|
30
30
|
# Calculates maxlength from length validations for string inputs
|
|
@@ -41,8 +41,14 @@ SimpleForm.setup do |config|
|
|
|
41
41
|
|
|
42
42
|
## Inputs
|
|
43
43
|
b.use :label_input
|
|
44
|
-
b.use :hint, :
|
|
45
|
-
b.use :error, :
|
|
44
|
+
b.use :hint, wrap_with: { tag: :span, class: :hint }
|
|
45
|
+
b.use :error, wrap_with: { tag: :span, class: :error }
|
|
46
|
+
|
|
47
|
+
## full_messages_for
|
|
48
|
+
# If you want to display the full error message for the attribute, you can
|
|
49
|
+
# use the component :full_error, like:
|
|
50
|
+
#
|
|
51
|
+
# b.use :full_error, wrap_with: { tag: :span, class: :error }
|
|
46
52
|
end
|
|
47
53
|
|
|
48
54
|
# The default wrapper to be used by the FormBuilder.
|
|
@@ -50,8 +56,8 @@ SimpleForm.setup do |config|
|
|
|
50
56
|
|
|
51
57
|
# Define the way to render check boxes / radio buttons with labels.
|
|
52
58
|
# Defaults to :nested for bootstrap config.
|
|
53
|
-
# :
|
|
54
|
-
# :
|
|
59
|
+
# inline: input + label
|
|
60
|
+
# nested: label > input
|
|
55
61
|
config.boolean_style = :nested
|
|
56
62
|
|
|
57
63
|
# Default class for buttons
|
|
@@ -66,7 +72,7 @@ SimpleForm.setup do |config|
|
|
|
66
72
|
config.error_notification_tag = :div
|
|
67
73
|
|
|
68
74
|
# CSS class to add for error notification helper.
|
|
69
|
-
config.error_notification_class = '
|
|
75
|
+
config.error_notification_class = 'error_notification'
|
|
70
76
|
|
|
71
77
|
# ID to add for error notification helper.
|
|
72
78
|
# config.error_notification_id = nil
|
|
@@ -84,21 +90,21 @@ SimpleForm.setup do |config|
|
|
|
84
90
|
# config.collection_wrapper_class = nil
|
|
85
91
|
|
|
86
92
|
# You can wrap each item in a collection of radio/check boxes with a tag,
|
|
87
|
-
# defaulting to :span.
|
|
88
|
-
# SimpleForm will force this option to be a label.
|
|
93
|
+
# defaulting to :span.
|
|
89
94
|
# config.item_wrapper_tag = :span
|
|
90
95
|
|
|
91
96
|
# You can define a class to use in all item wrappers. Defaulting to none.
|
|
92
97
|
# config.item_wrapper_class = nil
|
|
93
98
|
|
|
94
99
|
# How the label text should be generated altogether with the required text.
|
|
95
|
-
# config.label_text = lambda { |label, required| "#{required} #{label}" }
|
|
100
|
+
# config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
|
|
96
101
|
|
|
97
102
|
# You can define the class to use on all labels. Default is nil.
|
|
98
|
-
config.label_class =
|
|
103
|
+
# config.label_class = nil
|
|
99
104
|
|
|
100
|
-
# You can define the class to
|
|
101
|
-
#
|
|
105
|
+
# You can define the default class to be used on forms. Can be overriden
|
|
106
|
+
# with `html: { :class }`. Defaulting to none.
|
|
107
|
+
# config.default_form_class = nil
|
|
102
108
|
|
|
103
109
|
# You can define which elements should obtain additional classes
|
|
104
110
|
# config.generate_additional_classes_for = [:wrapper, :label, :input]
|
|
@@ -106,9 +112,12 @@ SimpleForm.setup do |config|
|
|
|
106
112
|
# Whether attributes are required by default (or not). Default is true.
|
|
107
113
|
# config.required_by_default = true
|
|
108
114
|
|
|
109
|
-
# Tell browsers whether to use
|
|
110
|
-
#
|
|
111
|
-
|
|
115
|
+
# Tell browsers whether to use the native HTML5 validations (novalidate form option).
|
|
116
|
+
# These validations are enabled in SimpleForm's internal config but disabled by default
|
|
117
|
+
# in this configuration, which is recommended due to some quirks from different browsers.
|
|
118
|
+
# To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
|
|
119
|
+
# change this configuration to true.
|
|
120
|
+
config.browser_validations = false
|
|
112
121
|
|
|
113
122
|
# Collection of methods to detect if a file type was given.
|
|
114
123
|
# config.file_methods = [ :mounted_as, :file?, :public_filename ]
|
|
@@ -120,7 +129,11 @@ SimpleForm.setup do |config|
|
|
|
120
129
|
|
|
121
130
|
# Custom wrappers for input types. This should be a hash containing an input
|
|
122
131
|
# type as key and the wrapper that will be used for all inputs with specified type.
|
|
123
|
-
# config.wrapper_mappings = { :
|
|
132
|
+
# config.wrapper_mappings = { string: :prepend }
|
|
133
|
+
|
|
134
|
+
# Namespaces where SimpleForm should look for custom input classes that
|
|
135
|
+
# override default inputs.
|
|
136
|
+
# config.custom_inputs_namespaces << "CustomInputs"
|
|
124
137
|
|
|
125
138
|
# Default priority for time_zone inputs.
|
|
126
139
|
# config.time_zone_priority = nil
|
|
@@ -128,9 +141,6 @@ SimpleForm.setup do |config|
|
|
|
128
141
|
# Default priority for country inputs.
|
|
129
142
|
# config.country_priority = nil
|
|
130
143
|
|
|
131
|
-
# Default size for text inputs.
|
|
132
|
-
# config.default_input_size = 50
|
|
133
|
-
|
|
134
144
|
# When false, do not use translations for labels.
|
|
135
145
|
# config.translate_labels = true
|
|
136
146
|
|
|
@@ -139,4 +149,17 @@ SimpleForm.setup do |config|
|
|
|
139
149
|
|
|
140
150
|
# Cache SimpleForm inputs discovery
|
|
141
151
|
# config.cache_discovery = !Rails.env.development?
|
|
152
|
+
|
|
153
|
+
# Default class for inputs
|
|
154
|
+
# config.input_class = nil
|
|
155
|
+
|
|
156
|
+
# Define the default class of the input wrapper of the boolean input.
|
|
157
|
+
config.boolean_label_class = 'checkbox'
|
|
158
|
+
|
|
159
|
+
# Defines if the default input wrapper class should be included in radio
|
|
160
|
+
# collection wrappers.
|
|
161
|
+
# config.include_default_input_wrapper_class = true
|
|
162
|
+
|
|
163
|
+
# Defines which i18n scope will be used in Simple Form.
|
|
164
|
+
# config.i18n_scope = 'simple_form'
|
|
142
165
|
end
|