From bd1e47f863aa4162cfd01b7d18f5232ca348848d Mon Sep 17 00:00:00 2001 From: Ryan Lerch Date: Jan 14 2016 14:45:06 +0000 Subject: started changes to the index_auth page First round of changes for the index_auth / user dashboard page Trying to make it more useful for a user, with icons showing the issues and PRs open for each of their repos. This also has less information about the repos presented by default to the user (ntoably the repo description), as the assumption here is that the user probably already knows what the repo does, because they created it. --- diff --git a/pagure/static/koji.css b/pagure/static/koji.css index 45aa44e..77594a4 100644 --- a/pagure/static/koji.css +++ b/pagure/static/koji.css @@ -379,3 +379,7 @@ padding:0; margin-bottom:0; } +a.notblue { + color: inherit; + text-decoration:none; +} diff --git a/pagure/templates/index_auth.html b/pagure/templates/index_auth.html index 192c78c..3cf375e 100644 --- a/pagure/templates/index_auth.html +++ b/pagure/templates/index_auth.html @@ -14,32 +14,60 @@ {% from "_render_repo.html" import render_repos_as_card %} {% block content %} -
-
- {{browse_header(select=tag)}} -
-
-

- {{ username | avatar(36) | safe }} {{ username }} - {% if g.fas_user and g.fas_user.username == username %} - - {% endif %} -

-
- {{ render_repos_as_card(repos, repos_length, 'Projects', 'repopage', repopage, total_page_repos) }} +
+
+ My Projects {{repos | count}} +
+ {% if repos %} +
+ {% for repo in repos %} +
+ {% if repo.is_fork %} + {% set url = url_for('view_repo', username=repo.user.username, repo=repo.name) %} + {% else %} + {% set url = url_for('view_repo', repo=repo.name) %} + {% endif %} + + + {{ repo.name }} + +
+ {% if repo.open_tickets_public == 0 %} + {{ repo.open_tickets_public }} + {% else %} + + {{ repo.open_tickets_public }} + + {% endif %} + + {% if repo.open_requests == 0 %} + {{repo.open_requests}} + {% else %} + + {{repo.open_requests}} + + {% endif %} + +
+
+ {% endfor %} +
+ {% else %} +
+

You have no projects

+
+ {% endif %} +
{{ render_repos_as_card(forks, forks_length,'Forks', 'forkpage', forkpage, total_page_forks) }}
- Groups {{ user.groups | length }} + My Groups {{ user.groups | length }}
{% for group in user.groups %}
diff --git a/pagure/ui/app.py b/pagure/ui/app.py index 9de75d8..37b7bd0 100644 --- a/pagure/ui/app.py +++ b/pagure/ui/app.py @@ -87,16 +87,10 @@ def index_auth(): except ValueError: forkpage = 1 - limit = APP.config['ITEM_PER_PAGE'] - repo_start = limit * (repopage - 1) - fork_start = limit * (forkpage - 1) - repos = pagure.lib.search_projects( SESSION, username=flask.g.fas_user.username, - fork=False, - start=repo_start, - limit=limit) + fork=False) repos_length = pagure.lib.search_projects( SESSION, username=flask.g.fas_user.username, @@ -106,18 +100,13 @@ def index_auth(): forks = pagure.lib.search_projects( SESSION, username=flask.g.fas_user.username, - fork=True, - start=fork_start, - limit=limit) + fork=True) forks_length = pagure.lib.search_projects( SESSION, username=flask.g.fas_user.username, fork=True, count=True) - total_page_repos = int(ceil(repos_length / float(limit))) - total_page_forks = int(ceil(forks_length / float(limit))) - return flask.render_template( 'index_auth.html', username=flask.g.fas_user.username, @@ -126,8 +115,6 @@ def index_auth(): repos=repos, repopage=repopage, forkpage=forkpage, - total_page_repos=total_page_repos, - total_page_forks=total_page_forks, repos_length=repos_length, forks_length=forks_length, )