Add project pictures (header) to Attract Index
This commit is contained in:
@@ -4,6 +4,7 @@ import logging
|
||||
from flask import Blueprint, render_template, url_for
|
||||
import flask_login
|
||||
|
||||
from pillar.api.utils import attach_project_pictures
|
||||
from pillar.api.utils import jsonify
|
||||
import pillar.web.subquery
|
||||
from pillar.web.system_util import pillar_api
|
||||
@@ -19,6 +20,8 @@ log = logging.getLogger(__name__)
|
||||
|
||||
@blueprint.route('/')
|
||||
def index():
|
||||
api = pillar_api()
|
||||
|
||||
user = flask_login.current_user
|
||||
if user.is_authenticated:
|
||||
tasks = current_attract.task_manager.tasks_for_user(user.objectid)
|
||||
@@ -28,13 +31,16 @@ def index():
|
||||
|
||||
# TODO: add projections.
|
||||
projects = current_attract.attract_projects()
|
||||
|
||||
for project in projects['_items']:
|
||||
utils.attach_project_pictures(project, api)
|
||||
|
||||
projs_with_summaries = [
|
||||
(proj, current_attract.shot_manager.shot_status_summary(proj['_id']))
|
||||
for proj in projects['_items']
|
||||
]
|
||||
|
||||
# Fetch all activities for all Attract projects.
|
||||
api = pillar_api()
|
||||
id_to_proj = {p['_id']: p for p in projects['_items']}
|
||||
activities = pillarsdk.Activity.all({
|
||||
'where': {
|
||||
|
Reference in New Issue
Block a user