This is an automated email from the git hooks/post-receive script.
praiskup pushed a commit to branch master
in repository copr/copr.
commit d5812ea95703c0886d5c4b525ab41fd9a1d3721c
Author: Jakub Kadlcik <frostyx(a)email.cz>
AuthorDate: Mon Jun 17 20:51:17 2019 +0200
[frontend] extract code for rendering project box into its own macro
---
.../coprs_frontend/coprs/templates/_helpers.html | 29 ++++++++++++++++++++++
.../coprs/templates/coprs/group_show.html | 24 ++----------------
.../coprs_frontend/coprs/templates/coprs/show.html | 28 ++-------------------
3 files changed, 33 insertions(+), 48 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/templates/_helpers.html
b/frontend/coprs_frontend/coprs/templates/_helpers.html
index 7e76688..ed65088 100644
--- a/frontend/coprs_frontend/coprs/templates/_helpers.html
+++ b/frontend/coprs_frontend/coprs/templates/_helpers.html
@@ -684,3 +684,32 @@
https://admin.fedoraproject.org/accounts/group/view/{{name}}
</tbody>
</table>
{% endmacro %}
+
+
+{% macro render_project_box(copr) %}
+<a href="{{ copr_details_href(copr) }}"
class="list-group-item">
+ <div>
+ <h3 class="list-group-item-heading" style="display:
inline;">
+ {{ copr_name(copr) }}
+ </h3>
+ {% if copr.delete_after %}
+ <small> (temporary project, {{ copr.delete_after_msg }})</small>
+ {% endif %}
+ </div>
+ <span class="list-group-item-text">
+ {{ copr.description|markdown|remove_anchor|default('Description not filled in
by author. Very likely personal repository for testing purpose, which you should not
use.', true) }}
+ <ul class="list-inline text-muted">
+ {% for os in copr.active_chroots_grouped %}
+ <li>
+ <strong>{{ friendly_os_name(os[0].split()[0], os[0].split()[1])
}}:</strong>
+ <small>
+ {% for arch in os[1] %}
+ {{ arch }}{% if not loop.last %}, {% endif %}
+ {% endfor %}
+ </small>
+ </li>
+ {% endfor %}
+ </ul>
+ </span>
+</a>
+{% endmacro %}
diff --git a/frontend/coprs_frontend/coprs/templates/coprs/group_show.html
b/frontend/coprs_frontend/coprs/templates/coprs/group_show.html
index f3bafef..a715717 100644
--- a/frontend/coprs_frontend/coprs/templates/coprs/group_show.html
+++ b/frontend/coprs_frontend/coprs/templates/coprs/group_show.html
@@ -2,7 +2,7 @@
{% block title %}Project List{% endblock %}
{% block header %}Project List{% endblock %}
{% from "_helpers.html" import render_pagination, copr_details_href, copr_name,
user_projects_panel %}
-{% from "_helpers.html" import recent_builds_panel, task_queue_panel,
friendly_os_name %}
+{% from "_helpers.html" import recent_builds_panel, task_queue_panel,
friendly_os_name, render_project_box %}
{%block main_menu_projects %}active{% endblock %}
{% block body %}
<div class="row">
@@ -15,27 +15,7 @@
<div class="panel panel-default">
<div class="list-group">
{% for copr in coprs %}
- <!--copr-project-->
- <a href="{{ copr_details_href(copr) }}"
class="list-group-item">
- <h3 class="list-group-item-heading">
- {{ copr_name(copr) }}
- </h3>
- <span class="list-group-item-text">
- {{ copr.description|markdown|remove_anchor|default('Description not
filled in by author. Very likely personal repository for testing purpose, which you should
not use.', true) }}
- <ul class="list-inline text-muted">
- {% for os in copr.active_chroots_grouped %}
- <li>
- <strong>{{ friendly_os_name(os[0].split()[0], os[0].split()[1])
}}:</strong>
- <small>
- {% for arch in os[1] %}
- {{arch}}{% if not loop.last %}, {% endif %}
- {%endfor%}
- </small>
- </li>
- {% endfor %}
- </ul>
- </span>
- </a>
+ {{ render_project_box(copr) }}
{% else %}
<p>No projects...</p>
{% endfor %}
diff --git a/frontend/coprs_frontend/coprs/templates/coprs/show.html
b/frontend/coprs_frontend/coprs/templates/coprs/show.html
index f71361f..e4f4df5 100644
--- a/frontend/coprs_frontend/coprs/templates/coprs/show.html
+++ b/frontend/coprs_frontend/coprs/templates/coprs/show.html
@@ -3,6 +3,7 @@
{% block header %}Project List{% endblock %}
{% from "_helpers.html" import render_pagination, copr_details_href, copr_name,
user_projects_panel %}
{% from "_helpers.html" import recent_builds_panel, task_queue_panel,
recent_blog_panel, friendly_os_name %}
+{% from "_helpers.html" import render_project_box %}
{%block main_menu_projects %}active{% endblock %}
{% block body %}
<div class="row">
@@ -17,32 +18,7 @@
<div class="panel panel-default">
<div class="list-group">
{% for copr in coprs %}
- <!--copr-project-->
- <a href="{{ copr_details_href(copr) }}"
class="list-group-item">
- <div>
- <h3 class="list-group-item-heading" style="display:
inline;">
- {{ copr_name(copr) }}
- </h3>
- {% if copr.delete_after %}
- <small> (temporary project, {{ copr.delete_after_msg }})</small>
- {% endif %}
- </div>
- <span class="list-group-item-text">
- {{ copr.description|markdown|remove_anchor|default('Description not
filled in by author. Very likely personal repository for testing purpose, which you should
not use.', true) }}
- <ul class="list-inline text-muted">
- {% for os in copr.active_chroots_grouped %}
- <li>
- <strong>{{ friendly_os_name(os[0].split()[0], os[0].split()[1])
}}:</strong>
- <small>
- {% for arch in os[1] %}
- {{ arch }}{% if not loop.last %}, {% endif %}
- {% endfor %}
- </small>
- </li>
- {% endfor %}
- </ul>
- </span>
- </a>
+ {{ render_project_box(copr) }}
{% else %}
<p>No projects...</p>
{% endfor %}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.