beautiful_scaffold 2.0.0.pre → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -1
  3. data/CHANGELOG +45 -0
  4. data/Gemfile +5 -4
  5. data/README.rdoc +22 -4
  6. data/Rakefile +0 -3
  7. data/beautiful_scaffold.gemspec +0 -2
  8. data/lib/beautiful_scaffold/version.rb +1 -1
  9. data/lib/generators/USAGE +25 -11
  10. data/lib/generators/beautiful_cancancan_generator.rb +51 -0
  11. data/lib/generators/beautiful_jointable_generator.rb +3 -5
  12. data/lib/generators/beautiful_locale_generator.rb +15 -13
  13. data/lib/generators/beautiful_migration_generator.rb +3 -1
  14. data/lib/generators/beautiful_scaffold_common_methods.rb +10 -2
  15. data/lib/generators/beautiful_scaffold_generator.rb +2 -10
  16. data/lib/generators/beautiful_sorcery_generator.rb +137 -0
  17. data/lib/generators/beautiful_storage_generator.rb +61 -0
  18. data/lib/generators/templates/app/assets/javascripts/application-bs.js +0 -2
  19. data/lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js +15 -30
  20. data/lib/generators/templates/app/assets/javascripts/bootstrap-datetimepicker-for-beautiful-scaffold.js +16 -15
  21. data/lib/generators/templates/app/assets/stylesheets/application-bs.css +0 -2
  22. data/lib/generators/templates/app/assets/stylesheets/beautiful-scaffold.css.scss +9 -1
  23. data/lib/generators/templates/app/controllers/user_sessions_controller.rb +20 -0
  24. data/lib/generators/templates/app/helpers/beautiful_helper.rb +19 -5
  25. data/lib/generators/templates/app/locales/beautiful_scaffold.en.yml +8 -0
  26. data/lib/generators/templates/app/locales/beautiful_scaffold.fr.yml +9 -1
  27. data/lib/generators/templates/app/locales/beautiful_scaffold.ja.yml +9 -2
  28. data/lib/generators/templates/app/mailers/user_mailer.rb +13 -0
  29. data/lib/generators/templates/app/models/ability.rb +39 -0
  30. data/lib/generators/templates/app/models/concerns/caption_concern.rb +1 -1
  31. data/lib/generators/templates/app/models/user.rb +11 -0
  32. data/lib/generators/templates/app/views/_form_habtm_tag.html.erb +3 -3
  33. data/lib/generators/templates/app/views/layout.html.erb +12 -2
  34. data/lib/generators/templates/app/views/login_logout/user_mailer/activation_needed_email.en.html.erb +16 -0
  35. data/lib/generators/templates/app/views/login_logout/user_mailer/activation_needed_email.en.text.erb +9 -0
  36. data/lib/generators/templates/app/views/login_logout/user_mailer/activation_needed_email.fr.html.erb +16 -0
  37. data/lib/generators/templates/app/views/login_logout/user_mailer/activation_needed_email.fr.text.erb +8 -0
  38. data/lib/generators/templates/app/views/login_logout/user_mailer/activation_success_email.en.html.erb +19 -0
  39. data/lib/generators/templates/app/views/login_logout/user_mailer/activation_success_email.en.text.erb +8 -0
  40. data/lib/generators/templates/app/views/login_logout/user_mailer/activation_success_email.fr.html.erb +19 -0
  41. data/lib/generators/templates/app/views/login_logout/user_mailer/activation_success_email.fr.text.erb +8 -0
  42. data/lib/generators/templates/app/views/login_logout/user_sessions/_form.html.erb +15 -0
  43. data/lib/generators/templates/app/views/login_logout/user_sessions/new.html.erb +3 -0
  44. data/lib/generators/templates/app/views/partials/_form_field.html.erb +33 -25
  45. data/lib/generators/templates/app/views/partials/_index_column.html.erb +2 -0
  46. data/lib/generators/templates/app/views/partials/_login_logout_register.html.erb +7 -0
  47. data/lib/generators/templates/app/views/partials/_show_field.html.erb +2 -0
  48. metadata +23 -15
  49. data/Gemfile.lock +0 -209
  50. data/lib/generators/beautiful_devisecancan_generator.rb +0 -128
  51. data/lib/generators/templates/app/assets/javascripts/bootstrap-colorpicker.js +0 -520
  52. data/lib/generators/templates/app/assets/javascripts/tagit.js +0 -489
  53. data/lib/generators/templates/app/assets/stylesheets/colorpicker.css +0 -127
  54. data/lib/generators/templates/app/assets/stylesheets/tagit-dark-grey.css +0 -135
  55. data/lib/generators/templates/app/views/partials/_register_form.html.erb +0 -44
  56. data/lib/generators/templates/app/views/partials/_sign_in_form.html.erb +0 -18
  57. data/lib/generators/templates/app/views/partials/_sign_in_sign_out.html.erb +0 -19
  58. data/lib/generators/templates/lib/custom_failure.rb +0 -15
