Commit 1d347335 authored by Leo Iannacone's avatar Leo Iannacone

add support to gravatar

parent 682ce76e
......@@ -29,6 +29,7 @@ from time import time
from json import dumps as toJSON
from json import load as fileToJSON
from collections import defaultdict
from hashlib import md5
class DebomaticModule_JSONLoggerStart:
......@@ -89,7 +90,10 @@ class DebomaticModule_JSONLogger:
status = {}
status['package'] = args.package
status['distribution'] = args.distribution
status['uploader'] = args.uploader
status['uploader'] = ""
if args.uploader != "":
email = args.uploader.lower().encode('utf-8')
status['gravatar'] = md5(email).hexdigest()
return status
def _append_json_logfile(self, args, status):
......
......@@ -74,7 +74,7 @@ class Client
pack.orig_name = p
read_package_status {distribution: data.distribution, package: pack}, (content) =>
for attr of content
if attr not in ['distribution', 'package', 'status', 'success']
if attr not in ['distribution', 'package', 'status', 'success', 'gravatar']
delete content[attr]
@socket.emit e.distribution_packages_status, content
data.distribution.packages.push pack
......
......@@ -225,6 +225,10 @@ function Page_Distrubion(socket) {
var p_html = $('#packages li[id="package-' + status_data.package + '"] a');
p_html.find('span.icon').remove();
p_html.append(Utils.get_status_icon_html(status_data));
if (status_data.gravatar) {
var image = "http://gravatar.com/avatar/" + status_data.gravatar + "?d=mm&s=30";
p_html.css("background-image", "url(" + image + ")");
}
if (Utils.check_view_package(view) && view.package.orig_name == status_data.package && view.distribution.name == status_data.distribution) {
// in case user is watching this package, update also view.package
view.package = Utils.clone(view.packages[status_data.package]);
......
......@@ -143,6 +143,24 @@ footer .info {
margin-top: -3px;
}
#packages li a {
background-image: url("/images/package.png");
padding-left: 40px;
background-repeat: no-repeat;
background-position: left;
border: 1px solid rgba(0, 0, 0, 0.18);
}
#packages li:not( .active) a {
box-shadow: 0 0px 2px rgba(0, 0, 0, 0.3) inset;
background-color: rgba(0, 0, 0, 0.05);
border-color: rgba(255,255,255, 0.76);
}
#packages li:not( .active) a:hover {
background-color: rgba(0, 0, 0, 0.06);
}
#files .size {
margin: 0 8px 0 0;
font-size: 70%;
......
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