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

add support to gravatar

parent 682ce76e
...@@ -29,6 +29,7 @@ from time import time ...@@ -29,6 +29,7 @@ from time import time
from json import dumps as toJSON from json import dumps as toJSON
from json import load as fileToJSON from json import load as fileToJSON
from collections import defaultdict from collections import defaultdict
from hashlib import md5
class DebomaticModule_JSONLoggerStart: class DebomaticModule_JSONLoggerStart:
...@@ -89,7 +90,10 @@ class DebomaticModule_JSONLogger: ...@@ -89,7 +90,10 @@ class DebomaticModule_JSONLogger:
status = {} status = {}
status['package'] = args.package status['package'] = args.package
status['distribution'] = args.distribution 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 return status
def _append_json_logfile(self, args, status): def _append_json_logfile(self, args, status):
......
...@@ -74,7 +74,7 @@ class Client ...@@ -74,7 +74,7 @@ class Client
pack.orig_name = p pack.orig_name = p
read_package_status {distribution: data.distribution, package: pack}, (content) => read_package_status {distribution: data.distribution, package: pack}, (content) =>
for attr of 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] delete content[attr]
@socket.emit e.distribution_packages_status, content @socket.emit e.distribution_packages_status, content
data.distribution.packages.push pack data.distribution.packages.push pack
......
...@@ -225,6 +225,10 @@ function Page_Distrubion(socket) { ...@@ -225,6 +225,10 @@ function Page_Distrubion(socket) {
var p_html = $('#packages li[id="package-' + status_data.package + '"] a'); var p_html = $('#packages li[id="package-' + status_data.package + '"] a');
p_html.find('span.icon').remove(); p_html.find('span.icon').remove();
p_html.append(Utils.get_status_icon_html(status_data)); 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) { 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 // in case user is watching this package, update also view.package
view.package = Utils.clone(view.packages[status_data.package]); view.package = Utils.clone(view.packages[status_data.package]);
......
...@@ -143,6 +143,24 @@ footer .info { ...@@ -143,6 +143,24 @@ footer .info {
margin-top: -3px; 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 { #files .size {
margin: 0 8px 0 0; margin: 0 8px 0 0;
font-size: 70%; 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