bigbluebutton_rails 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. data/.gitignore +2 -1
  2. data/CHANGELOG.rdoc +12 -0
  3. data/Gemfile.lock +53 -14
  4. data/README.rdoc +31 -29
  5. data/Rakefile +63 -11
  6. data/app/controllers/bigbluebutton/rooms_controller.rb +89 -26
  7. data/app/controllers/bigbluebutton/servers_controller.rb +38 -5
  8. data/app/helpers/bigbluebutton_rails_helper.rb +12 -0
  9. data/app/models/bigbluebutton_room.rb +44 -1
  10. data/app/models/bigbluebutton_server.rb +48 -12
  11. data/app/views/bigbluebutton/rooms/_form.html.erb +8 -0
  12. data/app/views/bigbluebutton/rooms/index.html.erb +34 -43
  13. data/app/views/bigbluebutton/rooms/join_mobile.html.erb +9 -0
  14. data/app/views/bigbluebutton/rooms/show.html.erb +8 -0
  15. data/app/views/bigbluebutton/servers/_activity_list.html.erb +48 -0
  16. data/app/views/bigbluebutton/servers/_form.html.erb +4 -0
  17. data/app/views/bigbluebutton/servers/activity.html.erb +51 -0
  18. data/app/views/bigbluebutton/servers/index.html.erb +21 -25
  19. data/app/views/bigbluebutton/servers/show.html.erb +5 -0
  20. data/bigbluebutton_rails.gemspec +9 -6
  21. data/config/locales/en.yml +11 -2
  22. data/lib/bigbluebutton_rails/controller_methods.rb +47 -14
  23. data/lib/bigbluebutton_rails/exceptions.rb +6 -0
  24. data/lib/bigbluebutton_rails/rails/routes.rb +17 -12
  25. data/lib/bigbluebutton_rails/rails.rb +4 -0
  26. data/lib/bigbluebutton_rails/version.rb +1 -1
  27. data/lib/bigbluebutton_rails.rb +1 -0
  28. data/lib/generators/bigbluebutton_rails/install_generator.rb +28 -5
  29. data/lib/generators/bigbluebutton_rails/templates/migration.rb +3 -0
  30. data/lib/generators/bigbluebutton_rails/templates/migration_0_0_4.rb +38 -0
  31. data/lib/generators/bigbluebutton_rails/templates/migration_0_0_5.rb +23 -0
  32. data/{lib/generators/bigbluebutton_rails/templates/public → public}/images/loading.gif +0 -0
  33. data/{lib/generators/bigbluebutton_rails/templates/public → public}/javascripts/jquery.min.js +0 -0
  34. data/public/stylesheets/bigbluebutton_rails.css +138 -0
  35. data/spec/controllers/bigbluebutton/rooms_controller_spec.rb +284 -25
  36. data/spec/controllers/bigbluebutton/servers_controller_spec.rb +93 -1
  37. data/spec/factories/bigbluebutton_room.rb +1 -0
  38. data/spec/factories/bigbluebutton_server.rb +1 -0
  39. data/spec/factories/integration/bigbluebutton_server_integration.rb +8 -0
  40. data/spec/generators/install_generator_spec.rb +53 -10
  41. data/spec/generators/views_generator_spec.rb +6 -2
  42. data/spec/helpers/bigbluebutton_rails_helper_spec.rb +19 -0
  43. data/spec/integration_conf.yml.example +5 -0
  44. data/spec/models/bigbluebutton_room_spec.rb +99 -72
  45. data/spec/models/bigbluebutton_server_spec.rb +81 -20
  46. data/spec/rails_app/.gitignore +2 -1
  47. data/spec/rails_app/app/views/layouts/application.html.erb +1 -1
  48. data/spec/rails_app/config/cucumber.yml +8 -0
  49. data/spec/rails_app/config/database.yml +4 -1
  50. data/spec/rails_app/db/seeds.rb +6 -5
  51. data/spec/rails_app/features/manage_bigbluebutton_rooms.feature +9 -0
  52. data/spec/rails_app/features/manage_bigbluebutton_servers.feature +9 -0
  53. data/spec/rails_app/features/step_definitions/bigbluebutton_room_steps.rb +38 -0
  54. data/spec/rails_app/features/step_definitions/bigbluebutton_server_steps.rb +23 -0
  55. data/spec/rails_app/features/step_definitions/common_steps.rb +3 -0
  56. data/spec/rails_app/features/step_definitions/web_steps.rb +211 -0
  57. data/spec/rails_app/features/support/content.rb +11 -0
  58. data/spec/rails_app/features/support/env.rb +50 -0
  59. data/spec/rails_app/features/support/env_gem.rb +9 -0
  60. data/spec/rails_app/features/support/paths.rb +38 -0
  61. data/spec/rails_app/features/support/selectors.rb +39 -0
  62. data/spec/rails_app/lib/tasks/cucumber.rake +65 -0
  63. data/spec/rails_app/public/images/loading.gif +0 -0
  64. data/spec/rails_app/public/javascripts/jquery.min.js +16 -0
  65. data/spec/rails_app/public/stylesheets/bigbluebutton_rails.css +138 -0
  66. data/spec/rails_app/script/cucumber +10 -0
  67. data/spec/routing/bigbluebutton/rooms_routing_spec.rb +12 -0
  68. data/spec/spec_helper.rb +0 -1
  69. data/spec/support/integration/integration_conf.rb +16 -0
  70. data/spec/support/matchers/shoulda/respond_with_json_matcher.rb +67 -0
  71. data/spec/support/mocked_server.rb +1 -0
  72. metadata +91 -29
  73. data/lib/generators/bigbluebutton_rails/public_generator.rb +0 -16
  74. data/spec/generators/public_generator_spec.rb +0 -31
