bootswatch_rails 3.2.0.11 → 3.2.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Makefile +5 -1
- data/lib/bootswatch_rails/version.rb +1 -1
- data/lib/generators/bootswatch_rails/carrierwave/templates/picture_uploader.rb +3 -0
- data/lib/generators/bootswatch_rails/sorcery/sorcery_generator.rb +10 -2
- data/lib/generators/bootswatch_rails/sorcery/templates/_form.html.erb +19 -1
- data/lib/generators/bootswatch_rails/sorcery/templates/index.html.erb +10 -6
- data/lib/generators/bootswatch_rails/sorcery/templates/show.html.erb +33 -9
- data/lib/generators/bootswatch_rails/sorcery/templates/sorcery.de.yml +6 -1
- data/lib/generators/bootswatch_rails/sorcery/templates/user_migration.rb +6 -1
- data/lib/generators/bootswatch_rails/sorcery/templates/user_model.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a206925a99b799bf8db48089529cd7459335c658
|
4
|
+
data.tar.gz: 6847b630b6fbd58394743926cc25a02692a18da5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 746c88ca7f52c4a98159d25d401126d117f60a4738871d44731697c72d5da0a0ddd1585656be3f4925c27d5a990f6071c6b9e9d517399ceb50bb809a336612bb
|
7
|
+
data.tar.gz: 0c0b16b89a3fa06965ac716cd7a975a2ef330dab0658bafd72745e4b74b4c1df40aa5266e73c59c16879a13900df4ea5bfdd3f5c896a7e827db555d0cec7e41c
|
data/Makefile
CHANGED
@@ -4,16 +4,20 @@
|
|
4
4
|
#
|
5
5
|
|
6
6
|
all: build
|
7
|
+
git status
|
8
|
+
|
9
|
+
rel: build
|
10
|
+
./generate.sh
|
7
11
|
vim lib/bootswatch_rails/version.rb
|
8
12
|
git commit -a
|
9
13
|
rake release
|
10
14
|
|
11
15
|
install: build
|
16
|
+
vim lib/bootswatch_rails/version.rb
|
12
17
|
git commit -a
|
13
18
|
sudo rake install
|
14
19
|
|
15
20
|
build:
|
16
|
-
./generate.sh
|
17
21
|
test -d cleditor && git add cleditor || true
|
18
22
|
git add lib
|
19
23
|
git add vendor
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module BootswatchRails
|
2
|
-
VERSION = "3.2.0.
|
2
|
+
VERSION = "3.2.0.13"
|
3
3
|
THEMES = [:amelia, :cerulean, :cosmo, :custom, :cyborg, :darkly, :flatly, :journal, :lumen, :paper, :readable, :sandstone, :simplex, :slate, :spacelab, :superhero, :united, :yeti]
|
4
4
|
DEFAULT = 1
|
5
5
|
end
|
@@ -46,6 +46,9 @@ class <%= column.camelize %>Uploader < CarrierWave::Uploader::Base
|
|
46
46
|
version :display do
|
47
47
|
process :resize_to_limit => [600, 600]
|
48
48
|
end
|
49
|
+
version :avatar do
|
50
|
+
process :resize_to_limit => [350, 350]
|
51
|
+
end
|
49
52
|
|
50
53
|
# Add a white list of extensions which are allowed to be uploaded.
|
51
54
|
# For images you might use something like this:
|
@@ -5,9 +5,11 @@ module BootswatchRails
|
|
5
5
|
|
6
6
|
module Generators
|
7
7
|
class SorceryGenerator < ActiveRecord::Generators::Base
|
8
|
-
desc "Install model, views and controller for Sorcery."
|
8
|
+
desc "Install model, views and controller for user with Sorcery."
|
9
9
|
argument :name, type: :string, default: "user",
|
10
10
|
banner: "user model (default 'user')"
|
11
|
+
class_option :picture, type: :boolean, default: false,
|
12
|
+
desc: 'Add picture to user (needs carrierwave)'
|
11
13
|
class_option :user_activation, type: :boolean, default: false,
|
12
14
|
desc: 'User activation by email with optional success email'
|
13
15
|
class_option :reset_password, type: :boolean, default: false,
|
@@ -111,6 +113,10 @@ module BootswatchRails
|
|
111
113
|
|
112
114
|
protected
|
113
115
|
|
116
|
+
def has_picture?
|
117
|
+
options.picture?
|
118
|
+
end
|
119
|
+
|
114
120
|
def user_activation?
|
115
121
|
options.user_activation?
|
116
122
|
end
|
@@ -173,7 +179,9 @@ module BootswatchRails
|
|
173
179
|
end
|
174
180
|
|
175
181
|
def whitelist
|
176
|
-
":email, :name, :
|
182
|
+
text = ":email, :name, :phone, :comment, :theme, " +
|
183
|
+
":active, :status, :password, :password_confirmation"
|
184
|
+
text += ", :picture, :picture_cache" if has_picture?
|
177
185
|
end
|
178
186
|
end
|
179
187
|
end
|
@@ -3,11 +3,29 @@
|
|
3
3
|
|
4
4
|
<%%= f.input :email, autofocus: true %>
|
5
5
|
<%%= f.input :name %>
|
6
|
+
<%%= f.input :phone %>
|
7
|
+
<%%= f.input :comment %>
|
8
|
+
<%- if has_picture? -%>
|
9
|
+
<%%= f.input :picture %>
|
10
|
+
<%%= f.input :picture_cache, as: :hidden %>
|
11
|
+
<%%- if @<%= name %>.picture? -%>
|
12
|
+
<div class="form-group">
|
13
|
+
<div class="col-sm-offset-3 col-sm-9">
|
14
|
+
<%%= image_tag(@<%= name %>.picture_url(:thumb)) %>
|
15
|
+
|
16
|
+
<label for="<%= name %>_remove_picture">
|
17
|
+
<%%= f.check_box :remove_picture %>
|
18
|
+
<%%= t('headers.destroy', name: t('activerecord.attributes.<%= name %>.picture')) %>
|
19
|
+
</label>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
<%%- end -%>
|
23
|
+
<%- end -%>
|
24
|
+
<%%= f.input :theme %>
|
6
25
|
<%%= f.input :active %>
|
7
26
|
<%%= f.input :password %>
|
8
27
|
<%%= f.input :password_confirmation %>
|
9
28
|
<%%= f.input :status %>
|
10
|
-
<%%= f.input :theme %>
|
11
29
|
|
12
30
|
<%%= f.button :submit, class: 'btn btn-primary' %>
|
13
31
|
<%%- if @<%= name %>.new_record? -%>
|
@@ -3,11 +3,13 @@
|
|
3
3
|
<table class="table table-striped table-hover">
|
4
4
|
<thead>
|
5
5
|
<tr>
|
6
|
-
<th><%%= t('activerecord.
|
7
|
-
<th><%%= t('activerecord.attributes.<%= name %>.
|
6
|
+
<th><%%= t('activerecord.models.<%= name %>.one') %></th>
|
7
|
+
<th><%%= t('activerecord.attributes.<%= name %>.comment') %></th>
|
8
|
+
<%- if has_picture? -%>
|
9
|
+
<th><%%= t('activerecord.attributes.<%= name %>.picture') %></th>
|
10
|
+
<%- end -%>
|
8
11
|
<th><%%= t('activerecord.attributes.<%= name %>.active') %></th>
|
9
12
|
<th><%%= t('activerecord.attributes.<%= name %>.status') %></th>
|
10
|
-
<th><%%= t('activerecord.attributes.<%= name %>.theme') %></th>
|
11
13
|
<th class="index-actions"><%%= t('actions.title') %></th>
|
12
14
|
</tr>
|
13
15
|
</thead>
|
@@ -15,11 +17,13 @@
|
|
15
17
|
<tbody>
|
16
18
|
<%% @<%= table_name %>.each do |<%= name %>| %>
|
17
19
|
<tr>
|
18
|
-
<td><%%=
|
19
|
-
<td><%%= <%= name %>.
|
20
|
+
<td><%%= mail_to(<%= name %>.email, <%= name %>.name) %><br><%%= <%= name %>.phone %></td>
|
21
|
+
<td><%%= <%= name %>.comment %></td>
|
22
|
+
<%- if has_picture? -%>
|
23
|
+
<td><%%= image_tag(<%= name %>.picture_url(:thumb).to_s) %></td>
|
24
|
+
<%- end -%>
|
20
25
|
<td><%%= <%= name %>.active ? t('simple_form.yes') : t('simple_form.no') %></td>
|
21
26
|
<td><%%= t('enums.<%= name %>.status.' + <%= name %>.status) %></td>
|
22
|
-
<td><%%= <%= name %>.theme %></td>
|
23
27
|
<td class="index-actions">
|
24
28
|
<%%= link_to t('actions.show'), <%= name %>, class: 'btn btn-default btn-xs' %>
|
25
29
|
<br>
|
@@ -4,33 +4,51 @@
|
|
4
4
|
<tbody>
|
5
5
|
<tr>
|
6
6
|
<td><%%= t('activerecord.attributes.<%= name %>.email') %></td>
|
7
|
-
<td><%%=
|
7
|
+
<td><%%= mail_to(@<%= name %>.email) %></td>
|
8
8
|
</tr>
|
9
9
|
<tr>
|
10
10
|
<td><%%= t('activerecord.attributes.<%= name %>.name') %></td>
|
11
11
|
<td><%%= @<%= name %>.name %></td>
|
12
12
|
</tr>
|
13
13
|
<tr>
|
14
|
-
<td><%%= t('activerecord.attributes.<%= name %>.
|
15
|
-
<td><%%= @<%= name %>.
|
14
|
+
<td><%%= t('activerecord.attributes.<%= name %>.phone') %></td>
|
15
|
+
<td><%%= @<%= name %>.phone %></td>
|
16
16
|
</tr>
|
17
17
|
<tr>
|
18
|
-
<td><%%= t('activerecord.attributes.<%= name %>.
|
19
|
-
<td><%%=
|
18
|
+
<td><%%= t('activerecord.attributes.<%= name %>.comment') %></td>
|
19
|
+
<td><%%= raw(@<%= name %>.comment) %></td>
|
20
20
|
</tr>
|
21
|
+
<%- if has_picture? -%>
|
22
|
+
<%%- if @<%= name %>.picture.present? -%>
|
23
|
+
<tr>
|
24
|
+
<td><%%= t('activerecord.attributes.<%= name %>.picture') %></td>
|
25
|
+
<td><%%= image_tag(@<%= name %>.picture_url(:avatar)) %></td>
|
26
|
+
</tr>
|
27
|
+
<%%- end -%>
|
28
|
+
<%- end -%>
|
21
29
|
<tr>
|
22
30
|
<td><%%= t('activerecord.attributes.<%= name %>.theme') %></td>
|
23
31
|
<td><%%= @<%= name %>.theme %></td>
|
24
32
|
</tr>
|
33
|
+
<tr>
|
34
|
+
<td><%%= t('activerecord.attributes.<%= name %>.active') %></td>
|
35
|
+
<td><%%= @<%= name %>.active ? t('simple_form.yes') : t('simple_form.no') %></td>
|
36
|
+
</tr>
|
37
|
+
<tr>
|
38
|
+
<td><%%= t('activerecord.attributes.<%= name %>.status') %></td>
|
39
|
+
<td><%%= t('enums.<%= name %>.status.' + @<%= name %>.status) %></td>
|
40
|
+
</tr>
|
25
41
|
<%- if activity_logging? -%>
|
42
|
+
<%%- if @<%= name %>.last_login_at.present? -%>
|
26
43
|
<tr>
|
27
44
|
<td><%%= t('activerecord.attributes.<%= name %>.last_login_at') %></td>
|
28
|
-
<td><%%= @<%= name %>.last_login_at %></td>
|
45
|
+
<td><%%= l(@<%= name %>.last_login_at) %></td>
|
29
46
|
</tr>
|
30
47
|
<tr>
|
31
48
|
<td><%%= t('activerecord.attributes.<%= name %>.last_login_from_ip_address') %></td>
|
32
49
|
<td><%%= @<%= name %>.last_login_from_ip_address %></td>
|
33
50
|
</tr>
|
51
|
+
<%%- end -%>
|
34
52
|
<%- end -%>
|
35
53
|
<%- if brute_force_protection? -%>
|
36
54
|
<tr>
|
@@ -39,20 +57,26 @@
|
|
39
57
|
</tr>
|
40
58
|
<%- end -%>
|
41
59
|
<%- if activity_logging? -%>
|
60
|
+
<%%- if @<%= name %>.last_logout_at.present? -%>
|
42
61
|
<tr>
|
43
62
|
<td><%%= t('activerecord.attributes.<%= name %>.last_logout_at') %></td>
|
44
|
-
<td><%%= @<%= name %>.last_logout_at %></td>
|
63
|
+
<td><%%= l(@<%= name %>.last_logout_at) %></td>
|
45
64
|
</tr>
|
65
|
+
<%%- end -%>
|
66
|
+
<%%- if @<%= name %>.last_activity_at.present? -%>
|
46
67
|
<tr>
|
47
68
|
<td><%%= t('activerecord.attributes.<%= name %>.last_activity_at') %></td>
|
48
|
-
<td><%%= @<%= name %>.last_activity_at %></td>
|
69
|
+
<td><%%= l(@<%= name %>.last_activity_at) %></td>
|
49
70
|
</tr>
|
71
|
+
<%%- end -%>
|
50
72
|
<%- end -%>
|
51
73
|
<%- if brute_force_protection? -%>
|
74
|
+
<%%- if @<%= name %>.lock_expires_at.present? -%>
|
52
75
|
<tr>
|
53
76
|
<td><%%= t('activerecord.attributes.<%= name %>.lock_expires_at') %></td>
|
54
|
-
<td><%%= @<%= name %>.lock_expires_at %></td>
|
77
|
+
<td><%%= l(@<%= name %>.lock_expires_at) %></td>
|
55
78
|
</tr>
|
79
|
+
<%%- end -%>
|
56
80
|
<%- end -%>
|
57
81
|
</tbody>
|
58
82
|
</table>
|
@@ -45,9 +45,14 @@ de:
|
|
45
45
|
<%= name %>:
|
46
46
|
email: "E-Mail"
|
47
47
|
name: "Name"
|
48
|
+
phone: "Telefon"
|
49
|
+
comment: "Bemerkung"
|
50
|
+
<%- if has_picture? -%>
|
51
|
+
picture: "Bild"
|
52
|
+
<%- end -%>
|
53
|
+
theme: "Oberfläche"
|
48
54
|
active: "Aktiv"
|
49
55
|
status: "Status"
|
50
|
-
theme: "Oberfläche"
|
51
56
|
password: "Kennwort"
|
52
57
|
password_confirmation: "Kennwort wiederholen"
|
53
58
|
<%- if remember_me? -%>
|
@@ -3,9 +3,14 @@ class <%= migration_name.camelize %> < ActiveRecord::Migration
|
|
3
3
|
create_table :<%= table_name %> do |t|
|
4
4
|
t.string :email, null: false
|
5
5
|
t.string :name
|
6
|
+
t.string :phone
|
7
|
+
t.text :comment
|
8
|
+
<%- if has_picture? -%>
|
9
|
+
t.string :picture
|
10
|
+
<%- end -%>
|
11
|
+
t.integer :theme, default: BootswatchRails::DEFAULT
|
6
12
|
t.boolean :active, default: true
|
7
13
|
t.integer :status, default: 0
|
8
|
-
t.integer :theme, default: BootswatchRails::DEFAULT
|
9
14
|
|
10
15
|
t.string :crypted_password, null: false
|
11
16
|
t.string :salt, null: false
|
@@ -6,6 +6,10 @@ class <%= class_name %> < ActiveRecord::Base
|
|
6
6
|
validates :password, confirmation: true
|
7
7
|
validates :password_confirmation, presence: true, on: :create
|
8
8
|
|
9
|
+
<%- if has_picture? -%>
|
10
|
+
mount_uploader :picture, PictureUploader
|
11
|
+
|
12
|
+
<%- end -%>
|
9
13
|
enum status: <%= BootswatchRails::USER_STATUS %>
|
10
14
|
validates :status, presence: true
|
11
15
|
|