concerto_hardware 0.7 → 0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/concerto_hardware/screens/_player_stats.html.erb +4 -0
- data/lib/concerto_hardware/engine.rb +2 -0
- data/lib/concerto_hardware/version.rb +1 -1
- metadata +7 -10
- data/app/controllers/concerto_hardware/application_controller.rb~ +0 -20
- data/app/models/concerto_hardware/ability.rb~ +0 -43
- data/app/views/concerto_hardware/players/index.html.erb~ +0 -49
- data/lib/concerto_hardware/version.rb~ +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f27ba9038effb1e046287157464de8141ec111c6
|
4
|
+
data.tar.gz: 51fd68535a9d507ad4a64451ac412a762df9e76c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cea1d6037f747349f2390f77797f0e86e71d07459cb588d98e122ca03ef658d19ad8adbaefa06d90d4c9e1171aed3221a78e3c8266a335396e35812f257d70d
|
7
|
+
data.tar.gz: 27dc28028c6b468a831e82bb587e26869ba606762d7335b6bbed98043d984a58985a326b4c1035e80a3fb8723c11fcbd5572b24602b28c9315814167ff5a8318
|
@@ -0,0 +1,4 @@
|
|
1
|
+
<%# This partial will be read in the context of the main Concerto app. %>
|
2
|
+
<%# URL helpers require use of the 'hardware' routing helper. %>
|
3
|
+
<%# ConcertoHardware authorization rules are automatically provided. %>
|
4
|
+
<p><b><%= link_to 'Hardware Players', hardware.players_path %>:</b> <%= ConcertoHardware::Player.count %></p>
|
@@ -66,6 +66,8 @@ module ConcertoHardware
|
|
66
66
|
end
|
67
67
|
|
68
68
|
add_view_hook "ScreensController", :screen_details, :partial => "concerto_hardware/screens/screen_link"
|
69
|
+
|
70
|
+
add_view_hook "ScreensController", :screen_statistics, :partial => "concerto_hardware/screens/player_stats"
|
69
71
|
end
|
70
72
|
end
|
71
73
|
end # class Engine
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: concerto_hardware
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.8'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Concerto Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -41,20 +41,18 @@ files:
|
|
41
41
|
- app/assets/stylesheets/concerto_hardware/players.css.scss
|
42
42
|
- app/assets/stylesheets/scaffolds.css.scss
|
43
43
|
- app/controllers/concerto_hardware/application_controller.rb
|
44
|
-
- app/controllers/concerto_hardware/application_controller.rb~
|
45
44
|
- app/controllers/concerto_hardware/players_controller.rb
|
46
45
|
- app/helpers/players_helper.rb
|
47
46
|
- app/models/concerto_hardware/ability.rb
|
48
|
-
- app/models/concerto_hardware/ability.rb~
|
49
47
|
- app/models/concerto_hardware/player.rb
|
50
48
|
- app/views/concerto_hardware/players/_form.html.erb
|
51
49
|
- app/views/concerto_hardware/players/_show_body.html.erb
|
52
50
|
- app/views/concerto_hardware/players/_show_header.html.erb
|
53
51
|
- app/views/concerto_hardware/players/edit.html.erb
|
54
52
|
- app/views/concerto_hardware/players/index.html.erb
|
55
|
-
- app/views/concerto_hardware/players/index.html.erb~
|
56
53
|
- app/views/concerto_hardware/players/new.html.erb
|
57
54
|
- app/views/concerto_hardware/players/show.html.erb
|
55
|
+
- app/views/concerto_hardware/screens/_player_stats.html.erb
|
58
56
|
- app/views/concerto_hardware/screens/_screen_link.html.erb
|
59
57
|
- config/locales/en.yml
|
60
58
|
- config/routes.rb
|
@@ -64,7 +62,6 @@ files:
|
|
64
62
|
- lib/concerto_hardware/engine.rb
|
65
63
|
- lib/concerto_hardware/time_accessible.rb
|
66
64
|
- lib/concerto_hardware/version.rb
|
67
|
-
- lib/concerto_hardware/version.rb~
|
68
65
|
- test/fixtures/players.yml
|
69
66
|
- test/functional/players_controller_test.rb
|
70
67
|
- test/unit/helpers/players_helper_test.rb
|
@@ -89,12 +86,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
86
|
version: '0'
|
90
87
|
requirements: []
|
91
88
|
rubyforge_project:
|
92
|
-
rubygems_version: 2.
|
89
|
+
rubygems_version: 2.4.5.1
|
93
90
|
signing_key:
|
94
91
|
specification_version: 4
|
95
92
|
summary: A Rails Engine for managing Bandshell-powered Concerto hardware
|
96
93
|
test_files:
|
97
|
-
- test/unit/player_test.rb
|
98
|
-
- test/unit/helpers/players_helper_test.rb
|
99
|
-
- test/functional/players_controller_test.rb
|
100
94
|
- test/fixtures/players.yml
|
95
|
+
- test/functional/players_controller_test.rb
|
96
|
+
- test/unit/helpers/players_helper_test.rb
|
97
|
+
- test/unit/player_test.rb
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module ConcertoHardware
|
2
|
-
# Congratulations! You've found this engine's secret sauce.
|
3
|
-
# In a regular isolated engine, the engine's ApplicationController
|
4
|
-
# inherits from ActionController::Base. We're using the the main app's
|
5
|
-
# ApplicationController, making the isolation a little less strict.
|
6
|
-
# For example, we get the layout from the main Concerto app.
|
7
|
-
# Note that links back to the main application will need to directly
|
8
|
-
# reference the main_app router.
|
9
|
-
helper_method :current_accessor2
|
10
|
-
class ApplicationController < ::ApplicationController
|
11
|
-
def current_ability
|
12
|
-
# Use the Ability class defined in this engine's namespace.
|
13
|
-
# It is designed to also include the rules from the main app.
|
14
|
-
@current_ability ||= ConcertoHardware::Ability.new(current_accessor)
|
15
|
-
end
|
16
|
-
def current_accessor2
|
17
|
-
current_accessor
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
module ConcertoHardware
|
2
|
-
# The enigne's Ability class simply extends the existing Ability
|
3
|
-
# class for the application. We rely on the fact that it already
|
4
|
-
# includes CanCan::Ability.
|
5
|
-
class Ability < ::Ability
|
6
|
-
def initialize(accessor)
|
7
|
-
super # Get the main application's rules
|
8
|
-
# The main app will delegate to user_abilities, etc.
|
9
|
-
# Note the inherited rules give Admins rights to manage everything
|
10
|
-
end
|
11
|
-
|
12
|
-
def user_abilities(user)
|
13
|
-
super # Get the user rules from the main applications
|
14
|
-
|
15
|
-
# For debugging you may want to make all Players readable
|
16
|
-
# can :read, Player
|
17
|
-
|
18
|
-
# Let's defer to Concerto's rules for Screen Permissions.
|
19
|
-
# This will apply to both users browsing the hardware info
|
20
|
-
# as well as public screens in public instances accessing their data.
|
21
|
-
# - Right now, only admins can create players (TODO)
|
22
|
-
# - It may become desirable in the future for reading to be
|
23
|
-
# restricted or curtailed if a lot of sensitive data is stored here.
|
24
|
-
can :read, Player do |player|
|
25
|
-
!player.screen.nil? and can? :read, player.screen
|
26
|
-
end
|
27
|
-
can :update, Player do |player|
|
28
|
-
!player.screen.nil? and can? :update, player.screen
|
29
|
-
end
|
30
|
-
can :delete, Player do |player|
|
31
|
-
!player.screen.nil? and can? :delete, player.screen
|
32
|
-
end
|
33
|
-
end # user_abilities
|
34
|
-
|
35
|
-
def screen_abilities(screen)
|
36
|
-
super
|
37
|
-
# A logged-in screen can read its own Player information.
|
38
|
-
can :read, Player, :screen_id => screen.id
|
39
|
-
# In the future it may also need to write reporting data, so
|
40
|
-
# this will need to be expanded.
|
41
|
-
end # screen_abilities
|
42
|
-
end # class Ability
|
43
|
-
end # module ConcertoHardware
|
@@ -1,49 +0,0 @@
|
|
1
|
-
<section class="viewblock">
|
2
|
-
<header class="viewblock-header">
|
3
|
-
<h1 class="default-padding">
|
4
|
-
<%= t(:all_model, :model => ConcertoHardware::Player.model_name.human.pluralize) %>
|
5
|
-
</h1>
|
6
|
-
</header>
|
7
|
-
<div class="viewblock-cont">
|
8
|
-
<table>
|
9
|
-
<tr>
|
10
|
-
<th><%= ConcertoHardware::Player.human_attribute_name(:ip_address) %></th>
|
11
|
-
<th><%= ConcertoHardware::Player.human_attribute_name(:screen_id) %></th>
|
12
|
-
<th><%= ConcertoHardware::Player.human_attribute_name(:activated) %></th>
|
13
|
-
<th>Actions</th>
|
14
|
-
</tr>
|
15
|
-
|
16
|
-
<% @players.each do |player| %>
|
17
|
-
<tr>
|
18
|
-
<td><%= player.ip_address %></td>
|
19
|
-
<td><%= player.screen.name %></td>
|
20
|
-
<td><%= player.activated %></td>
|
21
|
-
|
22
|
-
<td>
|
23
|
-
<% if can? :read, player %>
|
24
|
-
<%= link_to t(:show, :model => ConcertoHardware::Player.model_name.human), player, :class => "btn" %>
|
25
|
-
<% end %>
|
26
|
-
<% if can? :edit, player %>
|
27
|
-
<%= link_to t(:edit, :model => ConcertoHardware::Player.model_name.human), edit_player_path(player), :class => "btn" %>
|
28
|
-
<% end %>
|
29
|
-
<% if can? :delete, player %>
|
30
|
-
<%= link_to t(:destroy, :model => ConcertoHardware::Player), player,
|
31
|
-
:data => { :confirm => t(:are_you_sure_delete_model_key, :model =>ConcertoHardware::Player.model_name.human, :key => player.screen.name) }, :method => :delete, :class => "btn" %>
|
32
|
-
<% end %>
|
33
|
-
</td>
|
34
|
-
</tr>
|
35
|
-
<% end %>
|
36
|
-
</table>
|
37
|
-
</div>
|
38
|
-
</section>
|
39
|
-
<div class="default-padding">
|
40
|
-
<%# for demo purposes: %>
|
41
|
-
Note: the poll interval is currently set to <%=ConcertoConfig[:poll_interval]%> seconds.<br/>
|
42
|
-
<% [::Ability.new(current_accessor2), ConcertoHardware::Ability.new(current_accessor2)].each do |ma| %>
|
43
|
-
The ability class is <%=ma.class%>.<br/>
|
44
|
-
Screen: <%= ConcertoHardware::Player.find(4).screen.name %>.<br/>
|
45
|
-
Can read screen: <%=ma.can? :read, ConcertoHardware::Player.find(4).screen%>.<br/>
|
46
|
-
Can read player: <%=ma.can? :read, ConcertoHardware::Player.find(4)%>.<br/>
|
47
|
-
<%end%>
|
48
|
-
</div>
|
49
|
-
|