Skip to content

Commit 8da1709

Browse files
committed
Adicionado no template link do github de quem contribuiu no documento
1 parent 12216cc commit 8da1709

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

_templates/_page.html.erb

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<title><%= [topic_title, subgroup_title].compact.join(' - ') %> | <%= group_title %> | <%= distro %> <%= version %></title>
1212
<link href="https://assets.openshift.net/content/subdomain.css" rel="stylesheet" type="text/css">
1313
<link href="<%= File.join(css_path, 'docs.css') %>" rel="stylesheet" />
14-
<link href="https://assets.openshift.net/content/subdomain/touch-icon-precomposed.png" rel="apple-touch-icon-precomposed" type="image/png">
1514
<link href="_images/favicon32x32.png" rel="shortcut icon" type="image/png">
1615
<!--[if IE]><link rel="shortcut icon" href="https://assets.openshift.net/content/subdomain/favicon.ico"><![endif]-->
1716
<!-- or, set /favicon.ico for IE10 win -->
@@ -36,6 +35,8 @@
3635
</head>
3736
<body>
3837
<%= render("_templates/_topnav.html.erb", :distro_key => distro_key, :site_url => site_url) %>
38+
39+
3940
<div class="container">
4041
<p class="toggle-nav visible-xs pull-left">
4142
<button class="btn btn-default btn-sm" type="button" data-toggle="offcanvas">Toggle nav</button>
@@ -65,8 +66,12 @@
6566
<div class="col-xs-12 col-sm-9 col-md-9 main">
6667
<div class="page-header">
6768
<h1><%= article_title %></h1>
69+
6870
</div>
6971
<%= content %>
72+
73+
<h4> Esse documento existe graças à contribuição de:</h4>
74+
<div id="contribuidores"></div>
7075
</div>
7176
</div>
7277
</div>
@@ -89,6 +94,25 @@
8994
$("[id^='topicSubGroup']").on('hide.bs.collapse', function () {
9095
$(this).parent().find("[id^='sgSpan']").toggleClass("fa-caret-right fa-caret-down");
9196
});
97+
98+
// Script para pegar github de quem contribuiu para um documento específico
99+
var url = "https://api.github.com/repos/guardians-dsc/docs/commits?path=<%= navigation.find{|h| h[:id] == topic_id.split('::')[0]}[:topics][0][:path][2..-1] %>";
100+
url = url.replace("html", "adoc");
101+
var unique = [];
102+
$.getJSON(url, function(data) {
103+
var twitterList = $("<ul />");
104+
$.each(data, function(index, item) {
105+
if(item.author && unique.indexOf(item.author.html_url) == -1) {
106+
$("<li />", {
107+
"text": item.author.html_url
108+
}).appendTo(twitterList);
109+
unique.push(item.author.html_url)
110+
}
111+
});
112+
113+
$("#contribuidores").fadeOut("fast", function() {$(this).empty().append(twitterList).fadeIn(1000);});
114+
})
115+
92116
});
93117
/*]]>*/
94118
</script>

0 commit comments

Comments
 (0)