@@ -1,13 +1,14 @@
1
1
  class Bigbluebutton::ServersController < ApplicationController
2
2
 
3
3
  respond_to :html
4
+ respond_to :json, :only => [:index, :show, :new, :create, :update, :destroy]
4
5
 
5
6
  def index
6
7
  respond_with(@servers = BigbluebuttonServer.all)
7
8
  end
8
9
 
9
10
  def show
10
- respond_with(@server = BigbluebuttonServer.find(params[:id]))
11
+ respond_with(@server = BigbluebuttonServer.find_by_param(params[:id]))
11
12
  end
12
13
 
13
14
  def new
@@ -15,7 +16,31 @@ class Bigbluebutton::ServersController < ApplicationController
15
16
  end
16
17
 
17
18
  def edit
18
- respond_with(@server = BigbluebuttonServer.find(params[:id]))
19
+ respond_with(@server = BigbluebuttonServer.find_by_param(params[:id]))
20
+ end
21
+
22
+ def activity
23
+ @server = BigbluebuttonServer.find_by_param(params[:id])
24
+ # @new_meetings = @server.rooms
25
+ @server.fetch_meetings
26
+ # @new_meetings = @server.meetings.reject{ |r|
27
+ # i = @new_meetings.index(r)
28
+ # i.nil? ? false : r.attr_equal?(@new_meetings[i])
29
+ #}
30
+ @server.meetings.each do |meeting|
31
+ meeting.fetch_meeting_info
32
+ end
33
+
34
+ # TODO catch exceptions
35
+
36
+ if params[:update_list]
37
+ render :partial => 'activity_list'
38
+ return
39
+ end
40
+
41
+ # TODO json response
42
+
43
+ respond_with(@server)
19
44
  end
20
45
 
21
46
  def create
@@ -27,14 +52,16 @@ class Bigbluebutton::ServersController < ApplicationController
27
52
  message = t('bigbluebutton_rails.servers.notice.create.success')
28
53
  redirect_to(@server, :notice => message)
29
54
  }
55
+ format.json { render :json => @server, :status => :created }
30
56
  else
31
57
  format.html { render :action => "new" }
58
+ format.json { render :json => @server.errors.full_messages, :status => :unprocessable_entity }
32
59
  end
33
60
  end
34
61
  end