@@ -15,7 +15,7 @@ ja:
15
15
  cancel: "キャンセル"
16
16
  export: "エクスポート"
17
17
  search: "検索"
18
- sort: "Sort"
18
+ sort: "トライ"
19
19
  download: "ダウンロード"
20
20
  "yes": "はい"
21
21
  "no": "いいえ"
@@ -47,4 +47,11 @@ ja:
47
47
  register: "登録"
48
48
  search_and_filter: "検索条件"
49
49
  more_options: "追加オプション..."
50
-
50
+ edit_profile: "プロファイル編集"
51
+ logout: "ログアウト"
52
+ register: "登録"
53
+ login: "ログイン"
54
+ logged_out: "ログアウトしました"
55
+ login_failed: "ログインに失敗しました"
56
+ login_successful: "ログイン成功"
57
+ crypted_password: "暗号化されたパスワード"
@@ -0,0 +1,13 @@
1
+ class UserMailer < ApplicationMailer
2
+ def activation_needed_email(user)
3
+ @user = user
4
+ @url = activate_user_url(@user.activation_token)
5
+ mail(to: user.email, subject: 'Welcome to My Awesome Site')
6
+ end
7
+
8
+ def activation_success_email(user)
9
+ @user = user
10
+ @url = login_url
11
+ mail(to: user.email, subject: 'Your account is now activated')
12
+ end
13
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Ability
4
+ include CanCan::Ability
5
+
6
+ def initialize(user)
7
+ if !user.nil?
8
+ if user.id == 1
9
+ can :manage, :all
10
+ end
11
+ end
12
+ # Define abilities for the passed in user here. For example:
13
+ #
14
+ # user ||= User.new # guest user (not logged in)
15
+ # if user.admin?
16
+ # can :manage, :all
17
+ # else
18
+ # can :read, :all
19
+ # end
20
+ #
21
+ # The first argument to `can` is the action you are giving the user
22
+ # permission to do.
23
+ # If you pass :manage it will apply to every action. Other common actions
24
+ # here are :read, :create, :update and :destroy.
25
+ #
26
+ # The second argument is the resource the user can perform the action on.
27
+ # If you pass :all it will apply to every resource. Otherwise pass a Ruby
28
+ # class of the resource.
29
+ #
30
+ # The third argument is an optional hash of conditions to further filter the
31
+ # objects.
32
+ # For example, here the user can only update published articles.
33
+ #
34
+ # can :update, Article, :published => true
35
+ #
36
+ # See the wiki for details:
37
+ # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities
38
+ end
39
+ end
@@ -3,6 +3,6 @@ module CaptionConcern
3
3
 
4
4
  # You can OVERRIDE this method used in model form and search form (in belongs_to relation)
5
5
  def caption
6
- (self["name"] || self["label"] || self["description"] || "##{id}")
6
+ (self["name"] || self["label"] || self["description"] || self["email"] || "##{id}")
7
7
  end
8
8
  end
@@ -0,0 +1,11 @@
1
+ class User < ApplicationRecord
2
+ authenticates_with_sorcery!
3
+
4
+ validates :password, length: { minimum: 3 }, if: -> { new_record? || changes[:crypted_password] }
5
+ validates :password, confirmation: true, if: -> { new_record? || changes[:crypted_password] }
6
+ validates :password_confirmation, presence: true, if: -> { new_record? || changes[:crypted_password] }
7
+
8
+ before_update :setup_activation, if: -> { email_changed? }
9
+ after_update :send_activation_needed_email!, if: -> { previous_changes["email"].present? }
10
+
11
+ end
@@ -20,13 +20,13 @@
20
20
  <div class="form-group">
