diff --git a/pagure/templates/_render_repo.html b/pagure/templates/_render_repo.html new file mode 100644 index 0000000..c3d5729 --- /dev/null +++ b/pagure/templates/_render_repo.html @@ -0,0 +1,103 @@ +{% macro render_row(items) -%} + {% for repo in items %} + {% if loop.index == 1 %} +
+ {% endif %} + {% 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 %} + + {# TODO: get project logo #} + {{ repo.name }} + {% if repo.description %} + {{ repo.description | wraps(20) }} + {% endif %} + + {% if loop.last %} +
+ {% elif loop.index is divisibleby(3) or loop.last %} + +
+ {% endif %} + {% else %} +

No project found

+ {% endfor %} +{%- endmacro %} + + +{% macro render_repos(list, total, page, title, count, id, username=None) %} +
+
+ {% set title_lvl = 3 if username else 2 %} + {{ title }} ({{ count }}) +
+ {% if total and total > 1 %} + + {% endif %} +
+ {{ render_row(list) }} +
+
+{% endmacro %} + + +{% macro repos_switch(all = True) %} + +{% endmacro %} diff --git a/pagure/templates/index.html b/pagure/templates/index.html index cd8875f..c68df97 100644 --- a/pagure/templates/index.html +++ b/pagure/templates/index.html @@ -9,8 +9,8 @@ href="{{ url_for('static', filename='toggle.css') }}"/> {% endblock %} -{% from "render_repo.html" import render_repos %} -{% from "render_repo.html" import repos_switch %} +{% from "_render_repo.html" import render_repos %} +{% from "_render_repo.html" import repos_switch %} {% block content %} {% if username %} diff --git a/pagure/templates/render_repo.html b/pagure/templates/render_repo.html deleted file mode 100644 index c3d5729..0000000 --- a/pagure/templates/render_repo.html +++ /dev/null @@ -1,103 +0,0 @@ -{% macro render_row(items) -%} - {% for repo in items %} - {% if loop.index == 1 %} -
- {% endif %} - {% 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 %} - - {# TODO: get project logo #} - {{ repo.name }} - {% if repo.description %} - {{ repo.description | wraps(20) }} - {% endif %} - - {% if loop.last %} -
- {% elif loop.index is divisibleby(3) or loop.last %} -
-
- {% endif %} - {% else %} -

No project found

- {% endfor %} -{%- endmacro %} - - -{% macro render_repos(list, total, page, title, count, id, username=None) %} -
-
- {% set title_lvl = 3 if username else 2 %} - {{ title }} ({{ count }}) -
- {% if total and total > 1 %} - - {% endif %} -
- {{ render_row(list) }} -
-
-{% endmacro %} - - -{% macro repos_switch(all = True) %} - -{% endmacro %} diff --git a/pagure/templates/user_info.html b/pagure/templates/user_info.html index 9609144..61ed74a 100644 --- a/pagure/templates/user_info.html +++ b/pagure/templates/user_info.html @@ -10,8 +10,8 @@ {% endblock %} -{% from "render_repo.html" import render_repos %} -{% from "render_repo.html" import repos_switch %} +{% from "_render_repo.html" import render_repos %} +{% from "_render_repo.html" import repos_switch %} {% block content %}