From c675512b22a566ba0b5d9ef7690c92b747fa5cde Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Sat, 31 Mar 2018 23:31:40 +0300 Subject: [PATCH 01/13] Change `domains.valid_to` DB column to NOT NULL #800 --- app/models/whois_record.rb | 2 +- app/views/epp/domains/create.xml.builder | 2 +- app/views/epp/domains/info.xml.builder | 2 +- app/views/epp/domains/partials/_transfer.xml.builder | 2 +- app/views/epp/domains/renew.xml.builder | 2 +- .../20180331200125_change_domains_valid_to_to_not_null.rb | 5 +++++ db/structure.sql | 4 +++- spec/factories/domain.rb | 1 + 8 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 db/migrate/20180331200125_change_domains_valid_to_to_not_null.rb diff --git a/app/models/whois_record.rb b/app/models/whois_record.rb index bd16e0c99..45cff4036 100644 --- a/app/models/whois_record.rb +++ b/app/models/whois_record.rb @@ -48,7 +48,7 @@ class WhoisRecord < ActiveRecord::Base h[:status] = domain.statuses.map { |x| status_map[x] || x } h[:registered] = domain.registered_at.try(:to_s, :iso8601) h[:changed] = domain.updated_at.try(:to_s, :iso8601) - h[:expire] = domain.valid_to.try(:to_date).try(:to_s) + h[:expire] = domain.valid_to.to_date.to_s h[:outzone] = domain.outzone_at.try(:to_date).try(:to_s) h[:delete] = [domain.delete_at, domain.force_delete_at].compact.min.try(:to_date).try(:to_s) diff --git a/app/views/epp/domains/create.xml.builder b/app/views/epp/domains/create.xml.builder index 213a2aa8f..2293f5657 100644 --- a/app/views/epp/domains/create.xml.builder +++ b/app/views/epp/domains/create.xml.builder @@ -8,7 +8,7 @@ xml.epp_head do xml.tag!('domain:creData', 'xmlns:domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd') do xml.tag!('domain:name', @domain.name) xml.tag!('domain:crDate', @domain.created_at.try(:iso8601)) - xml.tag!('domain:exDate', @domain.valid_to.try(:iso8601)) + xml.tag!('domain:exDate', @domain.valid_to.iso8601) end end diff --git a/app/views/epp/domains/info.xml.builder b/app/views/epp/domains/info.xml.builder index 8bf169acd..2d10f8baf 100644 --- a/app/views/epp/domains/info.xml.builder +++ b/app/views/epp/domains/info.xml.builder @@ -48,7 +48,7 @@ xml.epp_head do xml.tag!('domain:upDate', @domain.updated_at.try(:iso8601)) end - xml.tag!('domain:exDate', @domain.valid_to.try(:iso8601)) + xml.tag!('domain:exDate', @domain.valid_to.iso8601) # TODO Make domain transferrable #xml.tag!('domain:trDate', @domain.transferred_at) if @domain.transferred_at diff --git a/app/views/epp/domains/partials/_transfer.xml.builder b/app/views/epp/domains/partials/_transfer.xml.builder index 151af28b3..bfcc7db94 100644 --- a/app/views/epp/domains/partials/_transfer.xml.builder +++ b/app/views/epp/domains/partials/_transfer.xml.builder @@ -5,5 +5,5 @@ builder.tag!('domain:trnData', 'xmlns:domain' => 'https://epp.tld.ee/schema/doma builder.tag!('domain:reDate', dt.transfer_requested_at.try(:iso8601)) builder.tag!('domain:acID', dt.old_registrar.code) builder.tag!('domain:acDate', dt.transferred_at.try(:iso8601) || dt.wait_until.try(:iso8601)) - builder.tag!('domain:exDate', dt.domain_valid_to.try(:iso8601)) + builder.tag!('domain:exDate', dt.domain_valid_to.iso8601) end diff --git a/app/views/epp/domains/renew.xml.builder b/app/views/epp/domains/renew.xml.builder index 5d03c7128..e407ff0e7 100644 --- a/app/views/epp/domains/renew.xml.builder +++ b/app/views/epp/domains/renew.xml.builder @@ -7,7 +7,7 @@ xml.epp_head do xml.resData do xml.tag!('domain:renData', 'xmlns:domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd') do xml.tag!('domain:name', @domain[:name]) - xml.tag!('domain:exDate', @domain.valid_to.try(:iso8601)) + xml.tag!('domain:exDate', @domain.valid_to.iso8601) end end diff --git a/db/migrate/20180331200125_change_domains_valid_to_to_not_null.rb b/db/migrate/20180331200125_change_domains_valid_to_to_not_null.rb new file mode 100644 index 000000000..049b08806 --- /dev/null +++ b/db/migrate/20180331200125_change_domains_valid_to_to_not_null.rb @@ -0,0 +1,5 @@ +class ChangeDomainsValidToToNotNull < ActiveRecord::Migration + def change + change_column_null :domains, :valid_to, false + end +end diff --git a/db/structure.sql b/db/structure.sql index 374b17b5b..2e662f6f5 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -873,7 +873,7 @@ CREATE TABLE domains ( registered_at timestamp without time zone, status character varying, valid_from timestamp without time zone, - valid_to timestamp without time zone, + valid_to timestamp without time zone NOT NULL, registrant_id integer NOT NULL, transfer_code character varying NOT NULL, created_at timestamp without time zone, @@ -4695,3 +4695,5 @@ INSERT INTO schema_migrations (version) VALUES ('20180309053921'); INSERT INTO schema_migrations (version) VALUES ('20180309054510'); +INSERT INTO schema_migrations (version) VALUES ('20180331200125'); + diff --git a/spec/factories/domain.rb b/spec/factories/domain.rb index fc4d3a97b..8abac339c 100644 --- a/spec/factories/domain.rb +++ b/spec/factories/domain.rb @@ -3,6 +3,7 @@ FactoryBot.define do sequence(:name) { |n| "test#{n}.com" } period 1 period_unit 'y' # Year + valid_to Time.zone.parse('2010-07-05') registrar registrant From d57c737a80fd2c9df2b9920363944b1a7898843d Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Mon, 2 Apr 2018 09:13:53 +0300 Subject: [PATCH 02/13] Convert specs to tests #792 --- app/models/concerns/domain/deletable.rb | 5 ++ spec/factories/domain.rb | 4 -- spec/models/concerns/domain/deletable_spec.rb | 19 -------- .../epp/domain/delete/discarded_spec.rb | 47 ------------------- .../epp/domain/update/discarded_spec.rb | 42 ----------------- .../epp/domain/domain_delete_test.rb | 27 +++++++++++ .../epp/domain/domain_update_test.rb | 23 +++++++++ test/models/domain/deletable_test.rb | 14 ++++++ 8 files changed, 69 insertions(+), 112 deletions(-) delete mode 100644 spec/models/concerns/domain/deletable_spec.rb delete mode 100644 spec/requests/epp/domain/delete/discarded_spec.rb delete mode 100644 spec/requests/epp/domain/update/discarded_spec.rb create mode 100644 test/integration/epp/domain/domain_update_test.rb create mode 100644 test/models/domain/deletable_test.rb diff --git a/app/models/concerns/domain/deletable.rb b/app/models/concerns/domain/deletable.rb index f724162e5..a0d49decb 100644 --- a/app/models/concerns/domain/deletable.rb +++ b/app/models/concerns/domain/deletable.rb @@ -5,6 +5,11 @@ module Concerns::Domain::Deletable alias_attribute :delete_time, :delete_at end + def discard + self.statuses << DomainStatus::DELETE_CANDIDATE + save + end + def discarded? statuses.include?(DomainStatus::DELETE_CANDIDATE) end diff --git a/spec/factories/domain.rb b/spec/factories/domain.rb index fc4d3a97b..4e15a8713 100644 --- a/spec/factories/domain.rb +++ b/spec/factories/domain.rb @@ -10,9 +10,5 @@ FactoryBot.define do domain.admin_domain_contacts << FactoryBot.build(:admin_domain_contact) domain.tech_domain_contacts << FactoryBot.build(:tech_domain_contact) end - - factory :domain_discarded do - statuses [DomainStatus::DELETE_CANDIDATE] - end end end diff --git a/spec/models/concerns/domain/deletable_spec.rb b/spec/models/concerns/domain/deletable_spec.rb deleted file mode 100644 index 826299b69..000000000 --- a/spec/models/concerns/domain/deletable_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'rails_helper' - -RSpec.describe Domain, db: false do - it { is_expected.to alias_attribute(:delete_time, :delete_at) } - - describe '#discarded?' do - context 'when :deleteCandidate status is present' do - let(:domain) { described_class.new(statuses: [DomainStatus::DELETE_CANDIDATE]) } - - specify { expect(domain).to be_discarded } - end - - context 'when :deleteCandidate status is absent' do - let(:domain) { described_class.new(statuses: []) } - - specify { expect(domain).to_not be_discarded } - end - end -end diff --git a/spec/requests/epp/domain/delete/discarded_spec.rb b/spec/requests/epp/domain/delete/discarded_spec.rb deleted file mode 100644 index 55e74d965..000000000 --- a/spec/requests/epp/domain/delete/discarded_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -require 'rails_helper' - -RSpec.describe 'EPP domain:delete' do - let(:registrar) { create(:registrar) } - let(:user) { create(:api_user_epp, registrar: registrar) } - let(:session_id) { create(:epp_session, user: user).session_id } - let(:request_xml) { <<-XML - - - - - - test.com - - - - - dGVzdCBmYWlsCg== - - - - - XML - } - - before :example do - login_as user - end - - context 'when domain is not discarded' do - let!(:domain) { create(:domain, name: 'test.com') } - - it 'returns epp code of 1001' do - post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => "session=#{session_id}" - expect(response).to have_code_of(1001) - end - end - - context 'when domain is discarded' do - let!(:domain) { create(:domain_discarded, name: 'test.com') } - - it 'returns epp code of 2105' do - post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => "session=#{session_id}" - expect(response).to have_code_of(2105) - end - end -end diff --git a/spec/requests/epp/domain/update/discarded_spec.rb b/spec/requests/epp/domain/update/discarded_spec.rb deleted file mode 100644 index 4a31b7d10..000000000 --- a/spec/requests/epp/domain/update/discarded_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -require 'rails_helper' - -RSpec.describe 'EPP domain:update' do - let(:registrar) { create(:registrar) } - let(:user) { create(:api_user_epp, registrar: registrar) } - let(:session_id) { create(:epp_session, user: user).session_id } - let(:request_xml) { <<-XML - - - - - - test.com - - - - - XML - } - - before :example do - login_as user - end - - context 'when domain is not discarded' do - let!(:domain) { create(:domain, name: 'test.com') } - - it 'returns epp code of 1000' do - post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => "session=#{session_id}" - expect(response).to have_code_of(1000) - end - end - - context 'when domain is discarded' do - let!(:domain) { create(:domain_discarded, name: 'test.com') } - - it 'returns epp code of 2105' do - post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => "session=#{session_id}" - expect(response).to have_code_of(2105) - end - end -end diff --git a/test/integration/epp/domain/domain_delete_test.rb b/test/integration/epp/domain/domain_delete_test.rb index bdd326a3e..eae4d39ff 100644 --- a/test/integration/epp/domain/domain_delete_test.rb +++ b/test/integration/epp/domain/domain_delete_test.rb @@ -25,4 +25,31 @@ class EppDomainDeleteTest < ActionDispatch::IntegrationTest assert_equal '1001', Nokogiri::XML(response.body).at_css('result')[:code] assert_equal 1, Nokogiri::XML(response.body).css('result').size end + + def test_discarded_domain_cannot_be_deleted + domains(:shop).discard + + request_xml = <<-XML + + + + + + shop.test + + + + + dGVzdCBmYWlsCg== + + + + + XML + + assert_no_difference 'Domain.count' do + post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' + end + assert_equal '2105', Nokogiri::XML(response.body).at_css('result')[:code] + end end diff --git a/test/integration/epp/domain/domain_update_test.rb b/test/integration/epp/domain/domain_update_test.rb new file mode 100644 index 000000000..9519b37bc --- /dev/null +++ b/test/integration/epp/domain/domain_update_test.rb @@ -0,0 +1,23 @@ +require 'test_helper' + +class EppDomainUpdateTest < ActionDispatch::IntegrationTest + def test_discarded_domain_cannot_be_updated + domains(:shop).discard + + request_xml = <<-XML + + + + + + shop.test + + + + + XML + + post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' + assert_equal '2105', Nokogiri::XML(response.body).at_css('result')[:code] + end +end diff --git a/test/models/domain/deletable_test.rb b/test/models/domain/deletable_test.rb new file mode 100644 index 000000000..499ff20b6 --- /dev/null +++ b/test/models/domain/deletable_test.rb @@ -0,0 +1,14 @@ +require 'test_helper' + +class DomainDeletableTest < ActiveSupport::TestCase + def setup + @domain = domains(:shop) + end + + def test_discard + refute @domain.discarded? + @domain.discard + @domain.reload + assert @domain.discarded? + end +end From 593c546c3048b6e038a13fe054486e032993e35a Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Tue, 3 Apr 2018 00:06:35 +0300 Subject: [PATCH 03/13] Convert HAML to ERB --- app/views/admin/domains/show.haml | 24 ----------- app/views/admin/domains/show.html.erb | 58 +++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 24 deletions(-) delete mode 100644 app/views/admin/domains/show.haml create mode 100644 app/views/admin/domains/show.html.erb diff --git a/app/views/admin/domains/show.haml b/app/views/admin/domains/show.haml deleted file mode 100644 index 17a85b841..000000000 --- a/app/views/admin/domains/show.haml +++ /dev/null @@ -1,24 +0,0 @@ -- content_for :actions do - = link_to(t(:edit_statuses), edit_admin_domain_path(@domain), class: 'btn btn-primary') - = link_to(t(:history), admin_domain_domain_versions_path(@domain.id), method: :get, class: 'btn btn-primary') - -= render 'shared/title', name: @domain.name - -.row - .col-md-6= render 'admin/domains/partials/general' - .col-md-6= render 'admin/domains/partials/owner' -.row - .col-md-12= render 'admin/domains/partials/tech_contacts' -.row - .col-md-12= render 'admin/domains/partials/admin_contacts' -.row - .col-md-12= render 'admin/domains/partials/statuses' -.row - .col-md-12= render 'admin/domains/partials/nameservers' -.row - .col-md-12= render 'admin/domains/partials/dnskeys' -.row - .col-md-12= render 'admin/domains/partials/keyrelays' -.row - .col-md-12 - = render 'admin/domains/partials/legal_documents', legal_documents: @domain.legal_documents diff --git a/app/views/admin/domains/show.html.erb b/app/views/admin/domains/show.html.erb new file mode 100644 index 000000000..61e20e1ca --- /dev/null +++ b/app/views/admin/domains/show.html.erb @@ -0,0 +1,58 @@ +<% content_for :actions do %> + <%= link_to(t(:edit_statuses), edit_admin_domain_path(@domain), class: 'btn btn-primary') %> + <%= link_to(t(:history), admin_domain_domain_versions_path(@domain.id), method: :get, + class: 'btn btn-primary') %> +<% end %> +<%= render 'shared/title', name: @domain.name %> + +
+
+ <%= render 'admin/domains/partials/general' %> +
+
+ <%= render 'admin/domains/partials/owner' %> +
+
+ +
+
+ <%= render 'admin/domains/partials/tech_contacts' %> +
+
+ +
+
+ <%= render 'admin/domains/partials/admin_contacts' %> +
+
+ +
+
+ <%= render 'admin/domains/partials/statuses' %> +
+
+ +
+
+ <%= render 'admin/domains/partials/nameservers' %> +
+
+ +
+
+ <%= render 'admin/domains/partials/dnskeys' %> +
+
+ +
+
+ <%= render 'admin/domains/partials/keyrelays' %> +
+
+ +
+
+ <%= render 'admin/domains/partials/legal_documents', legal_documents: + @domain.legal_documents %> +
+
From 74b681db077a6e8c96317fae254a83c5393b65e0 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Tue, 3 Apr 2018 00:12:17 +0300 Subject: [PATCH 04/13] Improve UI #792 --- app/views/admin/domains/show.html.erb | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/app/views/admin/domains/show.html.erb b/app/views/admin/domains/show.html.erb index 61e20e1ca..fb8d44046 100644 --- a/app/views/admin/domains/show.html.erb +++ b/app/views/admin/domains/show.html.erb @@ -1,9 +1,20 @@ -<% content_for :actions do %> - <%= link_to(t(:edit_statuses), edit_admin_domain_path(@domain), class: 'btn btn-primary') %> - <%= link_to(t(:history), admin_domain_domain_versions_path(@domain.id), method: :get, - class: 'btn btn-primary') %> -<% end %> -<%= render 'shared/title', name: @domain.name %> + + +
From f35f2045949421e1f99233fdefe7d2058decccdd Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Tue, 3 Apr 2018 00:15:00 +0300 Subject: [PATCH 05/13] Extract translation #792 --- app/views/admin/domains/show.html.erb | 4 ++-- config/locales/admin/domains.en.yml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/admin/domains/show.html.erb b/app/views/admin/domains/show.html.erb index fb8d44046..63be7256d 100644 --- a/app/views/admin/domains/show.html.erb +++ b/app/views/admin/domains/show.html.erb @@ -9,8 +9,8 @@
- <%= link_to(t(:edit_statuses), edit_admin_domain_path(@domain), class: 'btn btn-primary') %> - <%= link_to(t(:history), admin_domain_domain_versions_path(@domain.id), method: :get, + <%= link_to(t('.edit_btn'), edit_admin_domain_path(@domain), class: 'btn btn-primary') %> + <%= link_to(t('.history_btn'), admin_domain_domain_versions_path(@domain.id), method: :get, class: 'btn btn-primary') %>
diff --git a/config/locales/admin/domains.en.yml b/config/locales/admin/domains.en.yml index 200657d01..87c2c9c6a 100644 --- a/config/locales/admin/domains.en.yml +++ b/config/locales/admin/domains.en.yml @@ -5,6 +5,10 @@ en: header: Domains registrant: Registrant + show: + edit_btn: Edit statuses + history_btn: History + search_form: reset_btn: Reset From 639021d2620a40184905182e8199a887093fa269 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Tue, 3 Apr 2018 00:15:29 +0300 Subject: [PATCH 06/13] Reformat #792 --- app/views/admin/domains/show.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/admin/domains/show.html.erb b/app/views/admin/domains/show.html.erb index 63be7256d..7d81a696f 100644 --- a/app/views/admin/domains/show.html.erb +++ b/app/views/admin/domains/show.html.erb @@ -9,9 +9,9 @@
- <%= link_to(t('.edit_btn'), edit_admin_domain_path(@domain), class: 'btn btn-primary') %> - <%= link_to(t('.history_btn'), admin_domain_domain_versions_path(@domain.id), method: :get, - class: 'btn btn-primary') %> + <%= link_to t('.edit_btn'), edit_admin_domain_path(@domain), class: 'btn btn-primary' %> + <%= link_to t('.history_btn'), admin_domain_domain_versions_path(@domain.id), method: :get, + class: 'btn btn-primary' %>
From 4435183a0ee1b55525012f082401aba3fa575595 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Tue, 3 Apr 2018 00:17:27 +0300 Subject: [PATCH 07/13] Clean up #792 --- app/views/admin/domains/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/domains/show.html.erb b/app/views/admin/domains/show.html.erb index 7d81a696f..9bfb4b9b5 100644 --- a/app/views/admin/domains/show.html.erb +++ b/app/views/admin/domains/show.html.erb @@ -10,7 +10,7 @@
<%= link_to t('.edit_btn'), edit_admin_domain_path(@domain), class: 'btn btn-primary' %> - <%= link_to t('.history_btn'), admin_domain_domain_versions_path(@domain.id), method: :get, + <%= link_to t('.history_btn'), admin_domain_domain_versions_path(@domain), class: 'btn btn-primary' %>
From 1dcf7bcd62eed09c5426af7fa8f788b0c8a5dca1 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Tue, 3 Apr 2018 00:30:49 +0300 Subject: [PATCH 08/13] Remove unused partial #792 --- app/views/admin/domains/zonefile.haml | 8 -------- config/locales/en.yml | 1 - 2 files changed, 9 deletions(-) delete mode 100644 app/views/admin/domains/zonefile.haml diff --git a/app/views/admin/domains/zonefile.haml b/app/views/admin/domains/zonefile.haml deleted file mode 100644 index 72473ef53..000000000 --- a/app/views/admin/domains/zonefile.haml +++ /dev/null @@ -1,8 +0,0 @@ -- content_for :actions do - = link_to(t(:back_to_domain), admin_domain_path(@domain), class: 'btn btn-default') -= render 'shared/title', name: t(:zonefile) - -.row - .col-md-12 - = preserve do - %pre= @zonefile diff --git a/config/locales/en.yml b/config/locales/en.yml index 1e65f7e29..64b8c39c2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -337,7 +337,6 @@ en: transfer_requested: 'Transfer requested.' message_was_not_found: 'Message was not found' - zonefile: 'Zonefile' only_one_parameter_allowed: 'Only one parameter allowed: %{param_1} or %{param_2}' exactly_one_parameter_required: 'Exactly one parameter required: %{params}' ds_data_with_key_allowed: 'Allow DS data with key' From f2697963827043e0cd7d3659d111144ec7b693d3 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Tue, 3 Apr 2018 15:12:43 +0300 Subject: [PATCH 09/13] Show label in UI if a domain is discarded #792 --- app/models/concerns/domain/deletable.rb | 2 +- app/presenters/domain_presenter.rb | 11 +++++++++++ app/views/admin/domains/show.html.erb | 4 +++- test/integration/admin/domains/details_test.rb | 16 ++++++++++++++++ 4 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 test/integration/admin/domains/details_test.rb diff --git a/app/models/concerns/domain/deletable.rb b/app/models/concerns/domain/deletable.rb index a0d49decb..86c296d88 100644 --- a/app/models/concerns/domain/deletable.rb +++ b/app/models/concerns/domain/deletable.rb @@ -6,7 +6,7 @@ module Concerns::Domain::Deletable end def discard - self.statuses << DomainStatus::DELETE_CANDIDATE + statuses << DomainStatus::DELETE_CANDIDATE save end diff --git a/app/presenters/domain_presenter.rb b/app/presenters/domain_presenter.rb index 9597330b8..aac3c1527 100644 --- a/app/presenters/domain_presenter.rb +++ b/app/presenters/domain_presenter.rb @@ -6,6 +6,17 @@ class DomainPresenter @view = view end + def name_with_status + html = domain.name + + if domain.discarded? + label = view.content_tag(:span, 'deleteCandidate', class: 'label label-warning') + html += " #{label}" + end + + html.html_safe + end + def expire_time view.l(domain.expire_time) end diff --git a/app/views/admin/domains/show.html.erb b/app/views/admin/domains/show.html.erb index 9bfb4b9b5..1501b35bb 100644 --- a/app/views/admin/domains/show.html.erb +++ b/app/views/admin/domains/show.html.erb @@ -1,3 +1,5 @@ +<% domain = DomainPresenter.new(domain: @domain, view: self) %> + @@ -5,7 +7,7 @@