feather_cms 0.0.4 → 0.0.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.
Files changed (82) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/{README.md → README.rdoc} +13 -12
  3. data/Rakefile +40 -1
  4. data/app/assets/images/feather_cms/images/edit.png +0 -0
  5. data/app/assets/images/feather_cms/images/fullscreen.png +0 -0
  6. data/app/assets/images/feather_cms/images/preview.png +0 -0
  7. data/app/assets/javascripts/feather_cms/application.js +14 -0
  8. data/app/assets/javascripts/feather_cms/editor.js +21 -0
  9. data/app/assets/javascripts/feather_cms/epiceditor.js +716 -0
  10. data/app/assets/javascripts/feather_cms/epiceditor.min.js +4 -0
  11. data/app/assets/stylesheets/feather_cms/application.css.sass +37 -0
  12. data/{lib/generators/feather_cms/templates → app/assets/stylesheets/feather_cms}/bootstrap.css +0 -0
  13. data/app/assets/stylesheets/feather_cms/themes/base/epiceditor.css +31 -0
  14. data/app/assets/stylesheets/feather_cms/themes/editor/epic-dark.css +47 -0
  15. data/app/assets/stylesheets/feather_cms/themes/editor/epic-light.css +48 -0
  16. data/app/assets/stylesheets/feather_cms/themes/preview/github.css +82 -0
  17. data/app/assets/stylesheets/feather_cms/themes/preview/preview-dark.css +113 -0
  18. data/app/controllers/feather_cms/application_controller.rb +4 -0
  19. data/app/controllers/feather_cms/pages_controller.rb +84 -0
  20. data/app/helpers/feather_cms/application_helper.rb +4 -0
  21. data/app/models/feather_cms/page.rb +11 -0
  22. data/app/views/feather_cms/pages/_form.html.haml +24 -0
  23. data/app/views/feather_cms/pages/edit.html.haml +17 -0
  24. data/app/views/feather_cms/pages/index.html.haml +22 -0
  25. data/app/views/feather_cms/pages/new.html.haml +4 -0
  26. data/app/views/layouts/feather_layout.html.haml +30 -0
  27. data/config/routes.rb +7 -0
  28. data/lib/feather_cms/config.rb +6 -18
  29. data/lib/feather_cms/engine.rb +5 -0
  30. data/lib/feather_cms/version.rb +1 -1
  31. data/lib/feather_cms.rb +1 -13
  32. data/lib/generators/feather_cms/USAGE +3 -8
  33. data/lib/generators/feather_cms/feather_cms_generator.rb +5 -39
  34. data/lib/generators/feather_cms/templates/initializer.rb +0 -5
  35. data/lib/generators/feather_cms/templates/migration.rb +2 -3
  36. data/lib/tasks/feather_cms_tasks.rake +4 -0
  37. data/test/dummy/README.rdoc +261 -0
  38. data/test/dummy/Rakefile +7 -0
  39. data/test/dummy/app/assets/javascripts/application.js +15 -0
  40. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  41. data/test/dummy/app/controllers/application_controller.rb +3 -0
  42. data/test/dummy/app/helpers/application_helper.rb +2 -0
  43. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  44. data/test/dummy/config/application.rb +59 -0
  45. data/test/dummy/config/boot.rb +10 -0
  46. data/test/dummy/config/database.yml +25 -0
  47. data/test/dummy/config/environment.rb +5 -0
  48. data/test/dummy/config/environments/development.rb +37 -0
  49. data/test/dummy/config/environments/production.rb +67 -0
  50. data/test/dummy/config/environments/test.rb +37 -0
  51. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  52. data/test/dummy/config/initializers/inflections.rb +15 -0
  53. data/test/dummy/config/initializers/mime_types.rb +5 -0
  54. data/test/dummy/config/initializers/secret_token.rb +7 -0
  55. data/test/dummy/config/initializers/session_store.rb +8 -0
  56. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  57. data/test/dummy/config/locales/en.yml +5 -0
  58. data/test/dummy/config/routes.rb +4 -0
  59. data/test/dummy/config.ru +4 -0
  60. data/test/dummy/public/404.html +26 -0
  61. data/test/dummy/public/422.html +26 -0
  62. data/test/dummy/public/500.html +25 -0
  63. data/test/dummy/public/favicon.ico +0 -0
  64. data/test/dummy/script/rails +6 -0
  65. data/test/feather_cms_test.rb +7 -0
  66. data/test/fixtures/feather_cms/pages.yml +11 -0
  67. data/test/integration/navigation_test.rb +10 -0
  68. data/test/test_helper.rb +15 -0
  69. data/test/unit/feather_cms/page_test.rb +9 -0
  70. metadata +123 -26
  71. data/.gitignore +0 -4
  72. data/Gemfile +0 -4
  73. data/feather_cms.gemspec +0 -24
  74. data/lib/feather_cms/model.rb +0 -59
  75. data/lib/feather_cms/railtie.rb +0 -13
  76. data/lib/feather_cms/template_cache.rb +0 -52
  77. data/lib/generators/feather_cms/templates/controller.rb +0 -40
  78. data/lib/generators/feather_cms/templates/form.html.erb +0 -40
  79. data/lib/generators/feather_cms/templates/helper.rb +0 -18
  80. data/lib/generators/feather_cms/templates/index.html.erb +0 -11
  81. data/lib/generators/feather_cms/templates/layout.html.erb +0 -52
  82. data/lib/generators/feather_cms/templates/model.rb +0 -5
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2012 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,3 +1,5 @@
1
+ = FeatherCms
2
+
1
3
  # Motivation
