summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-02-25 18:03:42 -0500
committerPeter Kozak <spag@golwen.net>2013-02-25 18:03:42 -0500
commit387ce8f6694b41ab73d264190ce41dcd13484ede (patch)
tree5d7e399a6d5975f9e70f4540f9675efa0d184ce9
parentcf89633baaa6e9bc901c2cc630ed2c94296109f1 (diff)
icons
-rw-r--r--app/controllers/intruders_controller.rb2
-rw-r--r--app/views/intruders/_index_core.html.haml9
-rw-r--r--app/views/sip_accounts/_index_core.html.haml4
-rw-r--r--app/views/users/show.html.haml16
4 files changed, 23 insertions, 8 deletions
diff --git a/app/controllers/intruders_controller.rb b/app/controllers/intruders_controller.rb
index 147e06d..99cb023 100644
--- a/app/controllers/intruders_controller.rb
+++ b/app/controllers/intruders_controller.rb
@@ -1,6 +1,6 @@
class IntrudersController < ApplicationController
def index
- @intruders = Intruder.all
+ @intruders = Intruder.order('list_type ASC, contact_last DESC').all
spread_breadcrumbs
end
diff --git a/app/views/intruders/_index_core.html.haml b/app/views/intruders/_index_core.html.haml
index 31bbd11..63f2253 100644
--- a/app/views/intruders/_index_core.html.haml
+++ b/app/views/intruders/_index_core.html.haml
@@ -16,7 +16,14 @@
- for intruder in intruders
%tr
- %td= intruder.list_type.chars.first
+ %td
+ - if intruder.list_type == 'whitelist'
+ %i.icon-ok
+ - elsif intruder.bans > 0
+ %i.icon-fire
+ - elsif intruder.points > 0
+ %i.icon-warning-sign
+
%td= intruder.contact_ip
%td= intruder.contact_port
%td= intruder.points
diff --git a/app/views/sip_accounts/_index_core.html.haml b/app/views/sip_accounts/_index_core.html.haml
index 34aac64..d98ea0a 100644
--- a/app/views/sip_accounts/_index_core.html.haml
+++ b/app/views/sip_accounts/_index_core.html.haml
@@ -20,13 +20,13 @@
- if sip_account.registration
%i.icon-ok
- else
- %i.icon-thumbs-down
+ %i.icon-ban-circle
%td
= sip_account.caller_name
- phone_numbers = sip_account.phone_numbers
%td
- if sip_account.phone_numbers.count > 0
- = render 'phone_numbers/listing', :phone_numbers => sip_account.phone_numbers.order(:number)
+ = render 'phone_numbers/listing', :phone_numbers => sip_account.phone_numbers.order(:position)
- if sip_accounts.map{ |sip_account| sip_account.phone_sip_accounts.any? }.include?(true)
%td
%span.hidden-phone
diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml
index d3b1cf3..8148005 100644
--- a/app/views/users/show.html.haml
+++ b/app/views/users/show.html.haml
@@ -29,10 +29,18 @@
= render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @tenant, :child => @user }
- @user.sip_accounts.each do |sip_account|
- - phone_number = sip_account.phone_numbers.order(:number).last
- - if phone_number && !phone_number.number.blank? && phone_number.number[0] != '+'
- %p
- %strong= sip_account.phone_numbers.order(:number).last.number
+ - phone_numbers = sip_account.phone_numbers.order(:position)
+ %p
+ - if phone_numbers[0]
+ %strong= phone_numbers[0].number
+ - else
+ %strong= sip_account.to_s
+ - if phone_numbers[1]
+ %strong= phone_numbers[1].number
+ - if phone_numbers[2]
+ %strong= phone_numbers[2].number
+ - if phone_numbers[3]
+ %strong ...
%p
=link_to t("call_histories.index.page_title"), sip_account_call_histories_path(sip_account)
%br