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 +4 -4
- data/.github/workflows/ci.yml +39 -0
- data/.gitignore +4 -1
- data/Gemfile +5 -5
- data/README.md +40 -5
- data/active_admin_datetimepicker.gemspec +1 -3
- data/app/assets/javascripts/active_admin_datetimepicker.js +25 -0
- data/app/assets/javascripts/vendor/jquery.datetimepicker.full.js +2911 -0
- data/app/assets/stylesheets/active_admin_datetimepicker.scss +2 -0
- data/app/assets/stylesheets/vendor/jquery.datetimepicker.css +568 -0
- data/config/initializers/active_admin_datetimepicker.rb +6 -2
- data/lib/active_admin_datetimepicker/base.rb +7 -7
- data/lib/active_admin_datetimepicker/inputs/filters/date_time_range_input.rb +14 -0
- data/lib/active_admin_datetimepicker/version.rb +1 -1
- data/lib/active_admin_datetimepicker.rb +0 -1
- data/package.json +35 -0
- metadata +10 -35
- data/.travis.yml +0 -22
- data/app/assets/javascripts/active_admin_datetimepicker.js.coffee +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d14c8bf962657fbcbb8aad0e9c3133583af752ad7988c5d8505afd065f588d4
|
4
|
+
data.tar.gz: be5c65e10479834f0da606a7649473f19182fd49ab6d7a0ac87bf3be20871404
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
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 = '
|
8
|
-
default_activeadmin_version = '2.
|
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.
|
17
|
+
gem 'sqlite3', '~> 1.4.0'
|
17
18
|
gem 'launchy'
|
18
19
|
gem 'database_cleaner'
|
19
20
|
gem 'capybara'
|
20
|
-
gem '
|
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
|
-
|
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
|
36
|
+
Add the following line into `app/assets/javascripts/active_admin.js`:
|
34
37
|
|
35
|
-
```
|
36
|
-
|
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
|
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 "
|
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());
|