Commit 4b3ed753 authored by Antonio Terceiro's avatar Antonio Terceiro

Use FontAwesome via its standard API

This stops debci from breaking when fonts-font-awesome is upgraded from
v4 to v5, due to debci icorrectly using FontAwesome internals.
parent 09030215
......@@ -2,7 +2,7 @@
/log/*
/public/doc/
/public/jquery*.js
/public/font-awesome/
/public/font-awesome
/public/bootstrap
/config/whitelist*
/config/debci
......
......@@ -135,6 +135,23 @@ module Debci
text && CGI.escapeHTML(text)
end
ICONS = {
pass: 'thumbs-up',
fail: 'thumbs-down',
fail_passed_never: ['thumbs-down', 'ban'],
fail_passed_current: ['thumbs-down', 'bolt'],
fail_passed_old: ['thumbs-down', 'arrow-down'],
tmpfail_pass: 'thumbs-up',
tmpfail_fail: 'thumbs-down',
tmpfail: 'question-circle',
no_test_data: 'question',
}
def icon(status)
Array(ICONS[status.to_sym]).map do |i|
"<i class='#{status} fa fa-#{i}'></i>"
end.join(' ')
end
end
end
......@@ -12,14 +12,10 @@
<small>
[ <%= @suite %>/<%= @architecture %> ]
<a id='icon-rss'
href='/data/feeds/<%= @package.prefix %>/<%= @package.name %>.xml'>
</a>
<a href='/data/feeds/<%= @package.prefix %>/<%= @package.name %>.xml'><i class='fa fa-rss'></i></a>
<a id='icon-tracker'
href='https://tracker.debian.org/pkg/<%= @package.name %>'
title='On the Package Tracking System'>
</a>
<a href='https://tracker.debian.org/pkg/<%= @package.name %>'
title='On the Package Tracking System'><i class='fa fa-info-circle'></i></a>
</small>
</h2>
......@@ -30,7 +26,8 @@
<% end %>
<% if @latest && @latest.status == :fail && @latest.failmsg %>
<div class='alert alert-warning <%= @latest.extended_status %>'>
<div class='alert alert-warning'>
<%= icon(@latest.extended_status) %>
This package is failing and has <%= @latest.failmsg %>.
</div>
<% end %>
......@@ -54,7 +51,9 @@
<td><%= test.date %></td>
<td><%= escape(test.trigger) || '&mdash;' %></td>
<td><%= test.duration_human %></td>
<td class="<%= test.status %>"><%= test.status %></td>
<td>
<%= icon(test.status) %>
</td>
<% if test.expired? %>
<td><span class='fa fa-trash' title='file has been removed due to data retention policy'></span></td>
<% else %>
......
......@@ -3,10 +3,9 @@
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">News
<a id="icon-rss" class="pull-right"
<a class='pull-right'
href="data/feeds/all-packages.xml"
title='Atom feed for events in all packages'>
</a>
title='Atom feed for events in all packages'><i class='fa fa-rss'></i></a>
</div>
<div class="list-group">
<% news = @repository.news_for('*') %>
......@@ -14,8 +13,7 @@
<div class='list-group-item'><em>(no news yet)</em></div>
<% else %>
<% news.each do |item| %>
<a href="/packages/<%= @repository.find_package(item.package).prefix %>/<%= item.package %>/<%= item.suite %>/<%= item.architecture %>"
class="list-group-item <%= item.extended_status %>"><%= item.headline %><div><small class="text-muted"><%= item.date %> | <strong><%= item.time %></strong></small></div></a>
<a href="/packages/<%= @repository.find_package(item.package).prefix %>/<%= item.package %>/<%= item.suite %>/<%= item.architecture %>" class="list-group-item"><%= icon(item.extended_status) %> <%= item.headline %><div><small class="text-muted"><%= item.date %> | <strong><%= item.time %></strong></small></div></a>
<% end %>
<% end %>
......
......@@ -10,14 +10,10 @@
<%= @package.name %>
<small>
<a id='icon-rss'
href='/data/feeds/<%= @package.prefix %>/<%= @package.name %>.xml'>
</a>
<a href='/data/feeds/<%= @package.prefix %>/<%= @package.name %>.xml'><i class='fa fa-rss'></i></a>
<a id='icon-tracker'
href='https://tracker.debian.org/pkg/<%= @package.name %>'
title='On the Package Tracking System'>
</a>
<a href='https://tracker.debian.org/pkg/<%= @package.name %>'
title='On the Package Tracking System'><i class='fa fa-info-circle'></i></a>
</small>
</h2>
......@@ -48,13 +44,14 @@
<% row.each do |status| %>
<% if status.status.eql?(:no_test_data) %>
<td class="<%= status.extended_status %>"><%= status.title %></td>
<td><%= icon(status.extended_status)%> <%= status.title %></td>
<% else %>
<% package_dir = "/packages/#{@package.prefix}" +
"/#{@package.name}/#{status.suite}" +
"/#{row.first.architecture}"
%>
<td class="<%= status.status %>">
<td>
<%= icon(status.status) %>
<a href=<%= package_dir %>><%= status.version %> <%= status.title %></a>
</td>
<% end %>
......
......@@ -32,13 +32,16 @@
<% if package.failures.any? %>
<td>
<% package.failures.each do |s| %>
<a class='<%= s.extended_status %>' href='<%= "/packages/#{@prefix}/#{package.name}/#{s.suite}/#{s.architecture}"%>'>
<a href='<%= "/packages/#{@prefix}/#{package.name}/#{s.suite}/#{s.architecture}"%>'>
<%= icon(s.extended_status) %>
<%= s.version %> <%= s.status.upcase %> <%= s.suite %>/<%= s.architecture %> <%= s.failmsg && '(%s)' % s.failmsg %>
</a>
<% end %>
</td>
<% else %>
<td><div class='pass'>Passing everywhere</div></td>
<td>
<div><i class='pass fa fa-thumbs-up'></i> Passing everywhere</div>
</td>
<% end %>
</tr>
<% end %>
......
......@@ -13,8 +13,8 @@
<td><%= package %></td>
<td>
<% statuses.each do |status| %>
<a class='<%= status.extended_status %>'
href="/packages/<%= Debci::Package.new(package).prefix %>/<%= package %>/<%= status.suite %>/<%= status.architecture %>/">
<a href="/packages/<%= Debci::Package.new(package).prefix %>/<%= package %>/<%= status.suite %>/<%= status.architecture %>/">
<%= icon(status.extended_status) %>
<%= status.suite %>/<%= status.architecture%> <%= status.status %> (<%= status.duration_human %>)
</a>
&nbsp;
......
<ol id='status-nav' class='breadcrumb'>
<li><a id='icon-chart' href='/status'>Status charts</a></li>
<li><a id='icon-alert' href='/status/alerts'>Status alerts</a></li>
<li><a id='icon-pending' href='/status/pending'>Pending jobs</a></li>
<li><a class='fa fa-hand-paper-o' href='/status/blacklist/'>Blacklist</a></li>
<li><a class='fa fa-eye' href='/status/platform-specific-issues/'>Platform-specific issues</a></li>
<li><a href='/status' ><i class='fa fa-area-chart' ></i> Status charts</a ></li>
<li><a href='/status/alerts' ><i class='fa fa-exclamation-triangle'></i> Status alerts</a></li>
<li><a href='/status/pending' ><i class='fa fa-question-circle' ></i> Pending jobs</a></li>
<li><a href='/status/blacklist/' ><i class='fa fa-hand-paper-o' ></i> Blacklist</a></li>
<li><a href='/status/platform-specific-issues/' ><i class='fa fa-eye' ></i> Platform-specific issues</a></li>
</ol>
......@@ -2,6 +2,5 @@ public/jquery.flot.time.js /usr/share/javascript/jquery-flot/jquery.flot.time.
public/jquery.js /usr/share/javascript/jquery/jquery.min.js
public/jquery.flot.stack.js /usr/share/javascript/jquery-flot/jquery.flot.stack.min.js
public/jquery.flot.js /usr/share/javascript/jquery-flot/jquery.flot.min.js
public/font-awesome/css /usr/share/fonts-font-awesome/css
public/font-awesome/fonts /usr/share/fonts-font-awesome/fonts
public/font-awesome /usr/share/fonts-font-awesome
public/bootstrap /usr/share/javascript/bootstrap
......@@ -44,53 +44,39 @@
* status marks
* ----------------------------------------------------------------- */
.pass, .fail, .tmpfail, .no_test_data, .fail_passed_never,
.fail_passed_current, .fail_passed_old, .tmpfail_pass, .tmpfail_fail {
font-family: 'FontAwesome';
}
.pass:before {
content: "\f164 ";
.pass {
color: #8ae234;
}
.fail:before {
content: "\f165 ";
.fail {
color: #ef2929;
}
.tmpfail:before {
content: "\f059 ";
.tmpfail {
color: #ffd862;
}
.no_test_data:before {
content: "\f06a ";
.no_test_data {
color: #babdb6;
}
.fail_passed_never:before {
content: "\f165 \f05e ";
.fail_passed_never {
color: #ef2929;
}
.fail_passed_current:before {
content: "\f165 \f0e7 ";
.fail_passed_current {
color: #9e0000;
}
.fail_passed_old:before {
content: "\f165 \f063 ";
.fail_passed_old {
color: #c80c0c;
}
.tmpfail_pass:before {
content: "\f059 \f164 ";
.tmpfail_pass {
color: #fffa62;
}
.tmpfail_fail:before {
content: "\f059 \f165 ";
.tmpfail_fail {
color: #ffb062;
}
......@@ -98,55 +84,16 @@
* icons
* ----------------------------------------------------------------- */
#icon-alert:before {
font-family: "FontAwesome";
content: "\f071 ";
.fa-exclamation-triangle:before {
color: orange;
padding-right: 0.3em;
}
#icon-alert:hover {
text-decoration: none !important;
}
#icon-pending:before {
font-family: "FontAwesome";
content: "\f059 ";
color: green;
padding-right: 0.3em;
}
#icon-pending:hover {
text-decoration: none !important;
}
#icon-chart:before {
font-family: "FontAwesome";
content: "\f1fe ";
padding-right: 0.3em;
}
#icon-chart:hover {
text-decoration: none !important;
}
#icon-rss:before {
font-family: "FontAwesome";
content: "\f09e ";
.fa-rss:before {
color: orange;
}
#icon-rss:hover {
text-decoration: none !important;
}
#icon-tracker:before {
font-family: "FontAwesome";
content: "\f05a ";
}
#icon-tracker:hover {
text-decoration: none !important;
.fa-question-circle:before {
color: green;
}
/* -----------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment