vision 0.0.1.alpha1 → 0.0.1.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. data/README.md +30 -3
  2. data/app/assets/images/vision/img/glyphicons-halflings.png +0 -0
  3. data/app/assets/javascripts/{redactor-rails → vision/redactor-rails}/config.js +2 -5
  4. data/app/assets/javascripts/{redactor-rails → vision/redactor-rails}/ru.js +0 -0
  5. data/app/assets/stylesheets/vision/application.css +1 -2
  6. data/app/assets/stylesheets/vision/bootstrap_and_overrides.css.less +3 -4
  7. data/app/models/redactor_rails/asset.rb +0 -1
  8. data/app/models/redactor_rails/document.rb +7 -0
  9. data/app/uploaders/redactor_rails_document_uploader.rb +15 -0
  10. data/app/uploaders/redactor_rails_picture_uploader.rb +3 -3
  11. data/config/routes.rb +2 -0
  12. data/lib/generators/{vision → install}/install_generator.rb~ +0 -0
  13. data/lib/generators/templates/javascripts/vision/application.js +18 -0
  14. data/lib/generators/templates/layouts/vision/application.html.haml +25 -0
  15. data/lib/generators/templates/migrations/create_redactor_assets.rb +30 -0
  16. data/lib/generators/templates/stylesheets/vision/application.css +23 -0
  17. data/lib/generators/vision/assets_generator.rb +12 -0
  18. data/lib/generators/vision/css_generator.rb +11 -0
  19. data/lib/generators/vision/install_generator.rb +4 -0
  20. data/lib/generators/vision/js_generator.rb +11 -0
  21. data/lib/generators/vision/layout_generator.rb +11 -0
  22. data/lib/install/install_generator.rb~ +6 -0
  23. data/lib/tasks/vision_tasks.rake +8 -4
  24. data/lib/vision/version.rb +1 -1
  25. data/test/dummy/app/controllers/vision/posts_controller.rb +12 -0
  26. data/test/dummy/app/models/post.rb +3 -0
  27. data/test/dummy/app/views/vision/posts/_form.html.haml +6 -0
  28. data/test/dummy/app/views/vision/posts/_index.html.haml +16 -0
  29. data/test/dummy/app/views/vision/posts/_search.html.haml +4 -0
  30. data/test/dummy/app/views/vision/posts/edit.html.haml +9 -0
  31. data/test/dummy/app/views/vision/posts/index.html.haml +9 -0
  32. data/test/dummy/app/views/vision/posts/new.html.haml +5 -0
  33. data/test/dummy/app/views/vision/posts/show.html.haml +10 -0
  34. data/test/dummy/config/initializers/devise.rb +1 -1
  35. data/test/dummy/config/routes.rb +4 -2
  36. data/test/dummy/config/vision_navigation.rb +4 -0
  37. data/test/dummy/db/development.sqlite3 +0 -0
  38. data/test/dummy/db/migrate/20130212093735_create_users.rb +8 -0
  39. data/test/dummy/db/migrate/{20130211073237_devise_create_users.rb → 20130212093826_add_devise_to_users.rb} +11 -4
  40. data/test/dummy/db/migrate/20130215163420_create_posts.rb +10 -0
  41. data/test/dummy/db/schema.rb +27 -3
  42. data/test/dummy/log/development.log +2247 -1398
  43. data/test/dummy/public/system/redactor_assets/pictures/1/content_zengile.jpg +0 -0
  44. data/test/dummy/public/system/redactor_assets/pictures/1/thumb_zengile.jpg +0 -0
  45. data/test/dummy/public/system/redactor_assets/pictures/1/zengile.jpg +0 -0
  46. data/test/dummy/test/fixtures/posts.yml +9 -0
  47. data/test/dummy/test/unit/post_test.rb +7 -0
  48. data/test/dummy/tmp/cache/assets/{CFB/640/sprockets%2F2a4d6aba04a724d2792087832bd3a0b8 → BCC/8D0/sprockets%2F0f7302928646119b6675038886670c2c} +0 -0
  49. data/test/dummy/tmp/cache/assets/{DEE/430/sprockets%2Fdfcd51eae6f3a2a51c058c27ee0d750a → BF9/170/sprockets%2F47069c70a0800d54588492d44637e347} +0 -0
  50. data/test/dummy/tmp/cache/assets/{DB3/3A0/sprockets%2F6fce069886bdd665c59c2455edf01efd → BF9/200/sprockets%2F6065668d0900491074445a9e019f917e} +0 -0
  51. data/test/dummy/tmp/cache/assets/C75/5B0/sprockets%2F22310e0fd630908a3564d1468b198c5b +0 -0
  52. data/test/dummy/tmp/cache/assets/C86/140/sprockets%2Fc26952761dcf1575512ee617371e48f0 +0 -0
  53. data/test/dummy/tmp/cache/assets/{C22/760/sprockets%2F01391319c77618e63259d5172da3c087 → C8A/B80/sprockets%2F2819289b6d5eb9e59b05354513a3931f} +0 -0
  54. data/test/dummy/tmp/cache/assets/C8A/FA0/sprockets%2F7a06765c5760b4dc1e972d98a9170490 +0 -0
  55. data/test/dummy/tmp/cache/assets/{C83/BE0/sprockets%2F07d225b2971966fcc599b7001056e44d → C8F/BA0/sprockets%2F418ed162937a2f6d35565358a362f9f5} +0 -0
  56. data/test/dummy/tmp/cache/assets/CAA/600/sprockets%2Ffbb8268bc8ea175560105250a249638c +0 -0
  57. data/test/dummy/tmp/cache/assets/{D02/B10/sprockets%2F33f4d4d4552a4ae5b172b26c0716c39d → CAD/8F0/sprockets%2F329fb8b4c2590b23e27b47714fb11666} +0 -0
  58. data/test/dummy/tmp/cache/assets/{D26/3A0/sprockets%2F89ad96fb04e98d506546aed21b918d79 → CC3/BD0/sprockets%2Fe292661c5e7a7ae5389747c5294762da} +0 -0
  59. data/test/dummy/tmp/cache/assets/{D71/370/sprockets%2F19dac330438dea0771e8395b86eddf1c → CCD/D30/sprockets%2F11616281b0bcdc2e4a6912b4a47528f4} +0 -0
  60. data/test/dummy/tmp/cache/assets/{D21/D90/sprockets%2F976738f91218aa8bfc0e679cf3f3f061 → CD6/9D0/sprockets%2F8e5f3e2d05d2b03308086064cdd2449c} +0 -0
  61. data/test/dummy/tmp/cache/assets/{DA0/280/sprockets%2Fe2a91fe4ce8ef0c54b515145f44dde82 → CD8/090/sprockets%2Fff0619203fe61d14c5325d1919e9ba05} +0 -0
  62. data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  63. data/test/dummy/tmp/cache/assets/CDB/6F0/sprockets%2F216f91080df20aaaca9a41797a068985 +0 -0
  64. data/test/dummy/tmp/cache/assets/{D01/870/sprockets%2F975c929398c5770978a8eb96aac660af → CDB/7E0/sprockets%2F174b6468f4360ded76c6410733d12caf} +0 -0
  65. data/test/dummy/tmp/cache/assets/{CC5/DB0/sprockets%2F185b16e33c6e5952c63fe56e65d80787 → CE1/550/sprockets%2F92bd27ad385792a99e1d83aff3104160} +0 -0
  66. data/test/dummy/tmp/cache/assets/{DBC/510/sprockets%2Fc49b6ed55fefd850e586e0f77ac958a7 → CE6/020/sprockets%2Fb66bf61c4ec53d3e0585a18750c81787} +0 -0
  67. data/test/dummy/tmp/cache/assets/{E02/F00/sprockets%2Fa5845e8c36cf9e160fccfadf0a2db837 → CEA/2E0/sprockets%2Ffbd66064d66e5a48e80753bc7807054e} +0 -0
  68. data/test/dummy/tmp/cache/assets/{CF9/8B0/sprockets%2F6580899d8cc41372d92d8a5e8ab78c73 → D07/F70/sprockets%2Fc66613d00be6606fd37ccc171b6e6651} +0 -0
  69. data/test/dummy/tmp/cache/assets/{D3B/5C0/sprockets%2F40ae394bdc18dce154393aed80a27576 → D0C/A30/sprockets%2Faa0c480f3520220211baca7a91ddc021} +0 -0
  70. data/test/dummy/tmp/cache/assets/{E30/850/sprockets%2Fb6e723da1e4c9dab751ccd5ec295a9fe → D11/C90/sprockets%2Fe680cb408c287b029a404d7991e6bf5a} +0 -0
  71. data/test/dummy/tmp/cache/assets/D13/990/sprockets%2Fd6753fd3bf8603ad59b20558bb62526f +0 -0
  72. data/test/dummy/tmp/cache/assets/{D50/730/sprockets%2F084ff5f6ea3f368a543911339e9dfe2e → D13/FC0/sprockets%2F5f25acdf854561761d0e7cf3508d5f22} +0 -0
  73. data/test/dummy/tmp/cache/assets/{DCF/000/sprockets%2Fd0dfcf6a2f21043e23cf879aa9b81d9e → D16/D00/sprockets%2Fde2ec4883ad413832f7db0e494f37571} +0 -0
  74. data/test/dummy/tmp/cache/assets/D19/AA0/sprockets%2F7ec1941b439d165fd38ea8e4b3735e80 +0 -0
  75. data/test/dummy/tmp/cache/assets/{CD1/B10/sprockets%2F26e034c4229e35b5280e372090ca7acf → D1A/960/sprockets%2Fc196e57481231cae4b89b842d14ef8b9} +0 -0
  76. data/test/dummy/tmp/cache/assets/{D60/8A0/sprockets%2F1aaf8a80a707722d04cd8e53a971b1be → D1D/C00/sprockets%2Fb53102b0cb85b552fe0c06225e1ac2a8} +0 -0
  77. data/test/dummy/tmp/cache/assets/{C64/2A0/sprockets%2F134c13b9bd41169120f00f41d229a058 → D25/680/sprockets%2F7317f3d1b9f85b1f998e1e0e4e9c4942} +0 -0
  78. data/test/dummy/tmp/cache/assets/D2E/3D0/sprockets%2Fb8f3341b0ca61f4ea22802ff197c42f0 +0 -0
  79. data/test/dummy/tmp/cache/assets/{D45/5A0/sprockets%2Fed747866979a368aef7d8fee884b2789 → D31/E50/sprockets%2F0000e63a311e6f4ff8c959aa2460dfc3} +0 -0
  80. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  81. data/test/dummy/tmp/cache/assets/{E1A/BD0/sprockets%2F5baeff0d2da03cd0e93a561e71b5aac9 → D3E/870/sprockets%2F587aa5368472d6875edb50c03b90abfa} +0 -0
  82. data/test/dummy/tmp/cache/assets/{E17/BC0/sprockets%2Ff206319de0be2dd9adcaaa314ecf132f → D3F/950/sprockets%2Fa39b3bdd58cc66310e6461062598affc} +0 -0
  83. data/test/dummy/tmp/cache/assets/{D08/9E0/sprockets%2Fbd1b5d382eb7585ef2311f0e8a144185 → D41/4E0/sprockets%2F583c5b79b10de0a2875af13885a0b9ff} +0 -0
  84. data/test/dummy/tmp/cache/assets/{C61/E30/sprockets%2F7cc7480787c36cb33f8958a018908621 → D45/550/sprockets%2F92d696de7bbd085268ebbaa953b72351} +0 -0
  85. data/test/dummy/tmp/cache/assets/{D94/4C0/sprockets%2Fabaa1497cede72926b760ddef110144f → D46/0B0/sprockets%2F4667ee4ed951335efb1d715c57380bbe} +0 -0
  86. data/test/dummy/tmp/cache/assets/D48/1F0/sprockets%2F72168b925d36b6ef647c18a752b9eabc +0 -0
  87. data/test/dummy/tmp/cache/assets/{D30/9A0/sprockets%2F7f9ae14760822ff7b8978a67d6fe36e4 → D48/B40/sprockets%2F8d490f7c4cc51b08e68c70b7539ae56a} +0 -0
  88. data/test/dummy/tmp/cache/assets/D4B/1C0/sprockets%2Fda43e01d8e54b53f6b1657ff7a679b57 +0 -0
  89. data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  90. data/test/dummy/tmp/cache/assets/{D08/980/sprockets%2Fb70493dfb381aae06c270b4965b451f6 → D51/B00/sprockets%2Ff2b57a675398436787261aea5faccf7f} +0 -0
  91. data/test/dummy/tmp/cache/assets/D54/460/sprockets%2Fd87c25fae9c9f4f5a869b3f4a0148925 +0 -0
  92. data/test/dummy/tmp/cache/assets/D59/610/sprockets%2F8db398cbf528b3ea828dd66897fe6403 +0 -0
  93. data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  94. data/test/dummy/tmp/cache/assets/D6A/D00/sprockets%2Ffffd3cf016eee34d73b47453a1084a81 +0 -0
  95. data/test/dummy/tmp/cache/assets/{E2D/070/sprockets%2Fc4744f83de73cd2bbd645dabffd16b4c → D6C/0F0/sprockets%2F7f4c174ba5e6aac6e60544d0a9f637d2} +0 -0
  96. data/test/dummy/tmp/cache/assets/D6C/B20/sprockets%2Fcf97a06067fcdb6e442cb63ea843c306 +0 -0
  97. data/test/dummy/tmp/cache/assets/D78/BA0/sprockets%2F15df4ad1bb21103fb3a0e07b5a3b7c17 +0 -0
  98. data/test/dummy/tmp/cache/assets/D81/940/sprockets%2Fa69a4286a908ed97d68ee01a4d7dfd37 +0 -0
  99. data/test/dummy/tmp/cache/assets/{E09/6D0/sprockets%2Fcbdb4fef8b144c0fd37dc8ad96926e64 → D96/B10/sprockets%2F60cfef58ad697f58e553e98e866c92ea} +0 -0
  100. data/test/dummy/tmp/cache/assets/{CB8/880/sprockets%2F870390941fc4f61d24bc06c257f58a78 → D97/E80/sprockets%2F52459b67e1c0cbd0bffc545722fd3c3d} +0 -0
  101. data/test/dummy/tmp/cache/assets/{D4A/880/sprockets%2Fcc23ed71c73788a938e1357d11ca78ef → DA8/AF0/sprockets%2F1b5bd9ecacca87f42146fe787c16f095} +0 -0
  102. data/test/dummy/tmp/cache/assets/{CAB/EE0/sprockets%2F93064e70efa31924ce83d518222ba718 → DA9/590/sprockets%2F9f953dac0c5e578e12b88fd6d93e1ca0} +0 -0
  103. data/test/dummy/tmp/cache/assets/{D55/740/sprockets%2F6bfb0414e9f0de2e909917674dbe9f95 → DD0/1A0/sprockets%2Feb2821fcf35d7d0aee52b9298fa1d3d7} +0 -0
  104. data/test/dummy/tmp/cache/assets/{E0A/210/sprockets%2F05aadb4dc0b849fe9c3dd7788f28c5eb → DD2/3C0/sprockets%2F8eee6523c3e5b7086f14add8e23cdbc6} +0 -0
  105. data/test/dummy/tmp/cache/assets/{CDE/F80/sprockets%2Fab0f6cb3198d15258990f645d46b161a → DD7/070/sprockets%2Fdc3ff97a8be5b2c3ebdfc843308394d4} +0 -0
  106. data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  107. data/test/dummy/tmp/cache/assets/{D69/DB0/sprockets%2F217c932a66b36e34ed25ced07f9e0be0 → DEF/D40/sprockets%2Fab951c01afe70ed42c6a4a4d71c9f3be} +0 -0
  108. data/test/dummy/tmp/cache/assets/DF7/A20/sprockets%2Fca3679a0fa78a0e6bfe4be010fff483a +0 -0
  109. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  110. data/test/dummy/tmp/cache/assets/E0A/1E0/sprockets%2F19d3a55aef8420829d3c27fdecddfee8 +0 -0
  111. data/test/dummy/tmp/cache/assets/{CEE/180/sprockets%2Fc5ce9c764b20d7176d70584d76a764e4 → E0B/E20/sprockets%2F7bd33bbbe07f6a30fa0cac5b0aaf0391} +0 -0
  112. data/test/dummy/tmp/cache/assets/E23/510/sprockets%2Fc80f65a7fd0f878cba432d60aba2dfba +0 -0
  113. data/test/dummy/tmp/cache/assets/{D1E/250/sprockets%2Ff976c60140c7662f9d86d9b3048c5dda → E28/BD0/sprockets%2Fddafa4e67e5edb91ff307aa1c3c7d109} +0 -0
  114. data/test/dummy/tmp/cache/assets/{BFD/BE0/sprockets%2F7750d34d5ab84713536684084175b777 → E2A/F50/sprockets%2Ffd43757cb63aacffe677bd8eab1bd131} +0 -0
  115. data/test/dummy/tmp/cache/assets/{D1B/3E0/sprockets%2F77c391e536f4b5060992b74d7fbebc09 → E2C/CB0/sprockets%2F22e64d208fec6b7dbc74a2ad8fd17dbf} +0 -0
  116. data/test/dummy/tmp/cache/assets/{CCF/C50/sprockets%2F235f6e18294ffe4e969e1852c84f0893 → E30/760/sprockets%2Ffd8adf6f625eeca93076dcba302e2ff5} +0 -0
  117. data/test/dummy/tmp/cache/assets/E66/CE0/sprockets%2Fb0c9f764ecbf9fea4baf2c9fe4ab5671 +0 -0
  118. data/test/dummy/tmp/cache/assets/E6A/CD0/sprockets%2Fd5e8eb7a2d0ddab7b3f89d1bfbb8e779 +0 -0
  119. data/test/dummy/tmp/cache/assets/EF8/550/sprockets%2F736cdfb8ceaeeabfce9c2566aeefa7d5 +0 -0
  120. data/test/dummy/tmp/pids/server.pid +1 -0
  121. metadata +308 -248
  122. data/app/assets/stylesheets/vision/admin.css.less +0 -0
  123. data/app/controllers/redactor_rails/pictures_controller.rb +0 -22
  124. data/test/dummy/db/test.sqlite3 +0 -0
  125. data/test/dummy/tmp/cache/assets/C0D/930/sprockets%2F57ada54e11211525881db12657063262 +0 -0
  126. data/test/dummy/tmp/cache/assets/CE0/200/sprockets%2Fa9c2101de170df66d9c80861d89042d6 +0 -0
  127. data/test/dummy/tmp/cache/assets/CE3/4D0/sprockets%2F6381f9fd192014c42dfc274e83c9a650 +0 -0
  128. data/test/dummy/tmp/cache/assets/CEA/6B0/sprockets%2F575d96d2842a1d2deec19fe881033089 +0 -0
  129. data/test/dummy/tmp/cache/assets/CF2/540/sprockets%2F5c1c7a9d6a79855f609fae58f5505513 +0 -0
  130. data/test/dummy/tmp/cache/assets/D12/C80/sprockets%2F6ad24bf08272a07cdd957e174b964b73 +0 -0
  131. data/test/dummy/tmp/cache/assets/D3F/5B0/sprockets%2F6557d14727823bddeba2822eb4fcc951 +0 -0
  132. data/test/dummy/tmp/cache/assets/D4D/EF0/sprockets%2F05a24a46916881e9d38ee2e0c8d9f5fb +0 -0
  133. data/test/dummy/tmp/cache/assets/DA8/F80/sprockets%2F97cf03aa7e0ff76969bab9206da267cd +0 -0
  134. data/test/dummy/tmp/cache/assets/DAC/2F0/sprockets%2Fc630da1a0c4bb5a2529e034ba2c7cdb6 +0 -0
  135. data/test/dummy/tmp/cache/assets/DBB/030/sprockets%2F3ad40a6ab1a1bd6a4b0efee48168c367 +0 -0
  136. data/test/dummy/tmp/cache/assets/DCF/EE0/sprockets%2Fb4b66c49e5d32ce05fff1ff1397a50db +0 -0
  137. data/test/dummy/tmp/cache/assets/DE1/6C0/sprockets%2F6cd864830694d6acbef4f69cd0c88dae +0 -0
