kuhsaft 1.2.5 → 1.2.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.
- data/README.md +4 -4
- data/app/views/layouts/kuhsaft/cms/application.html.haml +3 -1
- data/lib/generators/kuhsaft/assets/install_generator.rb +22 -0
- data/lib/kuhsaft/version.rb +1 -1
- data/lib/templates/kuhsaft/assets/customizations.css.sass +0 -0
- data/lib/templates/kuhsaft/assets/customizations.js.coffee +0 -0
- data/spec/spec_helper.rb +3 -0
- metadata +7 -6
- data/app/assets/javascripts/kuhsaft/cms/customizations.js +0 -1
- data/app/assets/stylesheets/kuhsaft/cms/customizations.css.sass +0 -1
data/README.md
CHANGED
@@ -42,6 +42,7 @@ Then install the assets and the migrations and run them:
|
|
42
42
|
rake kuhsaft:install:migrations
|
43
43
|
rake db:migrate
|
44
44
|
rake db:seed
|
45
|
+
rails generate kuhsaft:assets:install
|
45
46
|
|
46
47
|
You might want to change the language suffixes on the fields inside the create_kuhsaft_pages migration, depending on your app's default_locale.
|
47
48
|
|
@@ -75,11 +76,10 @@ end
|
|
75
76
|
|
76
77
|
Also, be sure to have override the navigation partial in `app/views/kuhsaft/cms/admin/_main_navigation.html.haml` so you get a working logout button.
|
77
78
|
|
78
|
-
##
|
79
|
-
|
79
|
+
## Extending the backend CSS/javascript
|
80
|
+
Kuhsaft installs a sass file in `assets/stylesheets/kuhsaft/cms/customizations.css.sass` and a coffeescript file in `assets/javascripts/kuhsaft/cms/customizations.js.coffee` which are loaded by the backend layout. Those files can be installed by running `rails generate kuhsaft:assets:install`.
|
80
81
|
|
81
|
-
|
82
|
-
Simply override the custom javascript in your app with your own script at `assets/javascripts/kuhsaft/cms/customizations.js.coffee`
|
82
|
+
Make sure they are in the `config.assets.precompile` array in environments like production where you usually precompile the assets. The generator will only add the necessary configs for the production env!
|
83
83
|
|
84
84
|
## Testing
|
85
85
|
|
@@ -2,8 +2,9 @@
|
|
2
2
|
%html
|
3
3
|
%head
|
4
4
|
%meta{ charset: "utf-8" }
|
5
|
-
%title
|
5
|
+
%title Screen Concept CMS
|
6
6
|
= stylesheet_link_tag 'kuhsaft/cms/application.css', :media => 'screen, projection'
|
7
|
+
= stylesheet_link_tag 'kuhsaft/cms/customizations.css', :media => 'screen, projection'
|
7
8
|
= csrf_meta_tag
|
8
9
|
|
9
10
|
%body{ :class => "#{controller_name}" }
|
@@ -20,3 +21,4 @@
|
|
20
21
|
= render 'flash', :flash => flash
|
21
22
|
= yield
|
22
23
|
= javascript_include_tag 'kuhsaft/cms/application.js'
|
24
|
+
= javascript_include_tag 'kuhsaft/cms/customizations.js'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module Kuhsaft
|
4
|
+
module Assets
|
5
|
+
class Install < Rails::Generators::Base
|
6
|
+
source_root(File.join(Kuhsaft::Engine.root, '/lib/templates/kuhsaft/assets'))
|
7
|
+
|
8
|
+
def copy_customizations
|
9
|
+
custom_css_folder = 'app/assets/stylesheets/kuhsaft/foo/'
|
10
|
+
custom_js_folder = 'app/assets/javascripts/kuhsaft/foo/'
|
11
|
+
empty_directory custom_css_folder
|
12
|
+
empty_directory custom_js_folder
|
13
|
+
copy_file 'customizations.css.sass', "#{custom_css_folder}/customizations.css.sass"
|
14
|
+
copy_file 'customizations.js.coffee', "#{custom_js_folder}/customizations.js.coffee"
|
15
|
+
inject_into_file 'config/environments/production.rb', :after => /config\.assets\.precompile.*$/ do
|
16
|
+
"\n config.assets.precompile += %w( kuhsaft/cms/customizations.css kuhsaft/cms/customizations.js )"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
data/lib/kuhsaft/version.rb
CHANGED
File without changes
|
File without changes
|
data/spec/spec_helper.rb
CHANGED
@@ -27,6 +27,8 @@ RSpec.configure do |config|
|
|
27
27
|
# methods or matchers
|
28
28
|
require 'rspec/expectations'
|
29
29
|
require 'carrierwave/test/matchers'
|
30
|
+
require 'rails/generators'
|
31
|
+
|
30
32
|
|
31
33
|
config.include RSpec::Matchers
|
32
34
|
config.include CarrierWave::Test::Matchers
|
@@ -37,6 +39,7 @@ RSpec.configure do |config|
|
|
37
39
|
|
38
40
|
load File.expand_path("../dummy/Rakefile", __FILE__)
|
39
41
|
Rake::Task['kuhsaft:install:migrations'].invoke
|
42
|
+
Rails::Generators.invoke('kuhsaft:install:assets')
|
40
43
|
|
41
44
|
DatabaseCleaner.strategy = :transaction
|
42
45
|
DatabaseCleaner.clean_with(:truncation)
|
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.2.
|
4
|
+
version: 1.2.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-03-
|
14
|
+
date: 2013-03-04 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rspec
|
@@ -309,11 +309,9 @@ extra_rdoc_files: []
|
|
309
309
|
files:
|
310
310
|
- app/assets/javascripts/kuhsaft/application.js.coffee
|
311
311
|
- app/assets/javascripts/kuhsaft/cms/application.js.coffee
|
312
|
-
- app/assets/javascripts/kuhsaft/cms/customizations.js
|
313
312
|
- app/assets/javascripts/kuhsaft/views/read_more_view.js.coffee
|
314
313
|
- app/assets/stylesheets/kuhsaft/application.css.sass
|
315
314
|
- app/assets/stylesheets/kuhsaft/cms/application.css.sass
|
316
|
-
- app/assets/stylesheets/kuhsaft/cms/customizations.css.sass
|
317
315
|
- app/assets/stylesheets/kuhsaft/modules/_text_brick.css.sass
|
318
316
|
- app/controllers/kuhsaft/application_controller.rb
|
319
317
|
- app/controllers/kuhsaft/cms/admin_controller.rb
|
@@ -430,6 +428,7 @@ files:
|
|
430
428
|
- db/migrate/20130206141601_remove_cms_admin.rb
|
431
429
|
- db/migrate/8_add_display_styles_to_bricks.rb
|
432
430
|
- db/seeds.rb
|
431
|
+
- lib/generators/kuhsaft/assets/install_generator.rb
|
433
432
|
- lib/generators/kuhsaft/translations/add_generator.rb
|
434
433
|
- lib/kuhsaft/brick_list.rb
|
435
434
|
- lib/kuhsaft/engine.rb
|
@@ -439,6 +438,8 @@ files:
|
|
439
438
|
- lib/kuhsaft/version.rb
|
440
439
|
- lib/kuhsaft.rb
|
441
440
|
- lib/tasks/kuhsaft_tasks.rake
|
441
|
+
- lib/templates/kuhsaft/assets/customizations.css.sass
|
442
|
+
- lib/templates/kuhsaft/assets/customizations.js.coffee
|
442
443
|
- lib/templates/kuhsaft/translations/add_translation.html.erb
|
443
444
|
- vendor/assets/javascripts/redactor.js
|
444
445
|
- vendor/assets/stylesheets/redactor.css
|
@@ -516,7 +517,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
516
517
|
version: '0'
|
517
518
|
segments:
|
518
519
|
- 0
|
519
|
-
hash:
|
520
|
+
hash: -1782342829090588371
|
520
521
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
521
522
|
none: false
|
522
523
|
requirements:
|
@@ -525,7 +526,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
525
526
|
version: '0'
|
526
527
|
segments:
|
527
528
|
- 0
|
528
|
-
hash:
|
529
|
+
hash: -1782342829090588371
|
529
530
|
requirements: []
|
530
531
|
rubyforge_project: kuhsaft
|
531
532
|
rubygems_version: 1.8.24
|
@@ -1 +0,0 @@
|
|
1
|
-
// Override this empty file to add custom JS behaviour!
|
@@ -1 +0,0 @@
|
|
1
|
-
// Override this empty file to add custom CSS behaviour!
|