-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2396 from internetee/2391-domain-pdf
Admin: download pdf with domain data on show
- Loading branch information
Showing
7 changed files
with
276 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,241 @@ | ||
%html{lang: 'et'} | ||
%head | ||
%meta{charset: "utf-8"} | ||
:css | ||
.container { | ||
margin: auto; | ||
font-size: 12px; | ||
} | ||
.col-md-12 { | ||
} | ||
.col-xs-4 { | ||
width: 33%; | ||
} | ||
.left { | ||
float: left; | ||
} | ||
.left { | ||
padding-right: 5px; | ||
} | ||
.right { | ||
float: right; | ||
} | ||
dt { | ||
float: left; | ||
width: 100px; | ||
clear: left; | ||
text-align: right; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
font-weight: bold; | ||
line-height: 1.42857; | ||
} | ||
dd { | ||
margin-left: 120px; | ||
line-height: 1.42857; | ||
} | ||
table { | ||
width: 100%; | ||
border-collapse: collapse; | ||
font-size: 12px; | ||
} | ||
th { | ||
text-align: left; | ||
border: 0px; | ||
border-top: 1px solid #DDD; | ||
padding: 6px; | ||
} | ||
thead th { | ||
border-bottom: 2px solid #DDD; | ||
border-top: 0px; | ||
} | ||
td { | ||
border-top: 1px solid #DDD; | ||
} | ||
td { | ||
padding: 6px; | ||
} | ||
hr { | ||
height: 1px; | ||
border: 0; | ||
color: #DDD; | ||
background-color: #DDD; | ||
} | ||
.clear { | ||
clear: both; | ||
} | ||
.pull-down { | ||
margin-top: 30px; | ||
} | ||
#header { | ||
position: relative; | ||
min-height: 100px; | ||
} | ||
img { | ||
width: 106px; | ||
height: 102px; | ||
} | ||
#header-content { | ||
position: absolute; | ||
bottom: 0; | ||
} | ||
h1 { | ||
margin-bottom: 5px; | ||
} | ||
#footer { | ||
position: absolute; | ||
bottom: 0px; | ||
width: 99%; | ||
} | ||
.blue { | ||
color: #0098da; | ||
} | ||
%body | ||
.container | ||
#header.row | ||
.col-sm-6.left | ||
#header-content | ||
%h1= "#{@domain.name} (#{Time.zone.now.to_date.strftime("%d/%m/%Y")})" | ||
.col-sm-6.right | ||
%img{src: "#{Rails.root}/public/eis-logo-black-et.png"} | ||
.clear | ||
%hr | ||
.row | ||
.col-sm-8.left | ||
%h3 Üldine | ||
%hr | ||
%dl.dl-horizontal | ||
%dt Nimi | ||
%dd= @domain.name | ||
%dt Registreeritud | ||
%dd= @domain.registered_at.to_date.strftime("%d/%m/%Y") | ||
%dt Aegub | ||
%dd= @domain.valid_to.to_date.strftime("%d/%m/%Y") | ||
%dt Registripidaja | ||
%dd= "#{@domain.registrar} #{@domain.registrar.website}" | ||
|
||
.col-sm-4.right | ||
%h3 Registreerija | ||
%hr | ||
%dl.dl-horizontal | ||
%dt.left_25 Nimi | ||
%dd.left_25= @domain.registrant | ||
|
||
%dt.left_25 Isikukood | ||
%dd.left_25= @domain.registrant.ident_human_description | ||
|
||
%dt.left_25 E-mail | ||
%dd.left_25= @domain.registrant.email | ||
|
||
%dt.left_25 Telefon | ||
%dd.left_25= @domain.registrant.phone | ||
|
||
.clear | ||
.row.pull-down | ||
.col-md-12 | ||
%h3 Halduskontaktid | ||
%hr | ||
.table-responsive | ||
%table.table.table-hover.table-condensed | ||
%thead | ||
%tr | ||
%th{class: 'col-xs-3'} Nimi | ||
%th{class: 'col-xs-3'} Isikukood | ||
%th{class: 'col-xs-3'} E-mail | ||
%th{class: 'col-xs-3'} Telefon | ||
%tbody | ||
- @domain.admin_contacts.each do |ac| | ||
%tr | ||
%td= ac.name | ||
%td= ac.ident_human_description | ||
%td= ac.email | ||
%td= ac.phone | ||
|
||
.clear | ||
.row.pull-down | ||
.col-md-12 | ||
%h3 Tehnilised kontaktid | ||
%hr | ||
.table-responsive | ||
%table.table.table-hover.table-condensed | ||
%thead | ||
%tr | ||
%th{class: 'col-xs-3'} Nimi | ||
%th{class: 'col-xs-3'} Isikukood | ||
%th{class: 'col-xs-3'} E-mail | ||
%th{class: 'col-xs-3'} Telefon | ||
%tbody | ||
- @domain.tech_contacts.each do |tc| | ||
%tr | ||
%td= tc.name | ||
%td= tc.ident_human_description | ||
%td= tc.email | ||
%td= tc.phone | ||
|
||
.clear | ||
.row.pull-down | ||
.col-md-12 | ||
%h3 Nimeserverid | ||
%hr | ||
.table-responsive | ||
%table.table.table-hover.table-condensed | ||
%thead | ||
%tr | ||
%th{class: 'col-xs-4'} Hostinimi | ||
%th{class: 'col-xs-4'}= t(:ipv4) | ||
%th{class: 'col-xs-4'}= t(:ipv6) | ||
%tbody | ||
- @domain.nameservers.each do |x| | ||
%tr | ||
%td= x | ||
%td= x.ipv4 | ||
%td= x.ipv6 | ||
.clear | ||
.row.pull-down | ||
.col-md-12 | ||
%h3= t(:dnskeys) | ||
%hr | ||
.table-responsive | ||
%table.table.table-hover.table-condensed | ||
%thead | ||
%tr | ||
%th{class: 'col-xs-1'} Lipp | ||
%th{class: 'col-xs-1'} Protokolli | ||
%th{class: 'col-xs-1'} Algoritm | ||
%th{class: 'col-xs-9'} Avalik võti | ||
%tbody | ||
- @domain.dnskeys.each do |x| | ||
%tr | ||
%td= x.flags | ||
%td= x.protocol | ||
%td= x.alg | ||
%td= x.public_key | ||
#footer | ||
%hr | ||
%p{class: 'blue'} Eesti Interneti SA | ||
%p Paldiski mnt 80, 10617 Tallinn, Estonia T +372 727 1000 E info@internet.ee www.internet.ee | ||
%p Reg. nr 90010019 KMKR EE101286464 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require 'test_helper' | ||
|
||
class DomainShowTest < ApplicationIntegrationTest | ||
setup do | ||
@domain = domains(:shop) | ||
sign_in users(:admin) | ||
end | ||
|
||
def test_downloads_domain | ||
filename = "#{@domain.name}.pdf" | ||
get download_admin_domain_path(@domain) | ||
|
||
assert_response :ok | ||
assert_equal 'application/pdf', response.headers['Content-Type'] | ||
assert_equal "attachment; filename=\"#{filename}\"; filename*=UTF-8''#{filename}", response.headers['Content-Disposition'] | ||
assert_not_empty response.body | ||
end | ||
end |