35
62
 
36
63
  def update
37
- @server = BigbluebuttonServer.find(params[:id])
64
+ @server = BigbluebuttonServer.find_by_param(params[:id])
38
65
 
39
66
  respond_with @server do |format|
40
67
  if @server.update_attributes(params[:bigbluebutton_server])
@@ -42,15 +69,21 @@ class Bigbluebutton::ServersController < ApplicationController
42
69
  message = t('bigbluebutton_rails.servers.notice.update.success')
43
70
  redirect_to(@server, :notice => message)
44
71
  }
72
+ format.json { head :ok }
45
73
  else
46
74
  format.html { render :action => "edit" }
75
+ format.json { render :json => @server.errors.full_messages, :status => :unprocessable_entity }
47
76
  end
48
77
  end
49
78
  end
50
79
 
51
80
  def destroy
52
- @server = BigbluebuttonServer.find(params[:id])
81
+ @server = BigbluebuttonServer.find_by_param(params[:id])
53
82
  @server.destroy
54
- redirect_to(bigbluebutton_servers_url)
83
+
84
+ respond_with do |format|
85
+ format.html { redirect_to(bigbluebutton_servers_url) }
86
+ format.json { head :ok }
87
+ end
55
88
  end
56
89
  end
@@ -0,0 +1,12 @@
1
+ module BigbluebuttonRailsHelper
2
+
3
+ # Returns the URL for a QR-code image usign Google Charts API
4
+ def qrcode_url(content, size=nil)
5
+ size ||= "200x200"
6
+ content = CGI::escape(content)
7
+ "https://chart.googleapis.com/chart?cht=qr&chs=#{size}&chl=#{content}&choe=UTF-8"
8
+ end
9
+
10
+ end
11
+
12
+
@@ -14,20 +14,32 @@ class BigbluebuttonRoom < ActiveRecord::Base
14
14
  validates :randomize_meetingid, :inclusion => { :in => [true, false] }
15
15
  validates :voice_bridge, :presence => true, :uniqueness => true
16
16
 
17
+ validates :param,
18
+ :presence => true,
19
+ :uniqueness => true,
20
+ :length => { :minimum => 3 },
21
+ :format => { :with => /^[a-zA-Z\d_]+[a-zA-Z\d_-]*[a-zA-Z\d_]+$/,
22
+ :message => I18n.t('bigbluebutton_rails.rooms.errors.param_format') }
23
+
17
24
  # Passwords are 16 character strings
18
25
  # See http://groups.google.com/group/bigbluebutton-dev/browse_thread/thread/9be5aae1648bcab?pli=1
19
26
  validates :attendee_password, :length => { :maximum => 16 }
20
27
  validates :moderator_password, :length => { :maximum => 16 }
21
28
 
29
+ validates :attendee_password, :presence => true, :if => :private?
30
+ validates :moderator_password, :presence => true, :if => :private?
31
+
22
32
  attr_accessible :name, :server_id, :meetingid, :attendee_password, :moderator_password,
23
33
  :welcome_msg, :owner, :server, :private, :logout_url, :dial_number,
24
- :voice_bridge, :max_participants, :owner_id, :owner_type, :randomize_meetingid
34
+ :voice_bridge, :max_participants, :owner_id, :owner_type, :randomize_meetingid,
35
+ :external, :param
25
36
 
26
37
  # Note: these params need to be fetched from the server before being accessed
27
38
  attr_accessor :running, :participant_count, :moderator_count, :attendees,
28
39
  :has_been_forcibly_ended, :start_time, :end_time
29
40
 
30
41
  after_initialize :init
42
+ before_validation :set_param
31
43
 
32
44
  # Convenience method to access the attribute <tt>running</tt>
33
45
  def is_running?
@@ -155,6 +167,30 @@ class BigbluebuttonRoom < ActiveRecord::Base
155
167
  role
156
168
  end
157
169
 
