bookingsync_portal 0.0.1 → 0.0.2
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/app/assets/javascripts/bookingsync_portal/admin/list_filters.js +67 -0
- data/app/assets/stylesheets/bookingsync_portal/admin/_list_filters.css.scss +8 -0
- data/app/assets/stylesheets/bookingsync_portal/admin/application.css.scss +1 -0
- data/app/controllers/bookingsync_portal/admin/base_controller.rb +6 -1
- data/app/controllers/bookingsync_portal/admin/remote_accounts_controller.rb +2 -0
- data/app/controllers/bookingsync_portal/admin/rentals_controller.rb +2 -6
- data/lib/bookingsync_portal/version.rb +1 -1
- data/lib/bookingsync_portal.rb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b38418e24035c0d1f9a7cea2b6877aa855e41234
|
4
|
+
data.tar.gz: 8b95613cc12e8d89f1f690a389416c9d01f3d126
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8c12664d0da83e3e77447bb458cf82e5275616ee0bbad92d1e2d7b9c432c6e9ef1240d6b2fcb38d5223c7a680c7bea0ea0634aab949cf2296b56349ea38df7a
|
7
|
+
data.tar.gz: 24cc058e5e36c0fe582a72a6399ade9537ad268d21a7017f53e2307200972650e0a064064b3099694e07c293fb18f0a61243f227925939e3b2fb32dd17914fa5
|
@@ -0,0 +1,67 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
// Copyright (c) 2010 Kilian Valkhof
|
4
|
+
|
5
|
+
// Permission is hereby granted, free of charge, to any person
|
6
|
+
// obtaining a copy of this software and associated documentation
|
7
|
+
// files (the "Software"), to deal in the Software without
|
8
|
+
// restriction, including without limitation the rights to use,
|
9
|
+
// copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
// copies of the Software, and to permit persons to whom the
|
11
|
+
// Software is furnished to do so, subject to the following
|
12
|
+
// conditions:
|
13
|
+
|
14
|
+
// The above copyright notice and this permission notice shall be
|
15
|
+
// included in all copies or substantial portions of the Software.
|
16
|
+
|
17
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
18
|
+
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
19
|
+
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
20
|
+
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
21
|
+
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
22
|
+
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
23
|
+
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
24
|
+
// OTHER DEALINGS IN THE SOFTWARE.
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
(function ($) {
|
29
|
+
// custom css expression for a case-insensitive contains()
|
30
|
+
jQuery.expr[':'].Contains = function(a,i,m){
|
31
|
+
return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase())>=0;
|
32
|
+
};
|
33
|
+
|
34
|
+
|
35
|
+
function listFilter(header, list) { // header is any element, list is an unordered list
|
36
|
+
// create and add the filter form to the header
|
37
|
+
var form = $("<form>").attr({"class":"filterform","action":"#"}),
|
38
|
+
label = $("<label>Filter by name:</label>"),
|
39
|
+
input = $("<input>").attr({"class":"filterinput","type":"text"});
|
40
|
+
$(form).append(label).append(input).appendTo(header);
|
41
|
+
|
42
|
+
$(input)
|
43
|
+
.change( function () {
|
44
|
+
var filter = $(this).val();
|
45
|
+
if(filter) {
|
46
|
+
// this finds all links in a list that contain the input,
|
47
|
+
// and hide the ones not containing the input while showing the ones that do
|
48
|
+
$(list).find("> div .panel-heading:not(:Contains(" + filter + "))").parent().slideUp();
|
49
|
+
$(list).find("> div .panel-heading:Contains(" + filter + ")").parent().slideDown();
|
50
|
+
} else {
|
51
|
+
$(list).find("li").slideDown();
|
52
|
+
}
|
53
|
+
return false;
|
54
|
+
})
|
55
|
+
.keyup( function () {
|
56
|
+
// fire the above change event after every letter
|
57
|
+
$(this).change();
|
58
|
+
});
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
//ondomready
|
63
|
+
$(function () {
|
64
|
+
listFilter($(".rentals-list:first-child .rentals-list-header legend"), $(".rentals-list:first-child .rentals-list-scroll"));
|
65
|
+
listFilter($(".rentals-list:last-child .rentals-list-header legend"), $(".rentals-list:last-child .rentals-list-scroll"));
|
66
|
+
});
|
67
|
+
}(jQuery));
|
@@ -5,11 +5,16 @@ module BookingsyncPortal
|
|
5
5
|
class BaseController < ApplicationController
|
6
6
|
layout 'bookingsync_portal/admin'
|
7
7
|
respond_to :html
|
8
|
-
|
9
8
|
include BookingsyncApplication::Admin::CommonBaseController
|
10
9
|
|
10
|
+
before_action :enforce_remote_account!
|
11
|
+
|
11
12
|
private
|
12
13
|
|
14
|
+
def enforce_remote_account!
|
15
|
+
redirect_to new_admin_remote_account_path if current_account.remote_accounts.empty?
|
16
|
+
end
|
17
|
+
|
13
18
|
def messagebus_channel
|
14
19
|
"/account-#{current_account.id}"
|
15
20
|
end
|
@@ -26,12 +26,8 @@ module BookingsyncPortal
|
|
26
26
|
|
27
27
|
def disconnect
|
28
28
|
connection = rental.connection
|
29
|
-
|
30
|
-
|
31
|
-
else
|
32
|
-
rental.remote_rental.update_attribute(:synchronized_at, nil)
|
33
|
-
connection.destroy
|
34
|
-
end
|
29
|
+
rental.remote_rental.update_attribute(:synchronized_at, nil)
|
30
|
+
connection.destroy
|
35
31
|
|
36
32
|
BookingsyncPortal.connection_destroyed(connection)
|
37
33
|
redirect_or_js_response
|
data/lib/bookingsync_portal.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bookingsync_portal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Marciniak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -302,9 +302,11 @@ files:
|
|
302
302
|
- Rakefile
|
303
303
|
- app/assets/javascripts/bookingsync_portal/admin/application.js
|
304
304
|
- app/assets/javascripts/bookingsync_portal/admin/handle_remote_errors.js.coffee
|
305
|
+
- app/assets/javascripts/bookingsync_portal/admin/list_filters.js
|
305
306
|
- app/assets/javascripts/bookingsync_portal/admin/live_updates.js.coffee
|
306
307
|
- app/assets/javascripts/bookingsync_portal/admin/rentals.js.coffee
|
307
308
|
- app/assets/javascripts/bookingsync_portal/admin/templates/rentals/connected_rental.hbs
|
309
|
+
- app/assets/stylesheets/bookingsync_portal/admin/_list_filters.css.scss
|
308
310
|
- app/assets/stylesheets/bookingsync_portal/admin/application.css.scss
|
309
311
|
- app/controllers/bookingsync_portal/admin/base_controller.rb
|
310
312
|
- app/controllers/bookingsync_portal/admin/remote_accounts_controller.rb
|