bigbluebutton_rails 0.1.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +1 -12
- data/Gemfile.lock +1 -1
- data/README.rdoc +32 -46
- data/Rakefile +1 -0
- data/app/controllers/bigbluebutton/rooms_controller.rb +16 -17
- data/app/controllers/bigbluebutton/servers_controller.rb +2 -6
- data/app/models/bigbluebutton_room.rb +1 -35
- data/app/models/bigbluebutton_server.rb +1 -1
- data/app/views/bigbluebutton/rooms/_form.html.erb +3 -7
- data/app/views/bigbluebutton/rooms/edit.html.erb +2 -2
- data/app/views/bigbluebutton/rooms/external.html.erb +1 -2
- data/app/views/bigbluebutton/rooms/index.html.erb +37 -2
- data/app/views/bigbluebutton/rooms/invite.html.erb +2 -2
- data/app/views/bigbluebutton/rooms/join.html.erb +1 -1
- data/app/views/bigbluebutton/rooms/new.html.erb +1 -1
- data/app/views/bigbluebutton/rooms/show.html.erb +4 -10
- data/app/views/bigbluebutton/servers/_activity_list.html.erb +6 -6
- data/app/views/bigbluebutton/servers/index.html.erb +3 -4
- data/app/views/bigbluebutton/servers/show.html.erb +4 -3
- data/config/locales/en.yml +3 -7
- data/lib/bigbluebutton_rails/exceptions.rb +0 -4
- data/lib/bigbluebutton_rails/rails/routes.rb +35 -28
- data/lib/bigbluebutton_rails/version.rb +1 -1
- data/spec/controllers/bigbluebutton/rooms_controller_exception_handling_spec.rb +10 -13
- data/spec/controllers/bigbluebutton/rooms_controller_json_responses_spec.rb +13 -13
- data/spec/controllers/bigbluebutton/rooms_controller_spec.rb +115 -114
- data/spec/controllers/bigbluebutton/servers_controller_json_responses_spec.rb +1 -12
- data/spec/controllers/bigbluebutton/servers_controller_spec.rb +0 -11
- data/spec/generators/install_generator_spec.rb +1 -1
- data/spec/models/bigbluebutton_room_spec.rb +80 -166
- data/spec/models/bigbluebutton_server_spec.rb +4 -4
- data/spec/rails_app/features/activity_monitor_servers.feature +0 -6
- data/spec/rails_app/features/create_rooms.feature +0 -5
- data/spec/rails_app/features/create_servers.feature +2 -7
- data/spec/rails_app/features/edit_rooms.feature +0 -7
- data/spec/rails_app/features/edit_servers.feature +2 -8
- data/spec/rails_app/features/join_rooms.feature +0 -1
- data/spec/rails_app/features/list_and_show_rooms.feature +2 -10
- data/spec/rails_app/features/step_definitions/activity_monitor_servers_step.rb +10 -10
- data/spec/rails_app/features/step_definitions/common_steps.rb +4 -6
- data/spec/rails_app/features/step_definitions/create_rooms_steps.rb +0 -1
- data/spec/rails_app/features/step_definitions/join_mobile_steps.rb +3 -1
- data/spec/rails_app/features/step_definitions/join_rooms_steps.rb +7 -3
- data/spec/rails_app/features/step_definitions/list_and_show_rooms_steps.rb +5 -12
- data/spec/rails_app/features/step_definitions/list_and_show_servers_steps.rb +5 -1
- data/spec/rails_app/features/support/{patches/application_controller.rb → application_controller.rb} +0 -0
- data/spec/rails_app/features/support/paths.rb +10 -12
- data/spec/rails_app/features/support/templates.rb +46 -90
- data/spec/routing/bigbluebutton/custom_controllers_routing_spec.rb +22 -38
- data/spec/routing/bigbluebutton/rooms_routing_spec.rb +58 -142
- data/spec/routing/bigbluebutton/servers_routing_spec.rb +1 -9
- metadata +9 -12
- data/app/views/bigbluebutton/rooms/_rooms.html.erb +0 -37
- data/app/views/bigbluebutton/servers/rooms.html.erb +0 -2
- data/spec/rails_app/features/support/patches/bigbluebutton_room.rb +0 -9
data/CHANGELOG.rdoc
CHANGED
@@ -1,15 +1,4 @@
|
|
1
|
-
== 0.
|
2
|
-
|
3
|
-
* Rooms are now decoupled from servers:
|
4
|
-
* A room can exist without a server;
|
5
|
-
* Everytime a 'send_create' is called in a room, the method 'select_server' is called to select a server where the meeting will be held. The room is saved if the server changed;
|
6
|
-
* The method 'select_server' by default selects the server with less rooms;
|
7
|
-
* The routes for rooms are not nested with servers anymore ('/bigbluebutton/rooms' instead of '/bigbluebutton/server/:id/rooms').
|
8
|
-
* Because of this change all path helpers for rooms <b>must be updated!</b>
|
9
|
-
* rooms/external now receives a parameter "server_id" to indicate the server in which the external rooms is running. The views were updated.
|
10
|
-
* "bigbluebutton_routes :room_matchers" now generates all routes available for rooms, not only a selected set as before.
|
11
|
-
|
12
|
-
== 0.1.0
|
1
|
+
== 1.0.0
|
13
2
|
|
14
3
|
* First version with support to BigBlueButton 0.8:
|
15
4
|
* The support is still very basic: you can use the gem with BBB 0.8 but not all features are supported yet, such as pre-upload of slides and anything related to recordings.
|
data/Gemfile.lock
CHANGED
data/README.rdoc
CHANGED
@@ -1,23 +1,24 @@
|
|
1
1
|
= BigBlueButton on Rails
|
2
|
-
|
2
|
+
http://travis-ci.org/mconf/bigbluebutton_rails.png {(more...)}[http://travis-ci.org/#!/mconf/bigbluebutton_rails]
|
3
3
|
|
4
4
|
{BigBlueButton}[http://bigbluebutton.org] integration for Ruby on Rails 3.
|
5
5
|
|
6
6
|
Features:
|
7
|
-
* Allows multiple servers and multiple conference rooms
|
8
|
-
* Full API access using {bigbluebutton-api-ruby}[https://github.com/mconf/bigbluebutton-api-ruby]
|
9
|
-
* Easy way to join conferences: simply create a room and call the "join" action
|
10
|
-
* Easy integration with authentication and authorization mechanisms, such as Devise and CanCan
|
11
|
-
* Possibility to create private rooms, that require a password to join
|
12
|
-
* Deals with visitors (users that are not logged), allowing (or forbidding) them to join rooms
|
13
|
-
* Random meeting IDs to avoid problems with end_meeting, timeouts and reuse of URLs
|
14
|
-
* Server activity monitor
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
* Limit the number of users per room and rooms per server
|
19
|
-
* Server administration (modify config.xml, use bbb-conf, etc.)
|
20
|
-
*
|
7
|
+
* Allows multiple servers and multiple conference rooms
|
8
|
+
* Full API access using {bigbluebutton-api-ruby}[https://github.com/mconf/bigbluebutton-api-ruby]
|
9
|
+
* Easy way to join conferences: simply create a room and call the "join" action
|
10
|
+
* Easy integration with authentication and authorization mechanisms, such as Devise and CanCan
|
11
|
+
* Possibility to create private rooms, that require a password to join
|
12
|
+
* Deals with visitors (users that are not logged), allowing (or forbidding) them to join rooms
|
13
|
+
* Random meeting IDs to avoid problems with end_meeting, timeouts and reuse of URLs
|
14
|
+
* Server activity monitor
|
15
|
+
|
16
|
+
Planned features:
|
17
|
+
* Friendly URLs (e.g. http://somewhere.com/my-server/my-room)
|
18
|
+
* Limit the number of users per room and rooms per server
|
19
|
+
* Server administration (modify config.xml, use bbb-conf, etc.)
|
20
|
+
* Decouple servers-rooms to allow server selection on-the-fly
|
21
|
+
* Load balancing
|
21
22
|
|
22
23
|
For more future features and issues check {our google code page}[http://code.google.com/p/mconf/issues/list?can=2&q=label%3AComponent%20label%3ABigBlueButtonRails].
|
23
24
|
|
@@ -65,32 +66,33 @@ The routes to BigbluebuttonRails can be generated with the helper <tt>bigbluebut
|
|
65
66
|
It will generate the default routes. You need to call it at least once and the routes will be scoped with 'bigbluebutton'. They will look like:
|
66
67
|
|
67
68
|
/bigbluebutton/servers
|
68
|
-
/bigbluebutton/servers/
|
69
|
-
/bigbluebutton/servers/
|
70
|
-
/bigbluebutton/rooms
|
71
|
-
/bigbluebutton/rooms/my-room/join
|
69
|
+
/bigbluebutton/servers/default-server/rooms/my-room
|
70
|
+
/bigbluebutton/servers/default-server/rooms/his-room/join
|
72
71
|
|
73
|
-
You can customize the scope name and also make the routes
|
72
|
+
You can customize the scope name and also make the routes point to custom controllers.
|
74
73
|
|
75
74
|
bigbluebutton_routes :default, :scope => 'webconference', :controllers => { :servers => 'custom_servers', :rooms => 'custom_rooms' }
|
76
75
|
bigbluebutton_routes :default, :scope => '' # to remove the scope
|
77
76
|
|
78
77
|
You may also want shorter routes to access conference rooms. For that, use the option <tt>room_matchers</tt>:
|
79
78
|
|
79
|
+
bigbluebutton_routes :room_matchers
|
80
|
+
|
80
81
|
resources :users do
|
81
82
|
bigbluebutton_routes :room_matchers
|
82
83
|
end
|
83
84
|
|
84
|
-
It creates routes to the actions used to access
|
85
|
+
It creates routes to the actions used to access the conference room, so you can allow access to webconference rooms using URLs such as:
|
85
86
|
|
86
|
-
http://myserver.com/
|
87
|
-
http://myserver.com/user-name/room
|
87
|
+
http://myserver.com/server-name/room-name/join
|
88
|
+
http://myserver.com/user-name/public-room/join
|
89
|
+
http://myserver.com/ziltoid-room/join
|
88
90
|
|
89
91
|
For more information see:
|
90
92
|
|
91
93
|
* {How to: Routes}[https://github.com/mconf/bigbluebutton_rails/wiki/How-to:-Routes]
|
92
94
|
|
93
|
-
===
|
95
|
+
=== User authorization, permissions and assumptions
|
94
96
|
|
95
97
|
There are some basic assumptions made by BigbluebuttonRails:
|
96
98
|
|
@@ -101,21 +103,7 @@ If you don't, you can change this behaviour easily, keep reading.
|
|
101
103
|
|
102
104
|
BigbluebuttonRails uses the methods <tt>bigbluebutton_user</tt> and <tt>bigbluebutton_role(room)</tt> to get the current user and to get the permission that the current
|
103
105
|
user has in the <tt>room</tt>, respectively. These methods are defined in {lib/bigbluebutton_rails/controller_methods.rb}[https://github.com/mconf/bigbluebutton_rails/blob/master/lib/bigbluebutton_rails/controller_methods.rb]
|
104
|
-
and you can reimplement them in your application controller to change their behaviour
|
105
|
-
|
106
|
-
class ApplicationController < ActionController::Base
|
107
|
-
|
108
|
-
# overriding bigbluebutton_rails function
|
109
|
-
def bigbluebutton_user
|
110
|
-
current_user && current_user.is_a?(User) ? current_user : nil
|
111
|
-
end
|
112
|
-
|
113
|
-
def bigbluebutton_role(room)
|
114
|
-
...
|
115
|
-
end
|
116
|
-
|
117
|
-
end
|
118
|
-
|
106
|
+
and you can reimplement them in your application controller to change their behaviour.
|
119
107
|
|
120
108
|
==== See also
|
121
109
|
|
@@ -128,27 +116,25 @@ Fork this repository, clone your fork and start by installing the dependencies:
|
|
128
116
|
|
129
117
|
bundle install
|
130
118
|
|
131
|
-
|
119
|
+
Edit <tt>spec/rails_app/features/integration_conf.yml.example</tt> and set values for an existent BigBlueButton server. Save it as <tt>spec/integration_conf.yml</tt>. You will need it to run the integration tests. For more information see the page [Testing](https://github.com/mconf/bigbluebutton_rails/wiki/Testing) in our wiki.
|
132
120
|
|
133
121
|
Prepare the rails_app used for tests:
|
134
122
|
|
135
123
|
rake setup:rails_app
|
136
|
-
rake setup:rails_app:db
|
124
|
+
rake setup:rails_app:db
|
137
125
|
|
138
126
|
Run the tests:
|
139
127
|
|
140
128
|
rake spec
|
141
|
-
rake cucumber
|
129
|
+
rake cucumber
|
142
130
|
|
143
131
|
Or simply:
|
144
132
|
|
145
|
-
rake
|
146
|
-
|
147
|
-
Note: If you don't set the SERVER variable, the first server in <tt>config.yml</tt> will be used.
|
133
|
+
rake
|
148
134
|
|
149
135
|
Develop. :)
|
150
136
|
|
151
|
-
If you want your code to be integrated in this repository, please
|
137
|
+
If you want your code to be integrated in this repository, please create a branch with your modifications and submit a pull request.
|
152
138
|
|
153
139
|
=== Test Coverage
|
154
140
|
|
data/Rakefile
CHANGED
@@ -69,6 +69,7 @@ task :notes do
|
|
69
69
|
puts `grep -r 'OPTIMIZE\\|FIXME\\|TODO' app/ public/ spec/`
|
70
70
|
end
|
71
71
|
|
72
|
+
# FIXME: not the best way to test these migrations, but works for now
|
72
73
|
desc 'Setup the rails_app using the migration files created when upgrading the gem
|
73
74
|
version, run all tests and destroys the generated files.'
|
74
75
|
namespace :spec do
|
@@ -2,12 +2,13 @@ require 'bigbluebutton_api'
|
|
2
2
|
|
3
3
|
class Bigbluebutton::RoomsController < ApplicationController
|
4
4
|
|
5
|
+
before_filter :find_server
|
5
6
|
before_filter :find_room, :only => [:show, :edit, :update, :destroy, :join, :invite, :running, :end, :destroy, :end, :join_mobile]
|
6
|
-
before_filter :find_server, :only => [:external, :external_auth]
|
7
7
|
respond_to :html, :except => :running
|
8
8
|
respond_to :json, :only => [:running, :show, :new, :index, :create, :update]
|
9
9
|
|
10
10
|
def index
|
11
|
+
# TODO restrict to rooms belonging to the selected server
|
11
12
|
respond_with(@rooms = BigbluebuttonRoom.all)
|
12
13
|
end
|
13
14
|
|
@@ -25,6 +26,7 @@ class Bigbluebutton::RoomsController < ApplicationController
|
|
25
26
|
|
26
27
|
def create
|
27
28
|
@room = BigbluebuttonRoom.new(params[:bigbluebutton_room])
|
29
|
+
@room.server = @server
|
28
30
|
|
29
31
|
if !params[:bigbluebutton_room].has_key?(:meetingid) or
|
30
32
|
params[:bigbluebutton_room][:meetingid].blank?
|
@@ -35,7 +37,7 @@ class Bigbluebutton::RoomsController < ApplicationController
|
|
35
37
|
if @room.save
|
36
38
|
message = t('bigbluebutton_rails.rooms.notice.create.success')
|
37
39
|
format.html {
|
38
|
-
params[:redir_url] ||=
|
40
|
+
params[:redir_url] ||= bigbluebutton_server_room_path(@server, @room)
|
39
41
|
redirect_to params[:redir_url], :notice => message
|
40
42
|
}
|
41
43
|
format.json { render :json => { :message => message }, :status => :created }
|
@@ -63,7 +65,7 @@ class Bigbluebutton::RoomsController < ApplicationController
|
|
63
65
|
if @room.update_attributes(params[:bigbluebutton_room])
|
64
66
|
message = t('bigbluebutton_rails.rooms.notice.update.success')
|
65
67
|
format.html {
|
66
|
-
params[:redir_url] ||=
|
68
|
+
params[:redir_url] ||= bigbluebutton_server_room_path(@server, @room)
|
67
69
|
redirect_to params[:redir_url], :notice => message
|
68
70
|
}
|
69
71
|
format.json { render :json => { :message => message } }
|
@@ -99,7 +101,7 @@ class Bigbluebutton::RoomsController < ApplicationController
|
|
99
101
|
respond_with do |format|
|
100
102
|
format.html {
|
101
103
|
flash[:error] = message if error
|
102
|
-
params[:redir_url] ||=
|
104
|
+
params[:redir_url] ||= bigbluebutton_server_rooms_url
|
103
105
|
redirect_to params[:redir_url]
|
104
106
|
}
|
105
107
|
if error
|
@@ -171,31 +173,24 @@ class Bigbluebutton::RoomsController < ApplicationController
|
|
171
173
|
end
|
172
174
|
end
|
173
175
|
|
174
|
-
# receives :server_id to indicate the server and :meeting to indicate the
|
175
|
-
# MeetingID of the meeting that should be joined
|
176
176
|
def external
|
177
177
|
if params[:meeting].blank?
|
178
178
|
message = t('bigbluebutton_rails.rooms.errors.external.blank_meetingid')
|
179
|
-
params[:redir_url] ||=
|
179
|
+
params[:redir_url] ||= bigbluebutton_server_rooms_path(@server)
|
180
180
|
redirect_to params[:redir_url], :notice => message
|
181
181
|
end
|
182
|
-
@room = BigbluebuttonRoom.new(:
|
182
|
+
@room = BigbluebuttonRoom.new(:meetingid => params[:meeting])
|
183
183
|
end
|
184
184
|
|
185
185
|
# Authenticates an user using name and password passed in the params from #external
|
186
186
|
# Uses params[:meeting] to get the meetingID of the target room
|
187
187
|
def external_auth
|
188
|
-
# check :meeting and :user
|
189
188
|
if !params[:meeting].blank? && !params[:user].blank?
|
190
189
|
@server.fetch_meetings
|
191
190
|
@room = @server.meetings.select{ |r| r.meetingid == params[:meeting] }.first
|
192
|
-
message = t('bigbluebutton_rails.rooms.errors.external.inexistent_meeting') if @room.nil?
|
193
191
|
else
|
194
|
-
message = t('bigbluebutton_rails.rooms.errors.external.wrong_params')
|
195
|
-
end
|
196
|
-
|
197
|
-
unless message.nil?
|
198
192
|
@room = nil
|
193
|
+
message = t('bigbluebutton_rails.rooms.errors.auth.wrong_params')
|
199
194
|
redirect_to request.referer, :notice => message
|
200
195
|
return
|
201
196
|
end
|
@@ -260,7 +255,7 @@ class Bigbluebutton::RoomsController < ApplicationController
|
|
260
255
|
else
|
261
256
|
respond_with do |format|
|
262
257
|
format.html {
|
263
|
-
redirect_to(
|
258
|
+
redirect_to(bigbluebutton_server_room_path(@server, @room), :notice => message)
|
264
259
|
}
|
265
260
|
format.json { render :json => message }
|
266
261
|
end
|
@@ -269,7 +264,7 @@ class Bigbluebutton::RoomsController < ApplicationController
|
|
269
264
|
end
|
270
265
|
|
271
266
|
def join_mobile
|
272
|
-
@join_url =
|
267
|
+
@join_url = join_bigbluebutton_server_room_url(@server, @room, :mobile => '1')
|
273
268
|
@join_url.gsub!(/http:\/\//i, "bigbluebutton://")
|
274
269
|
|
275
270
|
# TODO: we can't use the mconf url because the mobile client scanning the qrcode is not
|
@@ -285,7 +280,11 @@ class Bigbluebutton::RoomsController < ApplicationController
|
|
285
280
|
end
|
286
281
|
|
287
282
|
def find_server
|
288
|
-
|
283
|
+
if params.has_key?(:server_id)
|
284
|
+
@server = BigbluebuttonServer.find_by_param(params[:server_id])
|
285
|
+
else
|
286
|
+
@server = BigbluebuttonServer.first
|
287
|
+
end
|
289
288
|
end
|
290
289
|
|
291
290
|
def join_internal(username, role, wait_action)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class Bigbluebutton::ServersController < ApplicationController
|
2
2
|
|
3
3
|
respond_to :html
|
4
|
-
respond_to :json, :only => [:index, :show, :new, :create, :update, :destroy, :activity
|
5
|
-
before_filter :find_server, :only => [:show, :edit, :activity, :update, :destroy
|
4
|
+
respond_to :json, :only => [:index, :show, :new, :create, :update, :destroy, :activity]
|
5
|
+
before_filter :find_server, :only => [:show, :edit, :activity, :update, :destroy]
|
6
6
|
|
7
7
|
def index
|
8
8
|
respond_with(@servers = BigbluebuttonServer.all)
|
@@ -97,10 +97,6 @@ class Bigbluebutton::ServersController < ApplicationController
|
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
|
-
def rooms
|
101
|
-
respond_with(@rooms = @server.rooms)
|
102
|
-
end
|
103
|
-
|
104
100
|
protected
|
105
101
|
|
106
102
|
def find_server
|
@@ -2,6 +2,7 @@ class BigbluebuttonRoom < ActiveRecord::Base
|
|
2
2
|
belongs_to :server, :class_name => 'BigbluebuttonServer'
|
3
3
|
belongs_to :owner, :polymorphic => true
|
4
4
|
|
5
|
+
validates :server_id, :presence => true
|
5
6
|
validates :meetingid, :presence => true, :uniqueness => true,
|
6
7
|
:length => { :minimum => 1, :maximum => 100 }
|
7
8
|
validates :name, :presence => true, :uniqueness => true,
|
@@ -63,8 +64,6 @@ class BigbluebuttonRoom < ActiveRecord::Base
|
|
63
64
|
#
|
64
65
|
# Triggers API call: <tt>get_meeting_info</tt>.
|
65
66
|
def fetch_meeting_info
|
66
|
-
require_server
|
67
|
-
|
68
67
|
response = self.server.api.get_meeting_info(self.meetingid, self.moderator_password)
|
69
68
|
|
70
69
|
@participant_count = response[:participantCount]
|
@@ -87,7 +86,6 @@ class BigbluebuttonRoom < ActiveRecord::Base
|
|
87
86
|
#
|
88
87
|
# Triggers API call: <tt>is_meeting_running</tt>.
|
89
88
|
def fetch_is_running?
|
90
|
-
require_server
|
91
89
|
@running = self.server.api.is_meeting_running?(self.meetingid)
|
92
90
|
end
|
93
91
|
|
@@ -95,25 +93,17 @@ class BigbluebuttonRoom < ActiveRecord::Base
|
|
95
93
|
#
|
96
94
|
# Triggers API call: <tt>end_meeting</tt>.
|
97
95
|
def send_end
|
98
|
-
require_server
|
99
96
|
self.server.api.end_meeting(self.meetingid, self.moderator_password)
|
100
97
|
end
|
101
98
|
|
102
99
|
# Sends a call to the BBB server to create the meeting.
|
103
100
|
#
|
104
|
-
# Will trigger 'select_server' to select a server where the meeting
|
105
|
-
# will be created. If a server is selected, the model is saved.
|
106
|
-
#
|
107
101
|
# With the response, updates the following attributes:
|
108
102
|
# * <tt>attendee_password</tt>
|
109
103
|
# * <tt>moderator_password</tt>
|
110
104
|
#
|
111
105
|
# Triggers API call: <tt>create_meeting</tt>.
|
112
106
|
def send_create
|
113
|
-
# updates the server whenever a meeting will be created
|
114
|
-
self.server = select_server
|
115
|
-
self.save unless self.new_record?
|
116
|
-
require_server
|
117
107
|
|
118
108
|
unless self.randomize_meetingid
|
119
109
|
response = do_create_meeting
|
@@ -155,8 +145,6 @@ class BigbluebuttonRoom < ActiveRecord::Base
|
|
155
145
|
#
|
156
146
|
# Uses the API but does not require a request to the server.
|
157
147
|
def join_url(username, role, password=nil)
|
158
|
-
require_server
|
159
|
-
|
160
148
|
case role
|
161
149
|
when :moderator
|
162
150
|
self.server.api.join_meeting_url(self.meetingid, username, self.moderator_password)
|
@@ -246,28 +234,6 @@ class BigbluebuttonRoom < ActiveRecord::Base
|
|
246
234
|
|
247
235
|
protected
|
248
236
|
|
249
|
-
# Every room needs a server to be used.
|
250
|
-
# The server of a room can change during the room's lifespan, but
|
251
|
-
# it should not change if the room is running or if it was created
|
252
|
-
# but not yet ended.
|
253
|
-
# Any action that requires a server should call 'require_server' before
|
254
|
-
# anything else.
|
255
|
-
def require_server
|
256
|
-
if self.server.nil?
|
257
|
-
msg = I18n.t('bigbluebutton_rails.rooms.errors.server.not_set')
|
258
|
-
raise BigbluebuttonRails::ServerRequired.new(msg)
|
259
|
-
end
|
260
|
-
end
|
261
|
-
|
262
|
-
# This method can be overridden to change the way the server is selected
|
263
|
-
# before a room is created
|
264
|
-
# This one selects the server with less rooms in it
|
265
|
-
def select_server
|
266
|
-
BigbluebuttonServer.
|
267
|
-
select("bigbluebutton_servers.*, count(bigbluebutton_rooms.id) as room_count").
|
268
|
-
joins(:rooms).group(:server_id).order("room_count ASC").first
|
269
|
-
end
|
270
|
-
|
271
237
|
def init
|
272
238
|
self[:meetingid] ||= random_meetingid
|
273
239
|
self[:voice_bridge] ||= random_voice_bridge
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<% if @room.new_record? %>
|
2
|
-
<% url =
|
2
|
+
<% url = bigbluebutton_server_rooms_path(@server) %>
|
3
3
|
<% else %>
|
4
|
-
<% url =
|
4
|
+
<% url = bigbluebutton_server_room_path(@server, @room) %>
|
5
5
|
<% end %>
|
6
6
|
|
7
|
-
<%= form_for @room, :url => url do |f| %>
|
7
|
+
<%= form_for [@server, @room], :url => url do |f| %>
|
8
8
|
<% if @room.errors.any? %>
|
9
9
|
<div id="error_explanation">
|
10
10
|
<h2><%= pluralize(@room.errors.count, "error") %>:</h2>
|
@@ -16,10 +16,6 @@
|
|
16
16
|
</div>
|
17
17
|
<% end %>
|
18
18
|
|
19
|
-
<div class="field">
|
20
|
-
<%= f.label :server_id %><br />
|
21
|
-
<%= f.text_field :server_id %>
|
22
|
-
</div>
|
23
19
|
<div class="field">
|
24
20
|
<%= f.label :name %><br />
|
25
21
|
<%= f.text_field :name %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<h1>Edit <%= BigbluebuttonRoom.model_name.human %>:</h1>
|
2
2
|
<%= render 'form' %>
|
3
3
|
|
4
|
-
<%= link_to 'Show',
|
5
|
-
<%= link_to 'Back',
|
4
|
+
<%= link_to 'Show', bigbluebutton_server_room_path(@server, @room) %> |
|
5
|
+
<%= link_to 'Back', bigbluebutton_server_rooms_path %>
|
6
6
|
|
@@ -4,8 +4,7 @@
|
|
4
4
|
|
5
5
|
<p>This meeting was created from another application.<br/>You must provide a name and a password to join:</p>
|
6
6
|
|
7
|
-
<%= form_tag
|
8
|
-
<%= hidden_field_tag "server_id", params[:server_id] %>
|
7
|
+
<%= form_tag external_bigbluebutton_server_rooms_path(@server) do %>
|
9
8
|
<%= hidden_field_tag "meeting", params[:meeting] %>
|
10
9
|
|
11
10
|
<div class="field">
|
@@ -1,2 +1,37 @@
|
|
1
|
-
<h1>Listing
|
2
|
-
|
1
|
+
<h1>Listing <%= BigbluebuttonRoom.model_name.human %>:</h1>
|
2
|
+
|
3
|
+
<div id="bbbrails_rooms_links">
|
4
|
+
<%= link_to 'Back to server', bigbluebutton_server_path(@server) %> |
|
5
|
+
<%= link_to 'Back to server list', bigbluebutton_servers_path %><br/>
|
6
|
+
<%= link_to 'New room', new_bigbluebutton_server_room_path %>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<ul id="bbbrails_rooms_list">
|
10
|
+
<% @rooms.each do |room| %>
|
11
|
+
<li>
|
12
|
+
<div class="field"><label><%= BigbluebuttonRoom.human_attribute_name(:server_id) %></label> <%= room.server_id %></div>
|
13
|
+
<div class="field"><label><%= BigbluebuttonRoom.human_attribute_name(:meetingid) %></label> <%= room.meetingid %></div>
|
14
|
+
<div class="field"><label><%= BigbluebuttonRoom.human_attribute_name(:randomize_meetingid) %></label> <%= room.randomize_meetingid %></div>
|
15
|
+
<div class="field"><label><%= BigbluebuttonRoom.human_attribute_name(:name) %></label> <%= room.name %></div>
|
16
|
+
<div class="field"><label><%= BigbluebuttonRoom.human_attribute_name(:private) %></label> <%= room.private %></div>
|
17
|
+
<div class="field"><label><%= BigbluebuttonRoom.human_attribute_name(:attendee_password) %></label> <%= room.attendee_password %></div>
|
18
|
+
<div class="field"><label><%= BigbluebuttonRoom.human_attribute_name(:moderator_password) %></label> <%= room.moderator_password %></div>
|
19
|
+
<div class="field"><label><%= BigbluebuttonRoom.human_attribute_name(:welcome_msg) %></label> <%= room.welcome_msg %></div>
|
20
|
+
<div class="field"><label><%= BigbluebuttonRoom.human_attribute_name(:logout_url) %></label> <%= room.logout_url %></div>
|
21
|
+
<div class="field"><label><%= BigbluebuttonRoom.human_attribute_name(:dial_number) %></label> <%= room.dial_number %></div>
|
22
|
+
<div class="field"><label><%= BigbluebuttonRoom.human_attribute_name(:voice_bridge) %></label> <%= room.voice_bridge %></div>
|
23
|
+
<div class="field"><label><%= BigbluebuttonRoom.human_attribute_name(:max_participants) %></label> <%= room.max_participants %></div>
|
24
|
+
<div class="field"><label><%= BigbluebuttonRoom.human_attribute_name(:external) %></label> <%= room.external %></div>
|
25
|
+
<div class="field"><label><%= BigbluebuttonRoom.human_attribute_name(:param) %></label> <%= room.param %></div>
|
26
|
+
<div class="field"><label>Access</label>
|
27
|
+
<%= link_to 'Show', bigbluebutton_server_room_path(@server, room) %> |
|
28
|
+
<%= link_to 'Join', join_bigbluebutton_server_room_path(@server, room) %> |
|
29
|
+
<%= link_to 'Invite', invite_bigbluebutton_server_room_path(@server, room) %> |
|
30
|
+
<%= link_to 'Mobile Join', join_mobile_bigbluebutton_server_room_path(@server, room) %> |
|
31
|
+
<%= link_to 'Edit', edit_bigbluebutton_server_room_path(@server, room) %> |
|
32
|
+
<%= link_to 'End', end_bigbluebutton_server_room_path(@server, room), :confirm => 'Are you sure?' %> |
|
33
|
+
<%= link_to 'Destroy', bigbluebutton_server_room_path(@server, room), :confirm => 'Are you sure?', :method => :delete %>
|
34
|
+
</div>
|
35
|
+
</li>
|
36
|
+
<% end %>
|
37
|
+
</ul>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
function ajax_request() {
|
4
4
|
$.ajax({
|
5
|
-
url: "<%=
|
5
|
+
url: "<%= running_bigbluebutton_server_room_url(@server, @room, :format => 'json') %>",
|
6
6
|
dataType: 'json',
|
7
7
|
error: function(xhr_data) {
|
8
8
|
$("#meeting_status").html("<request error>.");
|
@@ -33,7 +33,7 @@ $(document).ready(function(){
|
|
33
33
|
<p>Meeting status: <span id="meeting_status">-</span> (<a href="javascript:ajax_request();">refresh</a>)</p>
|
34
34
|
<p><%= @room.name %> requires a name and/or password to join:</p>
|
35
35
|
|
36
|
-
<%= form_tag
|
36
|
+
<%= form_tag join_bigbluebutton_server_room_path(@server, @room) do %>
|
37
37
|
|
38
38
|
<div class="field">
|
39
39
|
<label for="user_name">Name:</label><br />
|
@@ -8,7 +8,7 @@
|
|
8
8
|
</p>
|
9
9
|
<p>
|
10
10
|
<b><%= BigbluebuttonRoom.human_attribute_name(:server_id) %>:</b>
|
11
|
-
<%= @room.
|
11
|
+
<%= @room.server.id %>
|
12
12
|
</p>
|
13
13
|
<p>
|
14
14
|
<b><%= BigbluebuttonRoom.human_attribute_name(:meetingid) %>:</b>
|
@@ -59,15 +59,9 @@
|
|
59
59
|
<%= @room.param %>
|
60
60
|
</p>
|
61
61
|
|
62
|
-
<%= link_to 'Edit',
|
63
|
-
<%= link_to 'Back',
|
62
|
+
<%= link_to 'Edit', edit_bigbluebutton_server_room_path(@room.server, @room) %> |
|
63
|
+
<%= link_to 'Back', bigbluebutton_server_rooms_path(@room.server) %>
|
64
64
|
|
65
65
|
<br/>
|
66
66
|
|
67
|
-
|
68
|
-
<%= link_to 'Show', bigbluebutton_room_path(@room) %> |
|
69
|
-
<%= link_to 'Join', join_bigbluebutton_room_path(@room) %> |
|
70
|
-
<%= link_to 'Invite', invite_bigbluebutton_room_path(@room) %> |
|
71
|
-
<%= link_to 'Mobile Join', join_mobile_bigbluebutton_room_path(@room) %> |
|
72
|
-
<%= link_to 'End', end_bigbluebutton_room_path(@room), :confirm => 'Are you sure?' %> |
|
73
|
-
<%= link_to 'Destroy', bigbluebutton_room_path(@room), :confirm => 'Are you sure?', :method => :delete %>
|
67
|
+
<%= link_to 'Join', join_bigbluebutton_server_room_path(@room.server, @room) %>
|
@@ -3,14 +3,14 @@
|
|
3
3
|
<div class="title_bar">
|
4
4
|
<% unless room.new_record? %>
|
5
5
|
<div class="button_bar">
|
6
|
-
<%= link_to 'Show',
|
7
|
-
<%= link_to 'Edit',
|
8
|
-
<%= link_to 'Destroy',
|
6
|
+
<%= link_to 'Show', bigbluebutton_server_room_path(server, room) %>
|
7
|
+
<%= link_to 'Edit', edit_bigbluebutton_server_room_path(server, room) %>
|
8
|
+
<%= link_to 'Destroy', bigbluebutton_server_room_path(server, room), :confirm => 'Are you sure?', :method => :delete %>
|
9
9
|
</div>
|
10
10
|
<div class="button_bar">
|
11
|
-
<%= link_to 'Join',
|
12
|
-
<%= link_to 'Mobile Join',
|
13
|
-
<%= link_to 'End',
|
11
|
+
<%= link_to 'Join', join_bigbluebutton_server_room_path(server, room) %>
|
12
|
+
<%= link_to 'Mobile Join', join_mobile_bigbluebutton_server_room_path(server, room) %>
|
13
|
+
<%= link_to 'End', end_bigbluebutton_server_room_path(server, room), :confirm => 'Are you sure?' %>
|
14
14
|
</div>
|
15
15
|
<% end %>
|
16
16
|
<b><%= room.name %></b> (ID: <%= room.meetingid %>) -
|
@@ -1,8 +1,7 @@
|
|
1
1
|
<h1>Listing <%= BigbluebuttonServer.model_name.human %>:</h1>
|
2
2
|
|
3
3
|
<div id="bbbrails_servers_links">
|
4
|
-
<%= link_to
|
5
|
-
<%= link_to('New server', new_bigbluebutton_server_path) %>
|
4
|
+
<%= link_to 'New server', new_bigbluebutton_server_path %>
|
6
5
|
</div>
|
7
6
|
|
8
7
|
<ul id="bbbrails_servers_list">
|
@@ -15,10 +14,10 @@
|
|
15
14
|
<div><label><%= BigbluebuttonServer.human_attribute_name(:param) %></label> <%= server.param %></div>
|
16
15
|
<div><label>Access</label>
|
17
16
|
<%= link_to 'Show', server %> |
|
18
|
-
<%= link_to 'View rooms',
|
17
|
+
<%= link_to 'View rooms', bigbluebutton_server_rooms_path(server) %> |
|
19
18
|
<%= link_to 'Activity monitor', activity_bigbluebutton_server_path(server) %> |
|
20
19
|
<%= link_to 'Edit', edit_bigbluebutton_server_path(server) %> |
|
21
|
-
<%= link_to 'Destroy',
|
20
|
+
<%= link_to 'Destroy', server, :confirm => 'Are you sure?', :method => :delete %>
|
22
21
|
</div>
|
23
22
|
</li>
|
24
23
|
<% end %>
|
@@ -29,7 +29,8 @@
|
|
29
29
|
|
30
30
|
|
31
31
|
<%= link_to 'Edit', edit_bigbluebutton_server_path(@server) %> |
|
32
|
-
<%= link_to 'View rooms', rooms_bigbluebutton_server_path(@server) %> |
|
33
|
-
<%= link_to 'Activity monitor', activity_bigbluebutton_server_path(@server) %> |
|
34
|
-
<%= link_to 'Destroy', bigbluebutton_server_path(@server), :confirm => 'Are you sure?', :method => :delete %> |
|
35
32
|
<%= link_to 'Back', bigbluebutton_servers_path %>
|
33
|
+
|
34
|
+
<br/>
|
35
|
+
|
36
|
+
<%= link_to 'New room', new_bigbluebutton_server_room_path(@server) %>
|
data/config/locales/en.yml
CHANGED
@@ -27,14 +27,10 @@ en:
|
|
27
27
|
auth:
|
28
28
|
failure: "Authentication failure."
|
29
29
|
not_running: "The meeting is not running. You must wait for a moderator to join."
|
30
|
-
wrong_params: "Wrong
|
30
|
+
wrong_params: "Wrong params in your request."
|
31
31
|
external:
|
32
|
-
blank_meetingid: "You must specify the meetingid of the meeting you want to join
|
33
|
-
|
34
|
-
wrong_params: "Wrong parameters in your request."
|
35
|
-
param_format: 'you can only use letters, numbers and the symbols "-" or "_" (not at the begin or end).'
|
36
|
-
server:
|
37
|
-
not_set: "Your room must be associated to a server to execute this operation."
|
32
|
+
blank_meetingid: "You must specify the meetingid of the meeting you want to join"
|
33
|
+
param_format: 'you can only use letters, numbers and the symbols "-" or "_" (not at the begin or end)'
|
38
34
|
|
39
35
|
activerecord:
|
40
36
|
models:
|