170
+ # Compare the instance variables of two models to define if they are equal
171
+ # Returns a hash with the variables with different values or an empty hash
172
+ # if they are have all equal values.
173
+ # From: http://alicebobandmallory.com/articles/2009/11/02/comparing-instance-variables-in-ruby
174
+ def instance_variables_compare(o)
175
+ vars = [ :@running, :@participant_count, :@moderator_count, :@attendees,
176
+ :@has_been_forcibly_ended, :@start_time, :@end_time ]
177
+ Hash[*vars.map { |v|
178
+ self.instance_variable_get(v)!=o.instance_variable_get(v) ?
179
+ [v,o.instance_variable_get(v)] : []}.flatten]
180
+ end
181
+
182
+ # A more complete equal? method, comparing also the attibutes and
183
+ # the instance variables
184
+ def attr_equal?(o)
185
+ self == o and
186
+ self.instance_variables_compare(o).empty? and
187
+ self.attributes == o.attributes
188
+ end
189
+
190
+ def to_param
191
+ self.param
192
+ end
193
+
158
194
  protected
159
195
 
160
196
  def init
@@ -197,4 +233,11 @@ class BigbluebuttonRoom < ActiveRecord::Base
197
233
  self.logout_url, self.max_participants, self.voice_bridge)
198
234
  end
199
235
 
236
+ # if :param wasn't set, sets it as :name downcase and parameterized
237
+ def set_param
238
+ if self.param.blank?
239
+ self.param = self.name.parameterize.downcase unless self.name.nil?
240
+ end
241
+ end
242
+
200
243
  end
@@ -1,23 +1,45 @@
1
1
  require 'bigbluebutton-api'
2
2
 
3
3
  class BigbluebuttonServer < ActiveRecord::Base
4
- has_many :rooms, :class_name => 'BigbluebuttonRoom', :foreign_key => 'server_id',
5
- :dependent => :destroy
4
+ has_many :rooms,
5
+ :class_name => 'BigbluebuttonRoom',
6
+ :foreign_key => 'server_id',
7
+ :dependent => :destroy
6
8
 
7
- validates :name, :presence => true, :length => { :minimum => 1, :maximum => 500 }
9
+ validates :name,
10
+ :presence => true,
11
+ :uniqueness => true,
12
+ :length => { :minimum => 1, :maximum => 500 }
8
13
 
9
- validates :url, :presence => true, :uniqueness => true, :length => { :maximum => 500 }
10
- validates :url, :format => { :with => /http:\/\/.*\/bigbluebutton\/api/,
11
- :message => 'URL should have the pattern http://<server>/bigbluebutton/api' }
14
+ validates :url,
15
+ :presence => true,
16
+ :uniqueness => true,
17
+ :length => { :maximum => 500 },
18
+ :format => { :with => /http:\/\/.*\/bigbluebutton\/api/,
19
+ :message => I18n.t('bigbluebutton_rails.servers.errors.url_format') }
12
20
 
13
- validates :salt, :presence => true, :length => { :minimum => 1, :maximum => 500 }
21
+ validates :param,
22
+ :presence => true,
23
+ :uniqueness => true,
24
+ :length => { :minimum => 3 },
25
+ :format => { :with => /^[a-zA-Z\d_]+[a-zA-Z\d_-]*[a-zA-Z\d_]+$/,
26
+ :message => I18n.t('bigbluebutton_rails.servers.errors.param_format') }
14
27
 
15
- validates :version, :presence => true, :inclusion => { :in => ['0.64', '0.7'] }
28
+ validates :salt,
29
+ :presence => true,
30
+ :length => { :minimum => 1, :maximum => 500 }
31
+
32
+ validates :version,
33
+ :presence => true,
34
+ :inclusion => { :in => ['0.64', '0.7'] }
35
+
36
+ attr_accessible :name, :url, :version, :salt, :param
16
37
 
17
38
  # Array of <tt>BigbluebuttonMeeting</tt>
18
39
  attr_reader :meetings
19
40
 
20
41
  after_initialize :init
42
+ before_validation :set_param
21
43
 
22
44
  # Returns the API object (<tt>BigBlueButton::BigBlueButtonAPI</tt> defined in
