summaryrefslogtreecommitdiff
path: root/app/views/voicemail_messages
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/voicemail_messages')
-rw-r--r--app/views/voicemail_messages/_index_core.html.haml118
-rw-r--r--app/views/voicemail_messages/_navigation.html.haml11
2 files changed, 81 insertions, 48 deletions
diff --git a/app/views/voicemail_messages/_index_core.html.haml b/app/views/voicemail_messages/_index_core.html.haml
index 5e82761..f93365c 100644
--- a/app/views/voicemail_messages/_index_core.html.haml
+++ b/app/views/voicemail_messages/_index_core.html.haml
@@ -1,45 +1,77 @@
-= form_tag(destroy_multiple_sip_account_voicemail_messages_path(@sip_account), :method => :delete, :id => 'voicemail_message_form') do
- %header.entries-nav= render :partial => "voicemail_messages/navigation"
- .content
- %table.table.table-striped
-
- - for voicemail_message in voicemail_messages
- %tr.voicemail-messages-entry{:id => "message_#{voicemail_message.uuid}"}
- %td.select_box= check_box_tag("selected_uuids[]", voicemail_message.uuid, false, :uuid => "select_item_#{voicemail_message.uuid}", :class => 'select_item')
- %td.time
- .voicemail-received
- = voicemail_message.format_date(voicemail_message.created_epoch, t("voicemail_messages.index.date_format"), t("voicemail_messages.index.date_today_format"))
- - read_date = voicemail_message.format_date(voicemail_message.read_epoch, t("voicemail_messages.index.date_format"), t("voicemail_messages.index.date_today_format"))
- - if read_date
- .voicemail-read
- = read_date
- %td.folder
- = t("voicemail_messages.index.mailbox.#{voicemail_message.in_folder}")
- %td.user
- .name= voicemail_message.cid_name
- .phone= voicemail_message.cid_number
- %td.status
- .duration= voicemail_message.display_duration
- %td
- - if ! voicemail_message.flags.blank?
- = t("voicemail_messages.index.flags.#{voicemail_message.flags}")
- %td.form-actions
- - if can?(:show, voicemail_message) && File.readable?(voicemail_message.file_path)
- = link_to t('voicemail_messages.index.actions.download'), sip_account_voicemail_message_path(@sip_account, voicemail_message, :format => :wav), :method => :get
- %td.actions
- - if @sip_account.registration && can?(:call, voicemail_message)
- = link_to t('voicemail_messages.index.actions.call'), call_sip_account_voicemail_message_path(@sip_account, voicemail_message), :method => :put
- %td.form-actions
- - if can?(:edit, voicemail_message) && voicemail_message.read_epoch > 0
- = link_to t('voicemail_messages.index.actions.mark_unread'), mark_unread_sip_account_voicemail_message_path(@sip_account, voicemail_message), :method => :put
- - else
- = link_to t('voicemail_messages.index.actions.mark_read'), mark_read_sip_account_voicemail_message_path(@sip_account, voicemail_message), :method => :put
- %td.form-actions
- - if can? :destroy, voicemail_message
- = link_to t('voicemail_messages.index.actions.destroy'), sip_account_voicemail_message_path(@sip_account, voicemail_message), :method => :delete
+= render :partial => "voicemail_messages/navigation", :locals => {:type => @type}
+
+- if voicemail_messages.any?
+ = form_tag(destroy_multiple_voicemail_account_voicemail_messages_path(@voicemail_account), :method => :delete, :id => 'Setting_form') do
+ %table.table.table-striped
+ %thead
+ %tr
+ %th{:width => '10px'}
+ = button_tag(:type => 'submit', :class => 'btn btn-mini btn-danger', :confirm => t("voicemail_messages.index.actions.confirm_selected")) do
+ %i{:class => 'icon-trash icon-white'}
+ %th
+ =sortable :created_epoch, t("voicemail_messages.index.date")
+ %th{:width => '10px'}
+ %th
+ =sortable :cid_name, t("voicemail_messages.index.calling_party")
+ %th
+ =sortable :message_len, t("voicemail_messages.index.duration")
+ %th
+ =sortable :flags, t("voicemail_messages.index.message_flags")
+ %th
+ %th
+ %tfoot
+ %tr
+ %td{:colspan => 2}
+ = button_tag(:type => 'submit', :class => 'btn btn-mini btn-danger', :confirm => t("voicemail_messages.index.actions.confirm_selected")) do
+ %i{:class => 'icon-trash icon-white'}
+ = t("voicemail_messages.index.actions.destroy_multiple")
+ %td{:colspan => 4}
+ %tbody
+ - for voicemail_message in voicemail_messages
+ - phone_book_entry = nil
+ - image = nil
+ - if !voicemail_message.cid_number.blank?
+ - phone_book_entry = voicemail_message.phone_book_entry_by_number(voicemail_message.cid_number)
+ - if phone_book_entry
+ - image = phone_book_entry.image_url(:mini)
+ %tr{:id => "message_#{voicemail_message.uuid}"}
+ %td.select_box= check_box_tag("selected_uuids[]", voicemail_message.uuid, false, :uuid => "select_item_#{voicemail_message.uuid}", :class => 'select_item')
+ %td
+ = l Time.at(voicemail_message.created_epoch).to_datetime, :format => :short
+ - if voicemail_message.read_epoch > 0
+ %br
+ %i{:class => 'icon-bullhorn'}
+ = l Time.at(voicemail_message.read_epoch).to_datetime, :format => :short
+ - else
+ %br
+ %i{:class => 'icon-envelope'}
+ = t("voicemail_messages.index.unread")
+ %td
+ - if image
+ %ul.thumbnails
+ =image_tag(image, :alt => phone_book_entry.to_s, :class => 'img-rounded')
+ %td
+ - if phone_book_entry
+ %a.name{:href => phone_book_phone_book_entry_path(phone_book_entry.phone_book, phone_book_entry), :itemprop => "name"}= voicemail_message.cid_name
+ - else
+ .name= voicemail_message.cid_name
+ .phone= voicemail_message.cid_number
+ %td
+ = voicemail_message.display_duration
+ %td
+ - if ! voicemail_message.flags.blank?
+ = t("voicemail_messages.index.flags.#{voicemail_message.flags}")
+ %td
+ - if can?(:show, voicemail_message) && File.readable?(voicemail_message.file_path)
+ = link_to raw("<i class = 'icon-download'></i> ") + t('voicemail_messages.index.actions.download'), voicemail_account_voicemail_message_path(@voicemail_account, voicemail_message, :format => :wav), :method => :get
+ - if can?(:edit, voicemail_message) && voicemail_message.read_epoch > 0
+ = link_to raw("<i class = 'icon-envelope'></i> ") + t('voicemail_messages.index.actions.mark_unread'), mark_unread_voicemail_account_voicemail_message_path(@voicemail_account, voicemail_message), :method => :put
+ - else
+ = link_to raw("<i class = 'icon-bullhorn'></i> ") + t('voicemail_messages.index.actions.mark_read'), mark_read_voicemail_account_voicemail_message_path(@voicemail_account, voicemail_message), :method => :put
+ %td
+ - if @available_sip_account && @available_sip_account.registration && can?(:call, voicemail_message)
+ = link_to raw("<i class = 'icon-bell'></i> ") + t('voicemail_messages.index.actions.call'), call_voicemail_account_voicemail_message_path(@voicemail_account, voicemail_message), :method => :put, :class => 'btn btn-mini'
- %footer.entries-nav= render :partial => "voicemail_messages/navigation"
- = link_to Haml::Engine.new("%i.icon-remove").render + ' test ', root_url
- = image_submit_tag('icons/cross-16x.png', :confirm => t("voicemail_messages.index.actions.confirm_selected"))
- = t("voicemail_messages.index.actions.destroy_multiple")
+ - if can? :destroy, voicemail_message
+ = link_to raw("<i class = 'icon-trash icon-white'></i> ") + t('voicemail_messages.index.actions.destroy'), [@voicemail_account, voicemail_message], :method => :delete, :remote => true, :class => 'btn btn-mini btn-danger'
diff --git a/app/views/voicemail_messages/_navigation.html.haml b/app/views/voicemail_messages/_navigation.html.haml
index 2277bf2..225801c 100644
--- a/app/views/voicemail_messages/_navigation.html.haml
+++ b/app/views/voicemail_messages/_navigation.html.haml
@@ -1,9 +1,10 @@
-%nav
- %ol.abc
- %li
+%div{:class => 'pagination'}
+ %ul
+ %li{:class => (type.blank? ? :active : nil )}
%a{ :href => "?type=" }= t('voicemail_messages.index.navigation.all', :count => @messages_count)
+ %li{:class => (type == 'read' ? :active : nil )}
%a{ :href => "?type=read" }= t('voicemail_messages.index.navigation.read', :count => @messages_read_count)
+ %li{:class => (type == 'unread' ? :active : nil )}
%a{ :href => "?type=unread" }= t('voicemail_messages.index.navigation.unread', :count => @messages_unread_count)
-.pagination
- = will_paginate @voicemail_messages
+ = will_paginate @voicemail_messages, :renderer => BootstrapPagination::Rails, :previous_label => raw('<i class = "icon-chevron-left"></i>'), :next_label => raw('<i class = "icon-chevron-right"></i>'), :class => nil