21
21
  <%= f.label plural_linked_model_name.to_sym, t(plural_linked_model_name.to_sym, :default => plural_linked_model_name.capitalize), :class => "control-label" %>
22
22
  <div>
23
- <ul class="bs-tagit" id="<%= model_name %>_<%= linked_model_name %>_ids" name="<%= model_name %>[<%= linked_model_name %>_ids][]" data-url="<%= path_namespace %><%= plural_linked_model_name %>/search_and_filter.json" data-param="q[<%= field_to_search_for_linked_model %>_cont]" data-result="<%= attr_to_show %>">
23
+ <select multiple="multiple" class="form-control bs-tagit" id="<%= model_name %>_<%= linked_model_name %>_ids" name="<%= model_name %>[<%= linked_model_name %>_ids][]" data-tags="true" data-placeholder="<%= t('select-an-option', default: 'Select an option') %>" data-allow-clear="true" data-ajax--cache="true" data-ajax--url="<%= path_namespace %><%= plural_linked_model_name %>/search_and_filter.json" data-param="q[<%= field_to_search_for_linked_model %>_cont]" data-result="<%= attr_to_show %>">
24
24
  <% begin %>
25
25
  <% for elt in model_class.send(plural_linked_model_name) %>
26
- <li data-value="<%= elt.id %>"><%= elt.caption %></li>
26
+ <option selected="selected" data-value="<%= elt.id %>"><%= elt.caption %></option>
27
27
  <% end %>
28
28
  <% rescue %>
29
29
  <% end %>
30
- </ul>
30
+ </select>
31
31
  </div>
32
32
  </div>
@@ -15,6 +15,9 @@
15
15
  <%%= stylesheet_link_tag "<%= engine_name %>application-bs" %>
16
16
  <%%= javascript_include_tag "<%= engine_name %>application-bs" %>
17
17
 
18
+ <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
19
+ <script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
20
+
18
21
  <%%= csrf_meta_tags %>
19
22
  <%%= yield :head %>
20
23
  </head>
@@ -30,11 +33,11 @@
30
33
  </div>
31
34
  <div class="navbar-collapse collapse">
32
35
  <nav class="nav navbar-nav">
33
- <a href="/" class="nav-link">Home</a>-
36
+ <a href="/" class="nav-link">Home</a>
34
37
  <%%= render :partial => "layouts/beautiful_menu" %>
38
+ <!-- Beautiful_scaffold - Signin - Do not remove -->
35
39
  </nav>
36
40
  <i class="fa fa-question-circle text-white float-right" id="bs-help"></i>
37
- <!-- Beautiful_scaffold - Signin - Do not remove -->
38
41
  </div>
39
42
  </div>
40
43
  <div class="container-fluid">
@@ -47,6 +50,13 @@
47
50
  <%%= flash[:notice] %>
48
51
  </div>
49
52
  <%% end %>
53
+ <%% if !flash[:alert].blank? %>
54
+ <div class="alert alert-warning">
55
+ <a class="close" data-dismiss="alert" href="#">×</a>
56
+ <h4 class="alert-heading">Warning : </h4>
57
+ <%%= flash[:alert] %>
58
+ </div>
59
+ <%% end %>
50
60
  <%% if !flash[:error].blank? %>
51
61
  <div class="alert alert-danger">
52
62
  <a class="close" data-dismiss="alert" href="#">×</a>
