beautiful_scaffold 0.3.0.rc1 → 0.3.0.rc2
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/CHANGELOG +14 -1
- data/README.rdoc +37 -2
- data/beautiful_scaffold.gemspec +1 -1
- data/lib/generators/beautiful_locale_generator.rb +11 -2
- data/lib/generators/beautiful_scaffold_common_methods.rb +2 -1
- data/lib/generators/beautiful_scaffold_generator.rb +3 -1
- data/lib/generators/templates/app/assets/javascripts/application-bs.js +9 -1
- data/lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js +11 -0
- data/lib/generators/templates/app/assets/javascripts/fixed_menu.js +1 -0
- data/lib/generators/templates/app/assets/javascripts/jquery-barcode.js +1351 -0
- data/lib/generators/templates/app/assets/stylesheets/application-bs.css +1 -0
- data/lib/generators/templates/app/helpers/beautiful_helper.rb +15 -6
- data/lib/generators/templates/app/views/_mass_inserting.html.erb +3 -3
- data/lib/generators/templates/app/views/index.html.erb +2 -2
- data/lib/generators/templates/app/views/treeview.html.erb +1 -1
- metadata +3 -2
data/CHANGELOG
CHANGED
@@ -1,4 +1,17 @@
|
|
1
|
-
== 0.3.0
|
1
|
+
== 0.3.0.rc2
|
2
|
+
|
3
|
+
* enhancement
|
4
|
+
* Barcode support (set README for usage)
|
5
|
+
* Chardinjs for overlay instruction (set README for usage)
|
6
|
+
|
7
|
+
* Bugfix
|
8
|
+
* i18n some bugfix i18n
|
9
|
+
* i18n download willpaginate i18n file
|
10
|
+
* Body hidden in firefox
|
11
|
+
* Add space after icon for some button
|
12
|
+
* Bug treeview double quote in attribute (data-opened=""")
|
13
|
+
|
14
|
+
== 0.3.0.rc1
|
2
15
|
|
3
16
|
* enhancement
|
4
17
|
* Refactoring i18n (avoid reserved words) :
|
data/README.rdoc
CHANGED
@@ -15,7 +15,7 @@ gem 'beautiful_scaffold', '0.2.7'
|
|
15
15
|
=== RubyOnRails 4.X
|
16
16
|
|
17
17
|
Add this in your Gemfile :
|
18
|
-
gem 'beautiful_scaffold', '0.3.0.
|
18
|
+
gem 'beautiful_scaffold', '0.3.0.rc2'
|
19
19
|
|
20
20
|
=== Next
|
21
21
|
|
@@ -50,6 +50,8 @@ rails g beautiful_migration AddFieldToModels field:type
|
|
50
50
|
|
51
51
|
=== Locale (i18n) (Example)
|
52
52
|
|
53
|
+
Run rake db:migrate before rail g beautiful_locale (to get lastest attribute translation)
|
54
|
+
|
53
55
|
rails g beautiful_locale all
|
54
56
|
rails g beautiful_locale fr
|
55
57
|
rails g beautiful_locale de
|
@@ -60,4 +62,37 @@ rails g beautiful_jointable model1 model2
|
|
60
62
|
|
61
63
|
=== Install et Configure Devise (authentification) and Cancan (authorization)
|
62
64
|
|
63
|
-
rails g beautiful_devisecancan model
|
65
|
+
rails g beautiful_devisecancan model
|
66
|
+
|
67
|
+
=== In views
|
68
|
+
|
69
|
+
==== Barcodes
|
70
|
+
|
71
|
+
Set code like this :
|
72
|
+
<span class="barcode" data-barcode="1234567890128" data-type-barcode="ean13"></span>
|
73
|
+
|
74
|
+
data-type-barcode can be :
|
75
|
+
|
76
|
+
codabar
|
77
|
+
code11 (code 11)
|
78
|
+
code39 (code 39)
|
79
|
+
code93 (code 93)
|
80
|
+
code128 (code 128)
|
81
|
+
ean8 (ean 8)
|
82
|
+
ean13 (ean 13)
|
83
|
+
std25 (standard 2 of 5 - industrial 2 of 5)
|
84
|
+
int25 (interleaved 2 of 5)
|
85
|
+
msi
|
86
|
+
datamatrix (ASCII + extended)
|
87
|
+
|
88
|
+
==== Chardinjs (overlay instructions)
|
89
|
+
|
90
|
+
Example : This button triggers chardinjs on element with 'menu' id.
|
91
|
+
<a href="#" class="bs-chardinjs" data-selector="#menu">Help Menu</a>
|
92
|
+
|
93
|
+
If you want display all chardinjs :
|
94
|
+
<a href="#" class="bs-chardinjs" data-selector="body">Help</a>
|
95
|
+
|
96
|
+
Just add class="bs-chardinjs" in a button / link for trigger chardinjs. Beautiful-Scaffold does the job !
|
97
|
+
|
98
|
+
For add instruction to element, read official documentation : https://github.com/heelhook/chardin.js#adding-data-for-the-instructions
|
data/beautiful_scaffold.gemspec
CHANGED
@@ -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.0.
|
6
|
+
s.version = "0.3.0.rc2"
|
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"
|
@@ -37,6 +37,15 @@ class BeautifulLocaleGenerator < Rails::Generators::Base
|
|
37
37
|
rescue
|
38
38
|
say_status("Error", "Error to download locale, verify if locale exist at : #{download_path}", :red)
|
39
39
|
end
|
40
|
+
|
41
|
+
willpaginate_locale_file = "will_paginate.#{temp_locale}.yml"
|
42
|
+
download_path = "https://raw.github.com/mislav/will_paginate/master/lib/will_paginate/locale/en.yml"
|
43
|
+
begin
|
44
|
+
get download_path, "config/locales/#{willpaginate_locale_file}"
|
45
|
+
say_status("Warning", "You must modify Will_paginate locale at : Rails.root/config/locale/#{willpaginate_locale_file}", :red)
|
46
|
+
rescue
|
47
|
+
say_status("Error", "Error to download locale, verify if locale exist at : #{download_path}", :red)
|
48
|
+
end
|
40
49
|
}
|
41
50
|
|
42
51
|
say_status("Warning", "/!\\ Remember to update your application.rb file !", :yellow)
|
@@ -72,12 +81,12 @@ class BeautifulLocaleGenerator < Rails::Generators::Base
|
|
72
81
|
|
73
82
|
hi18n[name.downcase]['app']['models'][model] ||= {
|
74
83
|
'bs_caption' => model,
|
75
|
-
'
|
84
|
+
'bs_caption_plural' => model.pluralize,
|
76
85
|
'bs_attributes' => {},
|
77
86
|
}
|
78
87
|
|
79
88
|
hi18n[name.downcase]['app']['models'][model]['bs_caption'] = translate_string(name.downcase, model)
|
80
|
-
hi18n[name.downcase]['app']['models'][model]['
|
89
|
+
hi18n[name.downcase]['app']['models'][model]['bs_caption_plural'] = translate_string(name.downcase, model.pluralize)
|
81
90
|
hi18n[name.downcase]['app']['models'][model]['bs_attributes'] ||= {}
|
82
91
|
|
83
92
|
sorted_attr.each { |k|
|
@@ -75,7 +75,7 @@ module BeautifulScaffoldCommonMethods
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def model_p_path_i18n(model)
|
78
|
-
"app.models.#{model}.
|
78
|
+
"app.models.#{model}.bs_caption_plural"
|
79
79
|
end
|
80
80
|
|
81
81
|
def i18n_t_a(model, attribute)
|
@@ -167,6 +167,7 @@ module BeautifulScaffoldCommonMethods
|
|
167
167
|
gem('rdiscount')
|
168
168
|
gem('sanitize')
|
169
169
|
gem('twitter-bootstrap-rails')
|
170
|
+
gem('chardinjs-rails')
|
170
171
|
end
|
171
172
|
|
172
173
|
end
|
@@ -20,7 +20,8 @@ class BeautifulScaffoldGenerator < Rails::Generators::Base
|
|
20
20
|
|
21
21
|
def install_gems
|
22
22
|
require_gems
|
23
|
-
inside Rails.root do
|
23
|
+
#inside Rails.root do # Bug ?!
|
24
|
+
Bundler.with_clean_env do
|
24
25
|
run "bundle install"
|
25
26
|
end
|
26
27
|
end
|
@@ -71,6 +72,7 @@ class BeautifulScaffoldGenerator < Rails::Generators::Base
|
|
71
72
|
"#{javascriptspath}bootstrap-timepicker.js",
|
72
73
|
"#{javascriptspath}jquery.livequery.js",
|
73
74
|
"#{javascriptspath}jquery.jstree.js",
|
75
|
+
"#{javascriptspath}jquery-barcode.js",
|
74
76
|
"#{javascriptspath}tagit.js",
|
75
77
|
"#{javascriptspath}bootstrap-colorpicker.js",
|
76
78
|
"#{javascriptspath}a-wysihtml5-0.3.0.min.js",
|
@@ -1,6 +1,13 @@
|
|
1
1
|
//= require jquery
|
2
2
|
//= require jquery-ui
|
3
3
|
//= require jquery_ujs
|
4
|
+
//= require twitter/bootstrap/bootstrap-transition
|
5
|
+
//= require twitter/bootstrap/bootstrap-alert
|
6
|
+
//= require twitter/bootstrap/bootstrap-modal
|
7
|
+
//= require twitter/bootstrap/bootstrap-button
|
8
|
+
//= require twitter/bootstrap/bootstrap-collapse
|
9
|
+
//= require twitter/bootstrap/bootstrap-dropdown
|
10
|
+
//= require twitter/bootstrap/bootstrap-tooltip
|
4
11
|
//= require jquery.livequery
|
5
12
|
//= require turbolinks
|
6
13
|
//= require a-wysihtml5-0.3.0.min
|
@@ -18,6 +25,7 @@
|
|
18
25
|
//= require markitup/sets/textile/set
|
19
26
|
//= require markitup/sets/wiki/set
|
20
27
|
//= require tagit.js
|
28
|
+
//= require chardinjs
|
21
29
|
//= require beautiful_scaffold
|
22
30
|
//= require fixed_menu
|
23
31
|
|
@@ -31,4 +39,4 @@ $(function() {
|
|
31
39
|
});
|
32
40
|
$(window).bind('page:change', function() {
|
33
41
|
initPage();
|
34
|
-
})
|
42
|
+
});
|
@@ -142,6 +142,17 @@ function bs_init(){
|
|
142
142
|
});
|
143
143
|
});
|
144
144
|
|
145
|
+
// Barcode
|
146
|
+
$('.barcode').each(function(index){
|
147
|
+
$(this).barcode($(this).attr('data-barcode'), $(this).attr('data-type-barcode'));
|
148
|
+
});
|
149
|
+
|
150
|
+
// Chardinjs (overlay instructions)
|
151
|
+
$(".bs-chardinjs").on("click", function(){
|
152
|
+
var selector = $(this).attr("data-selector");
|
153
|
+
$(selector).chardinJs('toggle');
|
154
|
+
});
|
155
|
+
|
145
156
|
// Mass inserting set focus
|
146
157
|
elt = $('form.mass-inserting div[style*="inline"][class*="col"] .input-small').first();
|
147
158
|
if($('form.mass-inserting').hasClass('setfocus')){
|