mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 03:58:27 +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_TYPE_ADMIN = 'admin'
|
||||||
CONTACT_TYPES = [CONTACT_TYPE_TECH, CONTACT_TYPE_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
|
# TEMP METHOD for transaction to STI
|
||||||
def address
|
def address
|
||||||
international_address
|
international_address
|
||||||
|
@ -86,7 +89,6 @@ class Contact < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
# generate random id for contact
|
# generate random id for contact
|
||||||
#
|
|
||||||
def generate_code
|
def generate_code
|
||||||
self.code = SecureRandom.hex(4)
|
self.code = SecureRandom.hex(4)
|
||||||
end
|
end
|
||||||
|
@ -131,6 +133,9 @@ class Contact < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
|
# non-EPP
|
||||||
|
|
||||||
|
# EPP
|
||||||
def extract_attributes(ph, type = :create)
|
def extract_attributes(ph, type = :create)
|
||||||
contact_hash = {
|
contact_hash = {
|
||||||
phone: ph[:voice],
|
phone: ph[:voice],
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
.row
|
.row
|
||||||
.col-sm-6
|
.col-sm-6
|
||||||
%h2.text-center-xs= t('shared.contacts')
|
%h2.text-center-xs= t('shared.contacts')
|
||||||
|
= render 'admin/contacts/partials/search'
|
||||||
.col-sm-6
|
.col-sm-6
|
||||||
%h2.text-right.text-center-xs
|
%h2.text-right.text-center-xs
|
||||||
= link_to(t('shared.add'), new_admin_contact_path, class: 'btn btn-primary')
|
= 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'
|
edit_contact: 'Edit contact'
|
||||||
failed_to_update_contact: 'Failed to update contact'
|
failed_to_update_contact: 'Failed to update contact'
|
||||||
contact_updated: 'Contact updated'
|
contact_updated: 'Contact updated'
|
||||||
|
search: 'Search'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue