stayind-manage 0.0.1

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.
Files changed (66) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +38 -0
  4. data/app/controllers/manage/Manage.iml +12 -0
  5. data/app/controllers/manage/management_controller.rb +17 -0
  6. data/app/controllers/manage/orders_controller.rb~ +15 -0
  7. data/app/views/manage/management/index.html.erb +36 -0
  8. data/app/views/manage/management/index.html.erb~ +23 -0
  9. data/app/views/manage/management/slider.html.erb +8 -0
  10. data/app/views/manage/management/switch.html.erb +15 -0
  11. data/app/views/manage/management/temperature.html.erb~ +14 -0
  12. data/config/Config.iml +12 -0
  13. data/config/locales/en.yml +9 -0
  14. data/config/locales/pl.yml +9 -0
  15. data/config/routes.rb +8 -0
  16. data/config/routes.rb~ +5 -0
  17. data/lib/Lib.iml +12 -0
  18. data/lib/manage.rb +29 -0
  19. data/lib/manage.rb~ +29 -0
  20. data/lib/manage/engine.rb +7 -0
  21. data/lib/manage/engine.rb~ +7 -0
  22. data/lib/manage/version.rb +3 -0
  23. data/lib/manage/version.rb~ +3 -0
  24. data/lib/order.rb~ +16 -0
  25. data/lib/tasks/manage_tasks.rake +4 -0
  26. data/lib/tasks/order_tasks.rake~ +4 -0
  27. data/test/Test.iml +22 -0
  28. data/test/dummy/README.rdoc +261 -0
  29. data/test/dummy/Rakefile +7 -0
  30. data/test/dummy/app/assets/javascripts/application.js +15 -0
  31. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  32. data/test/dummy/app/controllers/application_controller.rb +3 -0
  33. data/test/dummy/app/helpers/application_helper.rb +2 -0
  34. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  35. data/test/dummy/config.ru +4 -0
  36. data/test/dummy/config/application.rb +59 -0
  37. data/test/dummy/config/boot.rb +10 -0
  38. data/test/dummy/config/database.yml +25 -0
  39. data/test/dummy/config/environment.rb +5 -0
  40. data/test/dummy/config/environments/development.rb +37 -0
  41. data/test/dummy/config/environments/production.rb +67 -0
  42. data/test/dummy/config/environments/test.rb +37 -0
  43. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  44. data/test/dummy/config/initializers/inflections.rb +15 -0
  45. data/test/dummy/config/initializers/mime_types.rb +5 -0
  46. data/test/dummy/config/initializers/secret_token.rb +7 -0
  47. data/test/dummy/config/initializers/session_store.rb +8 -0
  48. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  49. data/test/dummy/config/locales/en.yml +5 -0
  50. data/test/dummy/config/routes.rb +58 -0
  51. data/test/dummy/db/development.sqlite3 +0 -0
  52. data/test/dummy/db/test.sqlite3 +0 -0
  53. data/test/dummy/log/development.log +27 -0
  54. data/test/dummy/log/test.log +3 -0
  55. data/test/dummy/public/404.html +26 -0
  56. data/test/dummy/public/422.html +26 -0
  57. data/test/dummy/public/500.html +25 -0
  58. data/test/dummy/public/favicon.ico +0 -0
  59. data/test/dummy/script/rails +6 -0
  60. data/test/manage_test.rb +7 -0
  61. data/test/order_test.rb~ +7 -0
  62. data/test/test_helper.rb +16 -0
  63. data/vendor/assets/javascripts/si.manage.js +79 -0
  64. data/vendor/assets/javascripts/si.manage.js~ +26 -0
  65. data/vendor/assets/javascripts/si.order.js~ +9 -0
  66. metadata +178 -0
