typus 3.1.0.rc11 → 3.1.0.rc12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/.gitignore +4 -16
  2. data/.gitmodules +3 -6
  3. data/README.md +50 -16
  4. data/Rakefile +19 -26
  5. data/app/helpers/admin/resources/data_types/belongs_to_helper.rb +15 -18
  6. data/app/helpers/admin/resources/data_types/position_helper.rb +9 -11
  7. data/app/helpers/admin/resources/form_helper.rb +13 -13
  8. data/app/helpers/admin/resources/relationships_helper.rb +4 -1
  9. data/app/helpers/admin/resources/table_helper.rb +11 -14
  10. data/app/helpers/admin/resources_helper.rb +12 -3
  11. data/app/themes/default/assets/javascripts/typus/jquery.application.js +0 -6
  12. data/app/themes/default/assets/stylesheets/typus/pagination.css +1 -2
  13. data/app/themes/default/views/admin/base/user_guide.html.erb +25 -27
  14. data/app/themes/default/views/admin/dashboard/_applications.html.erb +2 -10
  15. data/app/themes/default/views/admin/dashboard/_sidebar.html.erb +9 -2
  16. data/app/themes/default/views/admin/dashboard/styles.html.erb +10 -15
  17. data/app/themes/default/views/admin/resources/_form.html.erb +4 -2
  18. data/app/themes/default/views/admin/resources/_form_javascripts.html.erb +0 -0
  19. data/app/themes/default/views/admin/templates/README.md +5 -0
  20. data/app/themes/default/views/admin/templates/_dragonfly.html.erb +1 -0
  21. data/app/themes/default/views/admin/templates/_has_one.html.erb +1 -1
  22. data/app/themes/default/views/admin/templates/_position.html.erb +5 -0
  23. data/app/themes/default/views/admin/templates/_profile_sidebar.html.erb +2 -1
  24. data/app/themes/default/views/admin/templates/_selector.html.erb +4 -1
  25. data/app/themes/default/views/admin/templates/_text_with_ckeditor.html.erb +0 -4
  26. data/app/themes/default/views/helpers/admin/resources/_filters.html.erb +1 -3
  27. data/app/themes/default/views/helpers/admin/resources/_sidebar.html.erb +6 -9
  28. data/app/themes/default/views/helpers/admin/resources/_table.html.erb +11 -13
  29. data/lib/generators/templates/config/initializers/typus_resources.rb +1 -1
  30. data/lib/generators/templates/config/typus/README +1 -1
  31. data/lib/typus.rb +15 -26
  32. data/lib/typus/authentication/base.rb +4 -0
  33. data/lib/typus/authentication/http_basic.rb +2 -2
  34. data/lib/typus/authentication/session.rb +3 -5
  35. data/lib/typus/configuration.rb +14 -12
  36. data/lib/typus/controller/filters.rb +22 -0
  37. data/lib/typus/i18n.rb +17 -0
  38. data/lib/typus/orm/active_record/user/class_methods.rb +1 -1
  39. data/lib/typus/orm/base.rb +2 -2
  40. data/lib/typus/resources.rb +1 -1
  41. data/lib/typus/version.rb +1 -1
  42. metadata +21 -26
  43. data/.yardopts +0 -6
  44. data/Gemfile +0 -60
  45. data/doc/yard/handlers/configurable_attr_handler.rb +0 -38
  46. data/doc/yard/setup.rb +0 -9
  47. data/doc/yard/templates/default/fulldoc/html/css/common.css +0 -109
  48. data/doc/yard/templates/default/layout/html/layout.erb +0 -126
  49. data/doc/yard/templates/default/module/html/configuration_summary.erb +0 -31
  50. data/doc/yard/templates/default/module/setup.rb +0 -17
@@ -1,3 +1,25 @@
1
+ ##
2
+ # How predefined filters work?
3
+ #
4
+ # On your controllers ...
5
+ #
6
+ # def index
7
+ # # Added predefined filter takes any argumes, but in the views we
8
+ # # expected the following:
9
+ # #
10
+ # # add_predefined_filter(filter_name, action, scope)
11
+ # #
12
+ # ...
13
+ # add_predefined_filter("Trash", "trash", "deleted")
14
+ # ...
15
+ # end
16
+ #
17
+ # On your views ...
18
+ #
19
+ # <% predefined_filters.each do |filter_name, action, scope| %>
20
+ # ...
21
+ # <% end %>
22
+ #
1
23
  module Typus
2
24
  module Controller
