diff --git a/Gemfile b/Gemfile index 3672cc1eb..81bdaabe9 100644 --- a/Gemfile +++ b/Gemfile @@ -13,6 +13,7 @@ gem 'SyslogLogger', '2.0', require: 'syslog/logger' gem 'iso8601', '0.8.6' # for dates and times gem 'rails', '4.2.10' # when update, all initializers eis_custom files needs check/update gem 'rest-client' +gem 'uglifier' # load env gem 'figaro', '1.1.1' diff --git a/Gemfile.lock b/Gemfile.lock index 75570c43b..6e6d8baac 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -420,6 +420,8 @@ GEM tilt (1.4.1) tzinfo (1.2.5) thread_safe (~> 0.1) + uglifier (4.1.11) + execjs (>= 0.3.0, < 3) unf (0.1.4) unf_ext unf_ext (0.0.7.2) @@ -513,6 +515,7 @@ DEPENDENCIES selectize-rails (= 0.12.1) simplecov simpleidn (= 0.0.7) + uglifier uuidtools (= 2.1.5) validates_email_format_of (= 1.6.3) webmock diff --git a/app/controllers/registrant/whois_controller.rb b/app/controllers/registrant/whois_controller.rb deleted file mode 100644 index 2936477eb..000000000 --- a/app/controllers/registrant/whois_controller.rb +++ /dev/null @@ -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 diff --git a/app/models/directo.rb b/app/models/directo.rb index 3e4e93e2c..1269e7033 100644 --- a/app/models/directo.rb +++ b/app/models/directo.rb @@ -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 ) } diff --git a/app/views/admin/billing/prices/_form.html.erb b/app/views/admin/billing/prices/_form.html.erb index e1a65280a..44bf00484 100644 --- a/app/views/admin/billing/prices/_form.html.erb +++ b/app/views/admin/billing/prices/_form.html.erb @@ -41,10 +41,10 @@
- <%= f.text_field :valid_from, value: f.object.valid_from.try(:to_s, :dshort), + <%= f.text_field :valid_from, value: f.object.valid_from.try(:to_date), class: 'form-control js-datepicker' %> - - <%= f.text_field :valid_to, value: f.object.valid_to.try(:to_s, :dshort), + <%= f.text_field :valid_to, value: f.object.valid_to.try(:to_date), class: 'form-control js-datepicker' %>
diff --git a/app/views/layouts/registrant/application.html.erb b/app/views/layouts/registrant/application.html.erb index f38f8fcea..075ac4652 100644 --- a/app/views/layouts/registrant/application.html.erb +++ b/app/views/layouts/registrant/application.html.erb @@ -1,84 +1,86 @@ - - - - <% if content_for? :head_title %> - <%= yield :head_title %> - <% else %> - - <%= t(:registrant_head_title) %> - - <% end %> - <%= csrf_meta_tags %> - <%= stylesheet_link_tag 'registrant-manifest', media: 'all' %> - <%= favicon_link_tag 'favicon.ico' %> - - - - -
- <%= render 'shared/flash' %> - <%= yield %> -
- - <%= javascript_include_tag 'registrant-manifest', async: true %> - + + <%= javascript_include_tag 'registrant-manifest', async: true %> + diff --git a/config/environments/production.rb b/config/environments/production.rb index 7d77b7220..b0c13f491 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -23,7 +23,7 @@ Rails.application.configure do config.serve_static_files = false # Compress JavaScripts and CSS. - # config.assets.js_compressor = :uglifier + config.assets.js_compressor = Uglifier.new(harmony: true) # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. diff --git a/config/initializers/datetime.rb b/config/initializers/datetime.rb deleted file mode 100644 index cf4f747e2..000000000 --- a/config/initializers/datetime.rb +++ /dev/null @@ -1,3 +0,0 @@ -# Some handy day formats -Date::DATE_FORMATS[:dshort] = "%d.%m.%Y" -Time::DATE_FORMATS[:dshort] = "%d.%m.%Y" diff --git a/test/integration/registrant/layout_test.rb b/test/integration/registrant/layout_test.rb index 82b8026b7..fa811694f 100644 --- a/test/integration/registrant/layout_test.rb +++ b/test/integration/registrant/layout_test.rb @@ -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