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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4efb80ba84be6c967724c03348f2bd52380dd577
4
- data.tar.gz: 4f97a25ef1694c625c58e885b7050fc493b9f200
3
+ metadata.gz: b38418e24035c0d1f9a7cea2b6877aa855e41234
4
+ data.tar.gz: 8b95613cc12e8d89f1f690a389416c9d01f3d126
5
5
  SHA512:
6
- metadata.gz: 9445af97382d1e4600ab4d5c5dfa63cad255fc1df8fc1a0ce419fa81f3d0a0a8e77659727dec0b7fba091bb889f7d718ff99a9ecf3a2c09d477510eb43a2471c
7
- data.tar.gz: c9c1850fbd37e547bcb21d048db01f683e14753e5ab0f7c0f6b32593b96e669a20e7ecdfb58fa38655a3385bfd2ea583a1d102554fab58847f635cf77c427db1
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));
@@ -0,0 +1,8 @@
1
+ legend {
2
+ form {
3
+ font-size: small;
4
+ label {
5
+ margin-right: 10px;
6
+ }
7
+ }
8
+ }
@@ -4,6 +4,7 @@ $dropzone-active-bg: #fbf9ee;
4
4
  @import "font-awesome";
5
5
  @import "bootstrap-sprockets";
6
6
  @import "bootstrap";
7
+ @import 'list_filters.css.scss';
7
8
 
8
9
  html, body {
9
10
  height: 100%;
@@ -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
@@ -1,6 +1,8 @@
1
1
  module BookingsyncPortal
2
2
  module Admin
3
3
  class RemoteAccountsController < Admin::BaseController
4
+ skip_before_action :enforce_remote_account!
5
+
4
6
  def new
5
7
  @remote_account = scope.build
6
8
  end
@@ -26,12 +26,8 @@ module BookingsyncPortal
26
26
 
27
27
  def disconnect
28
28
  connection = rental.connection
29
- if rental.remote_rental.uid.blank? # was not yet created on HolidayLettings
30
- rental.remote_rental.destroy
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
@@ -1,3 +1,3 @@
1
1
  module BookingsyncPortal
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
@@ -1,5 +1,6 @@
1
1
  require 'bookingsync_application'
2
2
  require 'bookingsync_portal/engine'
3
+ require 'bookingsync_portal/mash_serializer'
3
4
  require 'message_bus'
4
5
 
5
6
  # FIXME requires below should get removed when ember frontend is added
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.1
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-04-15 00:00:00.000000000 Z
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