trestle-auth 0.2.3 → 0.2.4
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/README.md +1 -1
- data/app/assets/stylesheets/trestle/auth/_form.scss +18 -0
- data/app/helpers/trestle/auth/title_helper.rb +18 -0
- data/app/views/layouts/trestle/auth.html.erb +1 -9
- data/config/locale/zh-CN.yml +8 -0
- data/lib/generators/trestle/auth/install/install_generator.rb +7 -6
- data/lib/trestle/auth/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e01368d321502dbe498b5bdf59088390bd6086aeef291013f0baaa0416ef4c2
|
4
|
+
data.tar.gz: 9eaec32a25dc19056911f58982dcec072f426ca5835e30fe6501064c7374c68b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0df58e37c7544874b4e4c72367933e2cec9729cb7aa68effcb6d35cd92abde4e53f73e3ad4abee0598fa3fcfe1fcaa0f6593af3ff75b5f7e6e2ddbe2b48b4b5b
|
7
|
+
data.tar.gz: fb7e23d61644b5e88bd9a92ade6c0e16e52fbf8d71d76c2ef45445ef219550cd3443ffea6a9d116b49fe801fa3bdeaaa43b7d83fb0fea809277e4faa0cc0e203
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
> Authentication plugin for the Trestle admin framework
|
4
4
|
|
5
|
-
<img src="https://trestle.io/images/Trestle-Auth.png" width="50%" />
|
5
|
+
<img src="https://trestle.io/images/Trestle-Auth-1.png" width="50%" /><img src="https://trestle.io/images/Trestle-Auth-2.png" width="50%" />
|
6
6
|
|
7
7
|
|
8
8
|
## Getting Started
|
@@ -7,8 +7,26 @@ a {
|
|
7
7
|
text-align: center;
|
8
8
|
margin-bottom: 20px;
|
9
9
|
|
10
|
+
h1 {
|
11
|
+
display: flex;
|
12
|
+
align-items: center;
|
13
|
+
justify-content: center;
|
14
|
+
|
15
|
+
font-size: 24px;
|
16
|
+
font-weight: 500;
|
17
|
+
text-shadow: rgba(black, 0.5) 0 1px 1px;
|
18
|
+
|
19
|
+
height: 60px;
|
20
|
+
padding: 10px 15px;
|
21
|
+
}
|
22
|
+
|
10
23
|
img {
|
11
24
|
max-width: 100%;
|
25
|
+
max-height: 100%;
|
26
|
+
}
|
27
|
+
|
28
|
+
span {
|
29
|
+
margin-left: 10px;
|
12
30
|
}
|
13
31
|
}
|
14
32
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Trestle
|
2
|
+
module Auth
|
3
|
+
module TitleHelper
|
4
|
+
def trestle_auth_title
|
5
|
+
if Trestle.config.site_logo
|
6
|
+
image_tag(Trestle.config.site_logo)
|
7
|
+
elsif Trestle.config.site_logo_small
|
8
|
+
safe_join([
|
9
|
+
image_tag(Trestle.config.site_logo_small, alt: "", class: ""),
|
10
|
+
content_tag(:span, Trestle.config.site_title)
|
11
|
+
], "\n")
|
12
|
+
else
|
13
|
+
Trestle.config.site_title
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -20,15 +20,7 @@
|
|
20
20
|
<body>
|
21
21
|
<main class="container">
|
22
22
|
<header class="auth-header">
|
23
|
-
<h1>
|
24
|
-
<% if Trestle.config.site_logo -%>
|
25
|
-
<%= image_tag(Trestle.config.site_logo, alt: Trestle.config.site_title) %>
|
26
|
-
<% elsif Trestle.config.site_logo_small -%>
|
27
|
-
<%= image_tag(Trestle.config.site_logo_small, alt: Trestle.config.site_title) %>
|
28
|
-
<% else -%>
|
29
|
-
<%= Trestle.config.site_title %>
|
30
|
-
<% end -%>
|
31
|
-
</h1>
|
23
|
+
<h1><%= trestle_auth_title %></h1>
|
32
24
|
</header>
|
33
25
|
|
34
26
|
<%= yield %>
|
@@ -37,6 +37,13 @@ module Trestle
|
|
37
37
|
# User.authenticate(params[:login], params[:password])
|
38
38
|
# }
|
39
39
|
|
40
|
+
# Customize the method for finding a user given an ID from the session.
|
41
|
+
# The block should return an instance of the auth user class, or nil.
|
42
|
+
#
|
43
|
+
# config.auth.find_user = ->(id) {
|
44
|
+
# User.find_by(id: id)
|
45
|
+
# }
|
46
|
+
|
40
47
|
# Customize the rendering of user avatars. Can be disabled by setting to false.
|
41
48
|
# Defaults to the Gravatar based on the user's email address.
|
42
49
|
#
|
@@ -72,12 +79,6 @@ module Trestle
|
|
72
79
|
# User.authenticate_with_remember_token(token)
|
73
80
|
# }
|
74
81
|
|
75
|
-
# Customize the method for finding a user given an ID from the session.
|
76
|
-
#
|
77
|
-
# config.auth.remember.find_user = ->(id) {
|
78
|
-
# User.find_by(id: id)
|
79
|
-
# }
|
80
|
-
|
81
82
|
# Customize the method for remembering a user.
|
82
83
|
#
|
83
84
|
# config.auth.remember.remember_me, ->(user) { user.remember_me! }
|
data/lib/trestle/auth/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trestle-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Pohlenz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trestle
|
@@ -102,6 +102,7 @@ files:
|
|
102
102
|
- app/assets/stylesheets/trestle/auth/_layout.scss
|
103
103
|
- app/assets/stylesheets/trestle/auth/userbox.scss
|
104
104
|
- app/controllers/trestle/auth/sessions_controller.rb
|
105
|
+
- app/helpers/trestle/auth/title_helper.rb
|
105
106
|
- app/helpers/trestle/auth/user_helper.rb
|
106
107
|
- app/views/layouts/trestle/auth.html.erb
|
107
108
|
- app/views/trestle/auth/_userbox.html.erb
|
@@ -110,6 +111,7 @@ files:
|
|
110
111
|
- config/locale/en.yml
|
111
112
|
- config/locale/pl.yml
|
112
113
|
- config/locale/pt-BR.yml
|
114
|
+
- config/locale/zh-CN.yml
|
113
115
|
- config/routes.rb
|
114
116
|
- lib/generators/trestle/auth/admin/admin_generator.rb
|
115
117
|
- lib/generators/trestle/auth/admin/templates/admin.rb.erb
|
@@ -146,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
148
|
version: '0'
|
147
149
|
requirements: []
|
148
150
|
rubyforge_project:
|
149
|
-
rubygems_version: 2.7.
|
151
|
+
rubygems_version: 2.7.6
|
150
152
|
signing_key:
|
151
153
|
specification_version: 4
|
152
154
|
summary: Authentication plugin for the Trestle admin framework
|