active_admin_datetimepicker 0.7.2 → 1.0.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: 37b0c7a60c75a42f97c60f8c49e759948fe12b8ac2690a4c9526ede227e0116c
4
- data.tar.gz: fa8d55c00d7bcae667b2c93f3dd7c41e3f94c560fc2008a1c2e19bd49467339d
3
+ metadata.gz: 6d14c8bf962657fbcbb8aad0e9c3133583af752ad7988c5d8505afd065f588d4
4
+ data.tar.gz: be5c65e10479834f0da606a7649473f19182fd49ab6d7a0ac87bf3be20871404
5
5
  SHA512:
6
- metadata.gz: f716b3e7188f53333484d9c7d37dd35a792bd33bf8f978ac188854ac3affce37853069e51cce003f1544fb36b875640c550cb281450ba031ddcb2b4f91dcd675
7
- data.tar.gz: 45d2d19f6be5feb0c98d42b70db2e4b58faccc9026c96de7e1f305429a2900b4b58ad61af04a453cda3ba525005391023b5f8c045d87122ea9f35b6d55afb203
6
+ metadata.gz: 2274eb012d94b43a8145ed5f803862a0ff4397074af4059d20958d88d35fcd62c2867125a01d22968492543174543735afd35c5173b2da60e2238209ef435ee6
7
+ data.tar.gz: e5f25cb849a2577be0aa6af197300075eda084373328d5be653e9f956dd5c291cb268b86d34f7a5543e7862f932d8de2726510b163b3819d66fa188d18d7afca
@@ -0,0 +1,39 @@
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
+ - 2.5
15
+ - 2.6
16
+ rails:
17
+ - '5.2.0'
18
+ - '6.0.0'
19
+ activeadmin:
20
+ - '2.0.0'
21
+ - '2.6.0'
22
+ exclude:
23
+ - rails: '5.2.0'
24
+ activeadmin: '2.6.0'
25
+ - rails: '6.0.0'
26
+ activeadmin: '2.0.0'
27
+ env:
28
+ RAILS: ${{ matrix.rails }}
29
+ AA: ${{ matrix.activeadmin }}
30
+ steps:
31
+ - uses: actions/checkout@v2
32
+ - uses: actions/setup-ruby@v1
33
+ with:
34
+ ruby-version: ${{ matrix.ruby }}
35
+ - name: Run tests
36
+ run: |
37
+ gem install bundler -v '< 2'
38
+ bundle install
39
+ bundle exec rspec spec
data/.gitignore CHANGED
@@ -1,4 +1,7 @@
1
+ bin/
1
2
  Gemfile.lock
2
3
  coverage/
3
- spec/rails/rails-5.2.1/
4
+ spec/rails/rails-*
4
5
  pkg
6
+ .bundle
7
+ vendor/bundl
data/Gemfile CHANGED
@@ -4,20 +4,20 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  group :test do
7
- default_rails_version = '5.2.1'
8
- default_activeadmin_version = '2.0.0'
7
+ default_rails_version = '6.0.0'
8
+ default_activeadmin_version = '2.6.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
14
  gem 'rspec-rails'
14
15
  gem 'coveralls', require: false # Test coverage website. Go to https://coveralls.io
15
16
  gem 'sass-rails'
16
- gem 'sqlite3', '~> 1.3.6'
17
+ gem 'sqlite3', '~> 1.4.0'
17
18
  gem 'launchy'
18
19
  gem 'database_cleaner'
19
20
  gem 'capybara'
20
- gem 'selenium-webdriver'
21
- gem 'chromedriver-helper'
21
+ gem 'webdrivers'
22
22
  gem 'byebug'
23
23
  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/active_admin_datetimepicker.svg)](https://www.npmjs.com/package/@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,22 +26,55 @@ 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";
31
34
  ```
32
35
 
33
- Add the following line into `app/assets/javascripts/active_admin.js.coffee`:
36
+ Add the following line into `app/assets/javascripts/active_admin.js`:
34
37
 
35
- ```coffee
36
- #= require active_admin_datetimepicker
38
+ ```javascript
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.0", "< 3.a"
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());