data/README.md CHANGED
@@ -1,5 +1,32 @@
1
- = Vision
2
- == Install it using Gemfile
1
+ # Vision
2
+ ## Install it using Gemfile
3
3
 
4
+ `gem 'vision', :git=>'git://github.com/prikha/vision.git'`
4
5
 
5
- This project rocks and uses MIT-LICENSE.
6
+ ##Generators
7
+
8
+ ###Vision:
9
+ ####installation
10
+ `vision:install` - the one and the only MUSTRUN generator
11
+ ####assets
12
+ `vision:assets` - delivers you assets from the engine to for customization
13
+ `vision:css` - delivers only CSS
14
+ `vision:js` - delivers only JS
15
+ `vision:layout` - get the layout
16
+ ####make it dance
17
+ `vision:resource` - generates new resource in your admin interface
18
+ `vision:views` - overrides views for customization
19
+
20
+ Админка доступна по адресу /vision и резервирует под себя этот путь включая vision_path
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+ This project rocks and uses MIT-LICENSE.
@@ -7,10 +7,7 @@ $(document).ready(
7
7
  params = csrf_param + "=" + encodeURIComponent(csrf_token);
8
8
  }
9
9
  $('.redactor').redactor(
10
- { "imageUpload":"/redactor_rails/pictures?" + params,
11
- "imageGetJson":"/redactor_rails/pictures",
12
- "path":"/assets/redactor-rails",
13
- "css":"style.css",
14
- "lang":"ru"}
10
+ {"path":"/assets/redactor-rails",
11
+ "css":"style.css"}
15
12
  );
