typus 3.1.4 → 3.1.5

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/CHANGELOG CHANGED
@@ -1,4 +1,14 @@
1
- = 3.2.0 (unreleased)
1
+ = 3.1.5 (2011-12-10)
2
+
3
+ * [CHANGED] Association tables now contain a "show" link.
4
+
5
+ * [FIXED] Generators check if there's a database connection.
6
+
7
+ * [CHANGED] ActsAsList module now can only perform whitelisted actions.
8
+
9
+ * [CHANGED] ActsAsList hooks moved completely to it's module.
10
+
11
+ * [CHANGED] Repository moved again to http://github.com/fesplugas/typus
2
12
 
3
13
  = 3.1.4
4
14
 
data/Gemfile CHANGED
@@ -52,18 +52,18 @@ gem "rack-cache", :require => "rack/cache"
52
52
  gem "paperclip", "~> 2.4.2"
53
53
 
54
54
  # MongoDB
55
- gem "mongoid", "~> 2.3.0"
56
- gem "bson_ext", "~> 1.4.0"
55
+ gem "mongoid", "~> 2.3.4"
56
+ gem "bson_ext", "~> 1.5.1"
57
57
 
58
58
  group :test do
59
- gem "shoulda-context", "~> 1.0.0.beta1"
59
+ gem "shoulda-context", "~> 1.0.0"
60
60
  gem "mocha" # Make sure mocha is loaded at the end ...
61
61
  end
62
62
 
63
63
  # Remember to install the Chrome or Safari extension, otherwise it doesn't
64
64
  # make sense to have this here.
65
65
  group :development do
66
- gem "guard-livereload"
66
+ # gem "guard-livereload"
67
67
  # gem "rb-fsevent"
68
68
  # gem "growl_notify"
69
69
  end
data/README.md CHANGED
@@ -32,7 +32,7 @@ Add **Typus** to your `Gemfile`
32
32
  gem 'typus'
33
33
 
34
34
  # Bundle edge Typus instead:
35
- # gem 'typus', :git => 'git://github.com/typus/typus.git'
35
+ # gem 'typus', :git => 'git://github.com/fesplugas/typus.git'
36
36
 
37
37
  Update your bundle, run the generator and start the application server:
38
38
 
@@ -46,7 +46,7 @@ and go to <http://0.0.0.0:3000/admin>.
46
46
 
47
47
  To test, clone the repo and run the following commands:
48
48
 
49
- $ git clone git://github.com/typus/typus.git
49
+ $ git clone git://github.com/fesplugas/typus.git
50
50
  $ bundle install --path vendor/bundle
51
51
  $ bundle exec rake
52
52
 
