summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-02-10 16:45:59 +0100
committerJames Edwards-Jones <jedwardsjones@gitlab.com>2017-01-31 22:53:57 +0000
commit0552c0b6f185433ad0a7caac321f0a6d445a0b63 (patch)
treedbe9eebfc26ca11732d2f8201b129c3abb52d5bf
parente5e2e7b70315cbcee12db66ebc73dbd0ef4a14ae (diff)
downloadgitlab-ce-0552c0b6f185433ad0a7caac321f0a6d445a0b63.tar.gz
Fix views
-rw-r--r--app/models/pages_domain.rb4
-rw-r--r--app/views/projects/pages/_list.html.haml33
-rw-r--r--app/views/projects/pages/show.html.haml6
3 files changed, 22 insertions, 21 deletions
diff --git a/app/models/pages_domain.rb b/app/models/pages_domain.rb
index 810af4e832a..985329bb856 100644
--- a/app/models/pages_domain.rb
+++ b/app/models/pages_domain.rb
@@ -71,8 +71,6 @@ class PagesDomain < ActiveRecord::Base
@fingeprint ||= OpenSSL::Digest::SHA256.new(x509.to_der).to_s
end
- private
-
def x509
return unless certificate
@x509 ||= OpenSSL::X509::Certificate.new(certificate)
@@ -87,6 +85,8 @@ class PagesDomain < ActiveRecord::Base
nil
end
+ private
+
def update
::Projects::UpdatePagesConfigurationService.new(project).execute
end
diff --git a/app/views/projects/pages/_list.html.haml b/app/views/projects/pages/_list.html.haml
index 7dfeb0e6e12..e88a001d636 100644
--- a/app/views/projects/pages/_list.html.haml
+++ b/app/views/projects/pages/_list.html.haml
@@ -1,16 +1,17 @@
-.panel.panel-default
- .panel-heading
- Domains (#{@domains.count})
- %ul.well-list
- - @domains.each do |domain|
- %li
- .pull-right
- = link_to 'Details', namespace_project_page_path(@project.namespace, @project, domain), class: "btn btn-sm btn-grouped"
- = link_to 'Remove', namespace_project_page_path(@project.namespace, @project, domain), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-remove btn-sm btn-grouped"
- .clearfix
- %span= link_to domain.domain, domain.url
- %p
- - if domain.subject
- %span.label.label-gray Certificate: #{domain.subject}
- - if domain.expired?
- %span.label.label-danger Expired
+- if @domains.any?
+ .panel.panel-default
+ .panel-heading
+ Domains (#{@domains.count})
+ %ul.well-list
+ - @domains.each do |domain|
+ %li
+ .pull-right
+ = link_to 'Details', namespace_project_page_path(@project.namespace, @project, domain), class: "btn btn-sm btn-grouped"
+ = link_to 'Remove', namespace_project_page_path(@project.namespace, @project, domain), data: { confirm: 'Are you sure?'}, method: :delete, class: "btn btn-remove btn-sm btn-grouped"
+ .clearfix
+ %span= link_to domain.domain, domain.url
+ %p
+ - if domain.subject
+ %span.label.label-gray Certificate: #{domain.subject}
+ - if domain.expired?
+ %span.label.label-danger Expired
diff --git a/app/views/projects/pages/show.html.haml b/app/views/projects/pages/show.html.haml
index 98c4e890968..52493b1959b 100644
--- a/app/views/projects/pages/show.html.haml
+++ b/app/views/projects/pages/show.html.haml
@@ -1,7 +1,7 @@
- page_title "#{@domain.domain}", "Pages Domain"
%h3.page-title
- #{@domain.domain}
+ Pages Domain
.table-holder
%table.table
@@ -14,9 +14,9 @@
%td
Certificate
%td
- - if @domain.certificate
+ - if @domain.x509
%pre
- = @domain.certificate.to_text
+ = @domain.x509.to_text
- else
.light
missing