qbrick 2.6.9 → 2.6.10

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: 49695eed4e63d6e12b907b94559efad3d8915b24
4
- data.tar.gz: 489b41c0a55c4bf8b1bac5e4f102d174df924d41
3
+ metadata.gz: 77ffccf0af58c0baf0f3396848f8ee28716f57ae
4
+ data.tar.gz: 5c79d9219c79af8f7f9b93a4182b03954b23e53b
5
5
  SHA512:
6
- metadata.gz: 0da33eb0ee68b0d091c01b0390fde7d63b65f5007017a42ba59afb2b55cc922aa9288ea2aab2d482388b56050a2196c8407c766f718241a1d3af572fa5989dac
7
- data.tar.gz: ec2b3838042f44cd8dfdaaaf79d4227d0e250d0ef1aa17471f7dafbdcd7cf5aefe8b6d93b82481ff0303115e415ba9f2f068cbcf1a444e3c3951dd056c877d67
6
+ metadata.gz: f8a27fe09939893f8021db54f7087c9137475286afb9051eec17701e2457bf4cb7acf1c5144157ca054a7ba95b13ebd75d331c2f7e93898a0ff6d36c3f57de46
7
+ data.tar.gz: 14146aefb0457b86cfa09d357a85a068bda0f527f5a0b52897f0dca7e99913d9a872fa16783eba917685592ba39aa6918be5aecdea4294928ee17bc5e25cc293
@@ -7,7 +7,7 @@
7
7
  #= require bootstrap
8
8
  #= require bootstrap-modal-v2
9
9
  #= require bootstrap-modalmanager
10
- #= require ckeditor-jquery
10
+ #= require ckeditor/init
11
11
  #= require jquery.nestable
12
12
  #= require_tree .
13
13
  #
@@ -6,7 +6,7 @@ module Qbrick
6
6
  # GET /admins
7
7
  # GET /admins.json
8
8
  def index
9
- @admins = Admin.all
9
+ @admins = Qbrick::Admin.all
10
10
  end
11
11
 
12
12
  # GET /admins/1
@@ -16,7 +16,7 @@ module Qbrick
16
16
 
17
17
  # GET /admins/new
18
18
  def new
19
- @admin = Admin.new
19
+ @admin = Qbrick::Admin.new
20
20
  end
21
21
 
22
22
  # GET /admins/1/edit
@@ -26,7 +26,7 @@ module Qbrick
26
26
  # POST /admins
27
27
  # POST /admins.json
28
28
  def create
29
- @admin = Admin.new(admin_params)
29
+ @admin = Qbrick::Admin.new(admin_params)
30
30
 
31
31
  respond_to do |format|
32
32
  if @admin.save
@@ -67,7 +67,7 @@ module Qbrick
67
67
 
68
68
  # Use callbacks to share common setup or constraints between actions.
69
69
  def set_admin
70
- @admin = Admin.find(params[:id])
70
+ @admin = Qbrick::Admin.find params[:id]
71
71
  end
72
72
 
73
73
  # Never trust parameters from the scary internet, only allow the white list through.
@@ -14,14 +14,17 @@ module CmsHelper
14
14
  end
15
15
 
16
16
  def cms_brick_item(brick_list, type)
17
- type_name = type.class_name.constantize.model_name.human
18
- link_to type_name, qbrick.new_cms_brick_path(
17
+ path = qbrick.new_cms_brick_path(
19
18
  brick: {
20
19
  type: type.class_name,
21
20
  brick_list_id: brick_list.id,
22
21
  brick_list_type: brick_list.brick_list_type
23
- }), remote: true
24
- rescue NameError
25
- I18n.t type.class_name.underscore, scope: [:activerecord, :models]
22
+ })
23
+ type_name = type.class_name.constantize.model_name.human
24
+
25
+ link_to type_name, path, remote: true
26
+ rescue NameError => e
27
+ title = I18n.t(type.class_name.underscore, scope: %i(activerecord models)) + " (#{e.message})"
28
+ defined?(path) && path.present? ? link_to(title, path, remote: true) : title
26
29
  end