File without changes
File without changes
@@ -0,0 +1,27 @@
1
+
2
+
3
+ Started GET "/" for 127.0.0.1 at 2012-07-28 15:36:35 +0200
4
+ Connecting to database specified by database.yml
5
+
6
+ ActionController::RoutingError (No route matches [GET] "/"):
7
+ actionpack (3.2.7) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
8
+ actionpack (3.2.7) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
9
+ railties (3.2.7) lib/rails/rack/logger.rb:26:in `call_app'
10
+ railties (3.2.7) lib/rails/rack/logger.rb:16:in `call'
11
+ actionpack (3.2.7) lib/action_dispatch/middleware/request_id.rb:22:in `call'
12
+ rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
13
+ rack (1.4.1) lib/rack/runtime.rb:17:in `call'
14
+ activesupport (3.2.7) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
15
+ rack (1.4.1) lib/rack/lock.rb:15:in `call'
16
+ actionpack (3.2.7) lib/action_dispatch/middleware/static.rb:62:in `call'
17
+ railties (3.2.7) lib/rails/engine.rb:479:in `call'
18
+ railties (3.2.7) lib/rails/application.rb:220:in `call'
19
+ rack (1.4.1) lib/rack/content_length.rb:14:in `call'
20
+ railties (3.2.7) lib/rails/rack/log_tailer.rb:17:in `call'
21
+ rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
22
+ /home/wojtek/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
23
+ /home/wojtek/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
24
+ /home/wojtek/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
25
+
26
+
27
+ Rendered /home/wojtek/.rvm/gems/ruby-1.9.3-p194/gems/actionpack-3.2.7/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (4.3ms)
@@ -0,0 +1,3 @@
1
+ Connecting to database specified by database.yml
2
+  (0.4ms) begin transaction
3
+  (0.1ms) rollback transaction
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class ManageTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, Manage
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class OrderTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, Order
6
+ end
7
+ end
@@ -0,0 +1,16 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+ #ENV["RAILS_ROOT"] = File.expand_path("../dummy", __FILE__)
4
+
5
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
6
+ require "rails/test_help"
7
+
8
+ Rails.backtrace_cleaner.remove_silencers!
9
+
10
+ # Load support files
11
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
12
+
13
+ # Load fixtures from the engine
14
+ if ActiveSupport::TestCase.method_defined?(:fixture_path=)
15
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
16
+ end
@@ -0,0 +1,79 @@
1
+ Si.views.management = function () {
2
+ var tpl = Si.loadTemplate(Routes.management_tpl_path()),
3
+ slider_tpl = Si.loadTemplate(Routes.slider_tpl_path()),
4
+ switch_tpl = Si.loadTemplate(Routes.switch_tpl_path()),
5
+
6
+ controllers = Si.collections.Controller,
7
+ roomStay = Si.collections.RoomStay.first();
8
+
9
+ var temps = '',
10
+ lights = '';
11
+
12
+ controllers.each(function(controller) {
13
+ if(controller.get('type') == 'temperature') {
14
+ temps += _.template(slider_tpl, controller.toJSON());
15
+ } else if (controller.get('type') == 'light') {
16
+ lights += _.template(switch_tpl, controller.toJSON());
17
+ }
18
+ });
19
+
20
+ var fulfilled = _.template(tpl, {
21
+ status: roomStay.get('status'),
22
+ temperatures: temps,
23
+ lights: lights
24
+ });
25
+
26
+ return {
27
+ el: $(fulfilled),
28
+
29
+ init: function(urlObj, options) {
30
+
31
+ this.el.bind("pageshow", function() {
32
+ $("input[name='service-status']").bind( "change", function(event, ui) {
33
+
34
+ $("input[name='service-status']").checkboxradio('disable');
35
+
36
+ Si.socket.emit('roomStatusUpdate', {
37
+ _id: roomStay.get('_id'),
38
+ status: $(event.target).val()
39
+ }, function (data) {
40
+ if(data) {
41
+ roomStay.set('status', $(event.target).val());
42
+ roomStay.save();
43
+
44
+ $("input[name='service-status']").checkboxradio('enable');
45
+ } else {
46
+ console.log('failed');
47
+ }
48
+ });
49
+ });
50
+
51
+ $(".slider").bind("change", function(event) {
52
+ $(this).slider('disable');
53
+ var that = this;
54
+ Si.socket.emit('controllerStateUpdate', {
55
+ _id: this.id,
56
+ state: $(event.target).val()
57
+ }, function (data) {
58
+ if(data) {
59
+ var controller = controllers.where({'_id': this.id})[0];
60
+ controller.set('state', $(event.target).val());
61
+ controller.save();
62
+ } else {
63
+ console.log('failed');
64
+ }
65
+
66
+ $(that).slider('enable');
67
+ });
68
+
69
+
70
+ console.log($(event.target).val());
71
+ });
72
+
73
+
74
+ });
75
+
76
+
77
+ }
78
+ }
79
+ };
@@ -0,0 +1,26 @@
1
+ Si.views.management = function () {
2
+ var tpl = Si.loadTemplate(Routes.management_tpl_path()),
3
+ temp_tpl = Si.loadTemplate(Routes.temperature_tpl_path()),
4
+
5
+ controllers = Si.collections.Controller;
6
+ ;
7
+
8
+ var temps = '';
9
+
10
+ controllers.each(function(controller) {
11
+ if(controller.get('type') == 'temperature') {
12
+ temps += _.template(temp_tpl, controller.toJSON());
13
+ }
14
+ });
15
+
16
+ var fulfilled = _.template(tpl, { temperatures: temps });
17
+
18
+ return {
19
+ el: $(fulfilled),
20
+
21
+ init: function(urlObj, options) {
22
+ var self = this;
23
+
24
+ }
25
+ }
26
+ };
@@ -0,0 +1,9 @@
1
+ Si.manage = {
2
+ init: function () {
3
+ self = this;
4
+ },
5
+ }
6
+
7
+ $('#manage-page').live('pagebeforecreate', function (event) {
8
+ Si.order.init();
9
+ });
metadata ADDED
@@ -0,0 +1,178 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: stayind-manage
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - StayInd
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-01-13 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 3.2.6
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 3.2.6
30
+ - !ruby/object:Gem::Dependency
31
+ name: sqlite3
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ description: ! 'StayInd: Room Management module for StayInd App'
47
+ email:
48
+ - contact@stayind.com
49
+ executables: []
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - app/controllers/manage/Manage.iml
54
+ - app/controllers/manage/management_controller.rb
55
+ - app/controllers/manage/orders_controller.rb~
56
+ - app/views/manage/management/index.html.erb
57
+ - app/views/manage/management/switch.html.erb
58
+ - app/views/manage/management/temperature.html.erb~
59
+ - app/views/manage/management/slider.html.erb
60
+ - app/views/manage/management/index.html.erb~
61
+ - config/routes.rb~
62
+ - config/routes.rb
63
+ - config/Config.iml
64
+ - config/locales/en.yml
65
+ - config/locales/pl.yml
66
+ - lib/manage/engine.rb
67
+ - lib/manage/version.rb~
68
+ - lib/manage/version.rb
69
+ - lib/manage/engine.rb~
70
+ - lib/order.rb~
71
+ - lib/manage.rb~
72
+ - lib/manage.rb
73
+ - lib/Lib.iml
74
+ - lib/tasks/manage_tasks.rake
75
+ - lib/tasks/order_tasks.rake~
76
+ - vendor/assets/javascripts/si.order.js~
77
+ - vendor/assets/javascripts/si.manage.js
78
+ - vendor/assets/javascripts/si.manage.js~
79
+ - MIT-LICENSE
80
+ - Rakefile
81
+ - README.rdoc
82
+ - test/test_helper.rb
83
+ - test/order_test.rb~
84
+ - test/dummy/public/500.html
85
+ - test/dummy/public/422.html
86
+ - test/dummy/public/favicon.ico
87
+ - test/dummy/public/404.html
88
+ - test/dummy/README.rdoc
89
+ - test/dummy/Rakefile
90
+ - test/dummy/config.ru
91
+ - test/dummy/app/controllers/application_controller.rb
92
+ - test/dummy/app/helpers/application_helper.rb
93
+ - test/dummy/app/views/layouts/application.html.erb
94
+ - test/dummy/app/assets/javascripts/application.js
95
+ - test/dummy/app/assets/stylesheets/application.css
96
+ - test/dummy/log/test.log
97
+ - test/dummy/log/development.log
98
+ - test/dummy/script/rails
99
+ - test/dummy/config/initializers/inflections.rb
100
+ - test/dummy/config/initializers/secret_token.rb
101
+ - test/dummy/config/initializers/session_store.rb
102
+ - test/dummy/config/initializers/mime_types.rb
103
+ - test/dummy/config/initializers/wrap_parameters.rb
104
+ - test/dummy/config/initializers/backtrace_silencers.rb
105
+ - test/dummy/config/database.yml
106
+ - test/dummy/config/routes.rb
107
+ - test/dummy/config/environments/development.rb
108
+ - test/dummy/config/environments/test.rb
109
+ - test/dummy/config/environments/production.rb
110
+ - test/dummy/config/environment.rb
111
+ - test/dummy/config/application.rb
112
+ - test/dummy/config/locales/en.yml
113
+ - test/dummy/config/boot.rb
114
+ - test/dummy/db/test.sqlite3
115
+ - test/dummy/db/development.sqlite3
116
+ - test/Test.iml
117
+ - test/manage_test.rb
118
+ homepage: http://stayind.com
119
+ licenses: []
120
+ post_install_message:
121
+ rdoc_options: []
122
+ require_paths:
123
+ - lib
124
+ required_ruby_version: !ruby/object:Gem::Requirement
125
+ none: false
126
+ requirements:
127
+ - - ! '>='
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ required_rubygems_version: !ruby/object:Gem::Requirement
131
+ none: false
132
+ requirements:
133
+ - - ! '>='
134
+ - !ruby/object:Gem::Version
135
+ version: '0'
136
+ requirements: []
137
+ rubyforge_project:
138
+ rubygems_version: 1.8.24
139
+ signing_key:
140
+ specification_version: 3
141
+ summary: ! 'StayInd: Room Management Module'
142
+ test_files:
143
+ - test/test_helper.rb
144
+ - test/order_test.rb~
145
+ - test/dummy/public/500.html
146
+ - test/dummy/public/422.html
147
+ - test/dummy/public/favicon.ico
148
+ - test/dummy/public/404.html
149
+ - test/dummy/README.rdoc
150
+ - test/dummy/Rakefile
151
+ - test/dummy/config.ru
152
+ - test/dummy/app/controllers/application_controller.rb
153
+ - test/dummy/app/helpers/application_helper.rb
154
+ - test/dummy/app/views/layouts/application.html.erb
155
+ - test/dummy/app/assets/javascripts/application.js
156
+ - test/dummy/app/assets/stylesheets/application.css
157
+ - test/dummy/log/test.log
158
+ - test/dummy/log/development.log
159
+ - test/dummy/script/rails
160
+ - test/dummy/config/initializers/inflections.rb
161
+ - test/dummy/config/initializers/secret_token.rb
162
+ - test/dummy/config/initializers/session_store.rb
163
+ - test/dummy/config/initializers/mime_types.rb
164
+ - test/dummy/config/initializers/wrap_parameters.rb
165
+ - test/dummy/config/initializers/backtrace_silencers.rb
166
+ - test/dummy/config/database.yml
167
+ - test/dummy/config/routes.rb
168
+ - test/dummy/config/environments/development.rb
169
+ - test/dummy/config/environments/test.rb
170
+ - test/dummy/config/environments/production.rb
171
+ - test/dummy/config/environment.rb
172
+ - test/dummy/config/application.rb
173
+ - test/dummy/config/locales/en.yml
174
+ - test/dummy/config/boot.rb
175
+ - test/dummy/db/test.sqlite3
176
+ - test/dummy/db/development.sqlite3
177
+ - test/Test.iml
178
+ - test/manage_test.rb