agilibox 1.4.4 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/app/helpers/agilibox/form_helper.rb +1 -3
- data/app/libs/agilibox/get_http.rb +44 -0
- data/app/views/agilibox/search/_form.html.slim +1 -12
- data/app/views/agilibox/search/_form_bs3.html.slim +12 -0
- data/app/views/agilibox/search/_form_bs4.html.slim +8 -0
- data/lib/agilibox/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78700a2b997a191955b808d5661084cc2b3f7f60099607bf687463a7586193b1
|
4
|
+
data.tar.gz: 8f89357d1b2f33e0e0f5bc618657c828b8116f137ddb4ca4836f1b662bee8fa0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d79b5cbe922710c8ab5ce660dded77721635ae703e941029f8273a25a06ce52b257ff7c5070f8ee84eef99a53fae638b6dc016d024235e9f96617c682f19b36
|
7
|
+
data.tar.gz: e584536c5140385a38521dd2e79ef89cdcd859d7704ee9e9ef8e5b313a00fb988edde5f27f99276751f09807312af6fd58f7e24c15a53168a9c4055212d9f01e
|
data/CHANGELOG.md
CHANGED
@@ -47,9 +47,7 @@ module Agilibox::FormHelper
|
|
47
47
|
simple_form_for(obj, opts, &block)
|
48
48
|
end
|
49
49
|
|
50
|
-
def search_form(
|
51
|
-
action = opts.delete(:action) || request.fullpath
|
52
|
-
|
50
|
+
def search_form(action: request.fullpath)
|
53
51
|
render "agilibox/search/form", action: action
|
54
52
|
end
|
55
53
|
|
@@ -0,0 +1,44 @@
|
|
1
|
+
class Agilibox::GetHTTP < Agilibox::Service
|
2
|
+
class Error < StandardError
|
3
|
+
end
|
4
|
+
|
5
|
+
EXCEPTIONS_TO_RERAISE = [
|
6
|
+
Net::HTTPBadResponse,
|
7
|
+
Net::HTTPExceptions,
|
8
|
+
Net::HTTPHeaderSyntaxError,
|
9
|
+
OpenSSL::SSL::SSLError,
|
10
|
+
SocketError,
|
11
|
+
SystemCallError,
|
12
|
+
Timeout::Error,
|
13
|
+
Zlib::Error,
|
14
|
+
]
|
15
|
+
|
16
|
+
TIMEOUT = 10
|
17
|
+
|
18
|
+
initialize_with :url
|
19
|
+
|
20
|
+
def uri
|
21
|
+
uri = URI(url.to_s)
|
22
|
+
raise Error, "invalid URI type : #{uri.class}" unless uri.is_a?(URI::HTTP)
|
23
|
+
uri
|
24
|
+
end
|
25
|
+
|
26
|
+
def call
|
27
|
+
response = Timeout.timeout(TIMEOUT) do
|
28
|
+
Net::HTTP.get_response(uri)
|
29
|
+
end
|
30
|
+
|
31
|
+
if response.code.start_with?("3")
|
32
|
+
@url = response["Location"]
|
33
|
+
return call
|
34
|
+
end
|
35
|
+
|
36
|
+
unless response.code.start_with?("2")
|
37
|
+
raise Error, "invalid response code : #{response.code}"
|
38
|
+
end
|
39
|
+
|
40
|
+
response.body
|
41
|
+
rescue *EXCEPTIONS_TO_RERAISE => e
|
42
|
+
raise Error, e.message
|
43
|
+
end
|
44
|
+
end
|
@@ -1,12 +1 @@
|
|
1
|
-
|
2
|
-
= form_hidden_submit
|
3
|
-
|
4
|
-
p.input-group.search
|
5
|
-
input.form-control name="q" placeholder=t("actions.search") size=25 value=params[:q]
|
6
|
-
|
7
|
-
span.input-group-btn
|
8
|
-
button.btn.btn-default.search-reset.reset type="submit"
|
9
|
-
= icon :times
|
10
|
-
|
11
|
-
button.btn.btn-default.search-submit type="submit"
|
12
|
-
= icon :search
|
1
|
+
= render "agilibox/search/form_bs#{Bootstrap::VERSION[0]}", action: action
|
@@ -0,0 +1,12 @@
|
|
1
|
+
form.search.bs3 method="get" action=action
|
2
|
+
= form_hidden_submit
|
3
|
+
|
4
|
+
p.input-group.search
|
5
|
+
input.form-control name="q" placeholder=t("actions.search") size=25 value=params[:q]
|
6
|
+
|
7
|
+
span.input-group-btn
|
8
|
+
button.btn.btn-default.search-reset.reset type="submit"
|
9
|
+
= icon :times
|
10
|
+
|
11
|
+
button.btn.btn-default.search-submit type="submit"
|
12
|
+
= icon :search
|
@@ -0,0 +1,8 @@
|
|
1
|
+
form.search.bs4 method="get" action=action
|
2
|
+
= form_hidden_submit
|
3
|
+
|
4
|
+
.input-group.search
|
5
|
+
input.form-control.form-control-sm type="text" name="q" placeholder=ta(:search) value=params[:q]
|
6
|
+
span.input-group-append
|
7
|
+
button.btn.btn-sm.bg-light.border.search-reset.reset type="submit" = icon(:times)
|
8
|
+
button.btn.btn-sm.bg-light.border.search-submit type="submit" = icon(:search)
|
data/lib/agilibox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: agilibox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- agilidée
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails-i18n
|
@@ -112,6 +112,7 @@ files:
|
|
112
112
|
- app/libs/agilibox/collection_update.rb
|
113
113
|
- app/libs/agilibox/fcm/notifier.rb
|
114
114
|
- app/libs/agilibox/fcm/request.rb
|
115
|
+
- app/libs/agilibox/get_http.rb
|
115
116
|
- app/libs/agilibox/initialize_with.rb
|
116
117
|
- app/libs/agilibox/mini_model_serializer/serialize.rb
|
117
118
|
- app/libs/agilibox/mini_model_serializer/serializer.rb
|
@@ -142,6 +143,8 @@ files:
|
|
142
143
|
- app/views/agilibox/_flash.html.slim
|
143
144
|
- app/views/agilibox/forms/_checkboxes_dropdown.html.slim
|
144
145
|
- app/views/agilibox/search/_form.html.slim
|
146
|
+
- app/views/agilibox/search/_form_bs3.html.slim
|
147
|
+
- app/views/agilibox/search/_form_bs4.html.slim
|
145
148
|
- config/cucumber.yml
|
146
149
|
- config/locales/actions.en.yml
|
147
150
|
- config/locales/actions.fr.yml
|