diff options
Diffstat (limited to 'app/views/switchboards/show.html.erb')
-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> |