Skip to content

Commit 0c9a08a

Browse files
committed
fix: Fix some invalid HTML
- double <body> on main page - <div> outside <body> on matrix page - <th> without a row on main page - add HTML 5 doctype
1 parent f57184e commit 0c9a08a

File tree

7 files changed

+193
-192
lines changed

7 files changed

+193
-192
lines changed

DEVELOPER_SETUP.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* To run the example:
99

1010
cd dev
11+
bundle install
1112
bundle exec rackup
1213

1314
* The application will be available on `http://localhost:9292`

lib/pact_broker/api/renderers/html_pact_renderer.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,4 @@ def consumer_contract
167167
end
168168
end
169169
end
170-
end
170+
end

lib/pact_broker/ui/views/index/show-with-tags.haml

+34-33
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,28 @@
1818
Pacts
1919
%table.table.table-bordered.table-striped{ id: 'relationships' }
2020
%thead
21-
%th.consumer
22-
Consumer
23-
%span.glyphicon.glyphicon-sort.relationships-sort
24-
%th.consumer-version-number
25-
Consumer<br>Version
26-
%span.glyphicon.glyphicon-sort.relationships-sort
27-
%th.pact{ style: 'width: 40px' }
28-
%th.provider
29-
Provider
30-
%span.glyphicon.glyphicon-sort.relationships-sort
31-
%th.provider-version-number
32-
Provider<br>Version
33-
%span.glyphicon.glyphicon-sort.relationships-sort
34-
%th
35-
Published
36-
%span.glyphicon.glyphicon-sort.relationships-sort
37-
%th
38-
Webhook<br>status
39-
%th
40-
Last<br>verified
41-
%span.glyphicon.glyphicon-sort.relationships-sort
21+
%tr
22+
%th.consumer
23+
Consumer
24+
%span.glyphicon.glyphicon-sort.relationships-sort
25+
%th.consumer-version-number
26+
Consumer<br>Version
27+
%span.glyphicon.glyphicon-sort.relationships-sort
28+
%th.pact{ style: 'width: 40px' }
29+
%th.provider
30+
Provider
31+
%span.glyphicon.glyphicon-sort.relationships-sort
32+
%th.provider-version-number
33+
Provider<br>Version
34+
%span.glyphicon.glyphicon-sort.relationships-sort
35+
%th
36+
Published
37+
%span.glyphicon.glyphicon-sort.relationships-sort
38+
%th
39+
Webhook<br>status
40+
%th
41+
Last<br>verified
42+
%span.glyphicon.glyphicon-sort.relationships-sort
4243
%tbody
4344

4445
- index_items.each do | index_item |
@@ -84,17 +85,17 @@
8485
%div.relationships-size
8586
= index_items.size_label
8687
87-
:javascript
88-
$(function(){
89-
$("#relationships").tablesorter();
90-
});
88+
:javascript
89+
$(function(){
90+
$("#relationships").tablesorter();
91+
});
9192

92-
$(document).ready(function(){
93-
$("span.pact a").load("/images/doc-text.svg");
94-
$("span.pact-matrix a").load("/images/doc-matrix.svg");
95-
$('td[data-toggle="tooltip"]').each(function(index, td){
96-
//appended tooltip div screws up table if it's appended after a
97-
//td, so need to append it to a div
98-
$(td).tooltip({container: $(td).first()});
93+
$(document).ready(function(){
94+
$("span.pact a").load("/images/doc-text.svg");
95+
$("span.pact-matrix a").load("/images/doc-matrix.svg");
96+
$('td[data-toggle="tooltip"]').each(function(index, td){
97+
//appended tooltip div screws up table if it's appended after a
98+
//td, so need to append it to a div
99+
$(td).tooltip({container: $(td).first()});
100+
});
99101
});
100-
});

lib/pact_broker/ui/views/index/show.haml

+28-27
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,23 @@
1818
Pacts
1919
%table.table.table-bordered.table-striped{ id: 'relationships' }
2020
%thead
21-
%th
22-
%th.consumer
23-
Consumer
24-
%span.glyphicon.glyphicon-sort.relationships-sort
25-
%th.pact
21+
%tr
22+
%th
23+
%th.consumer
24+
Consumer
25+
%span.glyphicon.glyphicon-sort.relationships-sort
26+
%th.pact
2627

27-
%th.provider
28-
Provider
29-
%span.glyphicon.glyphicon-sort.relationships-sort
30-
%th
31-
%th
32-
Latest pact<br>published
33-
%th
34-
Webhook<br>status
35-
%th
36-
Last<br>verified
28+
%th.provider
29+
Provider
30+
%span.glyphicon.glyphicon-sort.relationships-sort
31+
%th
32+
%th
33+
Latest pact<br>published
34+
%th
35+
Webhook<br>status
36+
%th
37+
Last<br>verified
3738
%tbody
3839

3940
- index_items.each do | index_item |
@@ -65,17 +66,17 @@
6566
%div.relationships-size
6667
= index_items.size_label
6768
68-
:javascript
69-
$(function(){
70-
$("#relationships").tablesorter();
71-
});
69+
:javascript
70+
$(function(){
71+
$("#relationships").tablesorter();
72+
});
7273

73-
$(document).ready(function(){
74-
$("span.pact a").load("/images/doc-text.svg");
75-
$("span.pact-matrix a").load("/images/doc-matrix.svg");
76-
$('td[data-toggle="tooltip"]').each(function(index, td){
77-
//appended tooltip div screws up table if it's appended after a
78-
//td, so need to append it to a div
79-
$(td).tooltip({container: $(td).first()});
74+
$(document).ready(function(){
75+
$("span.pact a").load("/images/doc-text.svg");
76+
$("span.pact-matrix a").load("/images/doc-matrix.svg");
77+
$('td[data-toggle="tooltip"]').each(function(index, td){
78+
//appended tooltip div screws up table if it's appended after a
79+
//td, so need to append it to a div
80+
$(td).tooltip({container: $(td).first()});
81+
});
8082
});
81-
});
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
<!DOCTYPE html>
12
%html
23
%head
34
%title= defined?(title) ? title : ""
45
%link{rel: 'shortcut icon', href: '/images/favicon.ico', type:'image/x-icon'}
5-
%body
6-
= yield
6+
= yield

0 commit comments

Comments
 (0)