active_admin_datetimepicker 0.7.4 → 1.1.0

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
  SHA256:
3
- metadata.gz: 15f98b11567aa0f6a378da8943a0f3fc48512906dbc4c43c8589e5cfb1238172
4
- data.tar.gz: e5b599f3c441b9843545156228eef9db4e4d7727606844c0beff5416d46e62fc
3
+ metadata.gz: f07bf8bae7ede7803d15356b3760742b3fc8606be54e6ac48ac87c2c90e9dc44
4
+ data.tar.gz: d759dfd7b84437b90ac99473c8e8a2a047973a20c73621d5792bd137b07263cf
5
5
  SHA512:
6
- metadata.gz: 15c365b5f317889da065fa694cf64cfd68a289e26f9407df5e41436dab71c3991a226c5dcb181b22be70625d392e58828af6962bc0f7be18e0cbb37072c5a794
7
- data.tar.gz: 8a3813adde99405f377f87779038702fcd877b4a73abe05908d3075a126f4c7e6f374e5828f377014b8c1f76d6595a9720be4c6b9ecb05e8c35d8623985ac47e
6
+ metadata.gz: e6ea079b52eca0add771eca873499ee05cc2f13c317825b74cf8fcb421af861349669f409348a194733b7949cea88c5b3844ebeafaccb90b3346841bad35c8b7
7
+ data.tar.gz: e100c85411f315881fbff0d0a25438acde9ad1d5a261b40bd29271e5f75c3b9ab0f72c97bdd61131f9f09e8cc5e5fff8211390786753bff84689240c8d5b0f9f
@@ -0,0 +1,44 @@
1
+ name: CI
2
+ on:
3
+ pull_request:
4
+ push:
5
+ branches:
6
+ - master
7
+ jobs:
8
+ test:
9
+ name: Tests with Ruby ${{ matrix.ruby }} Rails ${{ matrix.rails }} Active Admin ${{ matrix.activeadmin }}
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ matrix:
13
+ ruby:
14
+ - '3.0.0'
15
+ - '3.1.0'
16
+ - '3.2.0'
17
+ - '3.3.0'
18
+ rails:
19
+ - '6.1.0'
20
+ - '7.0.0'
21
+ - '7.1.0'
22
+ activeadmin:
23
+ - '2.14.0'
24
+ - '3.0.0'
25
+ - '3.1.0'
26
+ - '3.2.0'
27
+ exclude:
28
+ - rails: '7.1.0'
29
+ activeadmin: '2.14.0'
30
+ - rails: '7.1.0'
31
+ activeadmin: '3.0.0'
32
+ env:
33
+ RAILS: ${{ matrix.rails }}
34
+ AA: ${{ matrix.activeadmin }}
35
+ steps:
36
+ - uses: actions/checkout@v4
37
+ - uses: ruby/setup-ruby@v1
38
+ with:
39
+ ruby-version: ${{ matrix.ruby }}
40
+ - name: Run tests
41
+ run: |
42
+ gem install bundler -v '< 2'
43
+ bundle install
44
+ bundle exec rspec spec
data/Gemfile CHANGED
@@ -4,15 +4,15 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  group :test do
7
- default_rails_version = '6.0.0'
8
- default_activeadmin_version = '2.6.0'
7
+ default_rails_version = '7.1.0'
8
+ default_activeadmin_version = '3.1.0'
9
9
 
10
10
  gem 'rails', "~> #{ENV['RAILS'] || default_rails_version}"
11
11
  gem 'activeadmin', "~> #{ENV['AA'] || default_activeadmin_version}"
12
12
 
13
- gem 'sprockets-rails', '3.0.4'
13
+ gem 'sprockets-rails'
14
14
  gem 'rspec-rails'
15
- gem 'coveralls', require: false # Test coverage website. Go to https://coveralls.io
15
+ gem 'coveralls_reborn', require: false
16
16
  gem 'sass-rails'
17
17
  gem 'sqlite3', '~> 1.4.0'
18
18
  gem 'launchy'
@@ -20,4 +20,5 @@ group :test do
20
20
  gem 'capybara'
21
21
  gem 'webdrivers'
22
22
  gem 'byebug'
