beautiful_scaffold 1.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +2 -0
- data/CHANGELOG +78 -1
- data/Gemfile +25 -9
- data/README.rdoc +45 -28
- data/Rakefile +29 -0
- data/beautiful_scaffold.gemspec +7 -7
- data/lib/beautiful_scaffold/version.rb +3 -0
- data/lib/generators/USAGE +3 -1
- data/lib/generators/beautiful_cancancan_generator.rb +51 -0
- data/lib/generators/beautiful_jointable_generator.rb +41 -8
- data/lib/generators/beautiful_locale_generator.rb +107 -104
- data/lib/generators/beautiful_migration_generator.rb +14 -20
- data/lib/generators/beautiful_scaffold_common_methods.rb +56 -26
- data/lib/generators/beautiful_scaffold_generator.rb +116 -78
- data/lib/generators/beautiful_sorcery_generator.rb +137 -0
- data/lib/generators/beautiful_storage_generator.rb +61 -0
- data/lib/generators/templates/app/assets/javascripts/application-bs.js +5 -7
- data/lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js +65 -79
- data/lib/generators/templates/app/assets/javascripts/bootstrap-datetimepicker-for-beautiful-scaffold.js +26 -23
- data/lib/generators/templates/app/assets/javascripts/fixed_menu.js +3 -1
- data/lib/generators/templates/app/assets/javascripts/jstree.min.js +6 -0
- data/lib/generators/templates/app/assets/stylesheets/application-bs.css +14 -6
- data/lib/generators/templates/app/assets/stylesheets/beautiful-scaffold.css.scss +20 -3
- data/lib/generators/templates/app/assets/stylesheets/themes/default-dark/32px.png +0 -0
- data/lib/generators/templates/app/assets/stylesheets/themes/default-dark/40px.png +0 -0
- data/lib/generators/templates/app/assets/stylesheets/themes/default-dark/style.scss +1146 -0
- data/lib/generators/templates/app/assets/stylesheets/themes/default-dark/throbber.gif +0 -0
- data/lib/generators/templates/app/assets/stylesheets/themes/default/32px.png +0 -0
- data/lib/generators/templates/app/assets/stylesheets/themes/default/40px.png +0 -0
- data/lib/generators/templates/app/assets/stylesheets/themes/default/style.scss +1102 -0
- data/lib/generators/templates/app/assets/stylesheets/themes/default/throbber.gif +0 -0
- data/lib/generators/templates/app/controllers/base.rb +14 -7
- data/lib/generators/templates/app/controllers/master_base.rb +19 -25
- data/lib/generators/templates/app/controllers/user_sessions_controller.rb +20 -0
- data/lib/generators/templates/app/helpers/beautiful_helper.rb +102 -66
- data/lib/generators/templates/app/initializers/link_renderer.rb +23 -18
- data/lib/generators/templates/app/locales/beautiful_scaffold.en.yml +8 -0
- data/lib/generators/templates/app/locales/beautiful_scaffold.fr.yml +9 -1
- data/lib/generators/templates/app/locales/beautiful_scaffold.ja.yml +9 -2
- data/lib/generators/templates/app/mailers/user_mailer.rb +13 -0
- data/lib/generators/templates/app/models/ability.rb +39 -0
- data/lib/generators/templates/app/models/concerns/caption_concern.rb +1 -1
- data/lib/generators/templates/app/models/user.rb +11 -0
- data/lib/generators/templates/app/views/_form.html.erb +4 -1
- data/lib/generators/templates/app/views/_form_habtm_tag.html.erb +6 -2
- data/lib/generators/templates/app/views/_mass_inserting.html.erb +38 -30
- data/lib/generators/templates/app/views/_modal_columns.html.erb +3 -3
- data/lib/generators/templates/app/views/edit.html.erb +1 -3
- data/lib/generators/templates/app/views/index.html.erb +83 -79
- data/lib/generators/templates/app/views/layout.html.erb +36 -36
- data/lib/generators/templates/app/views/login_logout/user_mailer/activation_needed_email.en.html.erb +16 -0
- data/lib/generators/templates/app/views/login_logout/user_mailer/activation_needed_email.en.text.erb +9 -0
- data/lib/generators/templates/app/views/login_logout/user_mailer/activation_needed_email.fr.html.erb +16 -0
- data/lib/generators/templates/app/views/login_logout/user_mailer/activation_needed_email.fr.text.erb +8 -0
- data/lib/generators/templates/app/views/login_logout/user_mailer/activation_success_email.en.html.erb +19 -0
- data/lib/generators/templates/app/views/login_logout/user_mailer/activation_success_email.en.text.erb +8 -0
- data/lib/generators/templates/app/views/login_logout/user_mailer/activation_success_email.fr.html.erb +19 -0
- data/lib/generators/templates/app/views/login_logout/user_mailer/activation_success_email.fr.text.erb +8 -0
- data/lib/generators/templates/app/views/login_logout/user_sessions/_form.html.erb +15 -0
- data/lib/generators/templates/app/views/login_logout/user_sessions/new.html.erb +3 -0
- data/lib/generators/templates/app/views/new.html.erb +0 -2
- data/lib/generators/templates/app/views/partials/_forget_password.html.erb +2 -2
- data/lib/generators/templates/app/views/partials/_form_field.html.erb +37 -29
- data/lib/generators/templates/app/views/partials/_index_batch.html.erb +1 -1
- data/lib/generators/templates/app/views/partials/_index_column.html.erb +6 -4
- data/lib/generators/templates/app/views/partials/_index_header.html.erb +1 -1
- data/lib/generators/templates/app/views/partials/_index_search.html.erb +1 -1
- data/lib/generators/templates/app/views/partials/_login_logout_register.html.erb +7 -0
- data/lib/generators/templates/app/views/partials/_show_field.html.erb +5 -3
- data/lib/generators/templates/app/views/show.html.erb +2 -2
- data/lib/generators/templates/app/views/treeview.html.erb +8 -5
- metadata +38 -24
- data/lib/generators/beautiful_devisecancan_generator.rb +0 -128
- data/lib/generators/templates/app/assets/javascripts/bootstrap-colorpicker.js +0 -520
- data/lib/generators/templates/app/assets/javascripts/jquery.jstree.js +0 -4551
- data/lib/generators/templates/app/assets/stylesheets/bootstrap_and_overrides.css.less +0 -40
- data/lib/generators/templates/app/assets/stylesheets/colorpicker.css +0 -127
- data/lib/generators/templates/app/assets/stylesheets/datepicker.css +0 -224
- data/lib/generators/templates/app/assets/stylesheets/reset.css +0 -48
- data/lib/generators/templates/app/assets/stylesheets/themes/default/d.gif +0 -0
- data/lib/generators/templates/app/assets/stylesheets/themes/default/d.png +0 -0
- data/lib/generators/templates/app/assets/stylesheets/themes/default/style.css +0 -74
- data/lib/generators/templates/app/assets/stylesheets/timepicker.css +0 -89
- data/lib/generators/templates/app/views/partials/_register_form.html.erb +0 -44
- data/lib/generators/templates/app/views/partials/_sign_in_form.html.erb +0 -18
- data/lib/generators/templates/app/views/partials/_sign_in_sign_out.html.erb +0 -19
- data/lib/generators/templates/lib/custom_failure.rb +0 -15
@@ -5,63 +5,63 @@
|
|
5
5
|
<title>Beautiful Scaffold</title>
|
6
6
|
|
7
7
|
<meta name="description" content="Beautiful Scaffold">
|
8
|
-
<meta name="author" content="You or me Sylvain Claudel (
|
8
|
+
<meta name="author" content="You or me Sylvain Claudel (https://blog.rivsc.ovh)">
|
9
9
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
<!--TODO remove cdn-->
|
12
|
+
<script src="https://unpkg.com/driver.js/dist/driver.min.js"></script>
|
13
|
+
<link rel="stylesheet" href="https://unpkg.com/driver.js/dist/driver.min.css">
|
14
|
+
|
15
|
+
<%%= stylesheet_link_tag "<%= engine_name %>application-bs" %>
|
16
|
+
<%%= javascript_include_tag "<%= engine_name %>application-bs" %>
|
13
17
|
|
14
18
|
<%%= csrf_meta_tags %>
|
15
19
|
<%%= yield :head %>
|
16
20
|
</head>
|
17
|
-
<body
|
18
|
-
<div class="navbar navbar-
|
19
|
-
<div class="
|
20
|
-
<
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
<ul class="nav navbar-nav pull-right">
|
35
|
-
<li>
|
36
|
-
<!-- Beautiful_scaffold - Signin - Do not remove -->
|
37
|
-
</li>
|
38
|
-
</ul>
|
39
|
-
</div>
|
21
|
+
<body>
|
22
|
+
<div class="navbar navbar-expand-md navbar-dark bg-dark">
|
23
|
+
<div class="navbar-header">
|
24
|
+
<a class="navbar-brand" href="#">
|
25
|
+
Beautiful-Scaffold
|
26
|
+
</a>
|
27
|
+
<button type="button" class="navbar-toggler collapsed" data-toggle="collapse" data-target=".navbar-collapse">
|
28
|
+
<span class="navbar-toggler-icon"></span>
|
29
|
+
</button>
|
30
|
+
</div>
|
31
|
+
<div class="navbar-collapse collapse">
|
32
|
+
<nav class="nav navbar-nav">
|
33
|
+
<a href="/" class="nav-link">Home</a>
|
34
|
+
<%%= render :partial => "layouts/beautiful_menu" %>
|
35
|
+
<!-- Beautiful_scaffold - Signin - Do not remove -->
|
36
|
+
</nav>
|
37
|
+
<i class="fa fa-question-circle text-white float-right" id="bs-help"></i>
|
40
38
|
</div>
|
41
39
|
</div>
|
42
40
|
<div class="container-fluid">
|
43
41
|
<div class="row">
|
44
|
-
<div class="col-md
|
45
|
-
|
46
|
-
<%%= render :partial => "layouts/beautiful_menu" %>
|
47
|
-
</ul>
|
48
|
-
</div>
|
49
|
-
<div class="col-md-10">
|
50
|
-
<%% if not flash[:notice].blank? then %>
|
42
|
+
<div class="col-md filler">
|
43
|
+
<%% if !flash[:notice].blank? %>
|
51
44
|
<div class="alert alert-info">
|
52
45
|
<a class="close" data-dismiss="alert" href="#">×</a>
|
53
46
|
<h4 class="alert-heading">Info : </h4>
|
54
47
|
<%%= flash[:notice] %>
|
55
48
|
</div>
|
56
49
|
<%% end %>
|
57
|
-
<%% if
|
50
|
+
<%% if !flash[:alert].blank? %>
|
51
|
+
<div class="alert alert-warning">
|
52
|
+
<a class="close" data-dismiss="alert" href="#">×</a>
|
53
|
+
<h4 class="alert-heading">Warning : </h4>
|
54
|
+
<%%= flash[:alert] %>
|
55
|
+
</div>
|
56
|
+
<%% end %>
|
57
|
+
<%% if !flash[:error].blank? %>
|
58
58
|
<div class="alert alert-danger">
|
59
59
|
<a class="close" data-dismiss="alert" href="#">×</a>
|
60
60
|
<h4 class="alert-heading">Error : </h4>
|
61
61
|
<%%= flash[:error] %>
|
62
62
|
</div>
|
63
63
|
<%% end %>
|
64
|
-
<div>
|
64
|
+
<div class="mt-2">
|
65
65
|
<%%= yield %>
|
66
66
|
</div>
|
67
67
|
</div>
|
@@ -76,7 +76,7 @@
|
|
76
76
|
<!-- Beautiful_scaffold - Modal - Do not remove -->
|
77
77
|
|
78
78
|
<script type="text/javascript">
|
79
|
-
<%% if
|
79
|
+
<%% if !@opened_modal.blank? %>
|
80
80
|
$('<%%= @opened_modal %>').modal('show');
|
81
81
|
<%% end %>
|
82
82
|
</script>
|
data/lib/generators/templates/app/views/login_logout/user_mailer/activation_needed_email.en.html.erb
ADDED
@@ -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>
|
data/lib/generators/templates/app/views/login_logout/user_mailer/activation_needed_email.en.text.erb
ADDED
@@ -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!
|
data/lib/generators/templates/app/views/login_logout/user_mailer/activation_needed_email.fr.html.erb
ADDED
@@ -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>
|
data/lib/generators/templates/app/views/login_logout/user_mailer/activation_needed_email.fr.text.erb
ADDED
@@ -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,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
|
+
|
@@ -2,8 +2,8 @@
|
|
2
2
|
<div class="modal-dialog">
|
3
3
|
<div class="modal-content">
|
4
4
|
<div class="modal-header">
|
5
|
+
<h5 class="modal-title"><%%= t(:forgot_password, :default => "Forgot password") %></h5>
|
5
6
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
6
|
-
<h3><%%= t(:forgot_password, :default => "Forgot password") %></h3>
|
7
7
|
</div>
|
8
8
|
<div class="modal-body">
|
9
9
|
<%%= form_for('<%= model %>', :as => '<%= model %>', :url => password_path('<%= model %>'), :html => { :method => :post, :class => "form-horizontal" }) do |f| %>
|
@@ -15,7 +15,7 @@
|
|
15
15
|
</div>
|
16
16
|
<div class="form-group">
|
17
17
|
<div>
|
18
|
-
<%%= f.submit t(:send_me_reset_password_instructions, :default => "Send me reset password instructions"), :class => 'btn btn-
|
18
|
+
<%%= f.submit t(:send_me_reset_password_instructions, :default => "Send me reset password instructions"), :class => 'btn btn-light' %>
|
19
19
|
</div>
|
20
20
|
</div>
|
21
21
|
<%% end %>
|
@@ -1,52 +1,60 @@
|
|
1
1
|
<%- attributes.each do |attribute| -%>
|
2
|
-
<%- if @beautiful_attributes.include?(attribute.name + ':wysiwyg')
|
2
|
+
<%- if @beautiful_attributes.include?(attribute.name + ':wysiwyg') -%>
|
3
3
|
<div class="form-group">
|
4
4
|
<%%= f.label :<%= attribute.name %>, <%= i18n_t_a(singular_table_name, attribute.name) %>.capitalize, :class => "control-label" %>
|
5
5
|
<%%= f.text_area :<%= attribute.name %>, :class => "wysiwyg-editor form-control" %>
|
6
6
|
</div>
|
7
7
|
<%%= f.hidden_field :<%= attribute.name %>_typetext, :value => "html" %>
|
8
|
-
<%- elsif @beautiful_attributes.include?(attribute.name + ':references')
|
8
|
+
<%- elsif @beautiful_attributes.include?(attribute.name + ':references') -%>
|
9
9
|
<div class="form-group">
|
10
10
|
<%%= f.label :<%= attribute.name %>, <%= i18n_t_a(singular_table_name, attribute.name) %>.capitalize, :class => "control-label" %>
|
11
|
-
<%%= f.collection_select :<%= attribute.name %>_id, <%= attribute.name.camelcase %>.all, :id, :caption, { :include_blank => true }, { :class => "form-control" } %>
|
11
|
+
<%%= f.collection_select :<%= attribute.name %>_id, <%= engine_camel.present? ? "#{engine_camel}::" : '' %><%= attribute.name.camelcase %>.all, :id, :caption, { :include_blank => true }, { :class => "form-control" } %>
|
12
12
|
</div>
|
13
|
-
<%- elsif @beautiful_attributes.include?(attribute.name + ':price')
|
13
|
+
<%- elsif @beautiful_attributes.include?(attribute.name + ':price') -%>
|
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-
|
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
|
-
|
24
|
-
<
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
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 %>
|
29
52
|
</div>
|
30
|
-
<%- elsif @beautiful_attributes.include?(attribute.name + ':
|
53
|
+
<%- elsif @beautiful_attributes.include?(attribute.name + ':color') -%>
|
31
54
|
<div class="form-group">
|
32
55
|
<%%= 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
56
|
<div class="input-group">
|
42
|
-
<%%= f.
|
43
|
-
</div>
|
44
|
-
</div>
|
45
|
-
<%- elsif @beautiful_attributes.include?(attribute.name + ':color') then -%>
|
46
|
-
<div class="form-group">
|
47
|
-
<%%= 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>
|
57
|
+
<%%= f.color_field :<%= attribute.name %>, :class => "form-control" %>
|
50
58
|
</div>
|
51
59
|
</div>
|
52
60
|
<%- else -%>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%- attributes.each{ |attribute| -%>
|
2
|
-
<%- if attribute.type.to_s == "boolean"
|
2
|
+
<%- if attribute.type.to_s == "boolean" -%>
|
3
3
|
<option value="<%= attribute.name %>.true"><%%= t(:settrueforattr, :attr => "'<%= attribute.name %>'", :default => "Set <%= attribute.name %> to true") %></option>
|
4
4
|
<option value="<%= attribute.name %>.false"><%%= t(:setfalseforattr, :attr => "'<%= attribute.name %>'", :default => "Set <%= attribute.name %> to false") %></option>
|
5
5
|
<%- end -%>
|
@@ -1,15 +1,17 @@
|
|
1
1
|
<%- attributes.each do |attribute| -%>
|
2
2
|
<td <%%= visible_column("<%= singular_table_name %>", "<%= attribute.name %>") %> class="bs-col-<%= attribute.name %> <%%= align_attribute("<%= attribute.type %>") %>">
|
3
|
-
<%- if @beautiful_attributes.include?(attribute.name + ':price')
|
3
|
+
<%- if @beautiful_attributes.include?(attribute.name + ':price') -%>
|
4
4
|
<%%= number_to_currency(<%= singular_table_name %>.<%= attribute.name %>, :locale => I18n.locale) %>
|
5
|
-
<%- elsif @beautiful_attributes.include?(attribute.name + ':boolean')
|
5
|
+
<%- elsif @beautiful_attributes.include?(attribute.name + ':boolean') -%>
|
6
6
|
<%%= t((<%= singular_table_name %>.<%= attribute.name %> ? "yes" : "no").to_sym) %>
|
7
|
-
<%- elsif @beautiful_attributes.include?(attribute.name + ':references')
|
8
|
-
<%% if
|
7
|
+
<%- elsif @beautiful_attributes.include?(attribute.name + ':references') -%>
|
8
|
+
<%% if !<%= singular_table_name %>.<%= attribute.name %>_id.nil? %>
|
9
9
|
<%%= link_to <%= singular_table_name %>.<%= attribute.name %>.caption, <%= namespace_for_route %><%= attribute.name %>_path(<%= singular_table_name %>.<%= attribute.name %>_id) %>
|
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 %> %>;"> </span>
|
13
15
|
<%- else -%>
|
14
16
|
<%%= <%= singular_table_name %>.<%= attribute.name %> %>
|
15
17
|
<%- end -%>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%- attributes.each do |attribute| -%>
|
2
2
|
<th <%%= visible_column("<%= singular_table_name %>", "<%= attribute.name %>") %> class="bs-col-<%= attribute.name %>">
|
3
3
|
<%- id_or_not = "" -%>
|
4
|
-
<%- if @beautiful_attributes.include?(attribute.name + ':references')
|
4
|
+
<%- if @beautiful_attributes.include?(attribute.name + ':references') -%>
|
5
5
|
<%- id_or_not = "_id" -%>
|
6
6
|
<%- end -%>
|
7
7
|
<%%= sorting_header("<%= singular_table_name %>", "<%= attribute.name %><%= id_or_not %>", "<%= namespace_alone %>") %>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<%- next if @beautiful_attributes.include?(a.name + ':color') -%>
|
3
3
|
<%- attribute = "" -%>
|
4
4
|
<%- caption = a.name.capitalize -%>
|
5
|
-
<%- if @beautiful_attributes.include?(a.name + ':references')
|
5
|
+
<%- if @beautiful_attributes.include?(a.name + ':references') -%>
|
6
6
|
<%- attribute = "_id" -%>
|
7
7
|
<%- end -%>
|
8
8
|
<%%= ransack_field("<%= singular_table_name %>", "<%= a.name %><%= attribute %>", f, "<%= caption %>"<%= (engine_name.blank? ? '' : ", \"#{engine_opt}\"") %>) %>
|
@@ -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 %>
|
@@ -1,12 +1,14 @@
|
|
1
1
|
<%- attributes.each do |attribute| -%>
|
2
2
|
<p>
|
3
3
|
<b><%%= <%= i18n_t_a(singular_table_name, attribute.name) %> %>:</b>
|
4
|
-
<%- if @beautiful_attributes.include?(attribute.name + ':price')
|
4
|
+
<%- if @beautiful_attributes.include?(attribute.name + ':price') -%>
|
5
5
|
<%%= number_to_currency(@<%= singular_table_name %>.<%= attribute.name %>) %>
|
6
|
-
<%- elsif @beautiful_attributes.include?(attribute.name + ':boolean')
|
6
|
+
<%- elsif @beautiful_attributes.include?(attribute.name + ':boolean') -%>
|
7
7
|
<%%= t((@<%= singular_table_name %>.<%= attribute.name %> ? "yes".to_sym : "no".to_sym)) %>
|
8
|
-
<%- elsif @beautiful_attributes.include?(attribute.name + ':references')
|
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 %> %>;"> </span>
|
10
12
|
<%- else -%>
|
11
13
|
<%%= @<%= singular_table_name %>.<%= attribute.name %> %>
|
12
14
|
<%- end -%>
|