3
25
  module Filters
@@ -1,3 +1,5 @@
1
+ # -*- encoding: utf-8 -*-
2
+
1
3
  module Typus
2
4
  module I18n
3
5
 
@@ -26,6 +28,21 @@ module Typus
26
28
  :en
27
29
  end
28
30
 
31
+ def available_locales
32
+ { "Brazilian Portuguese" => "pt-BR",
33
+ "Català" => "ca",
34
+ "German" => "de",
35
+ "Greek" => "el",
36
+ "Italiano" => "it",
37
+ "English" => "en",
38
+ "Español" => "es",
39
+ "Français" => "fr",
40
+ "Magyar" => "hu",
41
+ "Portuguese" => "pt-PT",
42
+ "Russian" => "ru",
43
+ "中文" => "zh-CN" }
44
+ end
45
+
29
46
  end
30
47
 
31
48
  end
@@ -19,7 +19,7 @@ module Typus
19
19
  end
20
20
 
21
21
  def locale
22
- Typus.locales
22
+ Typus::I18n.available_locales
23
23
  end
24
24
 
25
25
  end
@@ -58,7 +58,7 @@ module Typus
58
58
  # With Typus::Resources we some application defaults.
59
59
  #
60
60
  # Typus::Resources.setup do |config|
61
- # config.per_page = 15
61
+ # config.per_page = 25
62
62
  # end
63
63
  #
64
64
  # If for any reason we need a better default for an specific resource we
@@ -67,7 +67,7 @@ module Typus
67
67
  # Post:
68
68
  # ...
69
69
  # options:
70
- # per_page: 15
70
+ # per_page: 25
71
71
  #++
72
72
  def typus_options_for(filter)
73
73
  options = read_model_config['options']
@@ -28,7 +28,7 @@ module Typus
28
28
  @@only_user_items = false
29
29
 
30
30
  mattr_accessor :per_page
31
- @@per_page = 15
31
+ @@per_page = 25
32
32
 
33
33
  mattr_accessor :sortable
34
34
  @@sortable = true
@@ -1,3 +1,3 @@
1
1
  module Typus
2
- VERSION = "3.1.0.rc11"
2
+ VERSION = "3.1.0.rc12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: typus
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.rc11
4
+ version: 3.1.0.rc12
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-06-27 00:00:00.000000000Z
12
+ date: 2011-07-07 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dragonfly
16
- requirement: &2161117880 !ruby/object:Gem::Requirement
16
+ requirement: &2152822480 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0.9'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *2161117880
24
+ version_requirements: *2152822480
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: jquery-rails
27
- requirement: &2161117460 !ruby/object:Gem::Requirement
27
+ requirement: &2152821960 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2161117460
35
+ version_requirements: *2152821960
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: paperclip
38
- requirement: &2161117000 !ruby/object:Gem::Requirement
38
+ requirement: &2152821460 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2161117000
46
+ version_requirements: *2152821460
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rack-cache
49
- requirement: &2161116580 !ruby/object:Gem::Requirement
49
+ requirement: &2152821020 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2161116580
57
+ version_requirements: *2152821020
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rails-trash
60
- requirement: &2161116080 !ruby/object:Gem::Requirement
60
+ requirement: &2152820440 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 1.1.1
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2161116080
68
+ version_requirements: *2152820440
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: jquery-rails
71
- requirement: &2161115440 !ruby/object:Gem::Requirement
71
+ requirement: &2152819720 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *2161115440
79
+ version_requirements: *2152819720
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: kaminari
82
- requirement: &2161114760 !ruby/object:Gem::Requirement
82
+ requirement: &2152818880 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *2161114760
90
+ version_requirements: *2152818880
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rails
93
- requirement: &2161114000 !ruby/object:Gem::Requirement
93
+ requirement: &2152817080 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: 3.1.0.rc4
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *2161114000
101
+ version_requirements: *2152817080
102
102
  description: Ruby on Rails Admin Panel (Engine) to allow trusted users edit structured
103
103
  content.
104
104
  email:
@@ -109,8 +109,6 @@ extra_rdoc_files: []
109
109
  files:
110
110
  - .gitignore
111
111
  - .gitmodules
112
- - .yardopts
113
- - Gemfile
114
112
  - MIT-LICENSE
115
113
  - README.md
116
114
  - Rakefile
@@ -164,6 +162,7 @@ files:
164
162
  - app/themes/default/views/admin/mailer/reset_password_link.text.erb
165
163
  - app/themes/default/views/admin/resources/_edit.html.erb
