From 7fcdd478263589261877759f01d7b22ae08f9be5 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Aug 21 2017 10:35:08 +0000 Subject: Simplify the index_auth template so it renders faster By dropping the calls to the number of public ticket and PR that are opened on each project we're rendering we're significantly reducing the time it takes to render this template which on dist-git is quite welcome. Signed-off-by: Pierre-Yves Chibon --- diff --git a/template/index_auth.html b/template/index_auth.html new file mode 100644 index 0000000..9b77f2d --- /dev/null +++ b/template/index_auth.html @@ -0,0 +1,196 @@ +{% extends "master.html" %} + +{% block title %}Home{% endblock %} +{% set tag = "projects" %} +{% from "_browseheader.html" import browse_header %} + + +{% block header %} + +{% endblock %} + + +{% from "_render_repo.html" import render_repos_as_card, render_activity_graph %} + +{% block content %} +
+
+
+
+ + {{ render_activity_graph(username) }} + +
+
+ My Projects {{repos | count}} + {% if config.get('ENABLE_NEW_PROJECTS', True) and repos %} + + + + + + {% endif %} +
+ {% if repos %} +
+ {% for repo in repos %} +
+ {% set url = url_for( + 'view_repo', + repo=repo.name, + username=repo.user.username if repo.is_fork else None, + namespace=repo.namespace) %} + + {% if repo.avatar_email %} +   + {% else %} + + {% endif %} + {{ repo.namespace + '/' if repo.namespace }}{{ repo.name }} + +
+ {% endfor %} +
+ {% else %} +
+
You have no projects
+
+ {% if config.get('ENABLE_NEW_PROJECTS', True) %} + + Create a Project + + {% endif %} +
+
+ {% endif %} +
+ +
+
+ My Forks {{forks | count}} +
+ {% if forks %} +
+ {% for fork in forks %} +
+ {% set url = url_for( + 'view_repo', + repo=fork.name, + username=fork.user.username if fork.is_fork else None, + namespace=fork.namespace) %} + + + + {{fork.user.username}}/{{ fork.namespace + '/' if fork.namespace }}{{ fork.name }} + + +
+ {% endfor %} +
+ {% else %} +
+

You have no forks

+
+ {% endif %} +
+ +
+
+
+
+ My Groups {{ user.groups | length }} + + {% if config.get('ENABLE_GROUP_MNGT') %} + + + + {% endif %} + +
+ {% for group in user.groups %} + + {% else %} +
+

No group found

+
+ {% endfor %} +
+
+
+ My Watch List {{ watch_list | count }} +
+ {% for repo in watch_list %} + + {% else %} +
+

No project in watch list

+
+ {% endfor %} +
+
+
+
+
+{% endblock %} + +{% block jscripts %} + {{ super() }} + +{% endblock %}