beautiful_scaffold 0.3.6 → 1.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. checksums.yaml +7 -0
  2. data/.gitattributes +2 -0
  3. data/CHANGELOG +8 -0
  4. data/README.rdoc +47 -34
  5. data/beautiful_scaffold.gemspec +2 -1
  6. data/lib/generators/beautiful_locale_generator.rb +2 -2
  7. data/lib/generators/beautiful_migration_generator.rb +2 -2
  8. data/lib/generators/beautiful_scaffold_common_methods.rb +10 -14
  9. data/lib/generators/beautiful_scaffold_generator.rb +7 -15
  10. data/lib/generators/templates/app/assets/javascripts/application-bs.js +4 -12
  11. data/lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js +0 -33
  12. data/lib/generators/templates/app/assets/stylesheets/application-bs.css +0 -6
  13. data/lib/generators/templates/app/assets/stylesheets/bootstrap_and_overrides.css.less +6 -6
  14. data/lib/generators/templates/app/helpers/beautiful_helper.rb +1 -0
  15. data/lib/generators/templates/app/initializers/link_renderer.rb +2 -0
  16. data/lib/generators/templates/app/locales/beautiful_scaffold.ja.yml +50 -0
  17. data/lib/generators/templates/app/models/concerns/fulltext_concern.rb +10 -10
  18. data/lib/generators/templates/app/views/partials/_form_field.html.erb +1 -27
  19. data/lib/generators/templates/app/views/partials/_index_column.html.erb +0 -2
  20. data/lib/generators/templates/app/views/partials/_index_search.html.erb +0 -2
  21. metadata +25 -173
  22. data/lib/generators/templates/app/assets/javascripts/jquery.livequery.js +0 -226
  23. data/lib/generators/templates/markitup/jquery.markitup.js +0 -593
  24. data/lib/generators/templates/markitup/sets/bbcode/images/bold.png +0 -0
  25. data/lib/generators/templates/markitup/sets/bbcode/images/clean.png +0 -0
  26. data/lib/generators/templates/markitup/sets/bbcode/images/code.png +0 -0
  27. data/lib/generators/templates/markitup/sets/bbcode/images/fonts.png +0 -0
  28. data/lib/generators/templates/markitup/sets/bbcode/images/italic.png +0 -0
  29. data/lib/generators/templates/markitup/sets/bbcode/images/link.png +0 -0
  30. data/lib/generators/templates/markitup/sets/bbcode/images/list-bullet.png +0 -0
  31. data/lib/generators/templates/markitup/sets/bbcode/images/list-item.png +0 -0
  32. data/lib/generators/templates/markitup/sets/bbcode/images/list-numeric.png +0 -0
  33. data/lib/generators/templates/markitup/sets/bbcode/images/picture.png +0 -0
  34. data/lib/generators/templates/markitup/sets/bbcode/images/preview.png +0 -0
  35. data/lib/generators/templates/markitup/sets/bbcode/images/quotes.png +0 -0
  36. data/lib/generators/templates/markitup/sets/bbcode/images/stroke.png +0 -0
  37. data/lib/generators/templates/markitup/sets/bbcode/images/underline.png +0 -0
  38. data/lib/generators/templates/markitup/sets/bbcode/readme.txt +0 -11
  39. data/lib/generators/templates/markitup/sets/bbcode/set.js +0 -39
  40. data/lib/generators/templates/markitup/sets/bbcode/style.css +0 -47
  41. data/lib/generators/templates/markitup/sets/default/images/bold.png +0 -0
  42. data/lib/generators/templates/markitup/sets/default/images/clean.png +0 -0
  43. data/lib/generators/templates/markitup/sets/default/images/image.png +0 -0
  44. data/lib/generators/templates/markitup/sets/default/images/italic.png +0 -0
  45. data/lib/generators/templates/markitup/sets/default/images/link.png +0 -0
  46. data/lib/generators/templates/markitup/sets/default/images/list-bullet.png +0 -0
  47. data/lib/generators/templates/markitup/sets/default/images/list-numeric.png +0 -0
  48. data/lib/generators/templates/markitup/sets/default/images/picture.png +0 -0
  49. data/lib/generators/templates/markitup/sets/default/images/preview.png +0 -0
  50. data/lib/generators/templates/markitup/sets/default/images/stroke.png +0 -0
  51. data/lib/generators/templates/markitup/sets/default/set.js +0 -30
  52. data/lib/generators/templates/markitup/sets/default/style.css +0 -34
  53. data/lib/generators/templates/markitup/sets/html/images/bold.png +0 -0
  54. data/lib/generators/templates/markitup/sets/html/images/clean.png +0 -0
  55. data/lib/generators/templates/markitup/sets/html/images/h1.png +0 -0
  56. data/lib/generators/templates/markitup/sets/html/images/h2.png +0 -0
  57. data/lib/generators/templates/markitup/sets/html/images/h3.png +0 -0
  58. data/lib/generators/templates/markitup/sets/html/images/h4.png +0 -0
  59. data/lib/generators/templates/markitup/sets/html/images/h5.png +0 -0
  60. data/lib/generators/templates/markitup/sets/html/images/h6.png +0 -0
  61. data/lib/generators/templates/markitup/sets/html/images/image.png +0 -0
  62. data/lib/generators/templates/markitup/sets/html/images/italic.png +0 -0
  63. data/lib/generators/templates/markitup/sets/html/images/link.png +0 -0
  64. data/lib/generators/templates/markitup/sets/html/images/list-bullet.png +0 -0
  65. data/lib/generators/templates/markitup/sets/html/images/list-item.png +0 -0
  66. data/lib/generators/templates/markitup/sets/html/images/list-numeric.png +0 -0
  67. data/lib/generators/templates/markitup/sets/html/images/paragraph.png +0 -0
  68. data/lib/generators/templates/markitup/sets/html/images/picture.png +0 -0
  69. data/lib/generators/templates/markitup/sets/html/images/preview.png +0 -0
  70. data/lib/generators/templates/markitup/sets/html/images/stroke.png +0 -0
  71. data/lib/generators/templates/markitup/sets/html/readme.txt +0 -11
  72. data/lib/generators/templates/markitup/sets/html/set.js +0 -39
  73. data/lib/generators/templates/markitup/sets/html/style.css +0 -59
  74. data/lib/generators/templates/markitup/sets/markdown/images/bold.png +0 -0
  75. data/lib/generators/templates/markitup/sets/markdown/images/code.png +0 -0
  76. data/lib/generators/templates/markitup/sets/markdown/images/h1.png +0 -0
  77. data/lib/generators/templates/markitup/sets/markdown/images/h2.png +0 -0
  78. data/lib/generators/templates/markitup/sets/markdown/images/h3.png +0 -0
  79. data/lib/generators/templates/markitup/sets/markdown/images/h4.png +0 -0
  80. data/lib/generators/templates/markitup/sets/markdown/images/h5.png +0 -0
  81. data/lib/generators/templates/markitup/sets/markdown/images/h6.png +0 -0
  82. data/lib/generators/templates/markitup/sets/markdown/images/italic.png +0 -0
  83. data/lib/generators/templates/markitup/sets/markdown/images/link.png +0 -0
  84. data/lib/generators/templates/markitup/sets/markdown/images/list-bullet.png +0 -0
  85. data/lib/generators/templates/markitup/sets/markdown/images/list-numeric.png +0 -0
  86. data/lib/generators/templates/markitup/sets/markdown/images/picture.png +0 -0
  87. data/lib/generators/templates/markitup/sets/markdown/images/preview.png +0 -0
  88. data/lib/generators/templates/markitup/sets/markdown/images/quotes.png +0 -0
  89. data/lib/generators/templates/markitup/sets/markdown/readme.txt +0 -11
  90. data/lib/generators/templates/markitup/sets/markdown/set.js +0 -52
  91. data/lib/generators/templates/markitup/sets/markdown/style.css +0 -54
  92. data/lib/generators/templates/markitup/sets/textile/images/bold.png +0 -0
  93. data/lib/generators/templates/markitup/sets/textile/images/code.png +0 -0
  94. data/lib/generators/templates/markitup/sets/textile/images/h1.png +0 -0
  95. data/lib/generators/templates/markitup/sets/textile/images/h2.png +0 -0
  96. data/lib/generators/templates/markitup/sets/textile/images/h3.png +0 -0
  97. data/lib/generators/templates/markitup/sets/textile/images/h4.png +0 -0
  98. data/lib/generators/templates/markitup/sets/textile/images/h5.png +0 -0
  99. data/lib/generators/templates/markitup/sets/textile/images/h6.png +0 -0
  100. data/lib/generators/templates/markitup/sets/textile/images/italic.png +0 -0
  101. data/lib/generators/templates/markitup/sets/textile/images/link.png +0 -0
  102. data/lib/generators/templates/markitup/sets/textile/images/list-bullet.png +0 -0
  103. data/lib/generators/templates/markitup/sets/textile/images/list-numeric.png +0 -0
  104. data/lib/generators/templates/markitup/sets/textile/images/paragraph.png +0 -0
  105. data/lib/generators/templates/markitup/sets/textile/images/picture.png +0 -0
  106. data/lib/generators/templates/markitup/sets/textile/images/preview.png +0 -0
  107. data/lib/generators/templates/markitup/sets/textile/images/quotes.png +0 -0
  108. data/lib/generators/templates/markitup/sets/textile/images/stroke.png +0 -0
  109. data/lib/generators/templates/markitup/sets/textile/readme.txt +0 -11
  110. data/lib/generators/templates/markitup/sets/textile/set.js +0 -40
  111. data/lib/generators/templates/markitup/sets/textile/style.css +0 -60
  112. data/lib/generators/templates/markitup/sets/wiki/images/bold.png +0 -0
  113. data/lib/generators/templates/markitup/sets/wiki/images/code.png +0 -0
  114. data/lib/generators/templates/markitup/sets/wiki/images/h1.png +0 -0
  115. data/lib/generators/templates/markitup/sets/wiki/images/h2.png +0 -0
  116. data/lib/generators/templates/markitup/sets/wiki/images/h3.png +0 -0
  117. data/lib/generators/templates/markitup/sets/wiki/images/h4.png +0 -0
  118. data/lib/generators/templates/markitup/sets/wiki/images/h5.png +0 -0
  119. data/lib/generators/templates/markitup/sets/wiki/images/h6.png +0 -0
  120. data/lib/generators/templates/markitup/sets/wiki/images/italic.png +0 -0
  121. data/lib/generators/templates/markitup/sets/wiki/images/link.png +0 -0
  122. data/lib/generators/templates/markitup/sets/wiki/images/list-bullet.png +0 -0
  123. data/lib/generators/templates/markitup/sets/wiki/images/list-numeric.png +0 -0
  124. data/lib/generators/templates/markitup/sets/wiki/images/picture.png +0 -0
  125. data/lib/generators/templates/markitup/sets/wiki/images/preview.png +0 -0
  126. data/lib/generators/templates/markitup/sets/wiki/images/quotes.png +0 -0
  127. data/lib/generators/templates/markitup/sets/wiki/images/stroke.png +0 -0
  128. data/lib/generators/templates/markitup/sets/wiki/images/url.png +0 -0
  129. data/lib/generators/templates/markitup/sets/wiki/readme.txt +0 -11
  130. data/lib/generators/templates/markitup/sets/wiki/set.js +0 -37
  131. data/lib/generators/templates/markitup/sets/wiki/style.css +0 -57
  132. data/lib/generators/templates/markitup/skins/markitup/images/bg-container.png +0 -0
  133. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-bbcode.png +0 -0
  134. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-dotclear.png +0 -0
  135. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-html.png +0 -0
  136. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-json.png +0 -0
  137. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-markdown.png +0 -0
  138. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-textile.png +0 -0
  139. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-wiki.png +0 -0
  140. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor-xml.png +0 -0
  141. data/lib/generators/templates/markitup/skins/markitup/images/bg-editor.png +0 -0
  142. data/lib/generators/templates/markitup/skins/markitup/images/handle.png +0 -0
  143. data/lib/generators/templates/markitup/skins/markitup/images/menu.png +0 -0
  144. data/lib/generators/templates/markitup/skins/markitup/images/submenu.png +0 -0
  145. data/lib/generators/templates/markitup/skins/markitup/style.css +0 -147
  146. data/lib/generators/templates/markitup/skins/simple/images/handle.png +0 -0
  147. data/lib/generators/templates/markitup/skins/simple/images/menu.png +0 -0
  148. data/lib/generators/templates/markitup/skins/simple/images/submenu.png +0 -0
  149. data/lib/generators/templates/markitup/skins/simple/style.css +0 -118
  150. data/lib/generators/templates/markitup/templates/preview.css +0 -5
  151. data/lib/generators/templates/markitup/templates/preview.html +0 -11
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c788ac3707c3a554a7fd4b8d7796645899275068
4
+ data.tar.gz: 194fa4ea7f3f50c1548dd1306d9718e3e6eaaf76
5
+ SHA512:
6
+ metadata.gz: ccdaf02eeca18d1b3e84857a16ca055349207879ff83846b1e794d60efb0c2a6068f6a57351001eacbf96941ac3f3a3b293f3e2a72ac3be4efb0e10c2c337629
7
+ data.tar.gz: cd77e358cab2f4c04db96e08d7b52357d07e2223121fa5f67dacf8fae893c971e403e32a039043b982a2051a52a437d6f3d9f801260318dea64a52e6fe9ef7bd
data/.gitattributes ADDED
@@ -0,0 +1,2 @@
1
+ lib/generators/templates/app/assets/stylesheets/* linguist-vendored
2
+ lib/generators/templates/app/assets/javascripts/* linguist-vendored
data/CHANGELOG CHANGED
@@ -1,3 +1,11 @@
1
+ == 1.0.0.pre
2
+
3
+ * enhancement
4
+ * Remove Markitup
5
+ * Remove Livequery
6
+ * Compatibility Rails 5
7
+ * Update gem (prawn, ransack, willpaginate)
8
+
1
9
  == 0.3.6
2
10
 
3
11
  * enhancement
data/README.rdoc CHANGED
@@ -2,98 +2,111 @@
2
2
 
3
3
  Beautiful Scaffold is a gem which propose generators for a complete scaffold with paginate, sort and filter.
4
4
  Fully customizable.
5
- More info : http://www.beautiful-scaffold.com/
6
- Demo : http://demo.beautiful-scaffold.com/
5
+ Info : https://github.com/rivsc/Beautiful-Scaffold
6
+ Demo : http://demo.beautiful-scaffold.escarworld.com/
7
7
 
8
8
  == Install
9
9
 
10
10
  === RubyOnRails 4.1
11
11
 
12
12
  Add this in your Gemfile :
13
- gem 'beautiful_scaffold', '0.3.4'
13
+
14
+ gem 'beautiful_scaffold', '0.3.4'
14
15
 
15
16
  === RubyOnRails 4.2
16
17
 
17
18
  Add this in your Gemfile :
18
- gem 'beautiful_scaffold', '0.3.5'
19
+
20
+ gem 'beautiful_scaffold', '0.3.5'
21
+
22
+ === RubyOnRails 5+
23
+
24
+ Add this in your Gemfile :
25
+
26
+ gem 'beautiful_scaffold', '1.0.0.pre'
19
27
 
20
28
  === Next
21
29
 
22
30
  And run
23
- bundle install
31
+
32
+ bundle install
24
33
 
25
34
  == Usage
26
35
 
27
36
  === Scaffold
28
37
 
29
- rails generate beautiful_scaffold model attr:type attr:type... [--namespace=name] [--donttouchgem=name]
38
+ rails generate beautiful_scaffold model attr:type attr:type... [--namespace=name] [--donttouchgem=name]
30
39
 
31
- type available :
40
+ Types available:
32
41
  * integer
33
42
  * float
34
43
  * text
35
44
  * string
36
45
  * price
37
46
  * color
38
- * richtext
39
47
  * wysiwyg
40
48
 
41
49
  # Example : products
42
- rails g beautiful_scaffold product name:string price:price tva:float description:richtext visible:boolean && rake db:migrate
50
+
51
+ rails g beautiful_scaffold product name:string price:price tva:float description:wysiwyg visible:boolean && rake db:migrate
43
52
 
44
53
  # Example : admin products
45
- rails g beautiful_scaffold product name:string price:price tva:float description:richtext overview_description:richtext visible:boolean --namespace=admin && rake db:migrate
54
+
55
+ rails g beautiful_scaffold product name:string price:price tva:float description:wysiwyg overview_description:wysiwyg visible:boolean --namespace=admin && rake db:migrate
46
56
 
47
57
  === Migration (Use Add[Field]To[ModelPluralize] syntax)
48
58
 
49
- rails g beautiful_migration AddFieldToModels field:type
59
+ rails g beautiful_migration AddFieldToModels field:type
50
60
 
51
61
  === Locale (i18n) (Example)
52
62
 
53
- Run rake db:migrate before rail g beautiful_locale (to get lastest attribute translation)
63
+ Run `rake db:migrate` before `rails g beautiful_locale` (to get lastest attribute translation)
54
64
 
55
- rails g beautiful_locale all
56
- rails g beautiful_locale en
57
- rails g beautiful_locale fr
58
- rails g beautiful_locale de
65
+ rails g beautiful_locale all
66
+ rails g beautiful_locale en
67
+ rails g beautiful_locale fr
68
+ rails g beautiful_locale de
59
69
 
60
70
  === Join Table (has_and_belongs_to_many relation)
61
71
 
62
- rails g beautiful_jointable model1 model2
72
+ rails g beautiful_jointable model1 model2
63
73
 
64
74
  === Install et Configure Devise (authentification) and Cancan (authorization)
65
75
 
66
- rails g beautiful_devisecancan model
76
+ rails g beautiful_devisecancan model
67
77
 
68
78
  === In views
69
79
 
70
80
  ==== Barcodes
71
81
 
72
82
  Set code like this :
73
- <span class="barcode" data-barcode="1234567890128" data-type-barcode="ean13"></span>
83
+
84
+ <span class="barcode" data-barcode="1234567890128" data-type-barcode="ean13"></span>
74
85
 
75
86
  data-type-barcode can be :
76
87
 
77
- codabar
78
- code11 (code 11)
79
- code39 (code 39)
80
- code93 (code 93)
81
- code128 (code 128)
82
- ean8 (ean 8)
83
- ean13 (ean 13)
84
- std25 (standard 2 of 5 - industrial 2 of 5)
85
- int25 (interleaved 2 of 5)
86
- msi
87
- datamatrix (ASCII + extended)
88
+ codabar
89
+ code11 (code 11)
90
+ code39 (code 39)
91
+ code93 (code 93)
92
+ code128 (code 128)
93
+ ean8 (ean 8)
94
+ ean13 (ean 13)
95
+ std25 (standard 2 of 5 - industrial 2 of 5)
96
+ int25 (interleaved 2 of 5)
97
+ msi
98
+ datamatrix (ASCII + extended)
88
99
 
89
100
  ==== Chardinjs (overlay instructions)
90
101
 
91
102
  Example : This button triggers chardinjs on element with 'menu' id.
92
- <a href="#" class="bs-chardinjs" data-selector="#menu">Help Menu</a>
103
+
104
+ <a href="#" class="bs-chardinjs" data-selector="#menu">Help Menu</a>
93
105
 
94
106
  If you want display all chardinjs :
95
- <a href="#" class="bs-chardinjs" data-selector="body">Help</a>
96
107
 
97
- Just add class="bs-chardinjs" in a button / link for trigger chardinjs. Beautiful-Scaffold does the job !
108
+ <a href="#" class="bs-chardinjs" data-selector="body">Help</a>
109
+
110
+ Just add `class="bs-chardinjs"` in a button / link for trigger chardinjs. Beautiful-Scaffold does the job !
98
111
 
99
- For add instruction to element, read official documentation : https://github.com/heelhook/chardin.js#adding-data-for-the-instructions
112
+ For add instruction to element, read official documentation : https://github.com/heelhook/chardin.js#adding-data-for-the-instructions
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "beautiful_scaffold"
6
- s.version = "0.3.6"
6
+ s.version = "1.0.0.pre"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.summary = "Beautiful Scaffold generate fully customizable scaffold"
9
9
  s.email = "claudel.sylvain@gmail.com"
@@ -11,6 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.description = "Beautiful Scaffold generate a complete scaffold (sort, export, paginate and filter data) http://www.beautiful-scaffold.com"
12
12
  s.authors = ['Sylvain Claudel']
13
13
  s.files = `git ls-files`.split("\n")
14
+ s.licenses = ['MIT']
14
15
 
15
16
  s.rubyforge_project = "beautiful_scaffold"
16
17
 
@@ -5,10 +5,10 @@ class BeautifulLocaleGenerator < Rails::Generators::Base
5
5
 
6
6
  source_root File.expand_path('../templates', __FILE__)
7
7
 
8
- argument :name, :type => :string, :desc => "type of locale : fr OR en OR de OR all..."
8
+ argument :name, :type => :string, :desc => "type of locale : fr OR en OR de OR ja all..."
9
9
 
10
10
  def install_locale
11
- availablelocale = ["fr", "en"]
11
+ availablelocale = ["fr", "en", "ja"]
12
12
 
13
13
  localestr = name.downcase
14
14
 
@@ -41,8 +41,8 @@ class BeautifulMigrationGenerator < Rails::Generators::Base
41
41
  myattributes.each{ |attr|
42
42
  a,t = attr.split(':')
43
43
  if ['references', 'reference'].include?(t) then
44
- inject_into_file("app/models/#{model}.rb", "\n belongs_to :#{a}", :after => "ActiveRecord::Base")
45
- inject_into_file("app/models/#{a}.rb", "\n has_many :#{model_pluralize}, :dependent => :nullify", :after => "ActiveRecord::Base")
44
+ inject_into_file("app/models/#{model}.rb", "\n belongs_to :#{a}", :after => "ApplicationRecord")
45
+ inject_into_file("app/models/#{a}.rb", "\n has_many :#{model_pluralize}, :dependent => :nullify", :after => "ApplicationRecord")
46
46
  a += "_id"
47
47
  end
48
48
 
@@ -108,7 +108,7 @@ module BeautifulScaffoldCommonMethods
108
108
  myattributes.each{ |attr|
109
109
  a,t = attr.split(':')
110
110
  newt = t
111
- if ['richtext', 'wysiwyg'].include?(t) then
111
+ if ['wysiwyg'].include?(t) then
112
112
  newt = 'text'
113
113
  elsif t == 'price' then
114
114
  newt = 'float'
@@ -144,7 +144,7 @@ module BeautifulScaffoldCommonMethods
144
144
  fulltext_field = []
145
145
  myattributes.each{ |attr|
146
146
  a,t = attr.split(':')
147
- if ['richtext', 'wysiwyg'].include?(t) then
147
+ if ['wysiwyg'].include?(t) then
148
148
  fulltext_field << a
149
149
  end
150
150
  }
@@ -152,23 +152,19 @@ module BeautifulScaffoldCommonMethods
152
152
  end
153
153
 
154
154
  def richtext_type
155
- return ["bbcode","html","text","wiki","textile","markdown"]
155
+ return ["html","text"]
156
156
  end
157
157
 
158
158
  def require_gems
159
-
160
- gem('less-rails', :github => "CQQL/less-rails", :branch => 'less-2.5')
161
- gem('will_paginate')
162
- gem('ransack', :github => 'activerecord-hackery/ransack', :branch => 'rails-4.2')
163
- gem('polyamorous', :github => 'activerecord-hackery/polyamorous')
159
+ gem('less-rails', '2.8.0')
160
+ gem('will_paginate') # v 3.1.5
161
+ gem('ransack', '1.8.2')
162
+ gem('polyamorous', '1.3.1')
164
163
  gem('jquery-ui-rails')
165
- gem('prawn', '1.0.0')
166
- gem('RedCloth')
167
- gem('bb-ruby')
168
- gem('bluecloth')
169
- gem('rdiscount')
164
+ gem('prawn', '2.1.0')
165
+ gem('prawn-table', '0.2.2')
170
166
  gem('sanitize')
171
- gem('twitter-bootstrap-rails', :github => 'seyhunak/twitter-bootstrap-rails', :branch => 'bootstrap3')
167
+ gem('twitter-bootstrap-rails', '3.2.2')
172
168
  gem('chardinjs-rails')
173
169
  end
174
170
 
@@ -35,8 +35,8 @@ class BeautifulScaffoldGenerator < Rails::Generators::Base
35
35
  @fulltext_field = []
36
36
  myattributes.each{ |attr|
37
37
  a,t = attr.split(':')
38
- if ['richtext', 'wysiwyg'].include?(t) then
39
- # _typetext = {bbcode|html|text|wiki|textile|markdown}
38
+ if ['wysiwyg'].include?(t) then
39
+ # _typetext = {html|text}
40
40
  # _fulltext = text without any code
41
41
  @fulltext_field << [a + '_typetext', 'string'].join(':')
42
42
  @fulltext_field << [a + '_fulltext', 'text'].join(':')
@@ -74,7 +74,6 @@ class BeautifulScaffoldGenerator < Rails::Generators::Base
74
74
  "#{javascriptspath}bootstrap-datepicker.js",
75
75
  "#{javascriptspath}bootstrap-datetimepicker-for-beautiful-scaffold.js",
76
76
  "#{javascriptspath}bootstrap-timepicker.js",
77
- "#{javascriptspath}jquery.livequery.js",
78
77
  "#{javascriptspath}jquery.jstree.js",
79
78
  "#{javascriptspath}jquery-barcode.js",
80
79
  "#{javascriptspath}tagit.js",
@@ -100,6 +99,9 @@ class BeautifulScaffoldGenerator < Rails::Generators::Base
100
99
  # New method
101
100
  copy_file "#{stylesheetspath}bootstrap_and_overrides.css.less",
102
101
  "#{stylesheetspath}bootstrap_and_overrides.css.less"
102
+
103
+ # Precompile BS assets
104
+ inject_into_file("config/initializers/assets.rb", "Rails.application.config.assets.precompile += ['application-bs.css','application-bs.js']", after: /\z/m)
103
105
  end
104
106
 
105
107
  def generate_layout
@@ -119,16 +121,6 @@ class BeautifulScaffoldGenerator < Rails::Generators::Base
119
121
  </li>', :after => "<!-- Beautiful Scaffold Menu Do Not Touch This -->")
120
122
  end
121
123
 
122
- def install_markitup
123
- # CSS
124
- directory "markitup/skins", "app/assets/stylesheets/markitup/skins"
125
- # JS
126
- copy_file "markitup/jquery.markitup.js", "app/assets/javascripts/jquery.markitup.js"
127
- # JS and CSS
128
- directory "markitup/sets", "app/assets/stylesheets/markitup/sets"
129
- directory "markitup/sets", "app/assets/javascripts/markitup/sets"
130
- end
131
-
132
124
  def generate_model
133
125
  generate("model", "#{model} #{beautiful_attr_to_rails_attr.join(' ')} #{@fulltext_field.join(' ')}")
134
126
 
@@ -146,7 +138,7 @@ class BeautifulScaffoldGenerator < Rails::Generators::Base
146
138
 
147
139
  def self.permitted_attributes
148
140
  return ' + attributes_without_type.map{ |attr| ":#{attr}" }.join(",") + '
149
- end', :after => "class #{model_camelize} < ActiveRecord::Base")
141
+ end', :after => "class #{model_camelize} < ApplicationRecord")
150
142
 
151
143
  copy_file "app/models/pdf_report.rb", "app/models/pdf_report.rb"
152
144
  end
@@ -157,7 +149,7 @@ class BeautifulScaffoldGenerator < Rails::Generators::Base
157
149
  a,t = attr.split(':')
158
150
  if ['references', 'reference'].include?(t) then
159
151
  begin
160
- inject_into_file("app/models/#{a}.rb", "\n has_many :#{model_pluralize}, :dependent => :nullify", :after => "ActiveRecord::Base")
152
+ inject_into_file("app/models/#{a}.rb", "\n has_many :#{model_pluralize}, :dependent => :nullify", :after => "ApplicationRecord")
161
153
  rescue
162
154
  end
163
155
  end
@@ -2,7 +2,6 @@
2
2
  //= require jquery-ui
3
3
  //= require jquery_ujs
4
4
  //= require twitter/bootstrap
5
- //= require jquery.livequery
6
5
  //= require turbolinks
7
6
  //= require a-wysihtml5-0.3.0.min
8
7
  //= require bootstrap-colorpicker
@@ -11,13 +10,6 @@
11
10
  //= require bootstrap-datetimepicker-for-beautiful-scaffold
12
11
  //= require bootstrap-wysihtml5
13
12
  //= require jquery.jstree
14
- //= require jquery.markitup
15
- //= require markitup/sets/bbcode/set
16
- //= require markitup/sets/default/set
17
- //= require markitup/sets/html/set
18
- //= require markitup/sets/markdown/set
19
- //= require markitup/sets/textile/set
20
- //= require markitup/sets/wiki/set
21
13
  //= require tagit.js
22
14
  //= require chardinjs
23
15
  //= require jquery-barcode
@@ -40,10 +32,10 @@ $(function() {
40
32
  function stopSpinner(){
41
33
  $('.loader').hide();
42
34
  }
43
- document.addEventListener("page:fetch", startSpinner);
44
- document.addEventListener("page:receive", stopSpinner);
45
- document.addEventListener("page:restore", stopSpinner);
35
+ document.addEventListener("turbolinks:request-start", startSpinner);
36
+ document.addEventListener("turbolinks:request-end", stopSpinner);
37
+ document.addEventListener("turbolinks:render", stopSpinner);
46
38
  });
47
- $(window).bind('page:change', function() {
39
+ $(window).bind('turbolinks:render', function() {
48
40
  initPage();
49
41
  });
@@ -1,38 +1,5 @@
1
1
  function bs_init(){
2
2
 
3
- /* Richtext editor */
4
- $('.select-richtext').click(function(){
5
- $('.label-richtext-type[for=' + $(this).attr('id') + ']').trigger('click');
6
- });
7
- $(document).on("click", '.label-richtext-type', function(){
8
- elt = $('#' + $(this).attr('for'));
9
- newSet = elt.val();
10
- idspleditor = elt.attr('data-spleditor');
11
- ideditor = elt.attr('data-editor');
12
- $('#' + idspleditor).markItUpRemove();
13
- if(!$('#' + idspleditor).hasClass('markItUpEditor')){
14
- switch(newSet) {
15
- case 'bbcode':
16
- $('#' + idspleditor).markItUp(myBbcodeSettings);
17
- break;
18
- case 'wiki':
19
- $('#' + idspleditor).markItUp(myWikiSettings);
20
- break;
21
- case 'textile':
22
- $('#' + idspleditor).markItUp(myTextileSettings);
23
- break;
24
- case 'markdown':
25
- $('#' + idspleditor).markItUp(myMarkdownSettings);
26
- break;
27
- case 'html':
28
- $('#' + idspleditor).markItUp(myHtmlSettings);
29
- break;
30
- }
31
- }
32
- $('#' + ideditor).removeClass("bbcode html markdown textile wiki").addClass(newSet);
33
- return true;
34
- });
35
-
36
3
  // Tagit
