Merge branch 'staging'

This commit is contained in:
Xavier J 2016-09-22 11:31:48 +02:00
commit 49751fa100
7 changed files with 21 additions and 9 deletions

View file

@ -92,6 +92,8 @@ gem "maruku" # for Markdown support in apipie
gem 'openstack'
gem 'browser'
group :test do
gem 'capybara'
gem 'factory_girl'

View file

@ -84,6 +84,7 @@ GEM
sass (~> 3.0)
slim (>= 1.3.6, < 4.0)
terminal-table (~> 1.4)
browser (2.2.0)
builder (3.2.2)
byebug (5.0.0)
columnize (= 0.9.0)
@ -627,6 +628,7 @@ DEPENDENCIES
bootstrap-sass (~> 3.3.5)
bootstrap-wysihtml5-rails (~> 0.3.3.8)
brakeman
browser
byebug
capybara
carrierwave

View file

@ -14,12 +14,12 @@ function action_type_de_champs() {
toggleErrorClass(this, validatePhone(val));
});
$("#liste_champs input").on('focus', function (){
$("#description_"+this.id).slideDown();
$("#liste_champs input").on('focus', function () {
$("#description_" + this.id).slideDown();
});
$("#liste_champs input").on('blur', function (){
$("#description_"+this.id).slideUp();
$("#liste_champs input").on('blur', function () {
$("#description_" + this.id).slideUp();
});
address_type_init();

View file

@ -111,16 +111,16 @@
@extend .col-lg-2;
input[type='date'] {
width: 120px;
width: 160px;
}
}
.type_champ-datetime {
@extend .col-md-4;
@extend .col-lg-4;
@extend .col-md-5;
@extend .col-lg-5;
input[type='datetime'] {
width: 120px;
width: 160px;
}
}

View file

@ -2,9 +2,14 @@ class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_filter :check_browser
def default_url_options
return { protocol: 'https' } if Rails.env.staging? || Rails.env.production?
{}
end
def check_browser
BROWSER.value = Browser.new(request.user_agent)
end
end

View file

@ -9,7 +9,7 @@ class Champ < ActiveRecord::Base
end
def data_provide
return 'datepicker' if type_champ == 'datetime' || type_champ == 'date'
return 'datepicker' if (type_champ == 'datetime' || type_champ == 'date') && !BROWSER.value.chrome?
return 'typeahead' if type_champ == 'address'
end

View file

@ -0,0 +1,3 @@
BROWSER = Hashie::Mash.new ({
value: nil
})