@@ -0,0 +1,16 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
5
+ </head>
6
+ <body>
7
+ <h1> Welcome <%= @user.email %> </h1>
8
+ <p>
9
+ You have successfully signed up to www.example.com, and your username is: <%= @user.email %>.
10
+ </p>
11
+ <p>
12
+ To login to the site, just follow this link: <%= @url %> .
13
+ </p>
14
+ <p>Thanks for joining and have a great day!</p>
15
+ </body>
16
+ </html>
@@ -0,0 +1,9 @@
1
+ Welcome to example.com, <%= @user.email %>
2
+ ===============================================
3
+
4
+ You have successfully signed up to example.com,
5
+ your username is: <%= @user.email %>.
6
+
7
+ To login to the site, just follow this link: <%= @url %> .
8
+
9
+ Thanks for joining and have a great day!
@@ -0,0 +1,16 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
5
+ </head>
6
+ <body>
7
+ <h1>Bienvenue <%= @user.email %> </h1>
8
+ <p>
9
+ Vous vous êtes inscrit à www.example.com, votre identifiant est : <%= @user.email %>.
10
+ </p>
11
+ <p>
12
+ Pour activer votre compte, veuillez cliquer sur ce lien : <%= @url %> .
13
+ </p>
14
+ <p>Merci d'avoir créé votre compte, bonne journée !</p>
15
+ </body>
16
+ </html>
@@ -0,0 +1,8 @@
1
+ Bienvenue, <%= @user.email %>
2
+ ===============================================
3
+
4
+ Vous vous êtes inscrit à www.example.com, votre identifiant est : <%= @user.email %>.
5
+
6
+ Pour activer votre compte, veuillez cliquer sur ce lien : <%= @url %> .
7
+
8
+ Merci d'avoir créé votre compte, bonne journée !
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
5
+ </head>
6
+ <body>
7
+ <h1>Congratulations, <%= @user.email %>!</h1>
8
+ <p>
9
+ You have successfully activated your example.com account,
10
+ your username is: <%= @user.email %>.
11
+ </p>
12
+ <p>
13
+ To login to the site, just follow this link: <%= @url %>.
14
+ </p>
15
+ <p>
16
+ Thanks for joining and have a great day!
17
+ </p>
18
+ </body>
19
+ </html>
@@ -0,0 +1,8 @@
1
+ Congratulations, <%= @user.email %>!
2
+
3
+ You have successfully activated your example.com account,
4
+ your username is: <%= @user.email %>.
5
+
6
+ To login to the site, just follow this link: <%= @url %>.
7
+
8
+ Thanks for joining and have a great day!
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
5
+ </head>
6
+ <body>
7
+ <h1>Félicitations <%= @user.email %>!</h1>
8
+ <p>
9
+ Vous avez activé votre compte sur www.example.com avec succès,
10
+ Votre identifiant est : <%= @user.email %>.
11
+ </p>
12
+ <p>
13
+ Pour ce connecter sur le site, veuillez suivre ce lien : <%= @url %>.
14
+ </p>
15
+ <p>
16
+ Merci de vous être inscrit, bonne journée !
17
+ </p>
18
+ </body>
19
+ </html>
@@ -0,0 +1,8 @@
1
+ Félicitations <%= @user.email %>!
2
+
3
+ Vous avez activé votre compte sur www.example.com avec succès,
4
+ Votre identifiant est : <%= @user.email %>.
5
+
6
+ Pour ce connecter sur le site, veuillez suivre ce lien : <%= @url %>.
7
+
8
+ Merci de vous être inscrit, bonne journée !
@@ -0,0 +1,15 @@
1
+ <%= form_with url: user_sessions_path, method: :post do |f| %>
2
+ <div class="form-group">
3
+ <%= f.label :email, :class => "control-label" %><br />
4
+ <%= f.text_field :email, :class => "form-control" %>
5
+ </div>
6
+ <div class="form-group">
7
+ <%= f.label :password, :class => "control-label" %><br />
8
+ <%= f.password_field :password, :class => "form-control" %>
9
+ </div>
10
+ <div>
11
+ <%= link_to t(:back, :default => 'Back'), users_path, :class => "btn btn-light" %>
12
+ <%= f.submit :class => "btn btn-primary", :data => { :disable_with => t(:saving, :default => "Saving...") } %>
13
+ </div>
14
+ <% end %>
15
+
@@ -0,0 +1,3 @@
1
+ <h2><%= t(:login, :default => 'Login') %></h2>
2
+
3
+ <%= render 'form' %>
@@ -14,39 +14,47 @@
14
14
  <div class="form-group">
15
15
  <%%= f.label :<%= attribute.name %>, <%= i18n_t_a(singular_table_name, attribute.name) %>.capitalize, :class => "control-label" %>
16
16
  <div class="input-group">
17
- <span class="input-group-addon">$</span><%%= f.<%= attribute.field_type %> :<%= attribute.name %>, :class => "form-control" %>
17
+ <span class="input-group-text">$</span><%%= f.<%= attribute.field_type %> :<%= attribute.name %>, :class => "form-control" %>
18
18
  </div>
19
19
  </div>
20
- <%- elsif @beautiful_attributes.include?(attribute.name + ':date') -%>
20
+ <%- elsif (datetime_field = @beautiful_attributes.include?(attribute.name + ':datetime')) || @beautiful_attributes.include?(attribute.name + ':date') -%>
21
21
  <div class="form-group">