2
4
  We have felt the pain of integrating static pages into a Rails application. There are plenty of gems available for this (Radiant, Locomotiv, etc.) but they are very heavy for what we need.
3
5
 
@@ -10,28 +12,27 @@ Add the gem to your Gemfile
10
12
 
11
13
  Now, generate the pages
12
14
 
13
- # Use file system to store pages( default: public/system/templates)
14
- $ rails g feather_cms about_us jobs team
15
-
16
- #Use db to store pages
17
- $ rails g feather_cms about_us jobs team --storage=db
18
- or
19
- $ rails g feather_cms about_us jobs team -t=db
20
-
15
+ $ rails g feather_cms
21
16
  $ rake db:migrate
22
17
 
23
18
  This generates a route, the controller action and the view for each page. Start the server and use the URL http://localhost:3000/feathers/pages to go to the admin panel.
24
19
 
25
- This has basic HTTP authentication setup.The default username and password are feather/password and you can change this in feathers_controller.rb
20
+ This has basic HTTP authentication setup.The default username and password are feather/password and you can change this in feathers_controller.rb.
26
21
 
27
- http_basic_authenticate_with name: 'feather', password: 'password', except: :published
22
+ To change basic authentication: config/initializers/feather_cms.rb
23
+
24
+ c.authentication = {name: 'feather', password: 'password'}
25
+
26
+ If you want to add devise authentication set
27
+
28
+ c.authentication = :authenticate_user!
29
+ or
30
+ c.authentication = :authenticate_admin!
28
31
 
29
32
  # Features
30
33
 
31
34
  * Creates a route for each static page.
32
35
  * Caching the static pages.
33
- * Creates the view in app/views/feathers folder
34
- * Easily customization FeathersController
35
36
  * CodeMirror Editor for syntax highlighting. (Default: HTML)
36
37
  * Storage is file (default) or database.
37
38
 
data/Rakefile CHANGED
@@ -1 +1,40 @@
1
- require "bundler/gem_tasks"
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'FeatherCms'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
24
+ load 'rails/tasks/engine.rake'
25
+
26
+
27
+
28
+ Bundler::GemHelper.install_tasks
29
+
30
+ require 'rake/testtask'
31
+
32
+ Rake::TestTask.new(:test) do |t|
33
+ t.libs << 'lib'
34
+ t.libs << 'test'
35
+ t.pattern = 'test/**/*_test.rb'
36
+ t.verbose = false
37
+ end
38
+
39
+
40
+ task :default => :test
@@ -0,0 +1,14 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
@@ -0,0 +1,21 @@
1
+ $(document).ready(function(){
2
+ var opts = {
3
+ container: 'epiceditor',
4
+ basePath: '/assets/feather_cms',
5
+ focusOnLoad: true,
6
+ file: { defaultContent: "" }
7
+ };
8
+
9
+ window.editor = new EpicEditor(opts).load();
10
+
11
+ window.editor.load(function(){
12
+ window.editor.importFile(null, $('#page_content').val());
13
+ });
14
+
15
+ $('#page_form').submit(function(){
16
+ content = window.editor.exportFile(null, 'html');
17
+ $('#page_content').val(content);
18
+ });
19
+
20
+ });
21
+