apidae 1.0.5 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/apidae/projects_controller.rb +2 -2
- data/app/models/apidae/apidae_data_parser.rb +29 -17
- data/lib/apidae/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f69774e7655cd66923973e23882e6d1d0df0cb2a
|
4
|
+
data.tar.gz: 199df4ea7f45f563e569f9e1229dfdd012f6a2db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 671a682f09badf6919a55227c7366478c23bc74456fd58669101ac7a4c9462a5c08cd32a1a58711652bb484c39867c106d338afd9989f08b759af5c4dab375de
|
7
|
+
data.tar.gz: f7ba0f5be1b236da982b133e682c454ff251a1848927db75f54dd827ee0367e4b38a2fa93884dc64aebc29d60bfe04a307d25b33a10cc268ddd4ab82ce786ce5
|
@@ -24,7 +24,7 @@ module Apidae
|
|
24
24
|
else
|
25
25
|
@project = Project.new(project_params)
|
26
26
|
if @project.save
|
27
|
-
referrer =
|
27
|
+
referrer = params[:redirect_to] || session.delete(:referrer) || projects_url
|
28
28
|
redirect_to (referrer + "?apidae_project_id=#{@project.id}"), notice: 'Le projet a bien été créé'
|
29
29
|
else
|
30
30
|
flash.now[:alert] = "Une erreur s'est produite lors la création du projet"
|
@@ -54,7 +54,7 @@ module Apidae
|
|
54
54
|
|
55
55
|
def update_project
|
56
56
|
if @project.update(project_params)
|
57
|
-
referrer = session.delete(:referrer)
|
57
|
+
referrer = params[:redirect_to] || session.delete(:referrer)
|
58
58
|
redirect_to (referrer + "?apidae_project_id=#{@project.id}"), notice: 'Le projet a bien été mis à jour'
|
59
59
|
else
|
60
60
|
flash.now[:alert] = "Une erreur s'est produite lors la mise à jour du projet"
|
@@ -10,6 +10,17 @@ module Apidae
|
|
10
10
|
YELP = 4007
|
11
11
|
TRIP_ADVISOR = 4000
|
12
12
|
|
13
|
+
CONTACTS_MAP = {
|
14
|
+
'telephone' => PHONE,
|
15
|
+
'email' => EMAIL,
|
16
|
+
'website' => WEBSITE,
|
17
|
+
'facebook' => FACEBOOK,
|
18
|
+
'google' => GOOGLE,
|
19
|
+
'trip_advisor' => TRIP_ADVISOR,
|
20
|
+
'twitter' => TWITTER,
|
21
|
+
'yelp' => YELP
|
22
|
+
}
|
23
|
+
|
13
24
|
MODE_AUTO = 'auto'
|
14
25
|
MODE_MANUAL = 'manual'
|
15
26
|
|
@@ -114,7 +125,7 @@ module Apidae
|
|
114
125
|
url: pic[:traductionFichiers][0][:url].gsub('http:', 'https:'),
|
115
126
|
description: localized_value(pic, :legende, locale),
|
116
127
|
credits: localized_value(pic, :copyright, locale),
|
117
|
-
expiration_date: pic[:dateLimiteDePublication]
|
128
|
+
expiration_date: pic[:dateLimiteDePublication] || ''
|
118
129
|
}
|
119
130
|
end
|
120
131
|
end
|
@@ -149,29 +160,29 @@ module Apidae
|
|
149
160
|
contact_entries.each do |c|
|
150
161
|
case c[:type][:id]
|
151
162
|
when PHONE, ALT_PHONE
|
152
|
-
contact_details[:telephone] ||=
|
153
|
-
contact_details[:telephone]
|
163
|
+
contact_details[:telephone] ||= {}
|
164
|
+
contact_details[:telephone][c[:identifiant]] = c[:coordonnees][:fr]
|
154
165
|
when EMAIL
|
155
|
-
contact_details[:email] ||=
|
156
|
-
contact_details[:email]
|
166
|
+
contact_details[:email] ||= {}
|
167
|
+
contact_details[:email][c[:identifiant]] = c[:coordonnees][:fr]
|
157
168
|
when WEBSITE
|
158
|
-
contact_details[:website] ||=
|
159
|
-
contact_details[:website]
|
169
|
+
contact_details[:website] ||= {}
|
170
|
+
contact_details[:website][c[:identifiant]] = c[:coordonnees][:fr]
|
160
171
|
when GOOGLE
|
161
|
-
contact_details[:google] ||=
|
162
|
-
contact_details[:google]
|
172
|
+
contact_details[:google] ||= {}
|
173
|
+
contact_details[:google][c[:identifiant]] = c[:coordonnees][:fr]
|
163
174
|
when FACEBOOK
|
164
|
-
contact_details[:facebook] ||=
|
165
|
-
contact_details[:facebook]
|
175
|
+
contact_details[:facebook] ||= {}
|
176
|
+
contact_details[:facebook][c[:identifiant]] = c[:coordonnees][:fr]
|
166
177
|
when TWITTER
|
167
|
-
contact_details[:twitter] ||=
|
168
|
-
contact_details[:twitter]
|
178
|
+
contact_details[:twitter] ||= {}
|
179
|
+
contact_details[:twitter][c[:identifiant]] = c[:coordonnees][:fr]
|
169
180
|
when YELP
|
170
|
-
contact_details[:yelp] ||=
|
171
|
-
contact_details[:yelp]
|
181
|
+
contact_details[:yelp] ||= {}
|
182
|
+
contact_details[:yelp][c[:identifiant]] = c[:coordonnees][:fr]
|
172
183
|
when TRIP_ADVISOR
|
173
|
-
contact_details[:trip_advisor] ||=
|
174
|
-
contact_details[:trip_advisor]
|
184
|
+
contact_details[:trip_advisor] ||= {}
|
185
|
+
contact_details[:trip_advisor][c[:identifiant]] = c[:coordonnees][:fr]
|
175
186
|
else
|
176
187
|
end
|
177
188
|
end
|
@@ -339,6 +350,7 @@ module Apidae
|
|
339
350
|
external_id: o[:identifiantTechnique],
|
340
351
|
start_date: o[:dateDebut],
|
341
352
|
end_date: o[:dateFin],
|
353
|
+
each_year: o[:tousLesAns],
|
342
354
|
closing_days: closing_days.blank? ? [] : closing_days.map {|d| d[:dateSpeciale]},
|
343
355
|
details: node_value(o, :complementHoraire, *locales),
|
344
356
|
time_periods: [
|
data/lib/apidae/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apidae
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean-Baptiste Vilain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|