22
22
  <%%= f.label :<%= attribute.name %>, <%= i18n_t_a(singular_table_name, attribute.name) %>.capitalize, :class => "control-label" %>
23
- <input type="hidden" name="<%= singular_table_name %>[<%= attribute.name %>(3i)]" id="<%= singular_table_name %>_<%= attribute.name %>_3i" value="<%%= begin @<%= singular_table_name %>.<%= attribute.name %>.day rescue "" end %>" />
24
- <input type="hidden" name="<%= singular_table_name %>[<%= attribute.name %>(2i)]" id="<%= singular_table_name %>_<%= attribute.name %>_2i" value="<%%= begin @<%= singular_table_name %>.<%= attribute.name %>.mon rescue "" end %>" />
25
- <input type="hidden" name="<%= singular_table_name %>[<%= attribute.name %>(1i)]" id="<%= singular_table_name %>_<%= attribute.name %>_1i" value="<%%= begin @<%= singular_table_name %>.<%= attribute.name %>.year rescue "" end %>" />
26
- <div class="input-group">
27
- <%%= f.text_field :<%= attribute.name %>, :value => (begin @<%= singular_table_name %>.<%= attribute.name %>.strftime("%d/%m/%Y") rescue "" end), :class => "dpicker form-control" %><span class="input-group-addon"><i class="fa fa-calendar"></i></span>
28
- </div>
29
- </div>
30
- <%- elsif @beautiful_attributes.include?(attribute.name + ':datetime') -%>
31
- <div class="form-group">
32
- <%%= f.label :<%= attribute.name %>, <%= i18n_t_a(singular_table_name, attribute.name) %>.capitalize, :class => "control-label" %>
33
- <input type="hidden" name="<%= singular_table_name %>[<%= attribute.name %>(3i)]" id="<%= singular_table_name %>_<%= attribute.name %>_3i" value="<%%= begin @<%= singular_table_name %>.<%= attribute.name %>.day rescue "" end %>" />
34
- <input type="hidden" name="<%= singular_table_name %>[<%= attribute.name %>(2i)]" id="<%= singular_table_name %>_<%= attribute.name %>_2i" value="<%%= begin @<%= singular_table_name %>.<%= attribute.name %>.mon rescue "" end %>" />
35
- <input type="hidden" name="<%= singular_table_name %>[<%= attribute.name %>(1i)]" id="<%= singular_table_name %>_<%= attribute.name %>_1i" value="<%%= begin @<%= singular_table_name %>.<%= attribute.name %>.year rescue "" end %>" />
36
- <div class="input-group">
37
- <%%= f.text_field :<%= attribute.name %>, :value => (begin @<%= singular_table_name %>.<%= attribute.name %>.strftime("%d/%m/%Y") rescue "" end), :class => "dpicker form-control" %><span class="input-group-addon"><i class="fa fa-calendar"></i></span>
38
- </div>
39
- <input type="hidden" name="<%= singular_table_name %>[<%= attribute.name %>(4i)]" id="<%= singular_table_name %>_<%= attribute.name %>_4i" value="<%%= begin @<%= singular_table_name %>.<%= attribute.name %>.min rescue "" end %>" />
40
- <input type="hidden" name="<%= singular_table_name %>[<%= attribute.name %>(5i)]" id="<%= singular_table_name %>_<%= attribute.name %>_5i" value="<%%= begin @<%= singular_table_name %>.<%= attribute.name %>.hour rescue "" end %>" />
41
- <div class="input-group">
42
- <%%= f.text_field :<%= attribute.name %>, :value => (begin @<%= singular_table_name %>.<%= attribute.name %>.strftime("%H:%M") rescue "" end), :class => "tpicker form-control" %><span class="input-group-addon"><i class="fa fa-clock-o"></i></span>
43
- </div>
23
+ <% if datetime_field %>
24
+ <div class="row">
25
+ <% end %>
26
+ <div id="container_<%= singular_table_name %>_<%= attribute.name %>_dp" data-field="<%= singular_table_name %>_<%= attribute.name %>_input_" class="input-group input-datetime dpicker <%= (datetime_field ? 'col-sm' : '') %>" data-target-input="nearest">
27
+ <%%= f.text_field :<%= attribute.name %>, :value => (begin @<%= singular_table_name %>.<%= attribute.name %>.strftime("%d/%m/%Y") rescue "" end),
28
+ :class => "form-control datetimepicker-input",
29
+ "data-target" => "#container_<%= singular_table_name %>_<%= attribute.name %>_dp",
30
+ "data-id" => "<%= singular_table_name %>_<%= attribute.name %>_input_", id: nil %>
31
+ <div class="input-group-append" data-target="container_<%= singular_table_name %>_<%= attribute.name %>_dp" data-toggle="datetimepicker">
32
+ <span class="input-group-text"><i class="fa fa-calendar"></i></span>
33
+ </div>
34
+ </div>
35
+ <% if datetime_field %>
36
+ <div id="container_<%= singular_table_name %>_<%= attribute.name %>_tp" data-field="<%= singular_table_name %>_<%= attribute.name %>_input_" class="input-group input-datetime tpicker col-sm" data-target-input="nearest">
37
+ <%%= f.text_field :<%= attribute.name %>, :value => (begin @<%= singular_table_name %>.<%= attribute.name %>.strftime("%H:%M") rescue "" end),
38
+ :class => "form-control datetimepicker-input",
39
+ "data-target" => "#container_<%= singular_table_name %>_<%= attribute.name %>_tp",
40
+ "data-id" => "<%= singular_table_name %>_<%= attribute.name %>_input_", id: nil %>
41
+ <div class="input-group-append" data-target="container_<%= singular_table_name %>_<%= attribute.name %>_tp" data-toggle="datetimepicker">
42
+ <span class="input-group-text"><i class="fa fa-clock"></i></span>
43
+ </div>
44
+ </div>
45
+ <% end %>
46
+ <%% ["year","mon","day" <%= datetime_field ? ',"min","hour"' : '' %>].each_with_index do |meth, i| %>
47
+ <%%= f.hidden_field("<%= attribute.name %>(#{i+1}i)", value: @<%= singular_table_name %>.<%= attribute.name %>&.send(meth), id: "<%= singular_table_name %>_<%= attribute.name %>_input_#{i+1}i") %>
48
+ <%% end %>
49
+ <% if datetime_field %>
50
+ </div>
51
+ <% end %>
44
52
  </div>
