From e3b373bcf144dcd0c8e36f8894954dc2b752a05b Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Sat, 20 Apr 2013 12:51:50 +0200 Subject: voicemaiL_account in call_histories index --- app/views/call_histories/_index_core.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/call_histories') diff --git a/app/views/call_histories/_index_core.html.haml b/app/views/call_histories/_index_core.html.haml index 8bbf761..2faa220 100644 --- a/app/views/call_histories/_index_core.html.haml +++ b/app/views/call_histories/_index_core.html.haml @@ -28,7 +28,7 @@ %td - if call_history.voicemail_message? .voicemail-message - %a{:href => sip_account_voicemail_messages_path(@sip_account, :anchor => "message_#{call_history.voicemail_message.id}")} + %a{:href => voicemail_account_voicemail_messages_path(@sip_account.voicemail_account, :anchor => "message_#{call_history.voicemail_message.id}")} = image_tag('icons/gs_envelope_16x.png') = call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format")) -- cgit v1.2.3 From 2e3f13b5519f6764bbad4bb16232d1dc22be7551 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Mon, 29 Apr 2013 13:39:40 +0200 Subject: padination added to navigation view --- app/views/call_histories/_navigation.html.haml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'app/views/call_histories') diff --git a/app/views/call_histories/_navigation.html.haml b/app/views/call_histories/_navigation.html.haml index d72ad64..2218c50 100644 --- a/app/views/call_histories/_navigation.html.haml +++ b/app/views/call_histories/_navigation.html.haml @@ -1,14 +1,14 @@ %ul{:class => 'nav nav-pills'} - %li + %li{:class => (type.blank? ? :active : nil )} %a{ :href => "?type=" }= t("call_histories.index.navigation.all", :calls => @calls_count) - %li + %li{:class => (type == 'missed' ? :active : nil )} %a{ :href => "?type=missed" }= t("call_histories.index.navigation.missed", :calls => @calls_missed_count) - %li + %li{:class => (type == 'received' ? :active : nil )} %a{ :href => "?type=received" }= t("call_histories.index.navigation.received", :calls => @calls_received_count) - %li + %li{:class => (type == 'dialed' ? :active : nil )} %a{ :href => "?type=dialed" }= t("call_histories.index.navigation.dialed", :calls => @calls_dialed_count) - %li + %li{:class => (type == 'forwarded' ? :active : nil )} %a{ :href => "?type=forwarded" }= t("call_histories.index.navigation.forwarded", :calls => @calls_forwarded_count) -/ .pagination -/ = will_paginate @call_histories +.pagination + = will_paginate call_histories, :renderer => BootstrapPagination::Rails -- cgit v1.2.3 From 4cb4a33bb831439f3a6060bcabc4590a61fae27b Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Mon, 29 Apr 2013 13:43:00 +0200 Subject: call histories index --- app/views/call_histories/_index_core.html.haml | 143 +++++++++++-------------- 1 file changed, 61 insertions(+), 82 deletions(-) (limited to 'app/views/call_histories') diff --git a/app/views/call_histories/_index_core.html.haml b/app/views/call_histories/_index_core.html.haml index 2faa220..bc10cde 100644 --- a/app/views/call_histories/_index_core.html.haml +++ b/app/views/call_histories/_index_core.html.haml @@ -1,85 +1,64 @@ -= render :partial => "call_histories/navigation" -%table.table.table-striped - %thead - %tr - %th - Datum - %th - Uhrzeit - %th - Misc - %th - Avatar - %th - Teilnehmer - %th - Status += render :partial => "call_histories/navigation", :locals => {:call_histories => call_histories, :type => @type} - %tbody - - for call_history in call_histories - - if !call_history.display_number.blank? - - phone_book_entry = call_history.phone_book_entry_by_number(call_history.display_number) - %tr{:id => "call_history_id_#{call_history.id}_tr", :class => (call_history.duration.blank? ? 'warning' : '')} - %td - = l call_history.start_stamp, :format => :short - %td - = l call_history.start_stamp, :format => :short - %td - - if call_history.voicemail_message? - .voicemail-message - %a{:href => voicemail_account_voicemail_messages_path(@sip_account.voicemail_account, :anchor => "message_#{call_history.voicemail_message.id}")} - = image_tag('icons/gs_envelope_16x.png') - = call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format")) += form_tag(destroy_multiple_sip_account_call_histories_path(@sip_account), :method => :delete, :id => 'call_hostory_form') do + %table.table.table-striped + %thead + %tr + %th{:width => '10px'} + %th + =sortable :start_stamp, t("call_histories.index.date") + %th{:width => '10px'} + %th + =sortable :caller_id_name, t("call_histories.index.called_party") + %th + =sortable :duration, t("call_histories.index.duration") + %th + =sortable :result, t("call_histories.index.status") + %th - - else - - case call_history.entry_type - - when 'forwarded' - .call-forwarded= call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format")) - - if call_history.callee_account_type.to_s.downcase == 'voicemail' - = t("call_histories.index.voicemail") - - else - = call_history.destination_number - - when 'dialed' - .call-placed= call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format")) - - when 'received' - .call-received= call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format")) - - when 'missed' - .call-missed= call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format")) - - else - .call-unknown - = t("call_histories.index.#{call_history.entry_type}") - = call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format")) - - - if call_history.forwarding_service && call_history.entry_type != 'forwarded' - = t("call_histories.index.forwarded_by") - = call_history.display_auth_account_name - %td - - image = call_history.display_image(:small, phone_book_entry) - - if image - %ul.thumbnails - %li.span1 - %div.thumbnail - %a.thumbnail{:href => call_history.display_image(:profile, phone_book_entry)} - =image_tag(image, :alt => phone_book_entry.to_s, :class => 'img-rounded') - %td - - display_name = call_history.display_name - - if display_name.blank? - - display_name = phone_book_entry.to_s - - if phone_book_entry - %a.name{:href => phone_book_phone_book_entry_path(phone_book_entry.phone_book, phone_book_entry), :itemprop => "name"}= display_name - - else - .name= display_name - .phone= call_history.display_number - %td - - if call_history.display_duration - = call_history.display_duration - - else - = t("call_histories.call_results.#{call_history.result}") - %td - - if @sip_account.registration && can?(:call, call_history) - = link_to raw(" ") + t('call_histories.index.actions.call'), call_sip_account_call_history_path(@sip_account, call_history), :method => :put, :class => 'btn btn-mini' - %td - - if can? :destroy, call_history - = link_to raw(" ") + t('call_histories.index.actions.destroy'), [@sip_account, call_history], :method => :delete, :remote => true, :class => 'btn btn-mini btn-danger' - \ No newline at end of file + %tbody + - for call_history in call_histories + - if !call_history.display_number.blank? + - phone_book_entry = call_history.phone_book_entry_by_number(call_history.display_number) + %tr{:id => "call_history_id_#{call_history.id}_tr", :class => (call_history.duration.blank? ? 'warning' : '')} + %td.select_box= check_box_tag("selected_ids[]", call_history.id, false, :uuid => "select_item_#{call_history.id}", :class => 'select_item') + %td + -if call_history.entry_type == 'dialed' + %i{:class => 'icon-arrow-left'} + -elsif call_history.entry_type == 'missed' + %i{:class => 'icon-time'} + -elsif call_history.entry_type == 'forwarded' + %i{:class => 'icon-random'} + - else + %i{:class => 'icon-arrow-right'} + = l call_history.start_stamp, :format => :short + %br= t("call_histories.index.missed.#{call_history.entry_type}") + %td + - image = call_history.display_image(:mini, phone_book_entry) + - if image + %ul.thumbnails + =image_tag(image, :alt => phone_book_entry.to_s, :class => 'img-rounded') + %td + - display_name = call_history.display_name + - if display_name.blank? + - display_name = phone_book_entry.to_s + - if phone_book_entry + %a.name{:href => phone_book_phone_book_entry_path(phone_book_entry.phone_book, phone_book_entry), :itemprop => "name"}= display_name + - else + .name= display_name + .phone= call_history.display_number + %td + - if call_history.display_duration + = call_history.display_duration + %td + - if t("call_histories.call_results.#{call_history.result}").include?('translation missing') + = call_history.result.gsub('_', ' ').titleize + - else + = t("call_histories.call_results.#{call_history.result}") + %td + - if @sip_account.registration && can?(:call, call_history) + = link_to raw(" ") + t('call_histories.index.actions.call'), call_sip_account_call_history_path(@sip_account, call_history), :method => :put, :class => 'btn btn-mini' + %td + - if can? :destroy, call_history + = link_to raw(" ") + t('call_histories.index.actions.destroy'), [@sip_account, call_history], :method => :delete, :remote => true, :class => 'btn btn-mini btn-danger' -- cgit v1.2.3 From 1cc85875f35b69c31b25b7d426439f38e6936893 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Mon, 29 Apr 2013 14:54:26 +0200 Subject: display sounrce/destination number --- app/views/call_histories/_index_core.html.haml | 33 +++++++++++++++++++------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'app/views/call_histories') diff --git a/app/views/call_histories/_index_core.html.haml b/app/views/call_histories/_index_core.html.haml index bc10cde..0cbcd60 100644 --- a/app/views/call_histories/_index_core.html.haml +++ b/app/views/call_histories/_index_core.html.haml @@ -24,16 +24,30 @@ %tr{:id => "call_history_id_#{call_history.id}_tr", :class => (call_history.duration.blank? ? 'warning' : '')} %td.select_box= check_box_tag("selected_ids[]", call_history.id, false, :uuid => "select_item_#{call_history.id}", :class => 'select_item') %td - -if call_history.entry_type == 'dialed' - %i{:class => 'icon-arrow-left'} - -elsif call_history.entry_type == 'missed' - %i{:class => 'icon-time'} - -elsif call_history.entry_type == 'forwarded' - %i{:class => 'icon-random'} - - else - %i{:class => 'icon-arrow-right'} = l call_history.start_stamp, :format => :short - %br= t("call_histories.index.missed.#{call_history.entry_type}") + %br + -if call_history.entry_type == 'dialed' + %i{:class => 'icon-arrow-left'} + -elsif call_history.entry_type == 'missed' + %i{:class => 'icon-time'} + -elsif call_history.entry_type == 'forwarded' + - if call_history.callee_account_type.to_s.downcase == 'voicemailaccount' + %i{:class => 'icon-envelope'} + - else + %i{:class => 'icon-random'} + - else + %i{:class => 'icon-arrow-right'} + + - if call_history.entry_type == 'forwarded' + - if call_history.callee_account_type.to_s.downcase == 'phonenumber' + = call_history.destination_number + - if call_history.callee_account_type.to_s.downcase == 'voicemailaccount' + = VoicemailAccount.where(:id => call_history.callee_account_id).first.to_s + - elsif call_history.entry_type == 'dialed' + = call_history.caller_id_number + - else + = call_history.destination_number + %td - image = call_history.display_image(:mini, phone_book_entry) - if image @@ -56,6 +70,7 @@ = call_history.result.gsub('_', ' ').titleize - else = t("call_histories.call_results.#{call_history.result}") + /= call_history.inspect %td - if @sip_account.registration && can?(:call, call_history) = link_to raw(" ") + t('call_histories.index.actions.call'), call_sip_account_call_history_path(@sip_account, call_history), :method => :put, :class => 'btn btn-mini' -- cgit v1.2.3 From 2beeef5436da123dac0b3a9020c0ee352c8724c9 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Tue, 30 Apr 2013 10:13:42 +0200 Subject: delete multiple items --- app/views/call_histories/_index_core.html.haml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/views/call_histories') diff --git a/app/views/call_histories/_index_core.html.haml b/app/views/call_histories/_index_core.html.haml index 0cbcd60..fd335d4 100644 --- a/app/views/call_histories/_index_core.html.haml +++ b/app/views/call_histories/_index_core.html.haml @@ -6,6 +6,8 @@ %thead %tr %th{:width => '10px'} + = button_tag(:type => 'submit', :class => 'btn btn-mini btn-danger', :confirm => t("call_histories.index.actions.confirm_selected")) do + %i{:class => 'icon-trash icon-white'} %th =sortable :start_stamp, t("call_histories.index.date") %th{:width => '10px'} -- cgit v1.2.3 From 4b118eb90f6b87d3346c77efd6d6c2d37ef0e6d1 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Tue, 30 Apr 2013 11:43:34 +0200 Subject: comment removed --- app/views/call_histories/_index_core.html.haml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'app/views/call_histories') diff --git a/app/views/call_histories/_index_core.html.haml b/app/views/call_histories/_index_core.html.haml index fd335d4..8c40890 100644 --- a/app/views/call_histories/_index_core.html.haml +++ b/app/views/call_histories/_index_core.html.haml @@ -72,10 +72,9 @@ = call_history.result.gsub('_', ' ').titleize - else = t("call_histories.call_results.#{call_history.result}") - /= call_history.inspect %td - if @sip_account.registration && can?(:call, call_history) = link_to raw(" ") + t('call_histories.index.actions.call'), call_sip_account_call_history_path(@sip_account, call_history), :method => :put, :class => 'btn btn-mini' - %td + - if can? :destroy, call_history = link_to raw(" ") + t('call_histories.index.actions.destroy'), [@sip_account, call_history], :method => :delete, :remote => true, :class => 'btn btn-mini btn-danger' -- cgit v1.2.3 From 4b904201187892676a0fd12e518513334924c534 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Tue, 30 Apr 2013 11:58:48 +0200 Subject: table footer added --- app/views/call_histories/_index_core.html.haml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/views/call_histories') diff --git a/app/views/call_histories/_index_core.html.haml b/app/views/call_histories/_index_core.html.haml index 8c40890..f5e73ca 100644 --- a/app/views/call_histories/_index_core.html.haml +++ b/app/views/call_histories/_index_core.html.haml @@ -18,7 +18,13 @@ %th =sortable :result, t("call_histories.index.status") %th - + %tfoot + %tr + %td{:colspan => 2} + = button_tag(:type => 'submit', :class => 'btn btn-mini btn-danger', :confirm => t("call_histories.index.actions.confirm_selected")) do + %i{:class => 'icon-trash icon-white'} + = t("call_histories.index.actions.destroy_multiple") + %td{:colspan => 5} %tbody - for call_history in call_histories - if !call_history.display_number.blank? -- cgit v1.2.3 From fc40cc2b38a3b83115881a557c4c1fbf417fa95f Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Thu, 2 May 2013 10:50:24 +0200 Subject: pagination --- app/views/call_histories/_navigation.html.haml | 27 +++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'app/views/call_histories') diff --git a/app/views/call_histories/_navigation.html.haml b/app/views/call_histories/_navigation.html.haml index 2218c50..d293471 100644 --- a/app/views/call_histories/_navigation.html.haml +++ b/app/views/call_histories/_navigation.html.haml @@ -1,14 +1,15 @@ -%ul{:class => 'nav nav-pills'} - %li{:class => (type.blank? ? :active : nil )} - %a{ :href => "?type=" }= t("call_histories.index.navigation.all", :calls => @calls_count) - %li{:class => (type == 'missed' ? :active : nil )} - %a{ :href => "?type=missed" }= t("call_histories.index.navigation.missed", :calls => @calls_missed_count) - %li{:class => (type == 'received' ? :active : nil )} - %a{ :href => "?type=received" }= t("call_histories.index.navigation.received", :calls => @calls_received_count) - %li{:class => (type == 'dialed' ? :active : nil )} - %a{ :href => "?type=dialed" }= t("call_histories.index.navigation.dialed", :calls => @calls_dialed_count) - %li{:class => (type == 'forwarded' ? :active : nil )} - %a{ :href => "?type=forwarded" }= t("call_histories.index.navigation.forwarded", :calls => @calls_forwarded_count) +%div{:class => 'pagination'} + %ul + %li{:class => (type.blank? ? :active : nil )} + %a{ :href => "?type=" }= t("call_histories.index.navigation.all", :calls => @calls_count) + %li{:class => (type == 'missed' ? :active : nil )} + %a{ :href => "?type=missed" }= t("call_histories.index.navigation.missed", :calls => @calls_missed_count) + %li{:class => (type == 'received' ? :active : nil )} + %a{ :href => "?type=received" }= t("call_histories.index.navigation.received", :calls => @calls_received_count) + %li{:class => (type == 'dialed' ? :active : nil )} + %a{ :href => "?type=dialed" }= t("call_histories.index.navigation.dialed", :calls => @calls_dialed_count) + %li{:class => (type == 'forwarded' ? :active : nil )} + %a{ :href => "?type=forwarded" }= t("call_histories.index.navigation.forwarded", :calls => @calls_forwarded_count) -.pagination - = will_paginate call_histories, :renderer => BootstrapPagination::Rails + + = will_paginate call_histories, :renderer => BootstrapPagination::Rails, :previous_label => raw(''), :next_label => raw(''), :class => nil -- cgit v1.2.3 From 8b592b0a04c2ebc51794537275ec8ac7500ccda3 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Fri, 3 May 2013 09:36:10 +0200 Subject: display table only if some items are present --- app/views/call_histories/_index_core.html.haml | 157 +++++++++++++------------ 1 file changed, 79 insertions(+), 78 deletions(-) (limited to 'app/views/call_histories') diff --git a/app/views/call_histories/_index_core.html.haml b/app/views/call_histories/_index_core.html.haml index f5e73ca..ef5654a 100644 --- a/app/views/call_histories/_index_core.html.haml +++ b/app/views/call_histories/_index_core.html.haml @@ -1,86 +1,87 @@ = render :partial => "call_histories/navigation", :locals => {:call_histories => call_histories, :type => @type} -= form_tag(destroy_multiple_sip_account_call_histories_path(@sip_account), :method => :delete, :id => 'call_hostory_form') do - %table.table.table-striped - %thead - %tr - %th{:width => '10px'} - = button_tag(:type => 'submit', :class => 'btn btn-mini btn-danger', :confirm => t("call_histories.index.actions.confirm_selected")) do - %i{:class => 'icon-trash icon-white'} - %th - =sortable :start_stamp, t("call_histories.index.date") - %th{:width => '10px'} - %th - =sortable :caller_id_name, t("call_histories.index.called_party") - %th - =sortable :duration, t("call_histories.index.duration") - %th - =sortable :result, t("call_histories.index.status") - %th - %tfoot - %tr - %td{:colspan => 2} - = button_tag(:type => 'submit', :class => 'btn btn-mini btn-danger', :confirm => t("call_histories.index.actions.confirm_selected")) do - %i{:class => 'icon-trash icon-white'} - = t("call_histories.index.actions.destroy_multiple") - %td{:colspan => 5} - %tbody - - for call_history in call_histories - - if !call_history.display_number.blank? - - phone_book_entry = call_history.phone_book_entry_by_number(call_history.display_number) - %tr{:id => "call_history_id_#{call_history.id}_tr", :class => (call_history.duration.blank? ? 'warning' : '')} - %td.select_box= check_box_tag("selected_ids[]", call_history.id, false, :uuid => "select_item_#{call_history.id}", :class => 'select_item') - %td - = l call_history.start_stamp, :format => :short - %br - -if call_history.entry_type == 'dialed' - %i{:class => 'icon-arrow-left'} - -elsif call_history.entry_type == 'missed' - %i{:class => 'icon-time'} - -elsif call_history.entry_type == 'forwarded' - - if call_history.callee_account_type.to_s.downcase == 'voicemailaccount' - %i{:class => 'icon-envelope'} +- if call_histories.any? + = form_tag(destroy_multiple_sip_account_call_histories_path(@sip_account), :method => :delete, :id => 'call_hostory_form') do + %table.table.table-striped + %thead + %tr + %th{:width => '10px'} + = button_tag(:type => 'submit', :class => 'btn btn-mini btn-danger', :confirm => t("call_histories.index.actions.confirm_selected")) do + %i{:class => 'icon-trash icon-white'} + %th + =sortable :start_stamp, t("call_histories.index.date") + %th{:width => '10px'} + %th + =sortable :caller_id_name, t("call_histories.index.called_party") + %th + =sortable :duration, t("call_histories.index.duration") + %th + =sortable :result, t("call_histories.index.status") + %th + %tfoot + %tr + %td{:colspan => 2} + = button_tag(:type => 'submit', :class => 'btn btn-mini btn-danger', :confirm => t("call_histories.index.actions.confirm_selected")) do + %i{:class => 'icon-trash icon-white'} + = t("call_histories.index.actions.destroy_multiple") + %td{:colspan => 5} + %tbody + - for call_history in call_histories + - if !call_history.display_number.blank? + - phone_book_entry = call_history.phone_book_entry_by_number(call_history.display_number) + %tr{:id => "call_history_id_#{call_history.id}_tr", :class => (call_history.duration.blank? ? 'warning' : '')} + %td.select_box= check_box_tag("selected_ids[]", call_history.id, false, :uuid => "select_item_#{call_history.id}", :class => 'select_item') + %td + = l call_history.start_stamp, :format => :short + %br + -if call_history.entry_type == 'dialed' + %i{:class => 'icon-arrow-left'} + -elsif call_history.entry_type == 'missed' + %i{:class => 'icon-time'} + -elsif call_history.entry_type == 'forwarded' + - if call_history.callee_account_type.to_s.downcase == 'voicemailaccount' + %i{:class => 'icon-envelope'} + - else + %i{:class => 'icon-random'} - else - %i{:class => 'icon-random'} - - else - %i{:class => 'icon-arrow-right'} + %i{:class => 'icon-arrow-right'} - - if call_history.entry_type == 'forwarded' - - if call_history.callee_account_type.to_s.downcase == 'phonenumber' + - if call_history.entry_type == 'forwarded' + - if call_history.callee_account_type.to_s.downcase == 'phonenumber' + = call_history.destination_number + - if call_history.callee_account_type.to_s.downcase == 'voicemailaccount' + = VoicemailAccount.where(:id => call_history.callee_account_id).first.to_s + - elsif call_history.entry_type == 'dialed' + = call_history.caller_id_number + - else = call_history.destination_number - - if call_history.callee_account_type.to_s.downcase == 'voicemailaccount' - = VoicemailAccount.where(:id => call_history.callee_account_id).first.to_s - - elsif call_history.entry_type == 'dialed' - = call_history.caller_id_number + + %td + - image = call_history.display_image(:mini, phone_book_entry) + - if image + %ul.thumbnails + =image_tag(image, :alt => phone_book_entry.to_s, :class => 'img-rounded') + %td + - display_name = call_history.display_name + - if display_name.blank? + - display_name = phone_book_entry.to_s + - if phone_book_entry + %a.name{:href => phone_book_phone_book_entry_path(phone_book_entry.phone_book, phone_book_entry), :itemprop => "name"}= display_name + - else + .name= display_name + .phone= call_history.display_number + %td + - if call_history.display_duration + = call_history.display_duration + %td + - if t("call_histories.call_results.#{call_history.result}").include?('translation missing') + = call_history.result.gsub('_', ' ').titleize - else - = call_history.destination_number - - %td - - image = call_history.display_image(:mini, phone_book_entry) - - if image - %ul.thumbnails - =image_tag(image, :alt => phone_book_entry.to_s, :class => 'img-rounded') - %td - - display_name = call_history.display_name - - if display_name.blank? - - display_name = phone_book_entry.to_s - - if phone_book_entry - %a.name{:href => phone_book_phone_book_entry_path(phone_book_entry.phone_book, phone_book_entry), :itemprop => "name"}= display_name - - else - .name= display_name - .phone= call_history.display_number - %td - - if call_history.display_duration - = call_history.display_duration - %td - - if t("call_histories.call_results.#{call_history.result}").include?('translation missing') - = call_history.result.gsub('_', ' ').titleize - - else - = t("call_histories.call_results.#{call_history.result}") - %td - - if @sip_account.registration && can?(:call, call_history) - = link_to raw(" ") + t('call_histories.index.actions.call'), call_sip_account_call_history_path(@sip_account, call_history), :method => :put, :class => 'btn btn-mini' + = t("call_histories.call_results.#{call_history.result}") + %td + - if @sip_account.registration && can?(:call, call_history) + = link_to raw(" ") + t('call_histories.index.actions.call'), call_sip_account_call_history_path(@sip_account, call_history), :method => :put, :class => 'btn btn-mini' - - if can? :destroy, call_history - = link_to raw(" ") + t('call_histories.index.actions.destroy'), [@sip_account, call_history], :method => :delete, :remote => true, :class => 'btn btn-mini btn-danger' + - if can? :destroy, call_history + = link_to raw(" ") + t('call_histories.index.actions.destroy'), [@sip_account, call_history], :method => :delete, :remote => true, :class => 'btn btn-mini btn-danger' -- cgit v1.2.3 From ca490d7215ffb6015573b690cd5b1a53d9b67e34 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Fri, 17 May 2013 09:35:05 +0200 Subject: call_histories index view improvements --- app/views/call_histories/_index_core.html.haml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'app/views/call_histories') diff --git a/app/views/call_histories/_index_core.html.haml b/app/views/call_histories/_index_core.html.haml index ef5654a..9c2cf39 100644 --- a/app/views/call_histories/_index_core.html.haml +++ b/app/views/call_histories/_index_core.html.haml @@ -41,17 +41,29 @@ %i{:class => 'icon-time'} -elsif call_history.entry_type == 'forwarded' - if call_history.callee_account_type.to_s.downcase == 'voicemailaccount' - %i{:class => 'icon-envelope'} + - voicemail_message = call_history.voicemail_message + - if voicemail_message + - if voicemail_message.read_epoch > 0 + %i{:class => 'icon-bullhorn'} + - else + %i{:class => 'icon-envelope'} + - else + %i{:class => 'icon-random'} - else %i{:class => 'icon-random'} - else %i{:class => 'icon-arrow-right'} - if call_history.entry_type == 'forwarded' - - if call_history.callee_account_type.to_s.downcase == 'phonenumber' - = call_history.destination_number - if call_history.callee_account_type.to_s.downcase == 'voicemailaccount' - = VoicemailAccount.where(:id => call_history.callee_account_id).first.to_s + - if voicemail_message + %a.name{:href => voicemail_account_voicemail_messages_path(voicemail_message.voicemail_account, :anchor => "message_#{voicemail_message.uuid}")} + = voicemail_message.display_duration + /= VoicemailAccount.where(:id => call_history.callee_account_id).first.to_s + - else + = VoicemailAccount.where(:id => call_history.callee_account_id).first.to_s + - else + = call_history.destination_number - elsif call_history.entry_type == 'dialed' = call_history.caller_id_number - else -- cgit v1.2.3