summaryrefslogtreecommitdiff
path: root/app/views/call_histories
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-22 15:33:06 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-22 15:33:06 +0100
commit39aa7132ceed3d4beab3a9b828e571bbfc67c07e (patch)
tree6c88289c9f99be0af8635636fcdf64102090e5ec /app/views/call_histories
parent5ad8203ce4f1bfea997960d0b52c626dea24b944 (diff)
parent6f69c1a85055ec7c2515719d79d2a7a4e60cec50 (diff)
Merge branch 'develop'5.1-beta1
Diffstat (limited to 'app/views/call_histories')
-rw-r--r--app/views/call_histories/_index_core.html.haml121
-rw-r--r--app/views/call_histories/_navigation.html.haml23
-rw-r--r--app/views/call_histories/index.html.haml4
3 files changed, 72 insertions, 76 deletions
diff --git a/app/views/call_histories/_index_core.html.haml b/app/views/call_histories/_index_core.html.haml
index 2d7658a..f9d2150 100644
--- a/app/views/call_histories/_index_core.html.haml
+++ b/app/views/call_histories/_index_core.html.haml
@@ -1,65 +1,58 @@
-= form_tag(destroy_multiple_sip_account_call_histories_path(@sip_account), :method => :delete, :id => 'call_history_form') do
- %header.entries-nav= render :partial => "call_histories/navigation"
- .content
- %table
- - reset_cycle
- - for call_history in call_histories
- - phone_number = call_history.display_number
- - voicemail_message = call_history.voicemail_message
- - if phone_number
- - phone_book_entry = call_history.phone_book_entry_by_number(phone_number)
- %tr.call-history-entry{:class => cycle('odd', 'even')}
- %td.select_box= check_box_tag("selected_ids[]", call_history.id, false, :id => "select_item_#{call_history.id}", :class => 'select_item')
- %td.thumbnail
- - image = call_history.display_image(:small, phone_book_entry)
- - if image
- = image_tag(image, :itemprop => 'image')
- %td.time
- - if voicemail_message
- .voicemail-message
- %a{:href => sip_account_voicemail_messages_path(@sip_account, :anchor => "message_#{voicemail_message.id}")}
- = image_tag('icons/gs_envelope_16x.png', :class => 'display')
- = call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format"))
- - elsif call_history.entry_type == '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
- - elsif call_history.entry_type == 'dialed'
- .call-placed= call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format"))
- - elsif call_history.entry_type == 'received'
- .call-received= call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format"))
- - elsif call_history.entry_type == '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.user
- - 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= phone_number
- %td.status
- - if call_history.display_duration
- .duration= call_history.display_duration
- - else
- .disposition= t("call_histories.call_results.#{call_history.result}")
- %td.actions
- - if @sip_account.registration && can?(:call, call_history)
- = link_to t('call_histories.index.actions.call'), call_sip_account_call_history_path(@sip_account, call_history), :method => :put
- %td.actions
- - if can? :destroy, call_history
- = link_to t('call_histories.index.actions.destroy'), sip_account_call_history_path(@sip_account, call_history), :method => :delete
+= render :partial => "call_histories/navigation"
- %footer.entries-nav= render :partial => "call_histories/navigation"
- = image_submit_tag('icons/cross-16x.png', :confirm => t("call_histories.index.actions.confirm_selected"))
- = t("call_histories.index.actions.destroy_multiple")
+%table{:class => 'table table-striped'}
+ - for call_history in call_histories
+ - phone_number = call_history.display_number
+ - voicemail_message = call_history.voicemail_message
+ - if phone_number
+ - phone_book_entry = call_history.phone_book_entry_by_number(phone_number)
+ %tr.call-history-entry
+ %td.thumbnail
+ - image = call_history.display_image(:small, phone_book_entry)
+ - if image
+ = image_tag(image, :itemprop => 'image')
+ %td.time
+ - if voicemail_message
+ .voicemail-message
+ %a{:href => sip_account_voicemail_messages_path(@sip_account, :anchor => "message_#{voicemail_message.id}")}
+ = image_tag('icons/gs_envelope_16x.png', :class => 'display')
+ = call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format"))
+ - elsif call_history.entry_type == '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
+ - elsif call_history.entry_type == 'dialed'
+ .call-placed= call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format"))
+ - elsif call_history.entry_type == 'received'
+ .call-received= call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format"))
+ - elsif call_history.entry_type == '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.user
+ - 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= phone_number
+ %td.status
+ - if call_history.display_duration
+ .duration= call_history.display_duration
+ - else
+ .disposition= t("call_histories.call_results.#{call_history.result}")
+ %td.actions
+ - if @sip_account.registration && can?(:call, call_history)
+ = link_to t('call_histories.index.actions.call'), call_sip_account_call_history_path(@sip_account, call_history), :method => :put
+ %td.actions
+ - if can? :destroy, call_history
+ = link_to t('call_histories.index.actions.destroy'), sip_account_call_history_path(@sip_account, call_history), :method => :delete
diff --git a/app/views/call_histories/_navigation.html.haml b/app/views/call_histories/_navigation.html.haml
index a1999d9..d72ad64 100644
--- a/app/views/call_histories/_navigation.html.haml
+++ b/app/views/call_histories/_navigation.html.haml
@@ -1,11 +1,14 @@
-%nav
- %ol.abc
- %li
- %a{ :href => "?type=" }= t("call_histories.index.navigation.all", :calls => @calls_count)
- %a{ :href => "?type=missed" }= t("call_histories.index.navigation.missed", :calls => @calls_missed_count)
- %a{ :href => "?type=received" }= t("call_histories.index.navigation.received", :calls => @calls_received_count)
- %a{ :href => "?type=dialed" }= t("call_histories.index.navigation.dialed", :calls => @calls_dialed_count)
- %a{ :href => "?type=forwarded" }= t("call_histories.index.navigation.forwarded", :calls => @calls_forwarded_count)
+%ul{:class => 'nav nav-pills'}
+ %li
+ %a{ :href => "?type=" }= t("call_histories.index.navigation.all", :calls => @calls_count)
+ %li
+ %a{ :href => "?type=missed" }= t("call_histories.index.navigation.missed", :calls => @calls_missed_count)
+ %li
+ %a{ :href => "?type=received" }= t("call_histories.index.navigation.received", :calls => @calls_received_count)
+ %li
+ %a{ :href => "?type=dialed" }= t("call_histories.index.navigation.dialed", :calls => @calls_dialed_count)
+ %li
+ %a{ :href => "?type=forwarded" }= t("call_histories.index.navigation.forwarded", :calls => @calls_forwarded_count)
-.pagination
- = will_paginate @call_histories
+/ .pagination
+/ = will_paginate @call_histories
diff --git a/app/views/call_histories/index.html.haml b/app/views/call_histories/index.html.haml
index adf6838..a939387 100644
--- a/app/views/call_histories/index.html.haml
+++ b/app/views/call_histories/index.html.haml
@@ -1,6 +1,6 @@
- if @type
- - title t("call_histories.index.page_title_#{@type}")
+ - content_for :title, t("call_histories.index.page_title_#{@type}")
- else
- - title t("call_histories.index.page_title")
+ - content_for :title, t("call_histories.index.page_title")
= render "index_core", :call_histories => @call_histories