23
+ gem 'webrick', require: false
23
24
  end
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/active_admin_datetimepicker.svg)](http://badge.fury.io/rb/active_admin_datetimepicker)
2
+ [![NPM Version](https://badge.fury.io/js/@activeadmin-plugins%2Factive_admin_datetimepicker.svg)](https://badge.fury.io/js/@activeadmin-plugins%2Factive_admin_datetimepicker)
3
+ ![npm](https://img.shields.io/npm/dm/@activeadmin-plugins/active_admin_datetimepicker)
2
4
  [![Build Status](https://img.shields.io/travis/activeadmin-plugins/active_admin_datetimepicker.svg)](https://travis-ci.org/activeadmin-plugins/active_admin_datetimepicker)
3
5
  [![Coverage](https://coveralls.io/repos/activeadmin-plugins/active_admin_datetimepicker/badge.svg?branch=master)](https://coveralls.io/r/activeadmin-plugins/active_admin_datetimepicker)
4
6
 
@@ -24,7 +26,8 @@ Or install it yourself as:
24
26
 
25
27
  $ gem install active_admin_datetimepicker
26
28
 
27
- Add the following line into `app/assets/stylesheets/active_admin.css.scss`:
29
+ ##### Using assets via Sprockets
30
+ Add the following line into `app/assets/stylesheets/active_admin.scss`:
28
31
 
29
32
  ```css
30
33
  @import "active_admin_datetimepicker";
@@ -36,10 +39,42 @@ Add the following line into `app/assets/javascripts/active_admin.js`:
36
39
  //= require active_admin_datetimepicker
37
40
  ```
38
41
 
42
+ ##### Using assets via Webpacker (or any other assets bundler) as a NPM module (Yarn package)
43
+
44
+ Execute:
45
+
46
+ $ npm i @activeadmin-plugins/active_admin_datetimepicker
47
+
48
+ Or
49
+
50
+ $ yarn add @activeadmin-plugins/active_admin_datetimepicker
51
+
52
+ Or add manually to `package.json`:
53
+
54
+ ```
55
+ "dependencies": {
56
+ "@activeadmin-plugins/active_admin_datetimepicker": "1.0.0"
57
+ }
58
+ ```
59
+ and execute:
60
+
61
+ $ yarn
62
+
63
+ Add the following line into `app/assets/javascripts/active_admin.js`:
64
+
65
+ ```javascript
66
+ import '@activeadmin-plugins/active_admin_datetimepicker';
67
+ ```
68
+
69
+ Add the following line into `app/assets/stylesheets/active_admin.scss`:
70
+
71
+ ```css
72
+ @import '@activeadmin-plugins/active_admin_datetimepicker';
73
+ ```
39
74
 
40
75
  ## Usage
41
76
 
42
- This plugin adds the `date_time_picker` input and `date_time_range` filter, which use the [XDSoft DateTime Picker gem](https://github.com/shekibobo/xdan-datetimepicker-rails).
77
+ This plugin adds the `date_time_picker` input and `date_time_range` filter, which use the [XDSoft DateTime Picker](https://github.com/xdan/datetimepicker/).
43
78
 
44
79
  The `date_time_picker` input accepts many of the options available to the standard jQueryUI Datepicker. For example:
45
80
 
@@ -19,7 +19,5 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_dependency "coffee-rails"
23
- spec.add_dependency "activeadmin", ">= 1.1", "< 3.a"
24
- spec.add_dependency "xdan-datetimepicker-rails", "~> 2.5.4"
22
+ spec.add_dependency "activeadmin", ">= 2.14.0", "< 4.0"
25
23
  end
@@ -0,0 +1,25 @@
1
+ //= require vendor/jquery.datetimepicker.full
2
+
3
+ function setupDateTimePicker(container) {
4
+ const defaults = {
5
+ formatDate: 'y-m-d',
6
+ format: 'Y-m-d H:i',
7
+ allowBlank: true,
8
+ defaultSelect: false,
9
+ validateOnBlur: false
10
+ }
11
+
12
+ $(container).find('input.date-time-picker').each(function(index, entry) {
13
+ $(entry).datetimepicker($.extend(defaults, $(entry).data('datepicker-options')));
14
+ });
15
+ }
16
+
17
+ function initXdanDateTimePickerPlugin() {
18
+ setupDateTimePicker($('body'));
19
+ $(document).on('has_many_add:after', '.has_many_container', function(e, fieldset) {
20
+ setupDateTimePicker(fieldset);
21
+ });
22
+ }
23
+
24
+ $(document).ready(initXdanDateTimePickerPlugin);
25
+ $(document).on('turbolinks:load', initXdanDateTimePickerPlugin());