mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 00:42:04 +02:00
Domain list for admin
This commit is contained in:
parent
238be6d59e
commit
8531e50474
11 changed files with 81 additions and 7 deletions
5
app/controllers/admin/domains_controller.rb
Normal file
5
app/controllers/admin/domains_controller.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class Admin::DomainsController < ApplicationController
|
||||
def index
|
||||
@domains = Domain.all
|
||||
end
|
||||
end
|
|
@ -83,7 +83,8 @@ module Epp::DomainsHelper
|
|||
## CREATE
|
||||
def validate_domain_create_request
|
||||
@ph = params_hash['epp']['command']['create']['create']
|
||||
xml_attrs_present?(@ph, [['name'], ['ns'], ['contact'], ['registrant']])
|
||||
# TODO: Verify contact presence if registrant is juridical
|
||||
xml_attrs_present?(@ph, [['name'], ['ns'], ['registrant']])
|
||||
end
|
||||
|
||||
def domain_create_params
|
||||
|
|
|
@ -113,6 +113,10 @@ class Contact < ActiveRecord::Base
|
|||
}
|
||||
end
|
||||
|
||||
def to_s
|
||||
name
|
||||
end
|
||||
|
||||
class << self
|
||||
def extract_attributes(ph, type = :create)
|
||||
contact_hash = {
|
||||
|
|
|
@ -327,6 +327,10 @@ class Domain < ActiveRecord::Base
|
|||
|
||||
## SHARED
|
||||
|
||||
def to_s
|
||||
name
|
||||
end
|
||||
|
||||
def generate_auth_info
|
||||
begin
|
||||
self.auth_info = SecureRandom.hex
|
||||
|
|
|
@ -3,4 +3,8 @@ class Registrar < ActiveRecord::Base
|
|||
has_many :domains
|
||||
has_many :ns_sets
|
||||
has_many :epp_users
|
||||
|
||||
def to_s
|
||||
name
|
||||
end
|
||||
end
|
||||
|
|
24
app/views/admin/domains/index.haml
Normal file
24
app/views/admin/domains/index.haml
Normal file
|
@ -0,0 +1,24 @@
|
|||
%h2= t('shared.domains')
|
||||
%hr
|
||||
.row
|
||||
.col-md-12
|
||||
.table-responsive
|
||||
%table.table.table-striped.table-bordered.table-condensed
|
||||
%tr
|
||||
%th{class: 'col-xs-2'}
|
||||
= t('shared.name')
|
||||
%th{class: 'col-xs-2'}
|
||||
= t('shared.registrar')
|
||||
%th{class: 'col-xs-2'}
|
||||
= t('shared.owner')
|
||||
%th{class: 'col-xs-1'}
|
||||
= t('shared.valid_to')
|
||||
%th{class: 'col-xs-1'}
|
||||
= t('shared.action')
|
||||
- @domains.each do |x|
|
||||
%tr
|
||||
%td= link_to(x, admin_domain_path(x))
|
||||
%td= link_to(x.registrar, root_path) if x.registrar
|
||||
%td= link_to(x.owner_contact, root_path)
|
||||
%td= l(x.valid_to, format: :short)
|
||||
%td= link_to(t('shared.edit'), edit_admin_domain_path(x), class: 'btn btn-primary btn-xs')
|
|
@ -28,7 +28,7 @@
|
|||
%li
|
||||
= link_to t('shared.registrars'), root_path
|
||||
%li
|
||||
= link_to t('shared.domains'), root_path
|
||||
= link_to t('shared.domains'), admin_domains_path
|
||||
%li.dropdown
|
||||
%a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"}
|
||||
= t('shared.settings')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue