kuhsaft 1.3.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/app/controllers/kuhsaft/cms/admin_controller.rb +5 -1
- data/app/controllers/kuhsaft/pages_controller.rb +1 -1
- data/app/helpers/kuhsaft/application_helper.rb +1 -1
- data/app/helpers/kuhsaft/cms/{application_helper.rb → admin_helper.rb} +1 -1
- data/app/helpers/kuhsaft/cms/pages_helper.rb +1 -1
- data/app/models/kuhsaft/brick.rb +2 -7
- data/app/views/kuhsaft/cms/pages/_form.html.haml +11 -9
- data/lib/kuhsaft/version.rb +1 -1
- data/spec/helpers/kuhsaft/cms/{application_helper_spec.rb → admin_helper_spec.rb} +1 -1
- data/spec/models/brick_spec.rb +0 -21
- metadata +9 -9
- data/app/controllers/kuhsaft/application_controller.rb +0 -5
data/README.md
CHANGED
@@ -189,7 +189,7 @@ Finally, add the new translation locale to your `available_locales` inside your
|
|
189
189
|
|
190
190
|
By default, the text editor lets you add the following tags, for which you should supply some styles in your app:
|
191
191
|
|
192
|
-
p, h1, h2, h3,
|
192
|
+
p, h1, h2, h3, h4, table, a, strong, em
|
193
193
|
|
194
194
|
## Building a navigation
|
195
195
|
|
@@ -1,10 +1,14 @@
|
|
1
1
|
module Kuhsaft
|
2
2
|
module Cms
|
3
|
-
class AdminController <
|
3
|
+
class AdminController < ActionController::Base
|
4
4
|
respond_to :html
|
5
5
|
layout 'kuhsaft/cms/application'
|
6
6
|
before_filter :set_content_locale
|
7
7
|
|
8
|
+
def url_options
|
9
|
+
{ content_locale: I18n.locale }.merge(super)
|
10
|
+
end
|
11
|
+
|
8
12
|
def set_content_locale
|
9
13
|
if params[:content_locale].present?
|
10
14
|
I18n.locale = params[:content_locale]
|
data/app/models/kuhsaft/brick.rb
CHANGED
@@ -4,8 +4,8 @@ module Kuhsaft
|
|
4
4
|
|
5
5
|
belongs_to :brick_list, :polymorphic => true, :touch => true
|
6
6
|
|
7
|
-
scope :localized,
|
8
|
-
default_scope order('position ASC').localized
|
7
|
+
scope :localized, -> { where(:locale => I18n.locale) }
|
8
|
+
default_scope -> { order('position ASC').localized }
|
9
9
|
|
10
10
|
serialize :display_styles, Array
|
11
11
|
|
@@ -16,7 +16,6 @@ module Kuhsaft
|
|
16
16
|
:brick_list_type,
|
17
17
|
:display_styles
|
18
18
|
|
19
|
-
before_validation :set_locale
|
20
19
|
before_validation :set_position
|
21
20
|
|
22
21
|
validates :locale,
|
@@ -64,10 +63,6 @@ module Kuhsaft
|
|
64
63
|
p.reverse
|
65
64
|
end
|
66
65
|
|
67
|
-
def set_locale
|
68
|
-
self.locale = self.locale.presence || I18n.locale
|
69
|
-
end
|
70
|
-
|
71
66
|
def set_position
|
72
67
|
self.position = if self.position.present?
|
73
68
|
self.position
|
@@ -1,8 +1,9 @@
|
|
1
1
|
%ul.nav.nav-tabs.js-tabs
|
2
2
|
%li{ :class => metadata_tab_active(@page) }
|
3
3
|
= link_to t('.tab_metadata'), '#page-metadata', 'data-toggle' => :tab
|
4
|
-
|
5
|
-
|
4
|
+
- unless @page.redirect?
|
5
|
+
%li{ :class => content_tab_active(@page) }
|
6
|
+
= link_to t('.tab_content'), '#page-content', 'data-toggle' => :tab
|
6
7
|
|
7
8
|
.tab-content
|
8
9
|
#page-metadata.tab-pane{ :class => metadata_tab_active(@page) }
|
@@ -19,12 +20,13 @@
|
|
19
20
|
.form-actions
|
20
21
|
= form.button :submit, :class => 'btn btn-primary'
|
21
22
|
|
22
|
-
|
23
|
-
-
|
24
|
-
.
|
25
|
-
.
|
26
|
-
.
|
27
|
-
|
28
|
-
|
23
|
+
- unless @page.redirect?
|
24
|
+
#page-content.tab-pane{ :class => content_tab_active(@page) }
|
25
|
+
- if @page.persisted?
|
26
|
+
.clearfix
|
27
|
+
.actions
|
28
|
+
.btn-group
|
29
|
+
= render 'brick_type_dropdown', :brick_list => @page
|
30
|
+
= render 'kuhsaft/cms/bricks/brick_list', :brick_list => @page
|
29
31
|
|
30
32
|
= render 'kuhsaft/cms/bricks/sort_form'
|
data/lib/kuhsaft/version.rb
CHANGED
data/spec/models/brick_spec.rb
CHANGED
@@ -6,11 +6,6 @@ describe Kuhsaft::Brick do
|
|
6
6
|
end
|
7
7
|
|
8
8
|
describe '#valid?' do
|
9
|
-
it 'sets a default locale' do
|
10
|
-
brick.should_receive(:set_locale)
|
11
|
-
brick.valid?
|
12
|
-
end
|
13
|
-
|
14
9
|
it 'sets a default position' do
|
15
10
|
brick.should_receive(:set_position)
|
16
11
|
brick.valid?
|
@@ -33,22 +28,6 @@ describe Kuhsaft::Brick do
|
|
33
28
|
end
|
34
29
|
end
|
35
30
|
|
36
|
-
describe '#set_locale' do
|
37
|
-
context 'witout a locale' do
|
38
|
-
it 'sets a default' do
|
39
|
-
brick.set_locale
|
40
|
-
brick.locale.should == I18n.locale
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
context 'with a locale' do
|
45
|
-
it 'does not change' do
|
46
|
-
brick.locale = 'de'
|
47
|
-
expect { brick.set_locale }.to_not change(brick, :locale)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
31
|
describe '#brick_list_type' do
|
53
32
|
it 'returns Kuhsaft::Brick' do
|
54
33
|
brick.brick_list_type.should == 'Kuhsaft::Brick'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kuhsaft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,10 +9,11 @@ authors:
|
|
9
9
|
- Felipe Kaufmann
|
10
10
|
- Phil Schilter
|
11
11
|
- Donat Baier
|
12
|
+
- Franca Rast
|
12
13
|
autorequire:
|
13
14
|
bindir: bin
|
14
15
|
cert_chain: []
|
15
|
-
date: 2013-
|
16
|
+
date: 2013-05-03 00:00:00.000000000 Z
|
16
17
|
dependencies:
|
17
18
|
- !ruby/object:Gem::Dependency
|
18
19
|
name: rspec
|
@@ -330,7 +331,6 @@ files:
|
|
330
331
|
- app/assets/stylesheets/kuhsaft/application.css.sass
|
331
332
|
- app/assets/stylesheets/kuhsaft/cms/application.css.sass
|
332
333
|
- app/assets/stylesheets/kuhsaft/modules/_text_brick.css.sass
|
333
|
-
- app/controllers/kuhsaft/application_controller.rb
|
334
334
|
- app/controllers/kuhsaft/cms/admin_controller.rb
|
335
335
|
- app/controllers/kuhsaft/cms/assets_controller.rb
|
336
336
|
- app/controllers/kuhsaft/cms/bricks_controller.rb
|
@@ -338,7 +338,7 @@ files:
|
|
338
338
|
- app/controllers/kuhsaft/pages_controller.rb
|
339
339
|
- app/helpers/cms_helper.rb
|
340
340
|
- app/helpers/kuhsaft/application_helper.rb
|
341
|
-
- app/helpers/kuhsaft/cms/
|
341
|
+
- app/helpers/kuhsaft/cms/admin_helper.rb
|
342
342
|
- app/helpers/kuhsaft/cms/pages_helper.rb
|
343
343
|
- app/helpers/pages_helper.rb
|
344
344
|
- app/models/kuhsaft/accordion_brick.rb
|
@@ -502,7 +502,7 @@ files:
|
|
502
502
|
- spec/dummy/script/rails
|
503
503
|
- spec/factories.rb
|
504
504
|
- spec/features/cms_pages_spec.rb
|
505
|
-
- spec/helpers/kuhsaft/cms/
|
505
|
+
- spec/helpers/kuhsaft/cms/admin_helper_spec.rb
|
506
506
|
- spec/kuhsaft_spec.rb
|
507
507
|
- spec/lib/brick_list_spec.rb
|
508
508
|
- spec/lib/engine_spec.rb
|
@@ -541,7 +541,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
541
541
|
version: '0'
|
542
542
|
segments:
|
543
543
|
- 0
|
544
|
-
hash:
|
544
|
+
hash: 4093169498580563011
|
545
545
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
546
546
|
none: false
|
547
547
|
requirements:
|
@@ -550,10 +550,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
550
550
|
version: '0'
|
551
551
|
segments:
|
552
552
|
- 0
|
553
|
-
hash:
|
553
|
+
hash: 4093169498580563011
|
554
554
|
requirements: []
|
555
555
|
rubyforge_project: kuhsaft
|
556
|
-
rubygems_version: 1.8.
|
556
|
+
rubygems_version: 1.8.24
|
557
557
|
signing_key:
|
558
558
|
specification_version: 3
|
559
559
|
summary: A tool that helps you to manage your content within your app.
|
@@ -593,7 +593,7 @@ test_files:
|
|
593
593
|
- spec/dummy/script/rails
|
594
594
|
- spec/factories.rb
|
595
595
|
- spec/features/cms_pages_spec.rb
|
596
|
-
- spec/helpers/kuhsaft/cms/
|
596
|
+
- spec/helpers/kuhsaft/cms/admin_helper_spec.rb
|
597
597
|
- spec/kuhsaft_spec.rb
|
598
598
|
- spec/lib/brick_list_spec.rb
|
599
599
|
- spec/lib/engine_spec.rb
|