From 5a2117b06c1cf72258f72987ad8ab43963bfba77 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Nov 16 2015 16:09:47 +0000 Subject: [PATCH 1/6] Add a datagrepper chart to user profile pages. --- diff --git a/pagure/default_config.py b/pagure/default_config.py index e8f214f..b107fbf 100644 --- a/pagure/default_config.py +++ b/pagure/default_config.py @@ -21,6 +21,9 @@ SECRET_KEY = '' # url to the database server: DB_URL = 'sqlite:////var/tmp/pagure_dev.sqlite' +# url to datagrepper (optional): +#DATAGREPPER_URL = 'https://apps.fedoraproject.org/datagrepper' + # The FAS group in which the admin of pagure are ADMIN_GROUP = 'sysadmin-main' diff --git a/pagure/static/pagure.css b/pagure/static/pagure.css index a59d6ad..86e60ac 100644 --- a/pagure/static/pagure.css +++ b/pagure/static/pagure.css @@ -178,6 +178,10 @@ header h1 span { border-spacing: 1em; } +#user_graph { + min-height: 400px; +} + .project_link { border: 1px solid #CCCCCC; border-radius: 5px 5px 5px 5px; diff --git a/pagure/templates/user_info.html b/pagure/templates/user_info.html index 3af3552..3099f1b 100644 --- a/pagure/templates/user_info.html +++ b/pagure/templates/user_info.html @@ -27,6 +27,17 @@ Joined {{ user.created | humanize }}

+ {% if config.get('DATAGREPPER_URL') %} +
+
+

Contributions

+
+ + User activity graph + +
+ {% endif %} + {{ render_repos( repos, total_page_repos, 'repopage', repopage, 'Projects', repos_length, 'repos', hide=False) }} From e151b1143262f1d39499e08ab265427f572359f0 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Nov 16 2015 16:09:47 +0000 Subject: [PATCH 2/6] Add a spinner for the contributions graph. --- diff --git a/pagure/static/images/spinner.gif b/pagure/static/images/spinner.gif new file mode 100644 index 0000000..8a3ea9f Binary files /dev/null and b/pagure/static/images/spinner.gif differ diff --git a/pagure/static/pagure.css b/pagure/static/pagure.css index 86e60ac..f17c18a 100644 --- a/pagure/static/pagure.css +++ b/pagure/static/pagure.css @@ -180,6 +180,9 @@ header h1 span { #user_graph { min-height: 400px; + background-image: url('images/spinner.gif'); + background-position: center; + background-repeat: no-repeat; } .project_link { From aabacde221c4e553919cb8a852a54c60fad10584 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Nov 16 2015 16:09:47 +0000 Subject: [PATCH 3/6] Make datagrepper category configurable. --- diff --git a/pagure/default_config.py b/pagure/default_config.py index b107fbf..bc86d7b 100644 --- a/pagure/default_config.py +++ b/pagure/default_config.py @@ -23,6 +23,7 @@ DB_URL = 'sqlite:////var/tmp/pagure_dev.sqlite' # url to datagrepper (optional): #DATAGREPPER_URL = 'https://apps.fedoraproject.org/datagrepper' +#DATAGREPPER_CATEGORY = 'pagure' # The FAS group in which the admin of pagure are ADMIN_GROUP = 'sysadmin-main' diff --git a/pagure/templates/user_info.html b/pagure/templates/user_info.html index 3099f1b..6a5d43c 100644 --- a/pagure/templates/user_info.html +++ b/pagure/templates/user_info.html @@ -32,8 +32,8 @@

Contributions

- - User activity graph + + User activity graph {% endif %} From 3f69f8b9cd9a89e7e18ba1928ac0a9cbe69d6004 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Nov 16 2015 16:09:47 +0000 Subject: [PATCH 4/6] Cubic interpolation is nice. --- diff --git a/pagure/templates/user_info.html b/pagure/templates/user_info.html index 6a5d43c..09083aa 100644 --- a/pagure/templates/user_info.html +++ b/pagure/templates/user_info.html @@ -33,7 +33,7 @@

Contributions

- User activity graph + User activity graph {% endif %} From cd6a75fbf4abb23e594413f8fd1a0989203058b0 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Nov 16 2015 16:09:47 +0000 Subject: [PATCH 5/6] Move contributions graph to the bottom of the user page so it doesn't distract from other more useful panels. --- diff --git a/pagure/static/pagure.css b/pagure/static/pagure.css index f17c18a..3001f24 100644 --- a/pagure/static/pagure.css +++ b/pagure/static/pagure.css @@ -179,7 +179,7 @@ header h1 span { } #user_graph { - min-height: 400px; + min-height: 150px; background-image: url('images/spinner.gif'); background-position: center; background-repeat: no-repeat; diff --git a/pagure/templates/user_info.html b/pagure/templates/user_info.html index 09083aa..b6cda73 100644 --- a/pagure/templates/user_info.html +++ b/pagure/templates/user_info.html @@ -27,17 +27,6 @@ Joined {{ user.created | humanize }}

- {% if config.get('DATAGREPPER_URL') %} -
-
-

Contributions

-
- - User activity graph - -
- {% endif %} - {{ render_repos( repos, total_page_repos, 'repopage', repopage, 'Projects', repos_length, 'repos', hide=False) }} @@ -67,6 +56,18 @@

No group found

{% endfor %} + + {% if config.get('DATAGREPPER_URL') %} +
+
+

Contributions

+
+ + User activity graph + +
+ {% endif %} + {% endblock %} {% block jscripts %} From ffc9112cbd8238e5eac45afe7be6adf50e24a800 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Nov 16 2015 16:59:51 +0000 Subject: [PATCH 6/6] Remove cubic interpolation. --- diff --git a/pagure/templates/user_info.html b/pagure/templates/user_info.html index b6cda73..4b81e59 100644 --- a/pagure/templates/user_info.html +++ b/pagure/templates/user_info.html @@ -63,7 +63,7 @@

Contributions

- User activity graph + User activity graph {% endif %}