mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 11:16:00 +02:00
Contact searching
This commit is contained in:
parent
6f3d3c849a
commit
f435b1bd19
4 changed files with 14 additions and 1 deletions
|
@ -45,6 +45,9 @@ class Contact < ActiveRecord::Base
|
|||
CONTACT_TYPE_ADMIN = 'admin'
|
||||
CONTACT_TYPES = [CONTACT_TYPE_TECH, CONTACT_TYPE_ADMIN]
|
||||
|
||||
# TEMP Scope until confusion with contact name is sorted out
|
||||
# scope :named, -> { joins(:international_address).uniq.all }
|
||||
|
||||
# TEMP METHOD for transaction to STI
|
||||
def address
|
||||
international_address
|
||||
|
@ -86,7 +89,6 @@ class Contact < ActiveRecord::Base
|
|||
end
|
||||
|
||||
# generate random id for contact
|
||||
#
|
||||
def generate_code
|
||||
self.code = SecureRandom.hex(4)
|
||||
end
|
||||
|
@ -131,6 +133,9 @@ class Contact < ActiveRecord::Base
|
|||
end
|
||||
|
||||
class << self
|
||||
# non-EPP
|
||||
|
||||
# EPP
|
||||
def extract_attributes(ph, type = :create)
|
||||
contact_hash = {
|
||||
phone: ph[:voice],
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
.row
|
||||
.col-sm-6
|
||||
%h2.text-center-xs= t('shared.contacts')
|
||||
= render 'admin/contacts/partials/search'
|
||||
.col-sm-6
|
||||
%h2.text-right.text-center-xs
|
||||
= link_to(t('shared.add'), new_admin_contact_path, class: 'btn btn-primary')
|
||||
|
|
6
app/views/admin/contacts/partials/_search.haml
Normal file
6
app/views/admin/contacts/partials/_search.haml
Normal file
|
@ -0,0 +1,6 @@
|
|||
= search_form_for [:admin, @q] do |f|
|
||||
= f.search_field :international_address_name_cont
|
||||
= f.submit do
|
||||
%span.glyphicon.glyphicon-search
|
||||
|
||||
|
|
@ -265,3 +265,4 @@ en:
|
|||
edit_contact: 'Edit contact'
|
||||
failed_to_update_contact: 'Failed to update contact'
|
||||
contact_updated: 'Contact updated'
|
||||
search: 'Search'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue