corn_starch 1.1.8 → 1.1.10
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69ee03da14eb1397eede12bd552cbda0e76c7b0d
|
4
|
+
data.tar.gz: 7e9cf49f0be79bc40eced5dc7711c00705e5a05d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4c49ba8433360756cd5d4b17e6100d7b185799e2bc7d28d6fb875f31690c9a81d0f2c2082c1b4529736c4dfb50fe22db78ab473041d105edacc223fcf001777
|
7
|
+
data.tar.gz: 64c52a08bf427294f420a079c4a8800c3e5dcfb9e4c3743167472613a3ec6279a7648268ec7eedfccf820c4b6f8c6c08225085289343035587e0ba845bde8624
|
@@ -74,22 +74,22 @@ module CornStarch
|
|
74
74
|
|
75
75
|
# Authentication Filter
|
76
76
|
def auth_filter
|
77
|
-
redirect_to new_session_url, alert: { head: t('
|
77
|
+
redirect_to new_session_url, alert: { head: t('auth.access_denied'), body: t('auth.login_required') } unless is_authed
|
78
78
|
end
|
79
79
|
|
80
80
|
# Un-Authentication Filter
|
81
81
|
def unauth_filter
|
82
|
-
redirect_to root_url, alert: { head: t('
|
82
|
+
redirect_to root_url, alert: { head: t('auth.access_denied'), body: t('auth.already_logged_in') } if is_authed
|
83
83
|
end
|
84
84
|
|
85
85
|
# Self Filter
|
86
86
|
def self_filter
|
87
|
-
redirect_to root_url, alert: { head: t('
|
87
|
+
redirect_to root_url, alert: { head: t('auth.access_denied'), body: t('auth.invalid_user_id') } unless is_self
|
88
88
|
end
|
89
89
|
|
90
90
|
# Not Self Filter
|
91
91
|
def not_self_filter
|
92
|
-
redirect_to root_url, alert: { head: t('
|
92
|
+
redirect_to root_url, alert: { head: t('auth.access_denied'), body: t('auth.invalid_user_id') } if is_self
|
93
93
|
end
|
94
94
|
|
95
95
|
# Pagination Filter
|
@@ -174,29 +174,29 @@ module CornStarch
|
|
174
174
|
# Session Control
|
175
175
|
when :login
|
176
176
|
{
|
177
|
-
pass: { head: t('
|
178
|
-
fail: { head: t('
|
177
|
+
pass: { head: t('gen_msg.login.pass.head'), body: t('gen_msg.login.pass.body', name: uname) },
|
178
|
+
fail: { head: t('gen_msg.login.fail.head'), body: t('gen_msg.login.fail.body') }
|
179
179
|
}[result_or_name]
|
180
180
|
when :logout
|
181
|
-
{ head: t('
|
181
|
+
{ head: t('gen_msg.logout.head'), body: t('gen_msg.logout.body') }
|
182
182
|
|
183
183
|
# Generic Resources
|
184
184
|
when :create
|
185
185
|
{
|
186
|
-
pass: { head: t('
|
187
|
-
fail: { head: t('
|
186
|
+
pass: { head: t('gen_msg.create.pass.head', model: model), body: t('gen_msg.create.pass.body', model: model, name: ename) },
|
187
|
+
fail: { head: t('gen_msg.create.fail.head', model: model), body: t('gen_msg.create.fail.body') }
|
188
188
|
}[result_or_name]
|
189
189
|
when :update
|
190
190
|
{
|
191
|
-
pass: { head: t('
|
192
|
-
fail: { head: t('
|
191
|
+
pass: { head: t('gen_msg.update.pass.head', model: model), body: t('gen_msg.update.pass.body', model: model, name: ename) },
|
192
|
+
fail: { head: t('gen_msg.update.fail.head', model: model), body: t('gen_msg.update.fail.body') }
|
193
193
|
}[result_or_name]
|
194
194
|
when :destroy
|
195
|
-
{ head: t('
|
195
|
+
{ head: t('gen_msg.destroy.head', model: model), body: t('gen_msg.destroy.body', model: model, name: result_or_name) }
|
196
196
|
|
197
197
|
# Error
|
198
198
|
else
|
199
|
-
t('
|
199
|
+
t('gen_msg.unknown_action', action: action)
|
200
200
|
end
|
201
201
|
end
|
202
202
|
end
|
data/config/locales/en.yml
CHANGED
@@ -4,55 +4,52 @@
|
|
4
4
|
# English Translations
|
5
5
|
en:
|
6
6
|
|
7
|
-
#
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
#
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
# Unknown Action
|
58
|
-
unknown_action: "Unknown action [%{action}]"
|
7
|
+
# Auth
|
8
|
+
auth:
|
9
|
+
access_denied: "Access denied"
|
10
|
+
login_required: "Login required"
|
11
|
+
already_logged_in: "Already logged in"
|
12
|
+
invalid_user_id: "Invalid user ID"
|
13
|
+
|
14
|
+
# Generic Notice Messages
|
15
|
+
gen_msg:
|
16
|
+
|
17
|
+
# Login
|
18
|
+
login:
|
19
|
+
pass:
|
20
|
+
head: "Logged in"
|
21
|
+
body: "You have successfully logged in as %{name}"
|
22
|
+
fail:
|
23
|
+
head: "Login failed"
|
24
|
+
body: "Invalid username / password"
|
25
|
+
|
26
|
+
# Logout
|
27
|
+
logout:
|
28
|
+
head: "Logged out"
|
29
|
+
body: "You have successfully logged out"
|
30
|
+
|
31
|
+
# Create
|
32
|
+
create:
|
33
|
+
pass:
|
34
|
+
head: "%{model} created"
|
35
|
+
body: "%{model} [%{name}] was successfully created"
|
36
|
+
fail:
|
37
|
+
head: "%{model} creation failed"
|
38
|
+
body: "Invalid information"
|
39
|
+
|
40
|
+
# Update
|
41
|
+
update:
|
42
|
+
pass:
|
43
|
+
head: "%{model} updated"
|
44
|
+
body: "%{model} [%{name}] was successfully updated"
|
45
|
+
fail:
|
46
|
+
head: "%{model} update failed"
|
47
|
+
body: "Invalid information"
|
48
|
+
|
49
|
+
# Destroy
|
50
|
+
destroy:
|
51
|
+
head: "%{model} destroyed"
|
52
|
+
body: "%{model} [%{name}] was successfully destroyed"
|
53
|
+
|
54
|
+
# Unknown Action
|
55
|
+
unknown_action: "Unknown action [%{action}]"
|
data/config/locales/fr.yml
CHANGED
@@ -4,48 +4,52 @@
|
|
4
4
|
# French Translations
|
5
5
|
fr:
|
6
6
|
|
7
|
-
#
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
body: ""
|
21
|
-
|
22
|
-
# Logout
|
23
|
-
logout:
|
7
|
+
# Auth
|
8
|
+
auth:
|
9
|
+
access_denied: ""
|
10
|
+
login_required: ""
|
11
|
+
already_logged_in: ""
|
12
|
+
invalid_user_id: ""
|
13
|
+
|
14
|
+
# Generic Notice Messages
|
15
|
+
gen_msg:
|
16
|
+
|
17
|
+
# Login
|
18
|
+
login:
|
19
|
+
pass:
|
24
20
|
head: ""
|
25
21
|
body: ""
|
22
|
+
fail:
|
23
|
+
head: ""
|
24
|
+
body: ""
|
25
|
+
|
26
|
+
# Logout
|
27
|
+
logout:
|
28
|
+
head: ""
|
29
|
+
body: ""
|
26
30
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
head: ""
|
31
|
-
body: ""
|
32
|
-
fail:
|
33
|
-
head: ""
|
34
|
-
body: ""
|
35
|
-
|
36
|
-
# Update
|
37
|
-
update:
|
38
|
-
pass:
|
39
|
-
head: ""
|
40
|
-
body: ""
|
41
|
-
fail:
|
42
|
-
head: ""
|
43
|
-
body: ""
|
44
|
-
|
45
|
-
# Destroy
|
46
|
-
destroy:
|
31
|
+
# Create
|
32
|
+
create:
|
33
|
+
pass:
|
47
34
|
head: ""
|
48
35
|
body: ""
|
36
|
+
fail:
|
37
|
+
head: ""
|
38
|
+
body: ""
|
39
|
+
|
40
|
+
# Update
|
41
|
+
update:
|
42
|
+
pass:
|
43
|
+
head: ""
|
44
|
+
body: ""
|
45
|
+
fail:
|
46
|
+
head: ""
|
47
|
+
body: ""
|
48
|
+
|
49
|
+
# Destroy
|
50
|
+
destroy:
|
51
|
+
head: ""
|
52
|
+
body: ""
|
49
53
|
|
50
|
-
|
51
|
-
|
54
|
+
# Unknown Action
|
55
|
+
unknown_action: ""
|
data/lib/corn_starch/version.rb
CHANGED