From b513aa22abf15a8902c058bf3691df5bb1b5f55b Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Tue, 13 Jun 2017 12:27:45 +0630 Subject: [PATCH] datepicker --- Gemfile | 1 + Gemfile.lock | 3 +++ app/assets/javascripts/CRM.js | 4 +++- app/assets/javascripts/application.js | 2 +- app/assets/javascripts/origami.js | 2 ++ app/assets/stylesheets/CRM.scss | 2 ++ app/assets/stylesheets/application.scss | 2 +- app/assets/stylesheets/origami.scss | 2 ++ app/views/crm/customers/index.html.erb | 12 +++++++++++- app/views/origami/customers/index.html.erb | 11 ++++++++++- 10 files changed, 36 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 53d6f963..36be43b7 100644 --- a/Gemfile +++ b/Gemfile @@ -45,6 +45,7 @@ gem 'to_xls-rails' # Use jquery as the JavaScript library gem 'jquery-rails' +gem 'jquery-ui-rails' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder diff --git a/Gemfile.lock b/Gemfile.lock index 3fabf983..a4441893 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -87,6 +87,8 @@ GEM rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) + jquery-ui-rails (6.0.1) + railties (>= 3.2.16) kaminari (0.16.3) actionpack (>= 3.0.0) activesupport (>= 3.0.0) @@ -244,6 +246,7 @@ DEPENDENCIES httparty (~> 0.15.5) jbuilder (~> 2.5) jquery-rails + jquery-ui-rails kaminari (~> 0.16.3) listen (~> 3.0.5) mysql2 (>= 0.3.18, < 0.5) diff --git a/app/assets/javascripts/CRM.js b/app/assets/javascripts/CRM.js index 66f161af..ee1c6a41 100644 --- a/app/assets/javascripts/CRM.js +++ b/app/assets/javascripts/CRM.js @@ -14,4 +14,6 @@ //= require bootstrap //= require jquery_ujs //= require turbolinks -//= require cable \ No newline at end of file +//= require cable +//= require jquery-ui +//= require bootstrap-datepicker \ No newline at end of file diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index f4ee96ab..a05ea4ee 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -17,7 +17,7 @@ //= require turbolinks //= require cable //= require settings/processing_items -//= require bootstrap-datepicker + diff --git a/app/assets/javascripts/origami.js b/app/assets/javascripts/origami.js index 70594497..0079142f 100644 --- a/app/assets/javascripts/origami.js +++ b/app/assets/javascripts/origami.js @@ -15,6 +15,8 @@ //= require jquery_ujs //= require turbolinks //= require cable +//= require jquery-ui +//= require bootstrap-datepicker $(document).ready(function(){ // Enable/Disable Button diff --git a/app/assets/stylesheets/CRM.scss b/app/assets/stylesheets/CRM.scss index f43cc3f9..a88efe96 100644 --- a/app/assets/stylesheets/CRM.scss +++ b/app/assets/stylesheets/CRM.scss @@ -1,6 +1,8 @@ @import "bootstrap"; @import "font-awesome"; @import "theme"; +@import "jquery-ui"; +@import "bootstrap-datepicker3"; /* Show it is fixed to the top */ // body { diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index c3030dfb..6097a890 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -2,7 +2,7 @@ @import "bootstrap"; @import "font-awesome"; @import "theme"; -@import "bootstrap-datepicker"; + /* Show it is fixed to the top */ // body { diff --git a/app/assets/stylesheets/origami.scss b/app/assets/stylesheets/origami.scss index 1ea32844..71a9915e 100644 --- a/app/assets/stylesheets/origami.scss +++ b/app/assets/stylesheets/origami.scss @@ -1,6 +1,8 @@ @import "bootstrap"; @import "font-awesome"; @import "theme"; +@import "jquery-ui"; +@import "bootstrap-datepicker3"; /* Show it is fixed to the top */ // body { diff --git a/app/views/crm/customers/index.html.erb b/app/views/crm/customers/index.html.erb index ba36500c..3f8e2e1a 100644 --- a/app/views/crm/customers/index.html.erb +++ b/app/views/crm/customers/index.html.erb @@ -92,7 +92,8 @@
- <%= f.input :date_of_birth,:class=>"form-control date_of_birth"%> + + <%= f.text_field :date_of_birth,:class=>"form-control datepicker"%>
@@ -119,6 +120,15 @@