From 1c6646bc732def369e54ef4ac576d748c6ba9c92 Mon Sep 17 00:00:00 2001
From: Stefan Wintermeyer
Date: Tue, 25 Jun 2013 13:19:26 +0200
Subject: GUI improvements.
---
app/serializers/switchboard_entry_serializer.rb | 2 +-
app/views/switchboards/show.html.erb | 40 +++++++++++++++----------
2 files changed, 26 insertions(+), 16 deletions(-)
(limited to 'app')
diff --git a/app/serializers/switchboard_entry_serializer.rb b/app/serializers/switchboard_entry_serializer.rb
index 1b6c761..5d76e16 100644
--- a/app/serializers/switchboard_entry_serializer.rb
+++ b/app/serializers/switchboard_entry_serializer.rb
@@ -1,5 +1,5 @@
class SwitchboardEntrySerializer < ActiveModel::Serializer
- attributes :id, :name, :path_to_user, :avatar_src, :callstate
+ attributes :id, :name, :path_to_user, :avatar_src, :callstate, :switchable
has_one :sip_account, embed: :ids
has_one :switchboard, embed: :ids
diff --git a/app/views/switchboards/show.html.erb b/app/views/switchboards/show.html.erb
index 69b0ed6..b390ce5 100644
--- a/app/views/switchboards/show.html.erb
+++ b/app/views/switchboards/show.html.erb
@@ -40,22 +40,32 @@
{{/if}}
-
- {{#each phoneNumber in switchboardEntry.sipAccount.phoneNumberShortList}}
-
- {{phoneNumber.number}}
-
+ {{#if switchboardEntry.switchable}}
+
+ {{#each phoneNumber in switchboardEntry.sipAccount.phoneNumberShortList}}
+
+ {{phoneNumber.number}}
+
+ {{/each}}
+
+ {{else}}
+
+ {{#each phoneNumber in switchboardEntry.sipAccount.phoneNumberShortList}}
+
+ {{phoneNumber.number}}
+
- {{#if dispatchableIncomingCalls.length}}
-
- {{#each dispatchableIncomingCall in dispatchableIncomingCalls}}
-
-
- {{/each}}
-
- {{/if}}
- {{/each}}
-
+ {{#if dispatchableIncomingCalls.length}}
+
+ {{#each dispatchableIncomingCall in dispatchableIncomingCalls}}
+
+
+ {{/each}}
+
+ {{/if}}
+ {{/each}}
+
+ {{/if}}
{{#if switchboardEntry.sipAccount.calls.length}}
--
cgit v1.2.3