16
13
  });
@@ -9,8 +9,7 @@
9
9
  * compiled file, but it's generally better to create a new file per style scope.
10
10
  *
11
11
  *= require redactor-rails
12
- *= require ./bootstrap_and_overrides
13
- *= require ./admin
12
+ *= require vision/bootstrap_and_overrides
14
13
  *= require_self
15
14
  */
16
15
 
@@ -2,9 +2,9 @@
2
2
  @import "twitter/bootstrap/responsive";
3
3
 
4
4
  /*Bootswatch Cosmo Theme*/
5
- @import 'vision/bootstrap_theme/variables.less';
6
- @import 'vision/bootstrap_theme/bootswatch.css.less';
7
- @import 'vision/bootstrap_theme/bootstrap.css.less';
5
+ @import 'vision/bootstrap_theme/variables';
6
+ @import 'bootstrap_theme/bootswatch.css';
7
+ @import 'bootstrap_theme/bootstrap.css';
8
8
 
9
9
 
10
10
  // Set the correct sprite paths
@@ -32,7 +32,6 @@
32
32
  //
33
33
  // Example:
34
34
  // @linkColor: #ff0000;
35
- @import 'vision/admin.css.less';
36
35
 
37
36
  body { padding-top: 60px; }
38
37
 
@@ -2,5 +2,4 @@ class RedactorRails::Asset < ActiveRecord::Base
2
2
  include RedactorRails::Orm::ActiveRecord::AssetBase