23
45
  # <tt>bigbluebutton-api-ruby</tt>) associated with this server.
@@ -43,19 +65,26 @@ class BigbluebuttonServer < ActiveRecord::Base
43
65
  response[:meetings].each do |attr|
44
66
  room = BigbluebuttonRoom.find_by_server_id_and_meetingid(self.id, attr[:meetingID])
45
67
  if room.nil?
46
- room = BigbluebuttonRoom.new(:server => self, :meetingid => attr[:meetingID], :name => attr[:meetingID],
47
- :attendee_password => attr[:attendeePW], :moderator_password => attr[:moderatorPW])
48
- room.running = attr[:running]
68
+ room = BigbluebuttonRoom.create(:server => self, :meetingid => attr[:meetingID],
69
+ :name => attr[:meetingID], :attendee_password => attr[:attendeePW],
70
+ :moderator_password => attr[:moderatorPW], :external => true,
71
+ :randomize_meetingid => false)
49
72
  else
50
73
  room.update_attributes(:attendee_password => attr[:attendeePW],
51
74
  :moderator_password => attr[:moderatorPW])
52
- room.running = attr[:running]
53
75
  end
76
+ room.running = attr[:running]
77
+
78
+ # TODO What if the update/save above fails?
54
79
 
55
80
  @meetings << room
56
81
  end
57
82
  end
58
83
 
84
+ def to_param
85
+ self.param
86
+ end
87
+
59
88
  protected
60
89
 
61
90
  def init
@@ -63,4 +92,11 @@ class BigbluebuttonServer < ActiveRecord::Base
63
92
  @meetings = []
64
93
  end
65
94
 
95
+ # if :param wasn't set, sets it as :name downcase and parameterized
96
+ def set_param
97
+ if self.param.blank?
98
+ self.param = self.name.parameterize.downcase unless self.name.nil?
99
+ end
100
+ end
101
+
66
102
  end
@@ -60,6 +60,14 @@
60
60
  <%= f.label :max_participants %><br />
61
61
  <%= f.text_field :max_participants %>
62
62
  </div>
63
+ <div class="field">
64
+ <%= f.label :external %><br />
65
+ <%= f.check_box :external %>
66
+ </div>
67
+ <div class="field">
68
+ <%= f.label :param %><br />
69
+ <%= f.text_field :param %>
70
+ </div>
63
71
  <div class="actions">
64
72
  <%= f.submit %>
65
73
  </div>
@@ -1,46 +1,37 @@
1
1
  <h1>Listing <%= BigbluebuttonRoom.model_name.human %>:</h1>
2
2
 
3
- <table>
4
- <tr>
5
- <th><%= BigbluebuttonRoom.human_attribute_name(:server_id) %></th>
6
- <th><%= BigbluebuttonRoom.human_attribute_name(:meetingid) %></th>
7
- <th><%= BigbluebuttonRoom.human_attribute_name(:randomize_meetingid) %></th>
8
- <th><%= BigbluebuttonRoom.human_attribute_name(:meeting_name) %></th>
9
- <th><%= BigbluebuttonRoom.human_attribute_name(:private) %></th>
10
- <th><%= BigbluebuttonRoom.human_attribute_name(:attendee_password) %></th>
11
- <th><%= BigbluebuttonRoom.human_attribute_name(:moderator_password) %></th>
12
- <th><%= BigbluebuttonRoom.human_attribute_name(:welcome_msg) %></th>
13
- <th><%= BigbluebuttonRoom.human_attribute_name(:logout_url) %></th>
14
- <th><%= BigbluebuttonRoom.human_attribute_name(:dial_number) %></th>
15
- <th><%= BigbluebuttonRoom.human_attribute_name(:voice_bridge) %></th>
16
- <th><%= BigbluebuttonRoom.human_attribute_name(:max_participants) %></th>
17
- <th></th>
18
- <th></th>
19
- <th></th>
20
- </tr>
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>
21
8
 
