administration-one 1.0.0 → 1.0.1
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 +3 -0
- data/lib/administration_one/version.rb +1 -1
- data/lib/generators/admin/install/templates/erb/admin/users/show.html.erb +3 -0
- data/lib/generators/admin/install/templates/erb/layouts/admin/authentication.html.erb +1 -1
- data/lib/generators/admin/install/templates/jobs/attach_avatar_to_user_job.rb +3 -3
- data/lib/generators/admin/install/templates/models/user.rb +0 -2
- data/lib/generators/admin/scaffold/scaffold_generator.rb +7 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa883dc65e85907d203f948c6584c36b1e1174ce7e1c8d35073c6e7a2790f685
|
4
|
+
data.tar.gz: ac078ae36a533af16d3c6d3c0997649bfcd33481a46f446e6a796622f4d1ccd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c2d09b74b75d44f58a36c57f14187ad92f220f83e469679ec474e6f506735c3cb50ef75f796d62ec93e910f3efee408361d33f25835ccd6cead4867bf72b668
|
7
|
+
data.tar.gz: 8dd86d0b4c5f6b760408c323bb20cf28177d2047c15d25ace0701e8454ee4853a41752cc947fd65f229f838e0cad3e6e2bfceb9ca5bf091ade8791b6b8bd5f78
|
data/CHANGELOG.md
CHANGED
@@ -26,6 +26,9 @@
|
|
26
26
|
|
27
27
|
<dt class="col-md-3">Updated at</dt>
|
28
28
|
<dd class="col-md-9"><%= l(@user.updated_at, format: :long) %></dd>
|
29
|
+
|
30
|
+
<dt class="col-md-3">Administrator</dt>
|
31
|
+
<dd class="col-md-9"><%= true_or_false_icon(@user.is_admin?) %></dd>
|
29
32
|
</dl>
|
30
33
|
</div>
|
31
34
|
</div>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<meta charset="utf-8"/>
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/>
|
6
6
|
<meta http-equiv="X-UA-Compatible" content="ie=edge"/>
|
7
|
-
<title>
|
7
|
+
<title>Administration One &madsh; Log In</title>
|
8
8
|
|
9
9
|
<%= csrf_meta_tags %>
|
10
10
|
<%= csp_meta_tag %>
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require "open-uri"
|
2
2
|
class AttachAvatarToUserJob < ApplicationJob
|
3
3
|
queue_as :default
|
4
|
-
|
4
|
+
|
5
5
|
def perform(**args)
|
6
6
|
user = args[:user]
|
7
7
|
size = 512
|
8
|
-
colors = %w[ 066fd1 ]
|
8
|
+
colors = %w[ 066fd1 ae3ec9 d6336c d63939 f76707 f59f00 0ca678 17a2b8 ]
|
9
9
|
|
10
10
|
unless user.nil?
|
11
11
|
seed = URI.encode_uri_component user.username
|
@@ -18,4 +18,4 @@ class AttachAvatarToUserJob < ApplicationJob
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
21
|
-
end
|
21
|
+
end
|
@@ -15,11 +15,11 @@ module Admin
|
|
15
15
|
|
16
16
|
def ask_about_wysiwyg
|
17
17
|
return if behavior == :revoke
|
18
|
-
if attributes_names.include?(
|
18
|
+
if attributes_names.include?("content")
|
19
19
|
puts "\n" * 2
|
20
20
|
puts "There was attribute named \"content\" passed to generator's options. Do you want to use EditorJS for it?"
|
21
21
|
answer = ask "Type \"Y\" or \"Yes\ to use EditorJS. Or anything else not to use it."
|
22
|
-
["y", "yes"].include?(answer.downcase) ? @use_editor_js = true : @use_editor_js = false
|
22
|
+
[ "y", "yes" ].include?(answer.downcase) ? @use_editor_js = true : @use_editor_js = false
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
@@ -61,7 +61,7 @@ EOF
|
|
61
61
|
file = "app/models/#{singular_table_name}.rb"
|
62
62
|
insertion = " def self.ransackable_attributes(auth_object = nil)\n #{attributes_to_array_string}\n end\n"
|
63
63
|
if File.exist?(file)
|
64
|
-
inject_into_class file, "#{
|
64
|
+
inject_into_class file, "#{class_name} < ApplicationRecord", insertion, force: true
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
@@ -103,17 +103,17 @@ EOF
|
|
103
103
|
end
|
104
104
|
|
105
105
|
def attributes_to_array_string
|
106
|
-
|
106
|
+
"%w[" + attributes_hash.map { |k, _| "#{k}" }.join(" ") + "]"
|
107
107
|
end
|
108
108
|
|
109
109
|
def attributes_hash
|
110
110
|
return {} if attributes_names.empty?
|
111
111
|
|
112
112
|
attributes_names.filter_map do |name|
|
113
|
-
if %w
|
114
|
-
["#{name}", '"secret"']
|
113
|
+
if %w[password password_confirmation].include?(name) && attributes.any?(&:password_digest?)
|
114
|
+
[ "#{name}", '"secret"' ]
|
115
115
|
elsif !virtual?(name)
|
116
|
-
["#{name}", "@#{singular_table_name}.#{name}"]
|
116
|
+
[ "#{name}", "@#{singular_table_name}.#{name}" ]
|
117
117
|
end
|
118
118
|
end.sort.to_h
|
119
119
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: administration-one
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey Beregovoy
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
email:
|
13
13
|
- thismailis4spam@icloud.com
|
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
- !ruby/object:Gem::Version
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
|
-
rubygems_version: 3.6.
|
121
|
+
rubygems_version: 3.6.7
|
122
122
|
specification_version: 4
|
123
123
|
summary: An administration system generator for Rails applications
|
124
124
|
test_files: []
|