3
3
  delegate :url, :current_path, :size, :content_type, :filename, :to => :data
4
4
  validates_presence_of :data
5
- belongs_to :user
6
5
  end
@@ -0,0 +1,7 @@
1
+ class RedactorRails::Document < RedactorRails::Asset
2
+ mount_uploader :data, RedactorRailsDocumentUploader, :mount_on => :data_file_name
3
+
4
+ def url_content
5
+ url(:content)
6
+ end
7
+ end
@@ -0,0 +1,15 @@
1
+ # encoding: utf-8
2
+ class RedactorRailsDocumentUploader < CarrierWave::Uploader::Base
3
+ include RedactorRails::Backend::CarrierWave
4
+
5
+ # storage :fog
6
+ storage :file
7
+
8
+ def store_dir
9
+ "system/redactor_assets/documents/#{model.id}"
10
+ end
11
+
12
+ def extension_white_list
13
+ RedactorRails.document_file_types
14
+ end
15
+ end
@@ -13,13 +13,13 @@ class RedactorRailsPictureUploader < CarrierWave::Uploader::Base
13
13
  # Override the directory where uploaded files will be stored.
14
14
  # This is a sensible default for uploaders that are meant to be mounted:
15
15
  def store_dir
16
- "system/redactor_assets/pictures/#{model.user.id}/#{model.id}"
16
+ "system/redactor_assets/pictures/#{model.id}"
17
17
  end
