Skip to content

Commit

Permalink
Merge cd2d40e into 967829e
Browse files Browse the repository at this point in the history
  • Loading branch information
teleyinex committed Feb 6, 2014
2 parents 967829e + cd2d40e commit d46e6a2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
11 changes: 7 additions & 4 deletions pybossa/cache/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def last_activity(app_id):
results = db.engine.execute(sql, app_id=app_id)
for row in results:
if row is not None:
return pretty_date(row[0])
return row[0]
else: # pragma: no cover
return None

Expand Down Expand Up @@ -171,7 +171,8 @@ def get_featured(category, page=1, per_page=5):
app = dict(id=row.id, name=row.name, short_name=row.short_name,
created=row.created, description=row.description,
overall_progress=overall_progress(row.id),
last_activity=last_activity(row.id),
last_activity=pretty_date(last_activity(row.id)),
last_activity_raw=last_activity(row.id),
owner=row.owner,
featured=row.id,
info=dict(json.loads(row.info)))
Expand Down Expand Up @@ -270,7 +271,8 @@ def get_draft(category, page=1, per_page=5):
created=row.created,
description=row.description,
owner=row.owner,
last_activity=last_activity(row.id),
last_activity=pretty_date(last_activity(row.id)),
last_activity_raw=last_activity(row.id),
overall_progress=overall_progress(row.id),
info=dict(json.loads(row.info)))
apps.append(app)
Expand Down Expand Up @@ -334,7 +336,8 @@ def get(category, page=1, per_page=5):
description=row.description,
owner=row.owner,
featured=row.featured,
last_activity=last_activity(row.id),
last_activity=pretty_date(last_activity(row.id)),
last_activity_raw=last_activity(row.id),
overall_progress=overall_progress(row.id),
info=dict(json.loads(row.info)))
apps.append(app)
Expand Down
2 changes: 1 addition & 1 deletion pybossa/themes/default
Submodule default updated from e5e37e to 423c60
3 changes: 2 additions & 1 deletion pybossa/view/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ def app_index(page, lookup, category, fallback, use_count):
for app in apps:
data.append(dict(app=app, n_tasks=cached_apps.n_tasks(app['id']),
overall_progress=cached_apps.overall_progress(app['id']),
last_activity=cached_apps.last_activity(app['id'])))
last_activity=app['last_activity'],
last_activity_raw=app['last_activity_raw']))


if fallback and not apps: # pragma: no cover
Expand Down

0 comments on commit d46e6a2

Please sign in to comment.