Merge branch 'master' into improve-registrant-area

This commit is contained in:
Artur Beljajev 2018-06-18 14:58:15 +03:00
commit 7ee0f18a46
4 changed files with 92 additions and 96 deletions

View file

@ -1,11 +0,0 @@
# As non-GDPR compliant, this controller is deprecated. Needs to be replaced with one that relies
# on the REST WHOIS API.
class Registrant::WhoisController < RegistrantController
def index
authorize! :view, :registrant_whois
if params[:domain_name].present?
@domain = WhoisRecord.find_by(name: params[:domain_name]);
end
end
end

View file

@ -29,14 +29,12 @@ class Directo < ActiveRecord::Base
"InvoiceDate" => invoice.created_at.strftime("%Y-%m-%dT%H:%M:%S"),
"PaymentTerm" => Setting.directo_receipt_payment_term,
"Currency" => invoice.currency,
"CustomerCode"=> invoice.buyer.accounting_customer_code,
'TotalVAT' => ActionController::Base.helpers.number_with_precision(invoice.vat_amount, precision: 2, separator: '.')
"CustomerCode"=> invoice.buyer.accounting_customer_code
){
xml.line(
"ProductID" => Setting.directo_receipt_product_name,
"Quantity" => 1,
"UnitPriceWoVAT" => ActionController::Base.helpers.number_with_precision(invoice.subtotal, precision: 2, separator: '.'),
'VATCode' => invoice.buyer_vat_no,
"UnitPriceWoVAT" => ActionController::Base.helpers.number_with_precision(invoice.subtotal, precision: 2, separator: "."),
"ProductName" => invoice.order
)
}

View file

@ -45,11 +45,13 @@
<li class="<%= active_class %>">
<%= link_to t(:domains), registrant_domains_path %>
</li>
<% end %>
<% active_class = %w(registrant/whois).include?(params[:controller]) ? 'active' :nil %>
<li class="<%= active_class %>">
<%= link_to 'WHOIS', 'https://whois.internet.ee' %>
</li>
<li class="<%= active_class %>">
<%= link_to 'Internet.ee', 'https://internet.ee' %>
</li>
<% end %>
</ul>
<ul class="nav navbar-nav navbar-right">
<% if user_signed_in? %>

View file

@ -9,9 +9,16 @@ class RegistrantLayoutTest < ActionDispatch::IntegrationTest
travel_to Time.zone.parse('2010-07-05')
end
def test_has_link_to_rest_whois
def teardown
super
travel_back
end
def test_has_link_to_rest_whois_and_internet_ee
visit registrant_domains_url
assert(has_link?('Internet.ee', href: 'https://internet.ee'))
refute(has_link?('WHOIS', href: 'registrant/whois'))
assert(has_link?('WHOIS', href: 'https://whois.internet.ee'))
end
end