45
53
  <%- elsif @beautiful_attributes.include?(attribute.name + ':color') -%>
46
54
  <div class="form-group">
47
55
  <%%= f.label :<%= attribute.name %>, <%= i18n_t_a(singular_table_name, attribute.name) %>.capitalize, :class => "control-label" %>
48
- <div class="input-group color" data-color="<%%= (@<%= model %>.<%= attribute.name %> || "rgba(0, 0, 0)") %>" data-color-format="rgba">
49
- <%%= f.<%= attribute.field_type %> :<%= attribute.name %>, :class => "form-control" %><span class="input-group-addon"><i style="background-color: rgb(0, 0, 0)"></i></span>
56
+ <div class="input-group">
57
+ <%%= f.color_field :<%= attribute.name %>, :class => "form-control" %>
50
58
  </div>
51
59
  </div>
52
60
  <%- else -%>
@@ -10,6 +10,8 @@
10
10
  <%% else %>
11
11
  <%%= t(:any, :default => "Any") %>
12
12
  <%% end %>
13
+ <%- elsif @beautiful_attributes.include?(attribute.name + ':color') -%>
14
+ <span class="overview-color" style="background-color:<%%= <%= singular_table_name %>.<%= attribute.name %> %>;">&nbsp;</span>
13
15
  <%- else -%>
14
16
  <%%= <%= singular_table_name %>.<%= attribute.name %> %>
15
17
  <%- end -%>
@@ -0,0 +1,7 @@
1
+ <% if current_user %>
2
+ <%= link_to "Edit Profile", edit_user_path(current_user.id), class: "nav-link" %>
3
+ <%= link_to "Logout", :logout, method: :post, class: "nav-link" %>
4
+ <% else %>
5
+ <%= link_to "Register", new_user_path, class: "nav-link" %>
6
+ <%= link_to "Login", :login, class: "nav-link" %>
7
+ <% end %>
@@ -7,6 +7,8 @@
7
7
  <%%= t((@<%= singular_table_name %>.<%= attribute.name %> ? "yes".to_sym : "no".to_sym)) %>
