godmin 0.10.2 → 0.10.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e40d76b92a05a93abe96da5571be9c130ffc032b
4
- data.tar.gz: 9dff03d4ed9a817b8c6bfe790198cde4567eff49
3
+ metadata.gz: 53be376cd7a129561b4522def2402cccb39d3058
4
+ data.tar.gz: 0d6f5077a4d56bbdb7bc4dcdd53fd2175f7383ad
5
5
  SHA512:
6
- metadata.gz: a108a5881c455d848394d2885649091e02d8d7eb67f67b036fe2916b526270e34fade67aa04717755167bb56fe802983ea453ea127cbc691a9e41f5d592503fa
7
- data.tar.gz: 3c38fac47a5cae6f89e8521380be42c411eb51af12e2160a59f91d8e83df2458aa5c5ad85c1f1a3a79069d16d66da115d897eeb10589243db4ef5e29d7747ccd
6
+ metadata.gz: dd9ef0ee561183456d29bdcfb9790f5c7779ac1fd38cd6655a860daff9b7094c2fe7c139956f0a973c42fb876ea6f6d38d4b8bc3f407e01057b27094c04d001b
7
+ data.tar.gz: 904eb969e8b6a2b9086bf630b5efd3ab0113fa6a95aa3472121e10dfb25f6ce6ff4ac758f3b9875888c3aafd1b2c0cfeb4c4ab08c17303c94585d2580b69d91d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ### 0.10.3 - 2015-02-18
4
+ Bug fixes
5
+ - Adds the possibility to pass options to the `date_field` and `datetime_field` form helpers
6
+
3
7
  ### 0.10.2 - 2015-02-16
4
8
  Bug fixes
5
9
  - Fixes standard resource params for multi-word models
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![Build Status](https://img.shields.io/travis/varvet/godmin/master.svg)](https://travis-ci.org/varvet/godmin)
5
5
  [![Code Climate](https://img.shields.io/codeclimate/github/varvet/godmin.svg)](https://codeclimate.com/github/varvet/godmin)
6
6
 
7
- Godmin is an admin engine for Rails 4+.
7
+ Godmin is an admin framework for Rails 4+.
8
8
 
9
9
  - [Installation](#installation)
10
10
  - [Standalone installation](#standalone-installation)
data/godmin.gemspec CHANGED
@@ -10,8 +10,8 @@ Gem::Specification.new do |gem|
10
10
  gem.authors = ["Jens Ljungblad", "Linus Pettersson", "Varvet"]
11
11
  gem.email = ["info@varvet.se"]
12
12
  gem.homepage = "https://github.com/varvet/godmin"
13
- gem.summary = "Godmin is an admin engine for Rails 4+"
14
- gem.description = "Godmin is an admin engine for Rails 4+"
13
+ gem.summary = "Godmin is an admin framework for Rails 4+"
14
+ gem.description = "Godmin is an admin framework for Rails 4+"
15
15
  gem.license = "MIT"
16
16
 
17
17
  gem.files = `git ls-files`.split($/)
@@ -34,11 +34,17 @@ module Godmin
34
34
  end
35
35
 
36
36
  def date_field(attribute, options = {})
37
- text_field(attribute, value: datetime_value(attribute, :datepicker), data: { behavior: "datepicker" })
37
+ text_field(attribute, options.deep_merge(
38
+ value: datetime_value(attribute, options, :datepicker),
39
+ data: { behavior: "datepicker" }
40
+ ))
38
41
  end
39
42
 
40
43
  def datetime_field(attribute, options = {})
41
- text_field(attribute, value: datetime_value(attribute, :datetimepicker), data: { behavior: "datetimepicker" })
44
+ text_field(attribute, options.deep_merge(
45
+ value: datetime_value(attribute, options, :datetimepicker),
46
+ data: { behavior: "datetimepicker" }
47
+ ))
42
48
  end
43
49
 
44
50
  private
@@ -59,8 +65,9 @@ module Godmin
59
65
  @object.class.reflect_on_association(attribute)
60
66
  end
61
67
 
62
- def datetime_value(attribute, format)
63
- @object.send(attribute).try(:strftime, @template.translate_scoped("datetimepickers.#{format}"))
68
+ def datetime_value(attribute, options, format)
69
+ value = options[:value] || @object.send(attribute)
70
+ value.try(:strftime, @template.translate_scoped("datetimepickers.#{format}"))
64
71
  end
65
72
  end
66
73
  end
@@ -1,3 +1,3 @@
1
1
  module Godmin
2
- VERSION = "0.10.2"
2
+ VERSION = "0.10.3"
3
3
  end
data/screenshot.png ADDED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: godmin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.2
4
+ version: 0.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Ljungblad
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-02-16 00:00:00.000000000 Z
13
+ date: 2015-02-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bcrypt
@@ -144,7 +144,7 @@ dependencies:
144
144
  - - ">="
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
- description: Godmin is an admin engine for Rails 4+
147
+ description: Godmin is an admin framework for Rails 4+
148
148
  email:
149
149
  - info@varvet.se
150
150
  executables: []
@@ -227,6 +227,7 @@ files:
227
227
  - lib/godmin/resource/scopes.rb
228
228
  - lib/godmin/version.rb
229
229
  - lib/tasks/godmin_tasks.rake
230
+ - screenshot.png
230
231
  - test/dummy/README.rdoc
231
232
  - test/dummy/Rakefile
232
233
  - test/dummy/app/assets/images/.keep
@@ -297,7 +298,7 @@ rubyforge_project:
297
298
  rubygems_version: 2.2.2
298
299
  signing_key:
299
300
  specification_version: 4
300
- summary: Godmin is an admin engine for Rails 4+
301
+ summary: Godmin is an admin framework for Rails 4+
301
302
  test_files:
302
303
  - test/dummy/README.rdoc
303
304
  - test/dummy/Rakefile