예제 #1
0
파일: views.py 프로젝트: prateek/hue
def home(request):
    docs = itertools.chain(
        Document.objects.get_docs(request.user).order_by("-last_modified").exclude(tags__tag__in=["history"])[:500],
        Document.objects.get_docs(request.user).order_by("-last_modified").filter(tags__tag__in=["history"])[:100],
    )
    docs = list(docs)
    trash = DocumentTag.objects.get_trash_tag(request.user)
    history = DocumentTag.objects.get_history_tag(request.user)
    tags = list(
        set(
            [tag for doc in docs for tag in doc.tags.all()]
            + [tag for tag in DocumentTag.objects.get_tags(user=request.user)]
        )
    )  # List of all personal and share tags

    apps = appmanager.get_apps_dict(request.user)

    return render(
        "home.mako",
        request,
        {
            "apps": apps,
            "documents": augment_docs(docs, request.user),
            "json_documents": json.dumps(massaged_documents_for_json(docs, request.user)),
            "tags": augment_tags(tags, request.user),
            "json_tags": json.dumps(massaged_tags_for_json(tags, request.user)),
        },
    )
예제 #2
0
파일: views.py 프로젝트: szhorizon/hue
def home(request):
  docs = _get_docs(request.user)

  apps = appmanager.get_apps_dict(request.user)

  return render('home.mako', request, {
    'apps': apps,
    'json_documents': json.dumps(massaged_documents_for_json(docs, request.user)),
    'json_tags': json.dumps(massaged_tags_for_json(docs, request.user)),
  })
예제 #3
0
파일: views.py 프로젝트: mrmichalis/hue
def home(request):
  docs = _get_docs(request.user)

  apps = appmanager.get_apps_dict(request.user)

  return render('home.mako', request, {
    'apps': apps,
    'json_documents': json.dumps(massaged_documents_for_json(docs, request.user)),
    'json_tags': json.dumps(massaged_tags_for_json(docs, request.user)),
    'tours_and_tutorials': Settings.get_settings().tours_and_tutorials
  })
예제 #4
0
파일: views.py 프로젝트: icloudkit/hue
def home(request):
  docs = _get_docs(request.user)

  apps = appmanager.get_apps_dict(request.user)

  return render('home.mako', request, {
    'apps': apps,
    'json_documents': json.dumps(massaged_documents_for_json(docs, request.user)),
    'json_tags': json.dumps(massaged_tags_for_json(docs, request.user)),
    'tours_and_tutorials': Settings.get_settings().tours_and_tutorials
  })
예제 #5
0
파일: views.py 프로젝트: Web5design/hue
def home(request):
  docs = Document.objects.get_docs(request.user).order_by('-last_modified')[:1000]
  tags = DocumentTag.objects.get_tags(user=request.user)

  apps = appmanager.get_apps_dict(request.user)

  return render('home.mako', request, {
    'apps': apps,
    'documents': docs,
    'json_documents': json.dumps(massaged_documents_for_json(docs)),
    'tags': tags,
    'json_tags': json.dumps(massaged_tags_for_json(tags, request.user))
  })
예제 #6
0
파일: views.py 프로젝트: jessica9421/hue
def home(request):
  docs = Document.objects.get_docs(request.user).order_by('-last_modified')[:1000]
  tags = DocumentTag.objects.get_tags(user=request.user)

  apps = appmanager.get_apps_dict(request.user)

  return render('home.mako', request, {
    'apps': apps,
    'documents': docs,
    'json_documents': json.dumps(massaged_documents_for_json(docs)),
    'tags': tags,
    'json_tags': json.dumps(massaged_tags_for_json(tags, request.user))
  })
예제 #7
0
def home(request):
    docs = _get_docs(request.user)

    apps = appmanager.get_apps_dict(request.user)

    return render(
        "home.mako",
        request,
        {
            "apps": apps,
            "json_documents": json.dumps(massaged_documents_for_json(docs, request.user)),
            "json_tags": json.dumps(massaged_tags_for_json(docs, request.user)),
            "tours_and_tutorials": Settings.get_settings().tours_and_tutorials,
        },
    )
예제 #8
0
파일: views.py 프로젝트: chu888chu888/hue
def home(request):
  docs = itertools.chain(
      Document.objects.get_docs(request.user).order_by('-last_modified').exclude(tags__tag__in=['history'])[:500],
      Document.objects.get_docs(request.user).order_by('-last_modified').filter(tags__tag__in=['history'])[:100]
  )
  docs = list(docs)
  tags = list(set([tag for doc in docs for tag in doc.tags.all()])) # List of all personal and share tags

  apps = appmanager.get_apps_dict(request.user)

  return render('home.mako', request, {
    'apps': apps,
    'documents': augment_docs(docs, request.user),
    'json_documents': json.dumps(massaged_documents_for_json(docs, request.user)),
    'tags': augment_tags(tags, request.user),
    'json_tags': json.dumps(massaged_tags_for_json(tags, request.user))
  })
예제 #9
0
파일: views.py 프로젝트: dominikgehl/hue
def home(request):
  docs = itertools.chain(
      Document.objects.get_docs(request.user).order_by('-last_modified').exclude(tags__tag__in=['history'])[:500],
      Document.objects.get_docs(request.user).order_by('-last_modified').filter(tags__tag__in=['history'])[:100]
  )
  docs = list(docs)
  tags = DocumentTag.objects.get_tags(user=request.user)

  apps = appmanager.get_apps_dict(request.user)

  return render('home.mako', request, {
    'apps': apps,
    'documents': augment_docs(docs, request.user),
    'json_documents': json.dumps(massaged_documents_for_json(docs, request.user)),
    'tags': augment_tags(tags, request.user),
    'json_tags': json.dumps(massaged_tags_for_json(tags, request.user))
  })