Skip to content

Commit

Permalink
manual merge (requirements.txt got confused)
Browse files Browse the repository at this point in the history
  • Loading branch information
mk270 committed Mar 16, 2013
2 parents c3a006d + b3157af commit e6f98d8
Show file tree
Hide file tree
Showing 22 changed files with 1,303 additions and 67 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ pybossa/templates/custom/*
_ga.html
_gcs.html
_gcs_form.html
dat/GeoLiteCity.dat
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: python
python:
- "2.6"
- "2.7"
env: PYBOSSA_SETTINGS='../settings_test.py'
install:
Expand Down
3 changes: 1 addition & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,4 @@ Authors

* Twitter Bootstrap Icons by Glyphicons http://http://glyphicons.com/
* FontAwesome fonts by http://fortawesome.github.com/Font-Awesome/


* GeoLite data by MaxMind http://www.maxmind.com
5 changes: 5 additions & 0 deletions dat/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Please, if you want to provide in the application statistics page a web map showing
the location of the volunteers as well as a table with the Country and City, you need
to download the GeoLite Free Database and save it here.

You can download it from this link: http://dev.maxmind.com/geoip/geolite
25 changes: 25 additions & 0 deletions doc/customizing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -319,4 +319,29 @@ And the **_gcs_form.html** will be like this::
After these steps, your site will be indexed by Google and Google Custom Search
will be working, providing for your users a search tool.

Adding web maps for application statistics
==========================================

PyBossa creates for each application a statistics page, where the creators of
the application and the volunteers can check the top 5 anonymous and
authenticated users, an estimation of time about when all the tasks will be
completed, etc.

One interesting feature of the statistics page is that it can generate a web
map showing the location of the anonymous volunteers that have been
participating in the application. By default the maps are disabled, because you
will need to download the GeoLiteCity DAT file database that will be use for
generating the maps.

GeoLite_ is a free geolocatication database from MaxMind that they release
under a `Creative Commons Attribution-ShareAlike 3.0 Uported License`_. You can
download the required file: GeoLite City from this page_. Once you have
downloaded the file, all you have to do is to uncompress it and place it in the
folder **/dat** of the pybossa root folder.

After copying the file, all you have to do to start creating the maps is to
restart the server.

.. _GeoLite: http://dev.maxmind.com/geoip/geolite
.. _`Creative Commons Attribution-ShareAlike 3.0 Uported License`: http://creativecommons.org/licenses/by-sa/3.0/
.. _page: http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
14 changes: 10 additions & 4 deletions doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ PyBossa is a python web application built using the Flask micro-framework.

Pre-requisites:

* Python >= 2.6, <3.0
* A database plus Python bindings for PostgreSQL
* Python >= 2.7, <3.0
* A database plus Python bindings for PostgreSQL version 9.1
* pip for installing python packages (e.g. on ubuntu python-pip)

.. note::
Expand Down Expand Up @@ -214,8 +214,8 @@ second one will perform the migration.
Enabling a Cache
================

PyBossa comes with a Cache system (based on `flask-cache <http://packages.python.org/Flask-Cache/>`_) that it is
disabled by default. If you want to start caching some pages of the PyBossa server, you
PyBossa comes with a Cache system (based on `flask-cache <http://packages.python.org/Flask-Cache/>`_)
that it is disabled by default. If you want to start caching some pages of the PyBossa server, you
only have to modify your settings and change the following value from::

CACHE_TYPE = 'null'
Expand All @@ -226,3 +226,9 @@ to::

The cache also supports other configurations, so please, check the official
documentation of `flask-cache <http://packages.python.org/Flask-Cache/>`_.

.. note::
**Important**: We highly recommend you to enable the cache, as it will boost
the performance of the server caching SQL queries as well as page views. If
you have lots of applications with hundreds of tasks, you should enable it.

9 changes: 8 additions & 1 deletion pybossa/cache/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@
from sqlalchemy.sql import func, text
from pybossa.core import cache
from pybossa.core import db
from pybossa.model import Featured, App, TaskRun
from pybossa.model import Featured, App, TaskRun, Task
from pybossa.util import pretty_date