18
18
 
19
19
  # Provide a default URL as a default if there hasn't been a file uploaded:
20
- #def default_url
20
+ # def default_url
21
21
  # "/images/fallback/" + [version_name, "default.png"].compact.join('_')
22
- #end
22
+ # end
23
23
 
24
24
  # Process files as they are uploaded:
25
25
  # process :scale => [200, 300]
data/config/routes.rb CHANGED
@@ -1,3 +1,5 @@
1
1
  Rails.application.routes.draw do
2
2
 
3
+ mount RedactorRails::Engine => '/redactor_rails'
4
+
3
5
  end
@@ -0,0 +1,18 @@
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
+ //= reqiure jquery.ui.all
15
+ //= require jquery_ujs
16
+ //= require twitter/bootstrap
17
+ //= require redactor-rails
18
+ //= require_tree .
@@ -0,0 +1,25 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %title= Vision.title
5
+ = stylesheet_link_tag "vision/application", :media => "all"
6
+ = javascript_include_tag "vision/application"
7
+ = csrf_meta_tags
8
+ %body
9
+ .navbar.navbar-fixed-top
10
+ .navbar-inner
11
+ .container-fluid
12
+ = link_to Vision.title, vision_root_path, class: 'brand'
13
+ .nav
14
+ = render 'user_bar'
15
+ .container-fluid
16
+ .row-fluid.alerts
17
+ = bootstrap_flash
18
+ .row-fluid
19
+ .span2.bs-docs-sidebar
20
+ = render_navigation :context=>:vision, :expand_all=>true
21
+ .span10
22
+ = yield
23
+ = redactor_lang("ru")
24
+
25
+
@@ -0,0 +1,30 @@
1
+ class CreateRedactorAssets < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :redactor_assets do |t|
4
+ t.integer :user_id
5
+ t.string :data_file_name, :null => false
6
+ t.string :data_content_type
7
+ t.integer :data_file_size
8
+
9
+ t.integer :assetable_id
10
+ t.string :assetable_type, :limit => 30
11
+ t.string :type, :limit => 30
12
+
13
+ # Uncomment it to save images dimensions, if your need it
14
+ t.integer :width
15
+ t.integer :height
16
+
17
+ t.timestamps
18
+ end
19
+
20
+ # Uncomment it to add foreign key. gem 'foreigner' is required in your .Gemfile
21
+ # add_foreign_key(:redactor_assets, :users, dependent: :delete)
22
+ add_index "redactor_assets", ["assetable_type", "type", "assetable_id"], :name => "idx_redactor_assetable_type"
23
+ add_index "redactor_assets", ["assetable_type", "assetable_id"], :name => "idx_redactor_assetable"
24
+ end
25
+
26
+ def self.down
27
+ drop_table :redactor_assets
28
+ end
29
+ end
30
+
@@ -0,0 +1,23 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require redactor-rails
12
+ *= require vision/bootstrap_and_overrides
13
+ *= require_self
14
+ */
15
+
16
+ .redactor{
17
+ max-width:500px;
18
+ }
19
+
20
+
21
+
22
+
23
+
@@ -0,0 +1,12 @@
1
+ module Vision
2
+ module Generators
3
+ class AssetsGenerator < Rails::Generators::Base
4
+ source_root File.expand_path("../../templates", __FILE__)
5
+ desc "Create application.js and application.css files "
6
+ def copy_view_files
7
+ directory 'javascripts', "app/assets/javascripts"
8
+ directory 'stylesheets', "app/assets/stylesheets"
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ module Vision
2
+ module Generators
3
+ class CssGenerator < Rails::Generators::Base
4
+ source_root File.expand_path("../../templates", __FILE__)
5
+ desc "Create stylesheets/vision/application.css file "
6
+ def copy_view_files
7
+ directory 'stylesheets', "app/assets/stylesheets"
8
+ end
9
+ end
10
+ end
11
+ end
@@ -16,6 +16,10 @@ module Vision
16
16
  copy_file 'vision.rb', 'config/initializers/vision.rb'
