summaryrefslogtreecommitdiff
path: root/app/views/switchboards
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-06-27 12:29:04 +0200
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-06-27 12:29:04 +0200
commitace935fd2793b09925ab4b8a6b352585b5bdf3d2 (patch)
tree2d96ad4a82de25a9ab4e00129dea3f4c3777ecb7 /app/views/switchboards
parentbdb14342dd502ea01a83a791bb51507a82522daf (diff)
Switchboard shows offline label when the SipAccount has no registration.
Diffstat (limited to 'app/views/switchboards')
-rw-r--r--app/views/switchboards/show.html.erb79
1 files changed, 47 insertions, 32 deletions
diff --git a/app/views/switchboards/show.html.erb b/app/views/switchboards/show.html.erb
index b390ce5..1952a3c 100644
--- a/app/views/switchboards/show.html.erb
+++ b/app/views/switchboards/show.html.erb
@@ -40,44 +40,59 @@
</p>
{{/if}}
- {{#if switchboardEntry.switchable}}
- <p>
- {{#each phoneNumber in switchboardEntry.sipAccount.phoneNumberShortList}}
- <span class="label">
- {{phoneNumber.number}}
- </span>
- {{/each}}
- </p>
- {{else}}
- <p>
+ {{#if switchboardEntry.sipAccount.is_registrated}}
+ {{#if switchboardEntry.switchable}}
+ <p>
+ {{#each phoneNumber in switchboardEntry.sipAccount.phoneNumberShortList}}
+ <span class="label">
+ {{phoneNumber.number}}
+ </span>
+ {{/each}}
+ </p>
+ {{else}}
+ <p>
+ {{#each phoneNumber in switchboardEntry.sipAccount.phoneNumberShortList}}
+ <span class="label">
+ {{phoneNumber.number}}
+ </span>
+
+ {{#if dispatchableIncomingCalls.length}}
+ <p>
+ {{#each dispatchableIncomingCall in dispatchableIncomingCalls}}
+ <button {{action transfer_blind dispatchableIncomingCall.id phoneNumber.number}} class="btn btn-small">Transfer</button>
+ <button {{action transfer_attended dispatchableIncomingCall.id phoneNumber.number}} class="btn btn-small">Attended Transfer</button>
+ {{/each}}
+ </p>
+ {{/if}}
+ {{/each}}
+ </p>
+ {{/if}}
+
+ {{#if switchboardEntry.sipAccount.calls.length}}
+ <p>
+ {{#each call in switchboardEntry.sipAccount.calls}}
+ <span {{bindAttr class=":label call.isRinging:label-warning:label-success"}}>
+ {{#if call.isRinging}}<i class="icon-bell icon-white"></i>{{/if}}
+ von {{call.b_caller_id_number}} an {{call.destination}}
+ </span>
+ {{/each}}
+ </p>
+ {{/if}}
+ {{else}}
+ <p>
{{#each phoneNumber in switchboardEntry.sipAccount.phoneNumberShortList}}
<span class="label">
{{phoneNumber.number}}
</span>
-
- {{#if dispatchableIncomingCalls.length}}
- <p>
- {{#each dispatchableIncomingCall in dispatchableIncomingCalls}}
- <button {{action transfer_blind dispatchableIncomingCall.id phoneNumber.number}} class="btn btn-small">Transfer</button>
- <button {{action transfer_attended dispatchableIncomingCall.id phoneNumber.number}} class="btn btn-small">Attended Transfer</button>
- {{/each}}
- </p>
- {{/if}}
{{/each}}
- </p>
- {{/if}}
-
- {{#if switchboardEntry.sipAccount.calls.length}}
- <p>
- {{#each call in switchboardEntry.sipAccount.calls}}
- <span {{bindAttr class=":label call.isRinging:label-warning:label-success"}}>
- {{#if call.isRinging}}<i class="icon-bell icon-white"></i>{{/if}}
- von {{call.b_caller_id_number}} an {{call.destination}}
- </span>
- {{/each}}
- </p>
- {{/if}}
+ </p>
+ <p>
+ <span class="label label-warning">
+ offline
+ </span>
+ </p>
+ {{/if}}
</small>
</div>
</li>