import json
import string
import operator
import datetime
import time
from datetime import timedelta

STATS_TIMEOUT=50

@cache.cached(key_prefix="front_page_featured_apps")
def get_featured_front_page():
Expand Down
38 changes: 38 additions & 0 deletions pybossa/static/css/stats/MarkerCluster.Default.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.marker-cluster-small {
background-color: rgba(181, 226, 140, 0.6);
}
.marker-cluster-small div {
background-color: rgba(110, 204, 57, 0.6);
}

.marker-cluster-medium {
background-color: rgba(241, 211, 87, 0.6);
}
.marker-cluster-medium div {
background-color: rgba(240, 194, 12, 0.6);
}

.marker-cluster-large {
background-color: rgba(253, 156, 115, 0.6);
}
.marker-cluster-large div {
background-color: rgba(241, 128, 23, 0.6);
}

.marker-cluster {
background-clip: padding-box;
border-radius: 20px;
}
.marker-cluster div {
width: 30px;
height: 30px;
margin-left: 5px;
margin-top: 5px;

text-align: center;
border-radius: 15px;
font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
}
.marker-cluster span {
line-height: 30px;
}
6 changes: 6 additions & 0 deletions pybossa/static/css/stats/MarkerCluster.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow {
-webkit-transition: -webkit-transform 0.25s ease-out, opacity 0.25s ease-in;
-moz-transition: -moz-transform 0.25s ease-out, opacity 0.25s ease-in;
-o-transition: -o-transform 0.25s ease-out, opacity 0.25s ease-in;
transition: transform 0.25s ease-out, opacity 0.25s ease-in;
}
110 changes: 110 additions & 0 deletions pybossa/static/css/stats/stats.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
html,
body {
background-color:#efeeee;
}

h1 {
font-weight:normal;
margin:0px;
}

.alert-info {
background-color: #2681c0;
border:none;
color: #FFF;
text-shadow:none;
}
.alert-info .close {
color: #FFFFFF;
opacity: 1.0;
text-shadow: none;
}

#heading {
margin-top:30px;
margin-bottom:20px;
}
#heading .span1 img {
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
[id*="card"] .well {
background-color:#FFF;
}
[id*="card"] .well h2 {
background-color:#d4d3d3;
margin: -19px -19px 30px;
padding:10px 20px;
font-size:18px;
font-weight: bold;
line-height:normal;
-webkit-border-top-left-radius: 4px;
-webkit-border-top-right-radius: 4px;
-moz-border-radius-topleft: 4px;
-moz-border-radius-topright: 4px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
[id*="card"] .well h2 small {
float: right;
font-size: 14px;
color: #6C6B6B;
background-image: url(/static/img/info-icon.png);
background-repeat: no-repeat;
background-position: left center;
padding-left:25px;
height:20px;
line-height:20px;
}

[id*="card"] h3 {
font-weight: bold;
}

[id*="card"] p {
font-size: 18px;
}

[id*="card"] .note {
font-size: 10px;
}

.table-hover tbody tr:hover td,
.table-hover tbody tr:hover th {
background-color: rgb(200,200,200);
}

a.pybossa {
display:inline-block;
position:absolute;
top:30px;
right:30px;
opacity:0.1;
}
a.pybossa:hover {
opacity:0.3;
}

/* Desktop */
@media (min-width: 768px) {
h1 {
font-size:24px;
}
#heading [class*="span"]:nth-of-type(2) {
margin-left:0px;
}
#heading .span1 {
width:54px;
}
#heading .span1 img {
max-width:44px;
}
}
/* Landscape phones and down */
@media (max-width: 480px) {
a.pybossa {
position:relative;
margin:30px;
}
}
Binary file added pybossa/static/img/info-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions pybossa/static/js/stats/flotr2.min.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions pybossa/static/js/stats/leaflet.markercluster.js

Large diffs are not rendered by default.

Loading

0 comments on commit e6f98d8

Please sign in to comment.