17
17
  end
18
18
 
19
+ def copy_migrations
20
+ migration_template "migrations/create_redactor_assets.rb", "db/migrate/create_redactor_assets.rb"
21
+ end
22
+
19
23
  end
20
24
  end
21
25
  end
@@ -0,0 +1,11 @@
1
+ module Vision
2
+ module Generators
3
+ class JsGenerator < Rails::Generators::Base
4
+ source_root File.expand_path("../../templates", __FILE__)
5
+ desc "Create javascripts/vision/application.js file "
6
+ def copy_view_files
7
+ directory 'javascripts', "app/assets/javascripts"
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module Vision
2
+ module Generators
3
+ class LayoutGenerator < Rails::Generators::Base
4
+ source_root File.expand_path("../../templates", __FILE__)
5
+ desc "Create a vision layout "
6
+ def copy_view_files
7
+ directory 'layouts', "app/views/layouts"
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ class Vision::InstallGenerator < Rails::Generators::Base
2
+ source_root File.expand_path('../templates', __FILE__)
3
+ def copy_config_files
4
+ copy_file 'vision_navigation.rb', 'config/vision_navigation.rb'
5
+ end
6
+ end
@@ -1,4 +1,8 @@
1
- # desc "Explaining what the task does"
2
- # task :vision do
3
- # # Task goes here
4
- # end
1
+ #coding: utf-8
2
+
3
+ namespace :vision do
4
+
5
+
6
+
7
+
8
+ end
@@ -1,3 +1,3 @@
1
1
  module Vision
