b4um_generators 0.3.0 → 0.4.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/README.de.md +338 -4
- data/README.md +330 -5
- data/lib/b4um_generators/version.rb +1 -1
- data/lib/generators/b4um/admin/admin_generator.rb +614 -0
- data/lib/generators/b4um/admin/templates/add_admin_fields_migration.rb.tt +10 -0
- data/lib/generators/b4um/admin/templates/admin_base_controller.rb.tt +5 -0
- data/lib/generators/b4um/admin/templates/admin_dashboard.html.erb.tt +19 -0
- data/lib/generators/b4um/admin/templates/admin_dashboard_controller.rb.tt +6 -0
- data/lib/generators/b4um/admin/templates/admin_users_controller.rb.tt +70 -0
- data/lib/generators/b4um/admin/templates/admin_users_index.html.erb.tt +110 -0
- data/lib/generators/b4um/admin/templates/b4um_admin.rake.tt +106 -0
- data/lib/generators/b4um/authentication/authentication_generator.rb +90 -1
- data/lib/generators/b4um/guest/guest_generator.rb +673 -0
- data/lib/generators/b4um/guest/templates/add_guest_fields_migration.rb.tt +12 -0
- data/lib/generators/b4um/guest/templates/b4um_guests.rake.tt +12 -0
- data/lib/generators/b4um/guest/templates/edit.html.erb.tt +156 -0
- data/lib/generators/b4um/guest/templates/guest_expiration_warning.html.erb.tt +12 -0
- data/lib/generators/b4um/guest/templates/guests_controller.rb.tt +88 -0
- data/lib/generators/b4um/guest/templates/new.html.erb.tt +136 -0
- data/lib/generators/b4um/help/help_generator.rb +162 -0
- data/lib/generators/b4um/scaffold/scaffold_generator.rb +50 -0
- data/lib/generators/b4um/scaffold/templates/_form.html.erb.tt +18 -14
- metadata +16 -1
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
<%% end %>
|
|
16
16
|
|
|
17
17
|
<% attributes.each do |attribute| -%>
|
|
18
|
+
<% required = required_fields.include?(attribute.name) -%>
|
|
19
|
+
<% label = attribute.name.humanize + (required ? " *" : "") -%>
|
|
18
20
|
<% if attribute.name == "password_digest" -%>
|
|
19
21
|
<div class="form-field">
|
|
20
22
|
<%%= form.password_field :password,
|
|
@@ -35,7 +37,7 @@
|
|
|
35
37
|
<%%= form.email_field :<%= attribute.name %>,
|
|
36
38
|
class: "form-input",
|
|
37
39
|
placeholder: " " %>
|
|
38
|
-
<%%= form.label :<%= attribute.name %>, class: "form-label" %>
|
|
40
|
+
<%%= form.label :<%= attribute.name %>, "<%= label %>", class: "form-label" %>
|
|
39
41
|
</div>
|
|
40
42
|
|
|
41
43
|
<% elsif attribute.name.match?(/(?:^|_)(?:password|password_confirmation)(?:_|$)/) -%>
|
|
@@ -43,7 +45,7 @@
|
|
|
43
45
|
<%%= form.password_field :<%= attribute.name %>,
|
|
44
46
|
class: "form-input",
|
|
45
47
|
placeholder: " " %>
|
|
46
|
-
<%%= form.label :<%= attribute.name %>, class: "form-label" %>
|
|
48
|
+
<%%= form.label :<%= attribute.name %>, "<%= label %>", class: "form-label" %>
|
|
47
49
|
</div>
|
|
48
50
|
|
|
49
51
|
<% elsif attribute.name.match?(/(?:^|_)(?:phone|telephone|mobile)(?:_|$)/) -%>
|
|
@@ -51,7 +53,7 @@
|
|
|
51
53
|
<%%= form.telephone_field :<%= attribute.name %>,
|
|
52
54
|
class: "form-input",
|
|
53
55
|
placeholder: " " %>
|
|
54
|
-
<%%= form.label :<%= attribute.name %>, class: "form-label" %>
|
|
56
|
+
<%%= form.label :<%= attribute.name %>, "<%= label %>", class: "form-label" %>
|
|
55
57
|
</div>
|
|
56
58
|
|
|
57
59
|
<% elsif attribute.name.match?(/(?:^|_)(?:url|website|homepage)(?:_|$)/) -%>
|
|
@@ -59,12 +61,12 @@
|
|
|
59
61
|
<%%= form.url_field :<%= attribute.name %>,
|
|
60
62
|
class: "form-input",
|
|
61
63
|
placeholder: " " %>
|
|
62
|
-
<%%= form.label :<%= attribute.name %>, class: "form-label" %>
|
|
64
|
+
<%%= form.label :<%= attribute.name %>, "<%= label %>", class: "form-label" %>
|
|
63
65
|
</div>
|
|
64
66
|
|
|
65
67
|
<% elsif select_field?(attribute.name) -%>
|
|
66
68
|
<div class="form-field form-field--select">
|
|
67
|
-
<%%= form.label :<%= attribute.name %>, class: "form-label" %>
|
|
69
|
+
<%%= form.label :<%= attribute.name %>, "<%= label %>", class: "form-label" %>
|
|
68
70
|
|
|
69
71
|
<%%= form.select :<%= attribute.name %>,
|
|
70
72
|
<%= select_configuration[:values].inspect %>.map { |choice|
|
|
@@ -76,7 +78,7 @@
|
|
|
76
78
|
|
|
77
79
|
<% elsif radio_field?(attribute.name) -%>
|
|
78
80
|
<div class="form-field form-field--radio">
|
|
79
|
-
<%%= form.label :<%= attribute.name %>, class: "form-label" %>
|
|
81
|
+
<%%= form.label :<%= attribute.name %>, "<%= label %>", class: "form-label" %>
|
|
80
82
|
|
|
81
83
|
<div class="form-radio-options">
|
|
82
84
|
<%% <%= radio_configuration[:values].inspect %>.each do |choice| %>
|
|
@@ -94,7 +96,7 @@
|
|
|
94
96
|
<% elsif attribute.type == :boolean -%>
|
|
95
97
|
<div class="form-field form-field--checkbox">
|
|
96
98
|
<%%= form.check_box :<%= attribute.name %>, class: "form-checkbox" %>
|
|
97
|
-
<%%= form.label :<%= attribute.name %>, class: "form-label form-label--checkbox" %>
|
|
99
|
+
<%%= form.label :<%= attribute.name %>, "<%= label %>", class: "form-label form-label--checkbox" %>
|
|
98
100
|
</div>
|
|
99
101
|
|
|
100
102
|
<% elsif attribute.type == :text -%>
|
|
@@ -102,7 +104,7 @@
|
|
|
102
104
|
<%%= form.text_area :<%= attribute.name %>,
|
|
103
105
|
class: "form-textarea",
|
|
104
106
|
placeholder: " " %>
|
|
105
|
-
<%%= form.label :<%= attribute.name %>, class: "form-label" %>
|
|
107
|
+
<%%= form.label :<%= attribute.name %>, "<%= label %>", class: "form-label" %>
|
|
106
108
|
</div>
|
|
107
109
|
|
|
108
110
|
<% elsif attribute.type == :integer -%>
|
|
@@ -111,7 +113,7 @@
|
|
|
111
113
|
class: "form-input",
|
|
112
114
|
placeholder: " ",
|
|
113
115
|
step: 1 %>
|
|
114
|
-
<%%= form.label :<%= attribute.name %>, class: "form-label" %>
|
|
116
|
+
<%%= form.label :<%= attribute.name %>, "<%= label %>", class: "form-label" %>
|
|
115
117
|
</div>
|
|
116
118
|
|
|
117
119
|
<% elsif [:float, :decimal].include?(attribute.type) -%>
|
|
@@ -120,7 +122,7 @@
|
|
|
120
122
|
class: "form-input",
|
|
121
123
|
placeholder: " ",
|
|
122
124
|
step: "any" %>
|
|
123
|
-
<%%= form.label :<%= attribute.name %>, class: "form-label" %>
|
|
125
|
+
<%%= form.label :<%= attribute.name %>, "<%= label %>", class: "form-label" %>
|
|
124
126
|
</div>
|
|
125
127
|
|
|
126
128
|
<% elsif attribute.type == :date -%>
|
|
@@ -128,7 +130,7 @@
|
|
|
128
130
|
<%%= form.date_field :<%= attribute.name %>,
|
|
129
131
|
class: "form-input",
|
|
130
132
|
placeholder: " " %>
|
|
131
|
-
<%%= form.label :<%= attribute.name %>, class: "form-label" %>
|
|
133
|
+
<%%= form.label :<%= attribute.name %>, "<%= label %>", class: "form-label" %>
|
|
132
134
|
</div>
|
|
133
135
|
|
|
134
136
|
<% elsif [:datetime, :timestamp].include?(attribute.type) -%>
|
|
@@ -136,7 +138,7 @@
|
|
|
136
138
|
<%%= form.datetime_local_field :<%= attribute.name %>,
|
|
137
139
|
class: "form-input",
|
|
138
140
|
placeholder: " " %>
|
|
139
|
-
<%%= form.label :<%= attribute.name %>, class: "form-label" %>
|
|
141
|
+
<%%= form.label :<%= attribute.name %>, "<%= label %>", class: "form-label" %>
|
|
140
142
|
</div>
|
|
141
143
|
|
|
142
144
|
<% elsif attribute.type == :time -%>
|
|
@@ -144,7 +146,7 @@
|
|
|
144
146
|
<%%= form.time_field :<%= attribute.name %>,
|
|
145
147
|
class: "form-input",
|
|
146
148
|
placeholder: " " %>
|
|
147
|
-
<%%= form.label :<%= attribute.name %>, class: "form-label" %>
|
|
149
|
+
<%%= form.label :<%= attribute.name %>, "<%= label %>", class: "form-label" %>
|
|
148
150
|
</div>
|
|
149
151
|
|
|
150
152
|
<% elsif attribute.type == :attachment -%>
|
|
@@ -153,6 +155,7 @@
|
|
|
153
155
|
|
|
154
156
|
<div class="form-file-control">
|
|
155
157
|
<%%= form.label :<%= attribute.name %>,
|
|
158
|
+
"<%= label %>",
|
|
156
159
|
class: "form-file-label" %>
|
|
157
160
|
|
|
158
161
|
<%%= form.file_field :<%= attribute.name %>,
|
|
@@ -189,6 +192,7 @@
|
|
|
189
192
|
|
|
190
193
|
<div class="form-file-control">
|
|
191
194
|
<%%= form.label :<%= attribute.name %>,
|
|
195
|
+
"<%= label %>",
|
|
192
196
|
class: "form-file-label" %>
|
|
193
197
|
|
|
194
198
|
<%% <%= singular_table_name %>.<%= attribute.name %>.each do |image| %>
|
|
@@ -246,7 +250,7 @@
|
|
|
246
250
|
<%%= form.<%= attribute.field_type %> :<%= attribute.name %>,
|
|
247
251
|
class: "form-input",
|
|
248
252
|
placeholder: " " %>
|
|
249
|
-
<%%= form.label :<%= attribute.name %>, class: "form-label" %>
|
|
253
|
+
<%%= form.label :<%= attribute.name %>, "<%= label %>", class: "form-label" %>
|
|
250
254
|
</div>
|
|
251
255
|
<% end -%>
|
|
252
256
|
<% end -%>
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: b4um_generators
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexander Baum
|
|
@@ -49,6 +49,14 @@ files:
|
|
|
49
49
|
- bin/setup
|
|
50
50
|
- lib/b4um_generators.rb
|
|
51
51
|
- lib/b4um_generators/version.rb
|
|
52
|
+
- lib/generators/b4um/admin/admin_generator.rb
|
|
53
|
+
- lib/generators/b4um/admin/templates/add_admin_fields_migration.rb.tt
|
|
54
|
+
- lib/generators/b4um/admin/templates/admin_base_controller.rb.tt
|
|
55
|
+
- lib/generators/b4um/admin/templates/admin_dashboard.html.erb.tt
|
|
56
|
+
- lib/generators/b4um/admin/templates/admin_dashboard_controller.rb.tt
|
|
57
|
+
- lib/generators/b4um/admin/templates/admin_users_controller.rb.tt
|
|
58
|
+
- lib/generators/b4um/admin/templates/admin_users_index.html.erb.tt
|
|
59
|
+
- lib/generators/b4um/admin/templates/b4um_admin.rake.tt
|
|
52
60
|
- lib/generators/b4um/attachment/attachment_generator.rb
|
|
53
61
|
- lib/generators/b4um/authentication/authentication_generator.rb
|
|
54
62
|
- lib/generators/b4um/authentication/templates/new.html.erb.tt
|
|
@@ -64,6 +72,13 @@ files:
|
|
|
64
72
|
- lib/generators/b4um/comments/templates/comments_controller.rb.tt
|
|
65
73
|
- lib/generators/b4um/comments/templates/create_comments.rb.tt
|
|
66
74
|
- lib/generators/b4um/controller/controller_generator.rb
|
|
75
|
+
- lib/generators/b4um/guest/guest_generator.rb
|
|
76
|
+
- lib/generators/b4um/guest/templates/add_guest_fields_migration.rb.tt
|
|
77
|
+
- lib/generators/b4um/guest/templates/b4um_guests.rake.tt
|
|
78
|
+
- lib/generators/b4um/guest/templates/edit.html.erb.tt
|
|
79
|
+
- lib/generators/b4um/guest/templates/guest_expiration_warning.html.erb.tt
|
|
80
|
+
- lib/generators/b4um/guest/templates/guests_controller.rb.tt
|
|
81
|
+
- lib/generators/b4um/guest/templates/new.html.erb.tt
|
|
67
82
|
- lib/generators/b4um/help/help_generator.rb
|
|
68
83
|
- lib/generators/b4um/in_place/in_place_generator.rb
|
|
69
84
|
- lib/generators/b4um/in_place/templates/_flash.html.erb
|