27
30
  end
@@ -3,7 +3,7 @@ module Qbrick
3
3
  module Cms
4
4
  module AdminHelper
5
5
  def render_language_switch?
6
- I18n.available_locales.size > 1
6
+ I18n.available_locales.many?
7
7
  end
8
8
 
9
9
  def link_to_content_locale(locale)
@@ -155,7 +155,7 @@ module Qbrick
155
155
 
156
156
  def link
157
157
  if bricks.count == 0 && children.count > 0
158
- children.first.link
158
+ children.published.first.link
159
159
  else
160
160
  path_with_prefixed_locale
161
161
  end
@@ -1,6 +1,6 @@
1
- - unless brick_list.brick_types.empty?
1
+ - unless brick_list.brick_types.allowed.empty?
2
2
  .btn-group
3
- - if brick_list.brick_types.allowed.count > 1
3
+ - if brick_list.brick_types.allowed.many?
4
4
  %a.btn.btn-small.btn-primary.dropdown-toggle{ 'data-toggle' => 'dropdown', 'href' => '#' }
5
5
  = t('.add_element')
6
6
  %span.caret
@@ -12,4 +12,4 @@
12
12
  .divider
13
13
  - else
14
14
  - brick_list.brick_types.allowed.each do |type|
15
- = link_to t('.add_specific_element', :name => type.class_name.constantize.model_name.human), qbrick.new_cms_brick_path(:brick => { :type => type.class_name, :brick_list_id => brick_list.id, :brick_list_type => brick_list.brick_list_type }), :remote => true, :class => 'btn btn-small btn-primary'
15
+ = link_to t('.add_specific_element', name: type.class_name.constantize.model_name.human), qbrick.new_cms_brick_path(brick: { type: type.class_name, brick_list_id: brick_list.id, brick_list_type: brick_list.brick_list_type }), remote: true, class: 'btn btn-small btn-primary'
@@ -2,4 +2,4 @@
2
2
  .centered.empty-state
3
3
  .muted= t('.empty')
4
4
  .btn-group
5
- = render 'brick_type_dropdown', :brick_list => brick
5
+ = render 'brick_type_dropdown', brick_list: brick
@@ -1,9 +1,9 @@
1
- = link_to 'Qbrick CMS', qbrick.cms_root_path, :class => 'brand'
1
+ = link_to 'Qbrick CMS', qbrick.cms_root_path, class: 'brand'
2
2
 
3
3
  %ul.nav.pull-right.language-navigation
4
4
  - if render_language_switch?
5
5
  - I18n.available_locales.each do |locale|
6
- %li{ :class => (:active if I18n.locale.to_s == locale.to_s) }
6
+ %li{ class: (:active if I18n.locale.to_s == locale.to_s) }
7
7
  = link_to_content_locale(locale)
8
8
 
9
9
  %li.dropdown
@@ -12,9 +12,9 @@
12
12
  %b.caret
13
13
  %ul.dropdown-menu
14
14
  %li= link_to t('.change_password'), qbrick.edit_cms_account_path
15
- %li= link_to t('.logout'), qbrick.destroy_admin_session_path, :method => :delete
15
+ %li= link_to t('.logout'), qbrick.destroy_admin_session_path, method: :delete
16
16
 
17
17
  %ul.nav
18
18
  %li= link_to t('.settings'), qbrick.cms_settings_collections_path
19
- %li= link_to Qbrick::Page.model_name.human(:count => 2), qbrick.cms_pages_path
20
- %li= link_to Qbrick::Admin.model_name.human(:count => 2), qbrick.cms_admins_path
19
+ %li= link_to Qbrick::Page.model_name.human(count: 2), qbrick.cms_pages_path
20
+ %li= link_to Qbrick::Admin.model_name.human(count: 2), qbrick.cms_admins_path
@@ -12,9 +12,9 @@
12
12
  - if brick.persisted?
13
13
 
14
14
  - # addable child dropdown menu