2
- VERSION = "0.0.1.alpha1"
2
+ VERSION = "0.0.1.beta"
3
3
  end
@@ -0,0 +1,12 @@
1
+ class Vision::PostsController < Vision::ResourceController
2
+
3
+ private
4
+ #DEFINE INPUT AND OUTPUT attributes!
5
+ #def attributes
6
+ # resource_class.attribute_names & form_attributes
7
+ #end
8
+ #
9
+ #def form_attributes
10
+ # %w(email password password_confirmation)
11
+ #end
12
+ end
@@ -0,0 +1,3 @@
1
+ class Post < ActiveRecord::Base
2
+ attr_accessible :description, :name
3
+ end
@@ -0,0 +1,6 @@
1
+ = simple_form_for [:vision, resource], :html=>{:class=>"form form-horizontal"} do |f|
2
+ = f.input :name, :input_html=>{:class=>"input-xxlarge"}
3
+ = f.input :description, :input_html=>{:class=>"redactor input-xxlarge"}
4
+ - associations(:belongs_to).each do |assoc|
5
+ = f.association assoc.name.to_sym
6
+ = f.submit :class=>"btn btn-success"
@@ -0,0 +1,16 @@
1
+ %table.table.table-striped
2
+ %thead
3
+ %tr
4
+ - attributes.each do |attr|
5
+ %th= sortable attr, resource_class.human_attribute_name(attr)
6
+ %tbody
7
+ - collection.each do |resource|
8
+ %tr
9
+ - attributes.each do |attr|
10
+ %td
11
+ = resource.public_send(attr).to_s.truncate(20)
12
+ %td
13
+ .btn-group
14
+ = link_to t(:show), resource_path(resource), :class=>"btn btn-action"
15
+ = link_to t(:edit), edit_resource_path(resource),:class=>"btn btn-warning"
16
+ = link_to( t(:delete), resource_path(resource),:method => :delete, :confirm =>"This action is irreversible!",:class=>"btn btn-danger" )
@@ -0,0 +1,4 @@
1
+ = form_tag collection_path, :method => 'get', :id => "text_search", :html=>{:class=>"form-search"} do
2
+ = text_field_tag :q, params[:q], :class=>"input-xxlarge search-query"
3
+ = hidden_field_tag :direction, params[:direction]
4
+ = hidden_field_tag :sort, params[:sort]
@@ -0,0 +1,9 @@
1
+ %h2
2
+ = "Edit #{resource_class.model_name.human}"
3
+ .from
4
+ = render "form"
5
+ %br/
6
+ .btn-group
7
+ = link_to t(:show), resource_path(resource), :class=>"btn btn-action"
8
+ = link_to t(:back), collection_path, :class=>"btn btn-warning"
9
+
@@ -0,0 +1,9 @@
1
+ .row
2
+ .span1
3
+ = link_to t(:new), new_resource_path, class: "btn btn-success"
4
+ .span9
5
+ = render :partial => "search" if searchable?
6
+ .row
7
+ = render :partial => "index"
8
+ .row
9
+ = paginate collection, :theme => 'twitter-bootstrap'
@@ -0,0 +1,5 @@
1
+ %h2
2
+ = "New #{resource_class.model_name.human}"
3
+ = render :partial => "form"
4
+ %br/
5
+ = link_to t(:back), collection_path
@@ -0,0 +1,10 @@
1
+ %div
2
+ %dl.dl-horizontal
3
+ - attributes.each do |attr|
4
+ %dt
5
+ = resource_class.human_attribute_name(attr)
6
+ %dd
7
+ = resource.public_send(attr) || "none"
8
+ .btn-group
9
+ = link_to t(:back), collection_path, :class=>"btn btn-action"
10
+ = link_to t(:edit), edit_resource_path(resource), :class=>"btn btn-warning"
@@ -82,7 +82,7 @@ Devise.setup do |config|
82
82
  config.stretches = Rails.env.test? ? 1 : 10
83
83
 
84
84
  # Setup a pepper to generate the encrypted password.
85
- # config.pepper = "3ca59adabc96da47e403e5f2ff23e7f3d996a95a575dca8a9d495ba085b7f247cf98d6b45ad73b37a6914c156176b0cd56a5c5ac88d68ade84173746cc4baf89"
85
+ # config.pepper = "13482309566650505e3d7ccaf1a3e9b0a9cbbdb785f5eacd4ec205a3777d602b80e3b1faa7223fc28e1508389afc0e548aa0602fc889e0360b22cdbc0896c080"
86
86
 
87
87
  # ==> Configuration for :confirmable
88
88
  # A period that the user is allowed to access the website even without