@@ -60,15 +60,15 @@ user to be able to run tests.
60
60
  - [Documentation](http://docs.typuscmf.com/)
61
61
  - [RubyGems][typus_gem]
62
62
  - [Mailing List](http://groups.google.com/group/typus)
63
- - [Contributors List](http://github.com/typus/typus/contributors)
63
+ - [Contributors List](http://github.com/fesplugas/typus/contributors)
64
64
 
65
65
  ## License
66
66
 
67
67
  **Typus** is released under the MIT license.
68
68
 
69
- [typus]: http://github.com/typus/typus
69
+ [typus]: http://github.com/fesplugas/typus
70
70
  [typus_demo]: http://demo.typuscmf.com/
71
- [typus_locales]: https://github.com/typus/typus/tree/master/config/locales
71
+ [typus_locales]: https://github.com/fesplugas/typus/tree/master/config/locales
72
72
  [typus_gem]: http://rubygems.org/gems/typus
73
73
  [paperclip]: http://rubygems.org/gems/paperclip
74
74
  [dragonfly]: http://rubygems.org/gems/dragonfly
@@ -5,7 +5,7 @@ class Admin::ResourcesController < Admin::BaseController
5
5
  include Typus::Controller::Format
6
6
  include Typus::Controller::Headless
7
7
 
8
- Whitelist = [:edit, :update, :destroy, :toggle, :position, :relate, :unrelate]
8
+ Whitelist = [:edit, :update, :destroy, :toggle]
9
9
 
10
10
  before_filter :get_model
11
11
  before_filter :set_context
@@ -43,6 +43,7 @@ module Admin::Resources::DataTypes::HasManyHelper
43
43
 
44
44
  def set_has_many_resource_actions
45
45
  @resource_actions = [["Edit", { :action => "edit", :_popup => true }, { :class => 'iframe_with_page_reload' }],
46
+ ["Show", { :action => "show", :_popup => true }, { :class => 'iframe'}],
46
47
  ["Trash", { :action => "destroy" }, { :confirm => "Trash?" } ]]
47
48
  end
48
49
 
@@ -1,7 +1,7 @@
1
1
  <div class="box_relationships" id="<%= association_name %>">
2
2
 
3
3
  <h2>
4
- <%= association_name.titleize.humanize.pluralize %>
4
+ <%= @model_to_relate.model_name.human.pluralize %>
5
5
  <small><%= add_new %></small>
6
6
  </h2>
7
7
 
@@ -7,6 +7,7 @@ es:
7
7
  "Active": "Activo"
8
8
  "Add": "Añadir"
9
9
  "Add New": "Añadir nuevo"
10
+ "Add New %{resource}": "Añadir Nuevo %{resource}"
10
11
  "All": "Todos"
11
12
  "Are you sure?": "¿Estás seguro?"
12
13
  "Are you sure you want to sign out and end your session?": "¿Estás seguro que quieres salir y cerrar la sessión?"
@@ -16,6 +17,7 @@ es:
16
17
 
17
18
  "Dashboard": "Panel de control"
18
19
  "Down": "Bajar"
20
+ "Applications": "Applicaciones"
19
21
 
20
22
  "Edit": "Editar"
21
23
  "Edit %{resource}": "Editar %{resource}"
@@ -50,6 +52,9 @@ es:
50
52
  "Reset password": "Cambiar contraseña"
51
53
  "Resources": "Recursos"
52
54
 
55
+ "Save": "Guardar"
56
+ "Save and add another": "Guardar y añadir nuevo"
57
+ "Save and continue editing": "Guardar y seguir editando"
53
58
  "Save %{resource}": "Guardar %{resource}"
54
59
  "Search": "Buscar"
55
60
  "Show": "Mostrar"
@@ -28,7 +28,7 @@ Description:
28
28
 
29
29
  def fields_for(model, *defaults)
30
30
  rejections = %w( ^id$ _type$ type created_at created_on updated_at updated_on deleted_at ).join("|")
31
- fields = model.table_exists? ? model.columns.map(&:name) : defaults
31
+ fields = ActiveRecord::Base.connected? && model.table_exists? ? model.columns.map(&:name) : defaults
32
32
  fields.reject { |f| f.match(rejections) }.join(", ")
33
33
  end
34
34
 
@@ -2,6 +2,11 @@ module Typus
2
2
  module Controller
3
3
  module ActsAsList
4
4
 
5
+ def self.included(base)
6
+ base.before_filter :get_object, :only => [:position]
7
+ base.before_filter :check_resource_ownership, :only => [:position]
8
+ end
9
+
5
10
  ##
6
11
  # This module is designed to work with `acts_as_list`.
7
12
  #
@@ -13,9 +18,13 @@ module Typus
13
18
  # - move_to_bottom
14
19
  #
15
20
  def position
16
- @item.send(params[:go])
17
- notice = Typus::I18n.t("%{model} successfully updated.", :model => @resource.model_name.human)
18
- redirect_to :back, :notice => notice
21
+ if %w(move_to_top move_higher move_lower move_to_bottom).include?(params[:go])
22
+ @item.send(params[:go])
23
+ notice = Typus::I18n.t("%{model} successfully updated.", :model => @resource.model_name.human)
24
+ redirect_to :back, :notice => notice
25
+ else
26
+ not_allowed
27
+ end
19
28
  end
20
29
 
21
30
  end
@@ -56,24 +56,19 @@ module Typus
56
56
  self.preferences[:locale] = locale
57
57
  end
58
58
 
59
- # Returns self if the password is correct, otherwise false.
60
59
  def authenticate(unencrypted_password)
61
- if BCrypt::Password.new(password_digest) == unencrypted_password
62
- self
63
- else
64
- false
65
- end
60
+ equal = BCrypt::Password.new(password_digest) == unencrypted_password
61
+ equal ? self : false
66
62
  end
67
63
 
68
- # Encrypts the password into the password_digest attribute.
69
64
  def password=(unencrypted_password)
70
65
  @password = unencrypted_password
71
66
  self.password_digest = BCrypt::Password.create(unencrypted_password)
72
67
  end
73
68
 
74
- def password_must_be_strong
75
- if password.present?
76
- errors.add(:password, :too_short, :count => 7) unless password.size > 6
69
+ def password_must_be_strong(count = 6)
70
+ if password.present? && password.size < count
71
+ errors.add(:password, :too_short, :count => count)
77
72
  end
78
73
  end
79
74
 
@@ -1,3 +1,3 @@
1
1
  module Typus
2
- VERSION = "3.1.4"
2
+ VERSION = "3.1.5"
3
3
  end
@@ -7,7 +7,7 @@ require "typus/version"
7
7
 
8
8
  files = `git ls-files`.split("\n")
9
9
  test_files = `git ls-files -- test/*`.split("\n")
10
- ignores = `git ls-files -- doc/* Guardfile .travis.yml .gitignor .travis.yml .gitignore`.split("\n")
10
+ ignores = `git ls-files -- doc/* Guardfile .travis.yml .gitignore`.split("\n")
11
11
 
12
12
  # Describe your gem and declare its dependencies:
13
13
  Gem::Specification.new do |s|
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.4
4
+ version: 3.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-06 00:00:00.000000000 +02:00
13
- default_executable:
12
+ date: 2011-12-10 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: bcrypt-ruby
17
- requirement: &70187560417180 !ruby/object:Gem::Requirement
16
+ requirement: &70133893099040 !ruby/object:Gem::Requirement
18
17
  none: false
19
18
  requirements:
20
19
  - - ~>
@@ -22,10 +21,10 @@ dependencies:
22
21
  version: 3.0.0
23
22
  type: :runtime
24
23
  prerelease: false
25
- version_requirements: *70187560417180
24
+ version_requirements: *70133893099040
26
25
  - !ruby/object:Gem::Dependency
27
26
  name: jquery-rails
28
- requirement: &70187560415940 !ruby/object:Gem::Requirement
27
+ requirement: &70133893112440 !ruby/object:Gem::Requirement
29
28
  none: false
30
29
  requirements:
31
30
  - - ! '>='
@@ -33,10 +32,10 @@ dependencies:
33
32
  version: '0'
34
33
  type: :runtime
35
34
  prerelease: false
36
- version_requirements: *70187560415940
35
+ version_requirements: *70133893112440
37
36
  - !ruby/object:Gem::Dependency
38
37
  name: kaminari
39
- requirement: &70187560414840 !ruby/object:Gem::Requirement
38
+ requirement: &70133893109900 !ruby/object:Gem::Requirement
40
39
  none: false
41
40
  requirements:
42
41
  - - ! '>='
@@ -44,10 +43,10 @@ dependencies:
44
43
  version: '0'
45
44
  type: :runtime
46
45
  prerelease: false
47
- version_requirements: *70187560414840
46
+ version_requirements: *70133893109900
48
47
  - !ruby/object:Gem::Dependency
49
48
  name: rails
50
- requirement: &70187560412760 !ruby/object:Gem::Requirement
49
+ requirement: &70133893108560 !ruby/object:Gem::Requirement
51
50
  none: false
52
51
  requirements:
53
52
  - - ~>
@@ -55,7 +54,7 @@ dependencies:
55
54
  version: 3.1.0
56
55
  type: :runtime
57
56
  prerelease: false
58
- version_requirements: *70187560412760
57
+ version_requirements: *70133893108560
59
58
  description: Ruby on Rails Admin Panel (Engine) to allow trusted users edit structured
60
59
  content.
61
60
  email:
@@ -316,7 +315,6 @@ files:
316
315
  - vendor/assets/formalize/images/select_arrow.gif
317
316
  - vendor/assets/formalize/js/jquery.formalize.min.js
318
317
  - vendor/assets/jquery-searchField/jquery.searchField.js
319
- has_rdoc: true
320
318
  homepage: http://www.typuscmf.com/
321
319
  licenses: []
322
320
  post_install_message:
@@ -331,8 +329,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
331
329
  version: '0'
332
330
  segments:
333
331
  - 0
334
- segments_generated: true
335
- hash: -737197900168303605
332
+ hash: -4534583435995700232
336
333
  required_rubygems_version: !ruby/object:Gem::Requirement
337
334
  none: false
338
335
  requirements:
@@ -341,11 +338,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
341
338
  version: '0'
342
339
  segments:
343
340
  - 0
344
- segments_generated: true
345
- hash: -737197900168303605
341
+ hash: -4534583435995700232
346
342
  requirements: []
347
343
  rubyforge_project: typus
348
- rubygems_version: 1.3.9.3
344
+ rubygems_version: 1.8.11
349
345
  signing_key:
350
346
  specification_version: 3
351
347
  summary: Effortless backend interface for Ruby on Rails applications. (Admin scaffold