166
164
  - app/themes/default/views/admin/resources/_form.html.erb
165
+ - app/themes/default/views/admin/resources/_form_javascripts.html.erb
167
166
  - app/themes/default/views/admin/resources/_index.html.erb
168
167
  - app/themes/default/views/admin/resources/_new.html.erb
169
168
  - app/themes/default/views/admin/resources/_show.html.erb
@@ -173,6 +172,7 @@ files:
173
172
  - app/themes/default/views/admin/resources/show.html.erb
174
173
  - app/themes/default/views/admin/session/new.html.erb
175
174
  - app/themes/default/views/admin/shared/_head.html.erb
175
+ - app/themes/default/views/admin/templates/README.md
176
176
  - app/themes/default/views/admin/templates/_belongs_to.html.erb
177
177
  - app/themes/default/views/admin/templates/_belongs_to_with_autocomplete.html.erb
178
178
  - app/themes/default/views/admin/templates/_boolean.html.erb
@@ -185,6 +185,7 @@ files:
185
185
  - app/themes/default/views/admin/templates/_paperclip.html.erb
186
186
  - app/themes/default/views/admin/templates/_paperclip_preview.html.erb
187
187
  - app/themes/default/views/admin/templates/_password.html.erb
188
+ - app/themes/default/views/admin/templates/_position.html.erb
188
189
  - app/themes/default/views/admin/templates/_profile_sidebar.html.erb
189
190
  - app/themes/default/views/admin/templates/_selector.html.erb
190
191
  - app/themes/default/views/admin/templates/_string.html.erb
@@ -233,12 +234,6 @@ files:
233
234
  - config/locales/typus.zh-CN.models.yml
234
235
  - config/locales/typus.zh-CN.yml
235
236
  - config/routes.rb
236
- - doc/yard/handlers/configurable_attr_handler.rb
237
- - doc/yard/setup.rb
238
- - doc/yard/templates/default/fulldoc/html/css/common.css
239
- - doc/yard/templates/default/layout/html/layout.erb
240
- - doc/yard/templates/default/module/html/configuration_summary.erb
241
- - doc/yard/templates/default/module/setup.rb
242
237
  - lib/generators/templates/config/initializers/typus.rb
243
238
  - lib/generators/templates/config/initializers/typus_authentication.rb
244
239
  - lib/generators/templates/config/initializers/typus_resources.rb