15
- - if brick.respond_to?(:brick_list)
15
+ - if brick.respond_to? :brick_list
16
16
  .btn-group
17
- = render('brick_type_dropdown', brick_list: brick)
17
+ = render 'brick_type_dropdown', brick_list: brick
18
18
 
19
19
  - # grid selection
20
20
  - if brick.class.include? Qbrick::Gridded
@@ -24,7 +24,7 @@
24
24
  %span.caret
25
25
  %ul.dropdown-menu.pull-right
26
26
  %li
27
- = form.input :col_count, collection: brick.class.available_grid_sizes, as: :radio_buttons, label_method: lambda { |col_count| t("qbrick.cms.bricks.columns", count: col_count) }
27
+ = form.input :col_count, collection: brick.class.available_grid_sizes, as: :radio_buttons, label_method: lambda { |col_count| t('qbrick.cms.bricks.columns', count: col_count) }
28
28
 
29
29
  - # possible styles
30
30
  - unless brick.available_display_styles.empty?
@@ -19,6 +19,6 @@ module Qbrick
19
19
  require 'ancestry'
20
20
  require 'bootstrap-sass'
21
21
  require 'haml'
22
- require 'ckeditor_rails'
22
+ require 'ckeditor'
23
23
  require 'inherited_resources'
24
24
  end
@@ -29,9 +29,11 @@ module Qbrick
29
29
  end
30
30
 
31
31
  def hosts
32
- [Socket.gethostname].tap do |result|
32
+ [Socket.gethostname, 'localhost'].tap do |result|
33
33
  result.concat [app_config.hosts].flatten if app_config.respond_to? :hosts
34
34
  result.concat [app_config.host].flatten if app_config.respond_to? :host
35
+ result.compact!
36
+ result.uniq!
35
37
  end
36
38
  end
37
39
 
@@ -1,3 +1,3 @@
1
1
  module Qbrick
2
- VERSION = '2.6.9'
2
+ VERSION = '2.6.10'
3
3
  end
@@ -13,7 +13,7 @@ CKEDITOR.editorConfig = (config) ->
13
13
  config.linkShowAdvancedTab = false
14
14
  config.linkShowTargetTab = false
15
15
 
16
- config.removePlugins = 'link'
16
+ config.removePlugins = 'link,language'
17
17
  config.extraPlugins = 'adv_link'
18
18
 
19
19
  true
@@ -24,7 +24,7 @@ describe Qbrick::Api::PagesController, type: :controller do
24
24
 
25
25
  it 'gets specific translated pages for each locale' do
26
26
  I18n.with_locale :de do
27
- @pages << @only_german = create(:page, published: true, title: 'foobar de', path: 'de/foobar-de')
27
+ @pages << @only_german = create(:page, published: true, title: 'foobar de 2', path_de: 'de/foobar-de-2')
28
28
  get :index
29
29
  expect(JSON.parse(response.body)).to eq([@page1, @page2, @only_german].as_json)
30
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qbrick
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.9
4
+ version: 2.6.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Immanuel Häussermann
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2015-07-15 00:00:00.000000000 Z
15
+ date: 2015-08-11 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rspec-rails
@@ -337,19 +337,19 @@ dependencies:
337
337
  - !ruby/object:Gem::Version
338
338
  version: 2.3.2.2
339
339
  - !ruby/object:Gem::Dependency
340
- name: ckeditor_rails
340
+ name: ckeditor
341
341
  requirement: !ruby/object:Gem::Requirement
342
342
  requirements:
343
- - - '='
343
+ - - ">="
344
344
  - !ruby/object:Gem::Version
345
- version: '4.2'
345
+ version: '0'
346
346
  type: :runtime
347
347
  prerelease: false
348
348
  version_requirements: !ruby/object:Gem::Requirement
349
349
  requirements:
350
- - - '='
350
+ - - ">="
351
351
  - !ruby/object:Gem::Version
352
- version: '4.2'
352
+ version: '0'
353
353
  - !ruby/object:Gem::Dependency
354
354
  name: pg_search
355
355
  requirement: !ruby/object:Gem::Requirement