fesplugas-typus 0.9.0
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.
- data/.gitignore +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +80 -0
- data/Rakefile +61 -0
- data/VERSION +1 -0
- data/app/controllers/admin/master_controller.rb +324 -0
- data/app/controllers/typus_controller.rb +127 -0
- data/app/helpers/admin/form_helper.rb +351 -0
- data/app/helpers/admin/master_helper.rb +99 -0
- data/app/helpers/admin/public_helper.rb +24 -0
- data/app/helpers/admin/sidebar_helper.rb +259 -0
- data/app/helpers/admin/table_helper.rb +227 -0
- data/app/helpers/typus_helper.rb +169 -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 +29 -0
- data/app/views/admin/resources/index.html.erb +28 -0
- data/app/views/admin/resources/new.html.erb +27 -0
- data/app/views/admin/resources/show.html.erb +21 -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 +72 -0
- data/app/views/layouts/typus.html.erb +29 -0
- data/app/views/typus/dashboard.html.erb +13 -0
- data/app/views/typus/recover_password.html.erb +7 -0
- data/app/views/typus/reset_password.html.erb +13 -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/es.yml +106 -0
- data/config/locales/pt-BR.yml +108 -0
- data/config/locales/typus_hacks.yml +14 -0
- data/config/routes.rb +14 -0
- data/generators/typus/templates/config/initializers/typus.rb +27 -0
- data/generators/typus/templates/config/typus/application.yml +45 -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 +709 -0
- data/generators/typus/typus_generator.rb +141 -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/init.rb +19 -0
- data/lib/typus/active_record.rb +298 -0
- data/lib/typus/authentication.rb +155 -0
- data/lib/typus/configuration.rb +92 -0
- data/lib/typus/format.rb +56 -0
- data/lib/typus/generator.rb +173 -0
- data/lib/typus/hash.rb +10 -0
- data/lib/typus/locale.rb +17 -0
- data/lib/typus/object.rb +22 -0
- data/lib/typus/quick_edit.rb +33 -0
- data/lib/typus/reloader.rb +17 -0
- data/lib/typus/string.rb +11 -0
- data/lib/typus/user.rb +137 -0
- data/lib/typus.rb +133 -0
- data/lib/vendor/active_record.rb +15 -0
- data/lib/vendor/paginator.rb +143 -0
- data/tasks/typus_tasks.rake +26 -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 +67 -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_bottom.html.erb +1 -0
- data/test/fixtures/app/views/admin/comments/_edit_sidebar.html.erb +1 -0
- data/test/fixtures/app/views/admin/comments/_edit_top.html.erb +1 -0
- data/test/fixtures/app/views/admin/comments/_index_bottom.html.erb +1 -0
- data/test/fixtures/app/views/admin/comments/_index_sidebar.html.erb +1 -0
- data/test/fixtures/app/views/admin/comments/_index_top.html.erb +1 -0
- data/test/fixtures/app/views/admin/comments/_new_bottom.html.erb +1 -0
- data/test/fixtures/app/views/admin/comments/_new_sidebar.html.erb +1 -0
- data/test/fixtures/app/views/admin/comments/_new_top.html.erb +1 -0
- data/test/fixtures/app/views/admin/comments/_show_bottom.html.erb +1 -0
- data/test/fixtures/app/views/admin/comments/_show_sidebar.html.erb +1 -0
- data/test/fixtures/app/views/admin/comments/_show_top.html.erb +1 -0
- data/test/fixtures/app/views/admin/dashboard/_bottom.html.erb +1 -0
- data/test/fixtures/app/views/admin/dashboard/_sidebar.html.erb +1 -0
- data/test/fixtures/app/views/admin/dashboard/_top.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 +121 -0
- data/test/functional/admin/master_controller_test.rb +5 -0
- data/test/functional/admin/posts_controller_test.rb +278 -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 +315 -0
- data/test/helper.rb +51 -0
- data/test/helpers/admin/form_helper_test.rb +316 -0
- data/test/helpers/admin/master_helper_test.rb +65 -0
- data/test/helpers/admin/public_helper_test.rb +22 -0
- data/test/helpers/admin/sidebar_helper_test.rb +351 -0
- data/test/helpers/admin/table_helper_test.rb +255 -0
- data/test/helpers/typus_helper_test.rb +106 -0
- data/test/lib/active_record_test.rb +372 -0
- data/test/lib/configuration_test.rb +91 -0
- data/test/lib/hash_test.rb +11 -0
- data/test/lib/routes_test.rb +82 -0
- data/test/lib/string_test.rb +25 -0
- data/test/lib/typus_test.rb +105 -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 +138 -0
- data/typus.gemspec +225 -0
- metadata +241 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
###
|
|
2
|
+
## Typus Roles Configuration File
|
|
3
|
+
##
|
|
4
|
+
#
|
|
5
|
+
# admin:
|
|
6
|
+
# Post: create, read, update, delete
|
|
7
|
+
# Category: create, read, update, delete
|
|
8
|
+
#
|
|
9
|
+
# editor:
|
|
10
|
+
# Post: create, read, update
|
|
11
|
+
# Category: read, update
|
|
12
|
+
#
|
|
13
|
+
# You can also define "resources" which are not related to a model,
|
|
14
|
+
# for example to control MemCached, see the Starling queue statistics.
|
|
15
|
+
#
|
|
16
|
+
# admin:
|
|
17
|
+
# Starling: index
|
|
18
|
+
# MemCached: index, cleanup
|
|
19
|
+
#
|
|
20
|
+
###
|
|
21
|
+
|
|
22
|
+
admin:
|
|
23
|
+
<%= configuration[:roles] %>
|
|
@@ -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,21 @@
|
|
|
1
|
+
class CreateTypusUsers < ActiveRecord::Migration
|
|
2
|
+
|
|
3
|
+
def self.up
|
|
4
|
+
create_table :typus_users do |t|
|
|
5
|
+
t.string :first_name, :default => "", :null => false
|
|
6
|
+
t.string :last_name, :default => "", :null => false
|
|
7
|
+
t.string :role, :null => false
|
|
8
|
+
t.string :email, :null => false
|
|
9
|
+
t.boolean :status, :default => false
|
|
10
|
+
t.string :token, :null => false
|
|
11
|
+
t.string :salt, :null => false
|
|
12
|
+
t.string :crypted_password, :null => false
|
|
13
|
+
t.timestamps
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def self.down
|
|
18
|
+
drop_table :typus_users
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Place your application-specific JavaScript functions and classes for
|
|
2
|
+
// Typus here.
|
|
3
|
+
|
|
4
|
+
function externalLinks() {
|
|
5
|
+
if (!document.getElementsByTagName) return;
|
|
6
|
+
var anchors = document.getElementsByTagName("a");
|
|
7
|
+
for (var i=0; i<anchors.length; i++) {
|
|
8
|
+
var anchor = anchors[i];
|
|
9
|
+
if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
|
|
10
|
+
anchor.target = "_blank";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
window.onload = externalLinks;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/* @group Structure Module */
|
|
2
|
+
|
|
3
|
+
body,html {margin:0;padding:0;}
|
|
4
|
+
|
|
5
|
+
/* @end */
|
|
6
|
+
|
|
7
|
+
/* @group Text Module */
|
|
8
|
+
|
|
9
|
+
abbr,acronym,address,blockquote,br,cite,code,dfn,div,em,h1,h2,h3,h4,h5,h6,kbd,p,pre,q,samp,span,strong,var{font-style:normal;font-weight:normal;text-decoration:none;}
|
|
10
|
+
blockquote,code,div,h1,h2,h3,h4,h5,h6,p,span,pre,hr{margin:0;padding:0;}
|
|
11
|
+
h1,h2,h3,h4,h5,h6{font-size:100%;}
|
|
12
|
+
b,i,em,strong,del,ins,u{font-weight:normal;font-style:normal;text-decoration:none;}
|
|
13
|
+
|
|
14
|
+
/* @end */
|
|
15
|
+
|
|
16
|
+
/* @group Hypertext Module */
|
|
17
|
+
|
|
18
|
+
a{text-decoration:none;}
|
|
19
|
+
|
|
20
|
+
/* @end */
|
|
21
|
+
|
|
22
|
+
/* @group List Module */
|
|
23
|
+
|
|
24
|
+
dl,dt,dd,ol,ul,li{margin:0;padding:0;list-style:none;}
|
|
25
|
+
dl,dt,dd,ol,ul,li{padding:0;margin:0;}
|
|
26
|
+
|
|
27
|
+
/* @end */
|
|
28
|
+
|
|
29
|
+
/* @group Forms Module */
|
|
30
|
+
|
|
31
|
+
button,fieldset,form,input,label,legend,select,optgroup,option,textarea{margin:0;padding:0;}
|
|
32
|
+
fieldset{border:0;}
|
|
33
|
+
|
|
34
|
+
/* @end */
|
|
35
|
+
|
|
36
|
+
/* @group Basic Table Module */
|
|
37
|
+
|
|
38
|
+
caption,table,td,th,tr{margin:0;padding:0;font-weight:normal;text-align:left;}
|
|
39
|
+
table{border-collapse:collapse;border-spacing:0;}
|
|
40
|
+
|
|
41
|
+
/* @end */
|
|
42
|
+
|
|
43
|
+
/* @group Image Module */
|
|
44
|
+
|
|
45
|
+
img{border:0;}
|
|
46
|
+
|
|
47
|
+
/* @end */
|
|
48
|
+
|
|
49
|
+
/* @group Object Module */
|
|
50
|
+
|
|
51
|
+
object,param{}
|
|
52
|
+
|
|
53
|
+
/* @end */
|
|
54
|
+
|
|
55
|
+
/* @group Presentation Module */
|
|
56
|
+
|
|
57
|
+
b,big,hr,i,small,sub,sup,tt{font-size:100%;}
|
|
58
|
+
q:before,q:after{content:'';}
|
|
59
|
+
sup {vertical-align:text-top;}
|
|
60
|
+
sub {vertical-align:text-bottom;}
|
|
61
|
+
|
|
62
|
+
/* @end */
|
|
63
|
+
|
|
64
|
+
/* @group Scripting Module */
|
|
65
|
+
|
|
66
|
+
noscript{}
|
|
67
|
+
|
|
68
|
+
/* @end */
|