22
- <% @rooms.each do |room| %>
23
- <tr>
24
- <td><%= room.server.id %></td>
25
- <td><%= room.meetingid %></td>
26
- <td><%= room.randomize_meetingid %></td>
27
- <td><%= room.name %></td>
28
- <td><%= room.private %></td>
29
- <td><%= room.attendee_password %></td>
30
- <td><%= room.moderator_password %></td>
31
- <td><%= room.welcome_msg %></td>
32
- <td><%= room.logout_url %></td>
33
- <td><%= room.dial_number %></td>
34
- <td><%= room.voice_bridge %></td>
35
- <td><%= room.max_participants %></td>
36
- <td><%= link_to 'Show', bigbluebutton_server_room_path(@server, room) %></td>
37
- <td><%= link_to 'Edit', edit_bigbluebutton_server_room_path(@server, room) %></td>
38
- <td><%= link_to 'Destroy', bigbluebutton_server_room_path(@server, room), :confirm => 'Are you sure?', :method => :delete %></td>
39
- </tr>
40
- <% end %>
41
-
42
- </table>
43
-
44
- <br />
45
-
46
- <%= link_to 'New Room', new_bigbluebutton_server_room_path %>
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>
@@ -0,0 +1,9 @@
1
+ <h1>Mobile access to <%= @room.name %></h1>
2
+
3
+ <div style="text-align:center; width:250px;">
4
+ <a href="<%= @join_url %>"><b>Click here</b><br/>to join from a mobile device</a><br><br/>
5
+ <span>Or scan the code below:</span><br/>
6
+ <img src="<%= qrcode_url(@join_url) %>" style="float:left; border:1px solid #ccc;"/>
7
+ </div>
8
+
9
+
@@ -50,6 +50,14 @@
50
50
  <b><%= BigbluebuttonRoom.human_attribute_name(:max_participants) %>:</b>
51
51
  <%= @room.max_participants %>
52
52
  </p>
53
+ <p>
54
+ <b><%= BigbluebuttonRoom.human_attribute_name(:external) %>:</b>
55
+ <%= @room.external %>
56
+ </p>
57
+ <p>
58
+ <b><%= BigbluebuttonRoom.human_attribute_name(:param) %>:</b>
59
+ <%= @room.param %>
60
+ </p>
53
61
 
54
62
  <%= link_to 'Edit', edit_bigbluebutton_server_room_path(@room.server, @room) %> |
55
63
  <%= link_to 'Back', bigbluebutton_server_rooms_path(@room.server) %>
@@ -0,0 +1,48 @@
1
+ <% @server.meetings.each do |room| %>
2
+ <div class="bbbrails_meeting_description">
3
+ <div class="title_bar">
4
+ <% unless room.new_record? %>
5
+ <div class="button_bar">
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
+ </div>
10
+ <div class="button_bar">
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
+ </div>
15
+ <% end %>
16
+ <b><%= room.name %></b> (ID: <%= room.meetingid %>) -
17
+ <% if room.is_running? %>
18
+ <span class="running">Running!</span>
19
+ <% else %>
20
+ <span class="not_running">Not running</span>
21
+ <% end %>
22
+ </div>
23
+ <% unless room.start_time.nil? %>
24
+ Started at: <%= room.start_time.strftime("%F, %R UTC%z") %><br/>
25
+ <% end %>
26
+ <% unless room.end_time.nil? %>
27
+ Ended at: <%= room.end_time.strftime("%F, %R UTC%z") %> (forcibly ended: <%= room.has_been_forcibly_ended %>)
28
+ <% end %>
29
+ <% unless room.attendees.count == 0 %>
30
+ Participants (<%= room.participant_count %> total, <%= room.moderator_count %> moderators):
31
+ <div class="bbbrails_meeting_attendees">
32
+ <div class="header">
33
+ <div class="field">Role</div>
34
+ <div class="field">ID</div>
35
+ <div class="field">Name</div>
36
+ </div>
37
+ <% room.attendees.each do |attendee| %>
38
+ <div class="row">
39
+ <div class="field"><%= attendee.role %></div>
40
+ <div class="field"><%= attendee.user_id %></div>
41
+ <div class="field"><%= attendee.full_name %></div>
42
+ </div>
43
+ <% end %>
44
+ </div>
45
+ <% end %>
46
+ <div style="clear:both;"></div>
47
+ </div>
48
+ <% end %>
@@ -26,6 +26,10 @@
26
26
  <%= f.label :version %><br />
