summaryrefslogtreecommitdiff
path: root/app/views/acd_agents/_form_core.html.haml
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-22 12:32:36 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-22 12:32:36 +0100
commitbc4e559c08616de312906903a1c89eb74d09ffd7 (patch)
tree49695b7ea1d4c207f3fc9ea56ada0d35086a5334 /app/views/acd_agents/_form_core.html.haml
parent77a3c41cbb7edb93dcc98b7ae18a1b58e0d2d2ef (diff)
GUI improvement for new acd agents.
Diffstat (limited to 'app/views/acd_agents/_form_core.html.haml')
-rw-r--r--app/views/acd_agents/_form_core.html.haml10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/views/acd_agents/_form_core.html.haml b/app/views/acd_agents/_form_core.html.haml
index ab4657c..a56fc9a 100644
--- a/app/views/acd_agents/_form_core.html.haml
+++ b/app/views/acd_agents/_form_core.html.haml
@@ -1,7 +1,9 @@
.inputs
= f.input :name, :label => t('acd_agents.form.name.label'), :hint => conditional_hint('acd_agents.form.name.hint')
= f.input :status, :label => t('acd_agents.form.status.label'), :hint => conditional_hint('acd_agents.form.status.hint'), :include_blank => false, :collection => AcdAgent::STATUSES
- = f.input :last_call, :label => t('acd_agents.form.last_call.label'), :hint => conditional_hint('acd_agents.form.last_call.hint')
- = f.input :calls_answered, :label => t('acd_agents.form.calls_answered.label'), :hint => conditional_hint('acd_agents.form.calls_answered.hint')
- = f.input :destination_type, :label => t('acd_agents.form.destination_type.label'), :hint => conditional_hint('acd_agents.form.destination_type.hint'), :include_blank => false, :collection => AcdAgent::DESTINATION_TYPES
- = f.input :destination_id, :label => t('acd_agents.form.destination_id.label'), :hint => conditional_hint('acd_agents.form.destination_id.hint')
+ - if AcdAgent::DESTINATION_TYPES.count == 1 && AcdAgent::DESTINATION_TYPES.first == 'SipAccount' && @available_sip_accounts && @available_sip_accounts.count < 30
+ = f.hidden_field :destination_type, :value => AcdAgent::DESTINATION_TYPES.first
+ = f.input :destination_id, :collection => @available_sip_accounts.map { |r| [r.to_s, r.id] }, :include_blank => false
+ - else
+ = f.input :destination_type, :label => t('acd_agents.form.destination_type.label'), :hint => conditional_hint('acd_agents.form.destination_type.hint'), :include_blank => false, :collection => AcdAgent::DESTINATION_TYPES
+ = f.input :destination_id, :label => t('acd_agents.form.destination_id.label'), :hint => conditional_hint('acd_agents.form.destination_id.hint')