data/.yardopts DELETED
@@ -1,6 +0,0 @@
1
- --main doc/wiki/home.md
2
- --output doc/site
3
- -e ./doc/yard/setup.rb
4
- -
5
- README.md
6
- doc/wiki/*
data/Gemfile DELETED
@@ -1,60 +0,0 @@
1
- source 'http://rubygems.org'
2
-
3
- # Specify your gem's dependencies in typus.gemspec
4
- gemspec
5
-
6
- gem "sqlite3"
7
- gem "jquery-rails"
8
- gem "ckeditor-rails", "0.0.2"
9
-
10
- # And this stuff needed for the demo application.
11
- gem "acts_as_list"
12
- gem "acts_as_tree"
13
- gem "factory_girl"
14
- gem "rails-trash", "~> 1.1.1"
15
-
16
- # Asset Management
17
- gem "dragonfly", "~> 0.9"
18
- gem "rack-cache", :require => "rack/cache"
19
- gem "paperclip"
20
-
21
- group :test do
22
- gem "shoulda-context"
23
- gem "mocha" # Make sure mocha is loaded at the end ...
24
- end
25
-
26
- group :development, :test do
27
-
28
- platforms :jruby do
29
- gem "activerecord-jdbc-adapter", :require => false
30
-
31
- gem "jdbc-mysql"
32
- gem "jdbc-postgres"
33
- gem "jdbc-sqlite3"
34
-
35
- gem "jruby-openssl" # JRuby limited openssl loaded. http://jruby.org/openssl
36
- end
37
-
38
- platforms :ruby do
39
- gem "mysql2"
40
- gem "pg"
41
- gem "sqlite3"
42
- end
43
-
44
- end
45
-
46
- group :production do
47
-
48
- # gem "mongoid"
49
-
50
- platforms :jruby do
51
- gem "activerecord-jdbc-adapter"
52
- gem "jdbc-sqlite3"
53
- end
54
-
55
- platforms :ruby do
56
- # gem "bson_ext"
57
- gem "sqlite3"
58
- end
59
-
60
- end
@@ -1,38 +0,0 @@
1
- class ConfigurableAttrHandler < YARD::Handlers::Ruby::Legacy::Base
2
- handles(/^\s*configurable_attr/)
3
-
4
- def process
5
- namespace[:configurable_attributes] ||= []
6
-
7
- attribute = token_to_object(statement.tokens[2])
8
- comments = statement.comments.join(' ') if statement.comments
9
-
10
- if statement.block
11
- # e.g. configurable_attr :datastore do FileDataStore.new end
12
- lazy_default_value = statement.block.to_s
13
- else
14
- # e.g. configurable_attr :fallback_mime_type, 'application/octet-stream'
15
- default_value = token_to_object(statement.tokens[5..-1])
16
- end
17
- namespace[:configurable_attributes] << {
18
- :attribute => attribute,
19
- :default_value => default_value,
20
- :lazy_default_value => lazy_default_value,
21
- :comments => comments
22
- }
23
- end
24
-
25
- private
26
-
27
- def token_to_object(token)
28
- if token
29
- if token.is_a?(YARD::Parser::Ruby::Legacy::TokenList)
30
- eval(token.to_s)
31
- else # is a single token
32
- eval(token.text)
33
- end
34
- end
35
- end
36
-
37
- end
38
-
@@ -1,9 +0,0 @@
1
- this_dir = File.dirname(__FILE__)
2
-
3
- YARD::Templates::Engine.register_template_path(this_dir + '/templates')
4
- Dir[this_dir + '/handlers/*.rb'].each do |file|
5
- require File.expand_path(file)
6
- end
7
- YARD::Parser::SourceParser.parser_type = :ruby18
8
-
9
- DRAGONFLY_VERSION = "0.0.0"
@@ -1,109 +0,0 @@
1
- /* Overrides for yard documentation */
2
-
3
- /* Clearfix */
4
- .clearfix:after {
5
- content: ".";
6
- display: block;
7
- clear: both;
8
- visibility: hidden;
9
- line-height: 0;
10
- height: 0;
11
- }
12
-
13
- .clearfix {
14
- display: inline-block;
15
- }
16
-
17
- html[xmlns] .clearfix {
18
- display: block;
19
- }
20
-
21
- * html .clearfix {
22
- height: 1%;
23
- }
24
- /************/
25
-
26
- body {
27
- font-family: "PT Sans",Verdana,Arial,sans-serif;
28
- font-size: 14px;
29
- }
30
-
31
- pre, code, .code,
32
- #filecontents pre.code,
33
- .docstring pre.code,
34
- .source_code pre {
35
- font-family: Inconsolata,Monaco,"Courier New","DejaVu Sans Mono","Bitstream Vera Sans Mono",monospace;
36
- }
37
-
38
- pre.code, code {
39
- background:#F5F5FF;
40
- overflow-x: auto;
41
- }
42
- #filecontents pre.code {
43
- margin:10px 0;
44
- padding:5px 12px;
45
- border-radius:5px;
46
- -webkit-border-radius:5px;
47
- -moz-border-radius:5px;
48
- border: 1px dotted #CCC;
49
- }
50
-
51
- code .val {
52
- color:#036A07;
53
- }
54
- code .kw {
55
- color:#0000FF;
56
- }
57
- code .symbol {
58
- color:#C5060B;
59
- }
60
-
61
- ul.main_files {
62
- list-style-type:none;
63
- margin:0;
64
- padding:0;
65
- font-size:14px;
66
- }
67
- ul.main_files li {
68
- margin:0;
69
- padding:0;
70
- }
71
-
72
- ul.main_files li a {
73
- margin: 0;
74
- padding:3px 12px;
75
- display:block;
76
- cursor:pointer;
77
- }
78
- #content ul.main_files li a:hover {
79
- background-color:#F4F9E4;
80
- }
81
- /* Layout */
82
- #header,
83
- #content,
84
- #footer {
85
- margin:0 auto;
86
- width:1000px;
87
- }
88
- #header #logo {
89
- float:left;
90
- width:50%;
91
- font-size: 32px;
92
- letter-spacing: -1px;
93
- margin-top: 20px;
94
- }
95
- #header #search {
96
- position:static;
97
- float:right;
98
- }
99
- #content .col1 {
100
- float:left;
101
- width: 750px;
102
- }
103
- #content .col2 {
104
- float:left;
105
- margin: 0 0 0 20px;
106
- padding: 0 0 0 20px;
107
- width: 200px;
108
- border-left: 1px dotted #D5D5D5;
109
- }