aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Etienne2014-08-19 16:31:34 +0200
committerMichel Etienne2014-08-19 16:31:34 +0200
commit9f00c4d31ab67cf394cef4cccd88de5d5ba0876c (patch)
treec4af1f030274c2c47bc4cc7d6dbe5dce00751f06
parent59775e64d0b1980651585d0b0d2e4b19403462ec (diff)
parent9e4124e5d5a88f0cd4f0f11821b6324daba71518 (diff)
downloadchouette-core-9f00c4d31ab67cf394cef4cccd88de5d5ba0876c.tar.bz2
merge V2_4
-rw-r--r--Gemfile3
-rw-r--r--app/assets/javascripts/multiple_selection.js.coffee37
-rw-r--r--app/models/user.rb1
-rw-r--r--app/views/help/index.textile5
-rw-r--r--app/views/lines/index.html.erb2
-rw-r--r--lib/tasks/userdoc.rake2
6 files changed, 29 insertions, 21 deletions
diff --git a/Gemfile b/Gemfile
index 79a4bdbb1..eef087238 100644
--- a/Gemfile
+++ b/Gemfile
@@ -61,10 +61,11 @@ gem 'google-analytics-rails'
gem 'will_paginate', '~> 3.0'
gem 'ransack'
gem 'squeel'
+
gem 'ninoxe', :git => 'https://github.com/afimb/ninoxe.git'
#gem 'ninoxe',:path => '~/projects/ninoxe'
#gem 'ninoxe',:path => '~/workspace/chouette/ninoxe'
-#gem 'ninoxe', '~> 1.0.1'
+#gem 'ninoxe', '~> 1.0.3'
gem 'acts_as_list', '0.1.6'
gem "acts_as_tree-1.8", '1.1.0', :require => "acts_as_tree"
diff --git a/app/assets/javascripts/multiple_selection.js.coffee b/app/assets/javascripts/multiple_selection.js.coffee
index 1ff473c4d..86b260fb7 100644
--- a/app/assets/javascripts/multiple_selection.js.coffee
+++ b/app/assets/javascripts/multiple_selection.js.coffee
@@ -1,5 +1,5 @@
jQuery ->
- enable_multiple_selection = (event) ->
+ enable_multiple_selection = (event) ->
event.preventDefault()
$('#multiple_selection_menu div.enabled').show()
$('#multiple_selection_menu div.disabled').hide()
@@ -7,7 +7,7 @@ jQuery ->
$('#multiple_selection_menu a.enable').click(enable_multiple_selection)
- disable_multiple_selection = (event) ->
+ disable_multiple_selection = (event) ->
event.preventDefault()
$('#multiple_selection_menu div.enabled').hide()
$('#multiple_selection_menu div.disabled').show()
@@ -15,13 +15,13 @@ jQuery ->
$('#multiple_selection_menu a.disable').click(disable_multiple_selection)
- select_all = (event) ->
+ select_all = (event) ->
event.preventDefault()
$('input[type=checkbox].multiple_selection').prop("checked", true)
$('#multiple_selection_menu a.select_all').click(select_all)
- deselect_all = (event) ->
+ deselect_all = (event) ->
event.preventDefault()
$('input[type=checkbox].multiple_selection').prop("checked", false)
@@ -30,24 +30,25 @@ jQuery ->
handle_multiple_action = (event) ->
event.preventDefault()
link = $(event.target)
+ r = confirm( link.attr( "confirmation-text" ) );
+ if (r == true)
+ href = link.attr("href")
+ method = link.data('multiple-method')
+ csrf_token = $('meta[name=csrf-token]').attr('content')
+ csrf_param = $('meta[name=csrf-param]').attr('content')
+ form = $('<form method="post" action="' + href + '"></form>')
+ target = link.attr('target')
- href = link.attr("href")
- method = link.data('multiple-method')
- csrf_token = $('meta[name=csrf-token]').attr('content')
- csrf_param = $('meta[name=csrf-param]').attr('content')
- form = $('<form method="post" action="' + href + '"></form>')
- target = link.attr('target')
+ metadata_input = '<input name="_method" value="' + method + '" type="hidden" />'
- metadata_input = '<input name="_method" value="' + method + '" type="hidden" />'
+ if csrf_param? and csrf_token?
+ metadata_input += '<input name="' + csrf_param + '" value="' + csrf_token + '" type="hidden" />'
- if csrf_param? and csrf_token?
- metadata_input += '<input name="' + csrf_param + '" value="' + csrf_token + '" type="hidden" />'
+ form.append($(input).clone()) for input in $('input[type=checkbox].multiple_selection:checked')
- form.append($(input).clone()) for input in $('input[type=checkbox].multiple_selection:checked')
-
- form.attr('target', target) if target?
+ form.attr('target', target) if target?
- form.hide().append(metadata_input).appendTo('body')
- form.submit()
+ form.hide().append(metadata_input).appendTo('body')
+ form.submit()
$('#multiple_selection_menu .actions a.remove').click(handle_multiple_action)
diff --git a/app/models/user.rb b/app/models/user.rb
index 1b9ec7416..ae6cceeee 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -17,6 +17,7 @@ class User < ActiveRecord::Base
before_validation(:on => :create) do
self.password ||= Devise.friendly_token.first(6)
+ self.password_confirmation ||= self.password
end
# remove organisation and referentials if last user of it
diff --git a/app/views/help/index.textile b/app/views/help/index.textile
index 8907abe4d..3e0af420b 100644
--- a/app/views/help/index.textile
+++ b/app/views/help/index.textile
@@ -30,8 +30,11 @@ h4. Version 2.4.1
** L'export GTFS exige que l'indice de ligne soit renseigné (Mantis 26726)
** L'import GTFS ne tient pas compte des courses commençant après minuit (Mantis 25824)
** Mise en place d'un script produisant l'aide en ligne sous forme de docx (Mantis 26604)
-** L'import GTFS plante sur une course qui dessert plus de 2 fois le même arrêt (Mantis 26755)
+** L'import GTFS ne fonctionne pas sur une course qui dessert plus de 2 fois le même arrêt (Mantis 26755)
** L'export NeTEx produit un fichier invalide si le champ VersionDate du réseau est vide (Mantis 26434)
+** Liens cassés dans les pages d'aide (Mantis 26690)
+** La validation ne fonctionne pas si un arrêt n'est pas géolocalisé (Mantis 26931)
+** L'import ne fonctionne pas si l'encodage du catalogue d'un ZIP n'est pas compatible UTF-8 (Mantis 27011)
h4. Version 2.4.0
diff --git a/app/views/lines/index.html.erb b/app/views/lines/index.html.erb
index 5f8f756d8..edcdbcc9c 100644
--- a/app/views/lines/index.html.erb
+++ b/app/views/lines/index.html.erb
@@ -85,7 +85,7 @@
<a class="disable" href="#"><%= t(".multi_selection_disable") %></a>
<ul class="actions">
- <%= link_to t(".delete_selected"), referential_lines_path(@referential), "data-multiple-method" => "delete", :class => "remove", :confirm => t("lines.actions.destroy_selection_confirm") %>
+ <%= link_to t(".delete_selected"), referential_lines_path(@referential), "data-multiple-method" => "delete", :class => "remove", "confirmation-text" => t("lines.actions.destroy_selection_confirm") %>
</ul>
<a class="select_all" href="#"><%= t(".select_all") %></a> | <a class="deselect_all" href="#"><%= t(".deselect_all") %></a>
diff --git a/lib/tasks/userdoc.rake b/lib/tasks/userdoc.rake
index 1023aa681..df72c32e4 100644
--- a/lib/tasks/userdoc.rake
+++ b/lib/tasks/userdoc.rake
@@ -1,4 +1,5 @@
#encoding: utf-8
+if Rails.env != 'production'
require 'fileutils'
require 'nokogiri'
@@ -129,4 +130,5 @@ namespace :doc do
end
+end