27
27
  <%= f.text_field :version %>
28
28
  </div>
29
+ <div class="field">
30
+ <%= f.label :param %><br />
31
+ <%= f.text_field :param %>
32
+ </div>
29
33
  <div class="actions">
30
34
  <%= f.submit %>
31
35
  </div>
@@ -0,0 +1,51 @@
1
+ <script type="text/javascript">
2
+ var serverActivityCountdown = 0
3
+ var serverActivityCountdownInterval = 30 // in seconds
4
+
5
+ function serverActivityUpdateMeetingsLoad() {
6
+ $("#bbbrails_server_activity_meetings").load("<%= activity_bigbluebutton_server_path(@server, :update_list => true) %>", serverActivityUpdateMeetingsEnd());
7
+ }
8
+
9
+ function serverActivityUpdateMeetingsStart() {
10
+ clearInterval(serverActivityCountdown);
11
+ $(".bbbrails_countdown_value").html("Now...");
12
+ serverActivityUpdateMeetingsLoad();
13
+ }
14
+
15
+ function serverActivityUpdateMeetingsEnd() {
16
+ $(".bbbrails_countdown_value").html("Done!");
17
+ serverActivitySetCountdown();
18
+ }
19
+
20
+ function serverActivitySetCountdown() {
21
+ var count = serverActivityCountdownInterval;
22
+ serverActivityCountdown = setInterval(function(){
23
+ $(".bbbrails_countdown_value").html(count + " seconds");
24
+ if (count == 0) {
25
+ serverActivityUpdateMeetingsStart();
26
+ }
27
+ count--;
28
+ }, 1000);
29
+ }
30
+
31
+ $(document).ready(function(){
32
+ serverActivitySetCountdown();
33
+
34
+ $('.bbbrails_countdown a.bbbrails_refresh_now').click(function() {
35
+ serverActivityUpdateMeetingsStart();
36
+ return false;
37
+ });
38
+ });
39
+
40
+ </script>
41
+
42
+ <div class="bbbrails_countdown">
43
+ Refreshing in: <span class="bbbrails_countdown_value"></span>
44
+ (<a class="bbbrails_refresh_now" href="<%= activity_bigbluebutton_server_path(@server) %>">refresh now</a>)
45
+ </div>
46
+
47
+ <h1>Server activity monitor:</h1>
48
+
49
+ <div id="bbbrails_server_activity_meetings">
50
+ <%= render :partial => 'activity_list' %>
51
+ </div>
@@ -1,29 +1,25 @@
1
1
  <h1>Listing <%= BigbluebuttonServer.model_name.human %>:</h1>
2
2
 
3
- <table>
4
- <tr>
5
- <th><%= BigbluebuttonServer.human_attribute_name(:name) %></th>
6
- <th><%= BigbluebuttonServer.human_attribute_name(:url) %></th>
7
- <th><%= BigbluebuttonServer.human_attribute_name(:salt) %></th>
8
- <th><%= BigbluebuttonServer.human_attribute_name(:version) %></th>
9
- <th></th>
10
- <th></th>
11
- <th></th>
12
- </tr>
3
+ <div id="bbbrails_servers_links">
4
+ <%= link_to 'New server', new_bigbluebutton_server_path %>
5
+ </div>
13
6
 