8
8
  <%- elsif @beautiful_attributes.include?(attribute.name + ':references') -%>
9
9
  <%%= (@<%= singular_table_name %>.<%= attribute.name %>.nil? ? "" : @<%= singular_table_name %>.<%= attribute.name %>.caption) %>
10
+ <%- elsif @beautiful_attributes.include?(attribute.name + ':color') -%>
11
+ <span class="overview-color" style="background-color:<%%= @<%= singular_table_name %>.<%= attribute.name %> %>;">&nbsp;</span>
10
12
  <%- else -%>
11
13
  <%%= @<%= singular_table_name %>.<%= attribute.name %> %>
12
14
  <%- end -%>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beautiful_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvain Claudel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-22 00:00:00.000000000 Z
11
+ date: 2021-08-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Beautiful Scaffold generate a complete scaffold (sort, export, paginate
14
14
  and filter data) http://beautiful-scaffold.rivsc.ovh
@@ -21,19 +21,20 @@ files:
21
21
  - ".gitignore"
22
22
  - CHANGELOG
23
23
  - Gemfile
24
- - Gemfile.lock
25
24
  - MIT-LICENSE
26
25
  - README.rdoc
27
26
  - Rakefile
28
27
  - beautiful_scaffold.gemspec
29
28
  - lib/beautiful_scaffold/version.rb
30
29
  - lib/generators/USAGE
31
- - lib/generators/beautiful_devisecancan_generator.rb
30
+ - lib/generators/beautiful_cancancan_generator.rb
32
31
  - lib/generators/beautiful_jointable_generator.rb
33
32
  - lib/generators/beautiful_locale_generator.rb
34
33
  - lib/generators/beautiful_migration_generator.rb
35
34
  - lib/generators/beautiful_scaffold_common_methods.rb
36
35
  - lib/generators/beautiful_scaffold_generator.rb
36
+ - lib/generators/beautiful_sorcery_generator.rb
37
+ - lib/generators/beautiful_storage_generator.rb
37
38
  - lib/generators/templates/app/assets/images/alpha.png
38
39
  - lib/generators/templates/app/assets/images/hue.png
39
40
  - lib/generators/templates/app/assets/images/saturation.png
@@ -42,19 +43,15 @@ files:
42
43
  - lib/generators/templates/app/assets/javascripts/advanced.js
43
44
  - lib/generators/templates/app/assets/javascripts/application-bs.js
44
45
  - lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js
45
- - lib/generators/templates/app/assets/javascripts/bootstrap-colorpicker.js
46
46
  - lib/generators/templates/app/assets/javascripts/bootstrap-datetimepicker-for-beautiful-scaffold.js
47
47
  - lib/generators/templates/app/assets/javascripts/bootstrap-wysihtml5.js
48
48
  - lib/generators/templates/app/assets/javascripts/fixed_menu.js
49
49
  - lib/generators/templates/app/assets/javascripts/jquery-barcode.js
50
50
  - lib/generators/templates/app/assets/javascripts/jstree.min.js
51
51
  - lib/generators/templates/app/assets/javascripts/modernizr.custom.js
52
- - lib/generators/templates/app/assets/javascripts/tagit.js
53
52
  - lib/generators/templates/app/assets/stylesheets/application-bs.css
54
53
  - lib/generators/templates/app/assets/stylesheets/beautiful-scaffold.css.scss
55
54
  - lib/generators/templates/app/assets/stylesheets/bootstrap-wysihtml5.css
56
- - lib/generators/templates/app/assets/stylesheets/colorpicker.css
57
- - lib/generators/templates/app/assets/stylesheets/tagit-dark-grey.css
58
55
  - lib/generators/templates/app/assets/stylesheets/themes/default-dark/32px.png
59
56
  - lib/generators/templates/app/assets/stylesheets/themes/default-dark/40px.png
60
57
  - lib/generators/templates/app/assets/stylesheets/themes/default-dark/style.scss
@@ -66,6 +63,7 @@ files:
66
63
  - lib/generators/templates/app/controllers/base.rb
67
64
  - lib/generators/templates/app/controllers/master_base.rb
68
65
  - lib/generators/templates/app/controllers/registrations_controller.rb
66
+ - lib/generators/templates/app/controllers/user_sessions_controller.rb
69
67
  - lib/generators/templates/app/helpers/beautiful_helper.rb
