summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/switchboard_entries_controller.rb13
-rw-r--r--app/controllers/switchboards_controller.rb5
2 files changed, 15 insertions, 3 deletions
diff --git a/app/controllers/switchboard_entries_controller.rb b/app/controllers/switchboard_entries_controller.rb
index 32ca9bb..3f82976 100644
--- a/app/controllers/switchboard_entries_controller.rb
+++ b/app/controllers/switchboard_entries_controller.rb
@@ -3,8 +3,17 @@ class SwitchboardEntriesController < ApplicationController
authorize_resource :switchboard_entry, :through => :switchboard, :except => [:sort]
def index
- @switchboard_entries = @switchboard.switchboard_entries
- spread_breadcrumbs
+ if @switchboard
+ @switchboard_entries = @switchboard.switchboard_entries
+ spread_breadcrumbs
+ else
+ @switchboard_entries = SwitchboardEntry.where(:id => params[:ids])
+ end
+
+ respond_to do |format|
+ format.html
+ format.json { render json: @switchboard_entries }
+ end
end
def show
diff --git a/app/controllers/switchboards_controller.rb b/app/controllers/switchboards_controller.rb
index 8ceb96d..d3424ad 100644
--- a/app/controllers/switchboards_controller.rb
+++ b/app/controllers/switchboards_controller.rb
@@ -31,6 +31,9 @@ class SwitchboardsController < ApplicationController
def new
@switchboard = @user.switchboards.build
+ @switchboard.show_avatars = true
+ @switchboard.entry_width = 2
+ @switchboard.reload_interval = 2000
spread_breadcrumbs
end
@@ -68,7 +71,7 @@ class SwitchboardsController < ApplicationController
private
def switchboard_params
- params.require(:switchboard).permit(:name)
+ params.require(:switchboard).permit(:name, :reload_interval, :show_avatars, :entry_width)
end
def spread_breadcrumbs