37
4
  $('.bs-tagit').each(function( index ) {
38
5
  var tagitelt = this;
@@ -18,11 +18,5 @@
18
18
  *= require colorpicker
19
19
  *= require bootstrap-wysihtml5
20
20
  *= require bootstrap_and_overrides
21
- *= require markitup/skins/simple/style.css
22
- *= require markitup/sets/bbcode/style.css
23
- *= require markitup/sets/wiki/style.css
24
- *= require markitup/sets/markdown/style.css
25
- *= require markitup/sets/html/style.css
26
- *= require markitup/sets/textile/style.css
27
21
  *= require chardinjs
28
22
  */
@@ -1,9 +1,9 @@
1
- //= depend_on_asset "glyphicons-halflings-regular.eot"
2
- //= depend_on_asset "glyphicons-halflings-regular.woff"
3
- //= depend_on_asset "glyphicons-halflings-regular.ttf"
4
- //= depend_on_asset "glyphicons-halflings-regular.svg"
5
- //= depend_on_asset "twitter/bootstrap/glyphicons-halflings.png"
6
- //= depend_on_asset "twitter/bootstrap/glyphicons-halflings-white.png"
1
+ //= de pend_on_asset "glyphicons-halflings-regular.eot"
2
+ //= de pend_on_asset "glyphicons-halflings-regular.woff"
3
+ //= de pend_on_asset "glyphicons-halflings-regular.ttf"
4
+ //= de pend_on_asset "glyphicons-halflings-regular.svg"
5
+ //= de pend_on_asset "twitter/bootstrap/glyphicons-halflings.png"
6
+ //= de pend_on_asset "twitter/bootstrap/glyphicons-halflings-white.png"
7
7
  //= depend_on_asset "fontawesome-webfont.eot"
8
8
  //= depend_on_asset "fontawesome-webfont.woff"
9
9
  //= depend_on_asset "fontawesome-webfont.ttf"
@@ -226,6 +226,7 @@ module BeautifulHelper
226
226
  end
227
227
  end
228
228
 
229
+ # Encore utilisé avec wysihtml5 ?
229
230
  def exclude_richtext_field(array_of_attributes, only_fulltext = true)
230
231
  pattern = /$()_fulltext/
231
232
  richtext_attributes = []
@@ -1,3 +1,5 @@
1
+ require 'will_paginate/view_helpers/link_renderer_base'
2
+
1
3
  module WillPaginate
2
4
  module ViewHelpers
3
5
  # This class does the heavy lifting of actually building the pagination
@@ -0,0 +1,50 @@
1
+ # encoding : utf-8
2
+ ja:
3
+ edit: "更新"
4
+ editing: "更新:"
5
+ update: "更新"
6
+ show: "表示"
7
+ showing: "表示:"
8
+ delete: "削除"
9
+ destroy: "削除"
10
+ are_you_sure: "続行していいですか?"
11
+ new: "新規作成"
12
+ create: "新規作成"
13
+ listing: "一覧:"
14
+ filter: "検索"
15
+ cancel: "キャンセル"
16
+ export: "エクスポート"
17
+ search: "検索"
18
+ sort: "Sort"
19
+ download: "ダウンロード"
20
+ "yes": "はい"
21
+ "no": "いいえ"
22
+ all: "すべて"
23
+ back: "戻る"
24
+ manage: "管理"
25
+ settrueforattr: "%{attr} を「はい」にする"
26
+ setfalseforattr: "%{attr} を「いいえ」にする"
27
+ processing: "実行中"
28
+ process: "実行"
29
+ batch: "一括処理"
30
+ create_success: "%{model} を作成しました。"
31
+ update_success: "%{model} を更新しました。"
32
+ greater_than: "以上"
33
+ smaller_than: "以下"
34
+ select_columns: "項目選択"
35
+ treeview: "ツリー表示"
36
+ profile: "プロファイル"
37
+ sign_out: "サイン・アウト"
38
+ sign_in: "サインイン"
39
+ sign_up: "サイン・アップ"
40
+ login: "ログイン"
41
+ remember_me: "ログインを維持する"
42
+ email: "メールアドレス"
43
+ password: "パスワード"
44
+ password_confirmation: "パスワード (確認)"
45
+ forgot_your_password: "パスワードを忘れましたか?"
46
+ send_me_reset_password_instructions: "パスワードのリセット方法を送る"
47
+ register: "登録"
48
+ search_and_filter: "検索条件"
49
+ more_options: "追加オプション..."
50
+
@@ -30,18 +30,18 @@ module FulltextConcern
30
30
 
31
31
  def htmlize(text, type)
32
32
  case type
33
- when 'bbcode' then
34
- require 'bb-ruby'
35
- html = text.bbcode_to_html
33
+ #when 'bbcode' then
34
+ # require 'bb-ruby'
35
+ # html = text.bbcode_to_html
36
36
  when 'html' then
37
37
  html = text
38
- when 'textile' then
39
- html = RedCloth.new(text).to_html
40
- when 'markdown' then
41
- require 'rdiscount'
42
- html = RDiscount.new(text).to_html
43
- when 'wiki' then
44
- html = WikiCloth::Parser.new({:data => text}).to_html
38
+ #when 'textile' then
39
+ # html = RedCloth.new(text).to_html
40
+ #when 'markdown' then
41
+ # require 'rdiscount'
42
+ # html = RDiscount.new(text).to_html
43
+ #when 'wiki' then
44
+ # html = WikiCloth::Parser.new({:data => text}).to_html
45
45
  else
46
46
  html
47
47
  end
@@ -1,31 +1,5 @@
1
1
  <%- attributes.each do |attribute| -%>
2
- <%- if @beautiful_attributes.include?(attribute.name + ':richtext') then -%>
3
- <div class="form-group">
4
- <%%= f.label :<%= attribute.name %>, <%= i18n_t_a(singular_table_name, attribute.name) %>.capitalize, :class => "control-label" %>
5
- <%%= f.text_area :<%= attribute.name %>, :class => "richtext-editor" %>
6
- </div>
7
- <div class="form-group">
8
- <label class="control-label" for="inlineCheckboxes"></label>
9
- <% for type in richtext_type %>
10
- <%% hashradio = {:id => "<%= attribute.name %>-<%= type %>", :class => "select-richtext", 'data-editor' => 'markItUp<%= singular_table_name.capitalize %>_<%= attribute.name.downcase %>', 'data-spleditor' => '<%= singular_table_name %>_<%= attribute.name %>' } %>
11
- <%% hashradio[:checked] = "checked" if @<%= singular_table_name %>.<%= attribute.name %>_typetext == "<%= type %>" %>
12
- <label for="<%= attribute.name %>-<%= type %>" class="label-richtext-type checkbox inline">
13
- <%%= f.radio_button :<%= attribute.name %>_typetext, "<%= type %>", hashradio %>
14
- <%= type.capitalize %>
15
- </label>
16
- <% end %>
17
- </div>
18
-
19
- <%% rttype = @<%= singular_table_name %>.<%= attribute.name %>_typetext.to_s %>
20
- <%% if not rttype.blank? then %>
21
- <script language="javascript">
22
- $(document).ready(function(){
23
- $('#<%= singular_table_name %>_<%= attribute.name %>').markItUp(my<%%= rttype.capitalize %>Settings);
24
- $('#markItUp<%= singular_table_name.capitalize %>_<%= attribute.name.downcase %>').addClass('<%%= rttype.downcase %>');
25
- });
26
- </script>
27
- <%% end %>
28
- <%- elsif @beautiful_attributes.include?(attribute.name + ':wysiwyg') then -%>
2
+ <%- if @beautiful_attributes.include?(attribute.name + ':wysiwyg') then -%>
29
3
  <div class="form-group">
30
4
  <%%= f.label :<%= attribute.name %>, <%= i18n_t_a(singular_table_name, attribute.name) %>.capitalize, :class => "control-label" %>
31
5
  <%%= f.text_area :<%= attribute.name %>, :class => "wysiwyg-editor form-control" %>
@@ -2,8 +2,6 @@
2
2
  <td <%%= visible_column("<%= singular_table_name %>", "<%= attribute.name %>") %> class="bs-col-<%= attribute.name %> <%%= align_attribute("<%= attribute.type %>") %>">
3
3
  <%- if @beautiful_attributes.include?(attribute.name + ':price') then -%>
4
4
  <%%= number_to_currency(<%= singular_table_name %>.<%= attribute.name %>, :locale => I18n.locale) %>
5
- <%- elsif @beautiful_attributes.include?(attribute.name + ':richtext') then -%>
6
- <%%= truncate(<%= singular_table_name %>.<%= attribute.name + "_fulltext" %>, :length => 30) %>
7
5
  <%- elsif @beautiful_attributes.include?(attribute.name + ':boolean') then -%>
8
6
  <%%= t((<%= singular_table_name %>.<%= attribute.name %> ? "yes" : "no").to_sym) %>
9
7
  <%- elsif @beautiful_attributes.include?(attribute.name + ':references') then -%>
@@ -4,8 +4,6 @@
4
4
  <%- caption = a.name.capitalize -%>
5
5
  <%- if @beautiful_attributes.include?(a.name + ':references') then -%>
6
6
  <%- attribute = "_id" -%>
7
- <%- elsif @beautiful_attributes.include?(a.name + ':richtext') then -%>
8
- <%- attribute = "_fulltext" -%>
9
7
  <%- end -%>
10
8
  <%%= ransack_field("<%= singular_table_name %>", "<%= a.name %><%= attribute %>", f, "<%= caption %>") %>
11
9
  <%- end -%>