70
68
  - lib/generators/templates/app/helpers/model_helper.rb
71
69
  - lib/generators/templates/app/initializers/link_renderer.rb
@@ -73,10 +71,13 @@ files:
73
71
  - lib/generators/templates/app/locales/beautiful_scaffold.en.yml
74
72
  - lib/generators/templates/app/locales/beautiful_scaffold.fr.yml
75
73
  - lib/generators/templates/app/locales/beautiful_scaffold.ja.yml
74
+ - lib/generators/templates/app/mailers/user_mailer.rb
75
+ - lib/generators/templates/app/models/ability.rb
76
76
  - lib/generators/templates/app/models/concerns/caption_concern.rb
77
77
  - lib/generators/templates/app/models/concerns/default_sorting_concern.rb
78
78
  - lib/generators/templates/app/models/concerns/fulltext_concern.rb
79
79
  - lib/generators/templates/app/models/pdf_report.rb
80
+ - lib/generators/templates/app/models/user.rb
80
81
  - lib/generators/templates/app/views/_beautiful_menu.html.erb
81
82
  - lib/generators/templates/app/views/_form.html.erb
82
83
  - lib/generators/templates/app/views/_form_habtm_tag.html.erb
@@ -86,6 +87,16 @@ files:
86
87
  - lib/generators/templates/app/views/edit.html.erb
87
88
  - lib/generators/templates/app/views/index.html.erb
88
89
  - lib/generators/templates/app/views/layout.html.erb
90
+ - lib/generators/templates/app/views/login_logout/user_mailer/activation_needed_email.en.html.erb
91
+ - lib/generators/templates/app/views/login_logout/user_mailer/activation_needed_email.en.text.erb
92
+ - lib/generators/templates/app/views/login_logout/user_mailer/activation_needed_email.fr.html.erb
93
+ - lib/generators/templates/app/views/login_logout/user_mailer/activation_needed_email.fr.text.erb
94
+ - lib/generators/templates/app/views/login_logout/user_mailer/activation_success_email.en.html.erb
95
+ - lib/generators/templates/app/views/login_logout/user_mailer/activation_success_email.en.text.erb
96
+ - lib/generators/templates/app/views/login_logout/user_mailer/activation_success_email.fr.html.erb
97
+ - lib/generators/templates/app/views/login_logout/user_mailer/activation_success_email.fr.text.erb
98
+ - lib/generators/templates/app/views/login_logout/user_sessions/_form.html.erb
99
+ - lib/generators/templates/app/views/login_logout/user_sessions/new.html.erb
89
100
  - lib/generators/templates/app/views/new.html.erb
90
101
  - lib/generators/templates/app/views/partials/_forget_password.html.erb
91
102
  - lib/generators/templates/app/views/partials/_form_field.html.erb
@@ -94,13 +105,10 @@ files:
94
105
  - lib/generators/templates/app/views/partials/_index_header.html.erb
95
106
  - lib/generators/templates/app/views/partials/_index_search.html.erb
96
107
  - lib/generators/templates/app/views/partials/_index_search_default_fields.html.erb
97
- - lib/generators/templates/app/views/partials/_register_form.html.erb
108
+ - lib/generators/templates/app/views/partials/_login_logout_register.html.erb
98
109
  - lib/generators/templates/app/views/partials/_show_field.html.erb
99
- - lib/generators/templates/app/views/partials/_sign_in_form.html.erb
100
- - lib/generators/templates/app/views/partials/_sign_in_sign_out.html.erb
101
110
  - lib/generators/templates/app/views/show.html.erb
102
111
  - lib/generators/templates/app/views/treeview.html.erb
103
- - lib/generators/templates/lib/custom_failure.rb
104
112
  homepage: https://blog.rivsc.ovh
105
113
  licenses:
106
114
  - MIT
@@ -118,11 +126,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
118
126
  version: '0'
119
127
  required_rubygems_version: !ruby/object:Gem::Requirement
120
128
  requirements:
121
- - - ">"
129
+ - - ">="
122
130
  - !ruby/object:Gem::Version
123
- version: 1.3.1
131
+ version: '0'
124
132
  requirements: []
125
- rubygems_version: 3.1.2
133
+ rubygems_version: 3.1.4
126
134
  signing_key:
127
135
  specification_version: 4
128
136
  summary: Beautiful Scaffold generate fully customizable scaffold