typus 0.9.17
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +8 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +86 -0
- data/Rakefile +61 -0
- data/VERSION +1 -0
- data/app/controllers/admin/master_controller.rb +354 -0
- data/app/controllers/typus_controller.rb +128 -0
- data/app/helpers/admin/form_helper.rb +386 -0
- data/app/helpers/admin/master_helper.rb +104 -0
- data/app/helpers/admin/public_helper.rb +27 -0
- data/app/helpers/admin/sidebar_helper.rb +236 -0
- data/app/helpers/admin/table_helper.rb +227 -0
- data/app/helpers/typus_helper.rb +194 -0
- data/app/models/typus_mailer.rb +14 -0
- data/app/models/typus_user.rb +5 -0
- data/app/views/admin/dashboard/_sidebar.html.erb +9 -0
- data/app/views/admin/resources/edit.html.erb +24 -0
- data/app/views/admin/resources/index.html.erb +23 -0
- data/app/views/admin/resources/new.html.erb +22 -0
- data/app/views/admin/resources/show.html.erb +18 -0
- data/app/views/admin/shared/_footer.html.erb +1 -0
- data/app/views/admin/shared/_pagination.html.erb +28 -0
- data/app/views/layouts/admin.html.erb +73 -0
- data/app/views/layouts/typus.html.erb +29 -0
- data/app/views/typus/dashboard.html.erb +9 -0
- data/app/views/typus/recover_password.html.erb +7 -0
- data/app/views/typus/reset_password.html.erb +15 -0
- data/app/views/typus/sign_in.html.erb +9 -0
- data/app/views/typus/sign_up.html.erb +7 -0
- data/app/views/typus_mailer/reset_password_link.erb +11 -0
- data/config/locales/typus/de.yml +109 -0
- data/config/locales/typus/es.yml +109 -0
- data/config/locales/typus/language.yml.template +113 -0
- data/config/locales/typus/pt-BR.yml +111 -0
- data/config/locales/typus/ru.yml +111 -0
- data/generators/typus/templates/config/initializers/typus.rb +33 -0
- data/generators/typus/templates/config/typus/README +51 -0
- data/generators/typus/templates/config/typus/application.yml +6 -0
- data/generators/typus/templates/config/typus/application_roles.yml +23 -0
- data/generators/typus/templates/config/typus/typus.yml +14 -0
- data/generators/typus/templates/config/typus/typus_roles.yml +2 -0
- data/generators/typus/templates/db/create_typus_users.rb +21 -0
- data/generators/typus/templates/public/images/admin/arrow_down.gif +0 -0
- data/generators/typus/templates/public/images/admin/arrow_up.gif +0 -0
- data/generators/typus/templates/public/images/admin/spinner.gif +0 -0
- data/generators/typus/templates/public/images/admin/status_false.gif +0 -0
- data/generators/typus/templates/public/images/admin/status_true.gif +0 -0
- data/generators/typus/templates/public/images/admin/trash.gif +0 -0
- data/generators/typus/templates/public/javascripts/admin/application.js +14 -0
- data/generators/typus/templates/public/stylesheets/admin/reset.css +68 -0
- data/generators/typus/templates/public/stylesheets/admin/screen.css +729 -0
- data/generators/typus/typus_generator.rb +122 -0
- data/generators/typus_update_schema_to_01/templates/config/typus.yml +14 -0
- data/generators/typus_update_schema_to_01/templates/migration.rb +11 -0
- data/generators/typus_update_schema_to_01/typus_update_schema_to_01_generator.rb +19 -0
- data/lib/typus.rb +122 -0
- data/lib/typus/active_record.rb +307 -0
- data/lib/typus/authentication.rb +142 -0
- data/lib/typus/configuration.rb +85 -0
- data/lib/typus/extensions/routes.rb +15 -0
- data/lib/typus/format.rb +55 -0
- data/lib/typus/generator.rb +81 -0
- data/lib/typus/hash.rb +8 -0
- data/lib/typus/locale.rb +17 -0
- data/lib/typus/object.rb +21 -0
- data/lib/typus/quick_edit.rb +40 -0
- data/lib/typus/reloader.rb +15 -0
- data/lib/typus/string.rb +11 -0
- data/lib/typus/templates/index.html.erb +11 -0
- data/lib/typus/templates/resource_controller.rb.erb +15 -0
- data/lib/typus/templates/resource_controller_test.rb.erb +10 -0
- data/lib/typus/templates/resources_controller.rb.erb +37 -0
- data/lib/typus/user.rb +134 -0
- data/lib/vendor/active_record.rb +15 -0
- data/lib/vendor/paginator.rb +143 -0
- data/rails/init.rb +3 -0
- data/tasks/typus_tasks.rake +32 -0
- data/test/config/broken/application.yml +68 -0
- data/test/config/broken/application_roles.yml +20 -0
- data/test/config/broken/empty.yml +0 -0
- data/test/config/broken/empty_roles.yml +0 -0
- data/test/config/broken/undefined.yml +3 -0
- data/test/config/broken/undefined_roles.yml +6 -0
- data/test/config/default/typus.yml +14 -0
- data/test/config/default/typus_roles.yml +2 -0
- data/test/config/empty/empty_01.yml +0 -0
- data/test/config/empty/empty_01_roles.yml +0 -0
- data/test/config/empty/empty_02.yml +0 -0
- data/test/config/empty/empty_02_roles.yml +0 -0
- data/test/config/locales/es.yml +10 -0
- data/test/config/ordered/001_roles.yml +2 -0
- data/test/config/ordered/002_roles.yml +2 -0
- data/test/config/unordered/app_one_roles.yml +2 -0
- data/test/config/unordered/app_two_roles.yml +2 -0
- data/test/config/working/application.yml +68 -0
- data/test/config/working/application_roles.yml +22 -0
- data/test/config/working/typus.yml +14 -0
- data/test/config/working/typus_roles.yml +2 -0
- data/test/fixtures/app/controllers/admin/assets_controller.rb +2 -0
- data/test/fixtures/app/controllers/admin/categories_controller.rb +2 -0
- data/test/fixtures/app/controllers/admin/comments_controller.rb +2 -0
- data/test/fixtures/app/controllers/admin/pages_controller.rb +2 -0
- data/test/fixtures/app/controllers/admin/posts_controller.rb +2 -0
- data/test/fixtures/app/controllers/admin/status_controller.rb +6 -0
- data/test/fixtures/app/controllers/admin/typus_users_controller.rb +2 -0
- data/test/fixtures/app/controllers/admin/watch_dog_controller.rb +6 -0
- data/test/fixtures/app/views/admin/comments/_edit.html.erb +1 -0
- data/test/fixtures/app/views/admin/comments/_index.html.erb +1 -0
- data/test/fixtures/app/views/admin/comments/_new.html.erb +1 -0
- data/test/fixtures/app/views/admin/comments/_show.html.erb +1 -0
- data/test/fixtures/app/views/admin/comments/_sidebar.html.erb +1 -0
- data/test/fixtures/app/views/admin/dashboard/_content.html.erb +1 -0
- data/test/fixtures/app/views/admin/dashboard/_sidebar.html.erb +1 -0
- data/test/fixtures/app/views/admin/resources/_sidebar.html.erb +1 -0
- data/test/fixtures/app/views/admin/shared/_footer.html.erb +1 -0
- data/test/fixtures/app/views/admin/status/index.html.erb +1 -0
- data/test/fixtures/app/views/admin/templates/_datepicker.html.erb +1 -0
- data/test/fixtures/assets.yml +11 -0
- data/test/fixtures/categories.yml +14 -0
- data/test/fixtures/comments.yml +27 -0
- data/test/fixtures/pages.yml +41 -0
- data/test/fixtures/posts.yml +37 -0
- data/test/fixtures/typus_users.yml +54 -0
- data/test/functional/admin/assets_controller_test.rb +57 -0
- data/test/functional/admin/categories_controller_test.rb +106 -0
- data/test/functional/admin/comments_controller_test.rb +120 -0
- data/test/functional/admin/master_controller_test.rb +5 -0
- data/test/functional/admin/posts_controller_test.rb +261 -0
- data/test/functional/admin/status_controller_test.rb +43 -0
- data/test/functional/admin/typus_users_controller_test.rb +239 -0
- data/test/functional/typus_controller_test.rb +321 -0
- data/test/helper.rb +51 -0
- data/test/helpers/admin/form_helper_test.rb +337 -0
- data/test/helpers/admin/master_helper_test.rb +69 -0
- data/test/helpers/admin/public_helper_test.rb +26 -0
- data/test/helpers/admin/sidebar_helper_test.rb +335 -0
- data/test/helpers/admin/table_helper_test.rb +239 -0
- data/test/helpers/typus_helper_test.rb +117 -0
- data/test/lib/active_record_test.rb +382 -0
- data/test/lib/configuration_test.rb +94 -0
- data/test/lib/hash_test.rb +11 -0
- data/test/lib/routes_test.rb +71 -0
- data/test/lib/string_test.rb +25 -0
- data/test/lib/typus_test.rb +85 -0
- data/test/models.rb +51 -0
- data/test/schema.rb +64 -0
- data/test/unit/typus_mailer_test.rb +33 -0
- data/test/unit/typus_test.rb +17 -0
- data/test/unit/typus_user_roles_test.rb +90 -0
- data/test/unit/typus_user_test.rb +177 -0
- data/test/vendor/active_record_test.rb +18 -0
- data/test/vendor/paginator_test.rb +136 -0
- data/typus.gemspec +228 -0
- metadata +241 -0
@@ -0,0 +1,20 @@
|
|
1
|
+
admin:
|
2
|
+
Asset: create, read, update, delete
|
3
|
+
Category: create, read, update, delete
|
4
|
+
Comment: create, read, update, delete
|
5
|
+
TypusUser: create, read, update, delete
|
6
|
+
Page: create, read, update, delete
|
7
|
+
Post: create, read, update, delete
|
8
|
+
Status: index
|
9
|
+
Order:
|
10
|
+
|
11
|
+
editor:
|
12
|
+
Category: create, read, update
|
13
|
+
Comment: read, update, delete
|
14
|
+
Post: create, read, update
|
15
|
+
TypusUser: read, update
|
16
|
+
|
17
|
+
designer:
|
18
|
+
Category: read, update
|
19
|
+
Comment: read
|
20
|
+
Post: read
|
File without changes
|
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
TypusUser:
|
2
|
+
fields:
|
3
|
+
list: email, role, status
|
4
|
+
form: first_name, last_name, role, email, password, password_confirmation
|
5
|
+
options:
|
6
|
+
selectors: role
|
7
|
+
booleans:
|
8
|
+
status: Active, Inactive
|
9
|
+
filters: status, role
|
10
|
+
search: first_name, last_name, email, role
|
11
|
+
application: Typus
|
12
|
+
description: System Users Administration
|
13
|
+
options:
|
14
|
+
icon_on_boolean: false
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,68 @@
|
|
1
|
+
Asset:
|
2
|
+
fields:
|
3
|
+
list: caption
|
4
|
+
form: caption
|
5
|
+
application: Site
|
6
|
+
options:
|
7
|
+
|
8
|
+
Category:
|
9
|
+
fields:
|
10
|
+
list: name, position
|
11
|
+
form: name, permalink, position
|
12
|
+
order_by: position
|
13
|
+
module: Post
|
14
|
+
|
15
|
+
Comment:
|
16
|
+
fields:
|
17
|
+
list: email, post, post_id
|
18
|
+
form: email, post
|
19
|
+
csv: email, post_id
|
20
|
+
export: csv
|
21
|
+
filters: post
|
22
|
+
search: email, body
|
23
|
+
application: Blog
|
24
|
+
|
25
|
+
Page:
|
26
|
+
fields:
|
27
|
+
# Body field is overwrited from a Page class method.
|
28
|
+
list: title, is_published?
|
29
|
+
form: title, body, is_published?
|
30
|
+
options:
|
31
|
+
booleans:
|
32
|
+
is_published: ["Yes, it is", "No, it isn't"]
|
33
|
+
actions:
|
34
|
+
index: rebuild_all
|
35
|
+
edit: rebuild
|
36
|
+
application: Site
|
37
|
+
filters: is_published?
|
38
|
+
options:
|
39
|
+
form_rows: 25
|
40
|
+
on_header: true
|
41
|
+
|
42
|
+
Post:
|
43
|
+
fields:
|
44
|
+
list: title, created_at, status
|
45
|
+
form: title, body, created_at, status, published_at
|
46
|
+
relationship: title, created_at
|
47
|
+
options:
|
48
|
+
selectors: status
|
49
|
+
read_only: permalink
|
50
|
+
auto_generated: created_at
|
51
|
+
date_formats:
|
52
|
+
created_at: post_short
|
53
|
+
templates:
|
54
|
+
published_at: datepicker
|
55
|
+
relationships: assets, categories
|
56
|
+
actions:
|
57
|
+
index: cleanup
|
58
|
+
edit: send_as_newsletter, preview
|
59
|
+
filters: status, created_at, user, user_id
|
60
|
+
search: title
|
61
|
+
order_by: title, -created_at
|
62
|
+
application: Blog
|
63
|
+
|
64
|
+
CustomUser:
|
65
|
+
fields:
|
66
|
+
list: first_name, last_name, email
|
67
|
+
csv: first_name, last_name, email
|
68
|
+
export: csv
|
@@ -0,0 +1,22 @@
|
|
1
|
+
admin:
|
2
|
+
Asset: create, read, update, delete
|
3
|
+
Category: create, read, update, delete
|
4
|
+
Comment: create, read, update, delete
|
5
|
+
Git: index, commit
|
6
|
+
Order:
|
7
|
+
Page: create, read, update, delete, rebuild, rebuild_all
|
8
|
+
Post: create, read, update, delete
|
9
|
+
Status: index
|
10
|
+
WatchDog: index, cleanup
|
11
|
+
|
12
|
+
editor:
|
13
|
+
Category: create, read, update
|
14
|
+
Comment: read, update, delete
|
15
|
+
Git: index
|
16
|
+
Post: create, read, update
|
17
|
+
TypusUser: read, update
|
18
|
+
|
19
|
+
designer:
|
20
|
+
Category: read, update
|
21
|
+
Comment: read
|
22
|
+
Post: read
|
@@ -0,0 +1,14 @@
|
|
1
|
+
TypusUser:
|
2
|
+
fields:
|
3
|
+
list: email, role, status
|
4
|
+
form: first_name, last_name, role, email, password, password_confirmation
|
5
|
+
options:
|
6
|
+
selectors: role
|
7
|
+
booleans:
|
8
|
+
status: Active, Inactive
|
9
|
+
filters: status, role
|
10
|
+
search: first_name, last_name, email, role
|
11
|
+
application: Typus
|
12
|
+
description: System Users Administration
|
13
|
+
options:
|
14
|
+
icon_on_boolean: false
|
@@ -0,0 +1 @@
|
|
1
|
+
_edit.html.erb
|
@@ -0,0 +1 @@
|
|
1
|
+
_index.html.erb
|
@@ -0,0 +1 @@
|
|
1
|
+
_new.html.erb
|
@@ -0,0 +1 @@
|
|
1
|
+
_show.html.erb
|
@@ -0,0 +1 @@
|
|
1
|
+
_sidebar.html.erb
|
@@ -0,0 +1 @@
|
|
1
|
+
_content.html.erb
|
@@ -0,0 +1 @@
|
|
1
|
+
_sidebar.html.erb
|
@@ -0,0 +1 @@
|
|
1
|
+
_sidebar.html.erb
|
@@ -0,0 +1 @@
|
|
1
|
+
_footer.html.erb
|
@@ -0,0 +1 @@
|
|
1
|
+
index.html.erb
|
@@ -0,0 +1 @@
|
|
1
|
+
datepicker_template_<%= attribute %>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
first:
|
2
|
+
id: 1
|
3
|
+
name: John
|
4
|
+
email: john@example.com
|
5
|
+
body: Body of the comment
|
6
|
+
post_id: 1
|
7
|
+
|
8
|
+
second:
|
9
|
+
id: 2
|
10
|
+
name: Me
|
11
|
+
email: me@example.com
|
12
|
+
body: Body of the comment
|
13
|
+
post_id: 1
|
14
|
+
|
15
|
+
without_post_id:
|
16
|
+
id: 3
|
17
|
+
name: John
|
18
|
+
email: john@example.com
|
19
|
+
body: Body of the comment
|
20
|
+
post_id:
|
21
|
+
|
22
|
+
with_post_id:
|
23
|
+
id: 4
|
24
|
+
name: Me
|
25
|
+
email: me@example.com
|
26
|
+
body: Body of the comment
|
27
|
+
post_id: 1
|
@@ -0,0 +1,41 @@
|
|
1
|
+
published:
|
2
|
+
id: 1
|
3
|
+
title: Published Page
|
4
|
+
body: Content of the published page.
|
5
|
+
is_published: true
|
6
|
+
parent_id:
|
7
|
+
|
8
|
+
unpublished:
|
9
|
+
id: 2
|
10
|
+
title: Unpublished Page
|
11
|
+
body: Content of the unpublished page.
|
12
|
+
is_published: false
|
13
|
+
parent_id: 1
|
14
|
+
|
15
|
+
section:
|
16
|
+
id: 3
|
17
|
+
title: Section
|
18
|
+
body: This is a section.
|
19
|
+
is_published: true
|
20
|
+
parent_id:
|
21
|
+
|
22
|
+
subsection_1:
|
23
|
+
id: 4
|
24
|
+
title: Subsection 1
|
25
|
+
body: This is a subsection.
|
26
|
+
is_published: true
|
27
|
+
parent_id: 3
|
28
|
+
|
29
|
+
subsection_2:
|
30
|
+
id: 5
|
31
|
+
title: Subsection 2
|
32
|
+
body: This is a subsection.
|
33
|
+
is_published: true
|
34
|
+
parent_id: 3
|
35
|
+
|
36
|
+
subsubsection:
|
37
|
+
id: 6
|
38
|
+
title: Subsubsection
|
39
|
+
body: This is a subsubsection.
|
40
|
+
is_published: true
|
41
|
+
parent_id: 5
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# Belongs to admin.
|
2
|
+
published:
|
3
|
+
id: 1
|
4
|
+
title: Title One
|
5
|
+
body: This is the body.
|
6
|
+
created_at: <%= 7.days.ago.to_s(:db) %>
|
7
|
+
updated_at: <%= 7.days.ago.to_s(:db) %>
|
8
|
+
status: true
|
9
|
+
typus_user_id: 1
|
10
|
+
|
11
|
+
# Belongs to editor.
|
12
|
+
unpublished:
|
13
|
+
id: 2
|
14
|
+
title: Title Two
|
15
|
+
body: This is the body.
|
16
|
+
created_at: <%= 6.days.ago.to_s(:db) %>
|
17
|
+
updated_at: <%= 6.days.ago.to_s(:db) %>
|
18
|
+
status: false
|
19
|
+
typus_user_id: 1
|
20
|
+
|
21
|
+
owned_by_admin:
|
22
|
+
id: 3
|
23
|
+
title: Owned by admin
|
24
|
+
body: This is the body.
|
25
|
+
created_at: <%= 5.days.ago.to_s(:db) %>
|
26
|
+
updated_at: <%= 5.days.ago.to_s(:db) %>
|
27
|
+
status: false
|
28
|
+
typus_user_id: 1
|
29
|
+
|
30
|
+
owned_by_editor:
|
31
|
+
id: 4
|
32
|
+
title: Owned by editor
|
33
|
+
body: This is the body.
|
34
|
+
created_at: <%= 4.days.ago.to_s(:db) %>
|
35
|
+
updated_at: <%= 4.days.ago.to_s(:db) %>
|
36
|
+
status: false
|
37
|
+
typus_user_id: 2
|
@@ -0,0 +1,54 @@
|
|
1
|
+
admin:
|
2
|
+
id: 1
|
3
|
+
first_name: Admin
|
4
|
+
last_name: Example
|
5
|
+
role: admin
|
6
|
+
email: admin@example.com
|
7
|
+
status: true
|
8
|
+
token: 1A2B3C4D5E6F
|
9
|
+
salt: admin
|
10
|
+
crypted_password: <%= Digest::SHA1.hexdigest("--admin--#{12345678}") %>
|
11
|
+
|
12
|
+
editor:
|
13
|
+
id: 2
|
14
|
+
first_name: Editor
|
15
|
+
last_name: Example
|
16
|
+
role: editor
|
17
|
+
email: editor@example.com
|
18
|
+
status: true
|
19
|
+
token: A2B3C4D5E6F1
|
20
|
+
salt: editor
|
21
|
+
crypted_password: <%= Digest::SHA1.hexdigest("--editor--#{12345678}") %>
|
22
|
+
|
23
|
+
disabled_user:
|
24
|
+
id: 3
|
25
|
+
first_name: Typus
|
26
|
+
last_name: User
|
27
|
+
role: editor
|
28
|
+
email: disabled_user@example.com
|
29
|
+
status: false
|
30
|
+
token: 2B3C4D5E6F1A
|
31
|
+
salt: disabled_user
|
32
|
+
crypted_password: <%= Digest::SHA1.hexdigest("--disabled_user--#{12345678}") %>
|
33
|
+
|
34
|
+
designer:
|
35
|
+
id: 4
|
36
|
+
first_name: Designer
|
37
|
+
last_name: Example
|
38
|
+
role: designer
|
39
|
+
email: designer@example.com
|
40
|
+
status: true
|
41
|
+
token: B3C4D5E6F1A2
|
42
|
+
salt: designer
|
43
|
+
crypted_password: <%= Digest::SHA1.hexdigest("--designer--#{12345678}") %>
|
44
|
+
|
45
|
+
removed_role:
|
46
|
+
id: 5
|
47
|
+
first_name: Removed
|
48
|
+
last_name: Example
|
49
|
+
role: removed
|
50
|
+
email: removed@example.com
|
51
|
+
status: true
|
52
|
+
token: 3C4D5E6F1A2B
|
53
|
+
salt: removed_role
|
54
|
+
crypted_password: <%= Digest::SHA1.hexdigest("--removed_role--#{12345678}") %>
|