diff options
author | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-06-27 12:29:04 +0200 |
---|---|---|
committer | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-06-27 12:29:04 +0200 |
commit | ace935fd2793b09925ab4b8a6b352585b5bdf3d2 (patch) | |
tree | 2d96ad4a82de25a9ab4e00129dea3f4c3777ecb7 /app/views/switchboards | |
parent | bdb14342dd502ea01a83a791bb51507a82522daf (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.erb | 79 |
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> |