14
- <% @servers.each do |server| %>
15
- <tr>
16
- <td><%= server.name %></td>
17
- <td><%= server.url %></td>
18
- <td><%= server.salt %></td>
19
- <td><%= server.version %></td>
20
- <td><%= link_to 'Show', server %></td>
21
- <td><%= link_to 'Edit', edit_bigbluebutton_server_path(server) %></td>
22
- <td><%= link_to 'Destroy', server, :confirm => 'Are you sure?', :method => :delete %></td>
23
- </tr>
24
- <% end %>
25
- </table>
7
+ <ul id="bbbrails_servers_list">
8
+ <% @servers.each do |server| %>
9
+ <li>
10
+ <div><label><%= BigbluebuttonServer.human_attribute_name(:name) %></label> <%= server.name %></div>
11
+ <div><label><%= BigbluebuttonServer.human_attribute_name(:url) %></label> <%= server.url %></div>
12
+ <div><label><%= BigbluebuttonServer.human_attribute_name(:salt) %></label> <%= server.salt %></div>
13
+ <div><label><%= BigbluebuttonServer.human_attribute_name(:version) %></label> <%= server.version %></div>
14
+ <div><label><%= BigbluebuttonServer.human_attribute_name(:param) %></label> <%= server.param %></div>
15
+ <div><label>Access</label>
16
+ <%= link_to 'Show', server %> |
17
+ <%= link_to 'View rooms', bigbluebutton_server_rooms_path(server) %> |
18
+ <%= link_to 'Activity monitor', activity_bigbluebutton_server_path(server) %> |
19
+ <%= link_to 'Edit', edit_bigbluebutton_server_path(server) %> |
20
+ <%= link_to 'Destroy', server, :confirm => 'Are you sure?', :method => :delete %>
21
+ </div>
22
+ </li>
23
+ <% end %>
24
+ </ul>
26
25
 
27
- <br />
28
-
29
- <%= link_to 'New Server', new_bigbluebutton_server_path %>
@@ -22,6 +22,11 @@
22
22
  <%= @server.version %>
23
23
  </p>
24
24
 
25
+ <p>
26
+ <b><%= BigbluebuttonServer.human_attribute_name(:param) %>:</b>
27
+ <%= @server.param %>
28
+ </p>
29
+
25
30
 
26
31
  <%= link_to 'Edit', edit_bigbluebutton_server_path(@server) %> |
27
32
  <%= link_to 'Back', bigbluebutton_servers_path %>
@@ -6,22 +6,25 @@ Gem::Specification.new do |s|
6
6
  s.version = BigbluebuttonRails::VERSION.dup
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.summary = "BigBlueButton integration for Ruby on Rails"
9
- s.email = "mconf@googlegroups.com"
9
+ s.email = "mconf-dev@googlegroups.com"
10
10
  s.homepage = "http://github.com/mconf/bigbluebutton_rails"
11
- s.description = "It allows you to interact with a BigBlueButton server from your Ruby on Rails web application"
12
- s.authors = ['Leonardo Crauss Daronco']
11
+ s.description = "It allows you to interact with BigBlueButton from your Ruby on Rails application"
12
+ s.authors = ['Mconf', 'Leonardo Crauss Daronco']
13
13
 
14
14
  s.files = `git ls-files`.split("\n")
15
15
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
16
  s.require_paths = ["lib"]
17
17
 
18
- s.add_runtime_dependency("rails", "~> 3.0.3")
18
+ s.add_runtime_dependency("rails", ">= 3.0.3")
19
19
  s.add_runtime_dependency("bigbluebutton-api-ruby", "~> 0.0.10")
20
20
 
21
- s.add_development_dependency("rspec-rails", "~> 2.5.0")
21
+ s.add_development_dependency("rspec-rails", "~> 2.6.0")
22
22
  s.add_development_dependency("factory_girl", "~> 1.3.2")
23
23
  s.add_development_dependency("sqlite3-ruby", "~> 1.3.3")
24
24
  s.add_development_dependency("generator_spec", "~> 0.8.2")
25
25
  s.add_development_dependency("shoulda-matchers", "~> 1.0.0.beta")
26
26
  s.add_development_dependency("forgery", "~> 0.3.7")
27
- end
27
+ s.add_development_dependency("cucumber-rails", "~> 0.5.2")
28
+ s.add_development_dependency("database_cleaner", "~> 0.6.7")
29
+ s.add_development_dependency("rdoc", "~> 3.6.0")
30
+ end