Remove link to WHOIS controller from registrant portal

This commit is contained in:
Maciej Szlosarczyk 2018-05-25 13:55:21 +03:00
parent 13fe452c73
commit f1808cfcf1
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
3 changed files with 101 additions and 54 deletions

View file

@ -1,54 +0,0 @@
!!! 5
%html{lang: I18n.locale.to_s}
%head
%meta{charset: "utf-8"}/
%meta{content: "width=device-width, initial-scale=1", name: "viewport"}/
- if content_for? :head_title
= yield :head_title
- else
%title= t(:registrant_head_title)
= csrf_meta_tags
= stylesheet_link_tag 'registrant-manifest', media: 'all'
= favicon_link_tag 'favicon.ico'
%body
/ Fixed navbar
%nav.navbar.navbar-default.navbar-fixed-top
.container
.navbar-header
%button.navbar-toggle.collapsed{"aria-controls" => "navbar", "aria-expanded" => "false", "data-target" => "#navbar", "data-toggle" => "collapse", :type => "button"}
%span.sr-only Toggle navigation
%span.icon-bar
%span.icon-bar
%span.icon-bar
= link_to registrant_root_path, class: 'navbar-brand' do
= t(:registrant_head_title)
- if unstable_env.present?
.text-center
%small{style: 'color: #0074B3;'}= unstable_env
- if current_user
.navbar-collapse.collapse
%ul.nav.navbar-nav.public-nav
- if can? :view, Depp::Domain
- active_class = %w(registrant/domains registrant/check registrant/renew registrant/tranfer registrant/keyrelays).include?(params[:controller]) ? 'active' :nil
%li{class: active_class}= link_to t(:domains), registrant_domains_path
- active_class = %w(registrant/whois).include?(params[:controller]) ? 'active' :nil
%li{class: active_class}= link_to t(:whois), registrant_whois_path
%ul.nav.navbar-nav.navbar-right
- if user_signed_in?
%li= link_to t(:log_out, user: current_user), '/registrant/logout'
.container
= render 'shared/flash'
= yield
%footer.footer
.container
.row
.col-md-6
= image_tag 'eis-logo-et.png'
.col-md-6.text-right
Version
= CURRENT_COMMIT_HASH
= javascript_include_tag 'registrant-manifest', async: true

View file

@ -0,0 +1,84 @@
<!DOCTYPE html>
<html lang="<%= I18n.locale.to_s %>">
<head>
<meta charset="utf-8"/>
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<% if content_for? :head_title %>
<%= yield :head_title %>
<% else %>
<title>
<%= t(:registrant_head_title) %>
</title>
<% end %>
<%= csrf_meta_tags %>
<%= stylesheet_link_tag 'registrant-manifest', media: 'all' %>
<%= favicon_link_tag 'favicon.ico' %>
</head>
<body>
<!-- Fixed navbar
-->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button aria-controls="navbar" aria-expanded="false" class="navbar-toggle collapsed" data-target="#navbar" data-toggle="collapse" type="button">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<%= link_to registrant_root_path, class: 'navbar-brand' do %>
<%= t(:registrant_head_title) %>
<% if unstable_env.present? %>
<div class="text-center">
<small style="color: #0074B3;">
<%= unstable_env %>
</small>
</div>
<% end %>
<% end %>
</div>
<% if current_user %>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav public-nav">
<% if can? :view, Depp::Domain %>
<% active_class = %w(registrant/domains registrant/check registrant/renew registrant/tranfer registrant/keyrelays).include?(params[:controller]) ? 'active' :nil %>
<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 'Internet.ee', 'https://internet.ee' %>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<% if user_signed_in? %>
<li>
<%= link_to t(:log_out, user: current_user), '/registrant/logout' %>
</li>
<% end %>
</ul>
</div>
<% end %>
</div>
</nav>
<div class="container">
<%= render 'shared/flash' %>
<%= yield %>
</div>
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-md-6">
<%= image_tag 'eis-logo-et.png' %>
</div>
<div class="col-md-6 text-right">
Version
<%= CURRENT_COMMIT_HASH %>
</div>
</div>
</div>
</footer>
<%= javascript_include_tag 'registrant-manifest', async: true %>
</body>
</html>

View file

@ -0,0 +1,17 @@
require 'test_helper'
class RegistrantLayoutTest < ActionDispatch::IntegrationTest
def setup
super
login_as(users(:registrant))
Setting.days_to_keep_business_registry_cache = 1
travel_to Time.zone.parse('2010-07-05')
end
def test_has_link_to_rest_whois
visit registrant_domains_url
assert(has_link?('Internet.ee', href: 'https://internet.ee'))
refute(has_link?('WHOIS', href: registrant_whois_path))
end
end