[copr] master: Actually commit the templates :) (e98f165)

bkabrda at fedoraproject.org bkabrda at fedoraproject.org
Fri Jan 18 15:06:44 UTC 2013


Repository : http://git.fedorahosted.org/cgit/copr.git

On branch  : master

>---------------------------------------------------------------

commit e98f1658ce12b73c153f1b5d14de7146939a74ad
Author: Bohuslav Kabrda <bkabrda at redhat.com>
Date:   Fri Jan 18 16:03:45 2013 +0100

    Actually commit the templates :)


>---------------------------------------------------------------

 .../coprs/detail/.builds.html.swp}                 |  Bin 12288 -> 12288 bytes
 .../coprs/templates/coprs/detail/_build_forms.html |   24 ++++++++++
 .../coprs/{ => detail}/_permissions_table.html     |    0
 .../coprs/templates/coprs/detail/builds.html       |   12 +++++
 .../coprs/templates/coprs/detail/overview.html     |   45 ++++++++++++++++++++
 .../coprs/templates/coprs/detail/permissions.html  |    9 ++++
 6 files changed, 90 insertions(+), 0 deletions(-)

diff --git a/coprs_frontend/coprs/logic/.coprs_logic.py.swo b/coprs_frontend/coprs/templates/coprs/detail/.builds.html.swp
similarity index 67%
copy from coprs_frontend/coprs/logic/.coprs_logic.py.swo
copy to coprs_frontend/coprs/templates/coprs/detail/.builds.html.swp
index b244106..bfa2ee8 100644
Binary files a/coprs_frontend/coprs/logic/.coprs_logic.py.swo and b/coprs_frontend/coprs/templates/coprs/detail/.builds.html.swp differ
diff --git a/coprs_frontend/coprs/templates/coprs/detail/_build_forms.html b/coprs_frontend/coprs/templates/coprs/detail/_build_forms.html
new file mode 100644
index 0000000..a5d6c4e
--- /dev/null
+++ b/coprs_frontend/coprs/templates/coprs/detail/_build_forms.html
@@ -0,0 +1,24 @@
+{% macro copr_build_form(form, view, copr) %} 
+    <form action="{{ url_for(view, username = copr.owner.name, coprname = copr.name) }}" method=post class=add-entry> 
+      <dl> 
+        {{ form.csrf_token }} 
+        {{ render_field(form.pkgs, rows = 10, cols = 50) }} 
+        {% if g.user.proven %} 
+          {{ render_field(form.memory_reqs) }} 
+          {{ render_field(form.timeout) }} 
+          {% else %} {# once we pass the hidden attribute, the field will just be hidden, it seems #} 
+          {{ render_field(form.memory_reqs, hidden = True) }} 
+          {{ render_field(form.timeout, hidden = True) }} 
+        {% endif %} 
+        <dd><input type=submit value=Submit></dd> 
+      </dl> 
+    </form> 
+{% endmacro %} 
+ 
+{% macro copr_build_cancel_form(build) %} 
+  {% if build.cancelable %} 
+    <form action="{{ url_for('coprs_ns.copr_cancel_build', username = build.copr.owner.name, coprname = build.copr.name, build_id = build.id)}}" method=post> 
+      <input type=submit value=Cancel> 
+    </form> 
+  {% endif %} 
+{% endmacro %}
diff --git a/coprs_frontend/coprs/templates/coprs/_permissions_table.html b/coprs_frontend/coprs/templates/coprs/detail/_permissions_table.html
similarity index 100%
copy from coprs_frontend/coprs/templates/coprs/_permissions_table.html
copy to coprs_frontend/coprs/templates/coprs/detail/_permissions_table.html
diff --git a/coprs_frontend/coprs/templates/coprs/detail/builds.html b/coprs_frontend/coprs/templates/coprs/detail/builds.html
new file mode 100644
index 0000000..c2882b8
--- /dev/null
+++ b/coprs_frontend/coprs/templates/coprs/detail/builds.html
@@ -0,0 +1,12 @@
+{% extends "coprs/detail.html" %}
+{% from "coprs/_builds_table.html" import builds_table with context %}
+
+{% block detail_body %}
+  {% if copr.builds %}
+    <h3>Latest 10 in this repo</h3>
+      {{ builds_table(copr.builds) }}
+    <a href="{{ url_for('coprs_ns.copr_show_builds', username = copr.owner.name, coprname = copr.name) }}">Show all builds</a>
+      {% else %}
+    <h3>No builds so far</h3>
+  {% endif %}
+{% endblock %}
diff --git a/coprs_frontend/coprs/templates/coprs/detail/overview.html b/coprs_frontend/coprs/templates/coprs/detail/overview.html
new file mode 100644
index 0000000..82cb8d5
--- /dev/null
+++ b/coprs_frontend/coprs/templates/coprs/detail/overview.html
@@ -0,0 +1,45 @@
+{% extends "coprs/detail.html" %}
+{% block detail_body %}
+  <h2>Description</h2>
+  <div class="shift-right">This is a description...</div>
+  <h2>Installation Instructions</h2>
+  <div class="shift-right">These are installation instructions...</div>
+  <h2>Active Releases</h2>
+  <table class="releases">
+    <tr>
+      <th class="leftmost">Release</th>
+      <th class="rightmost">Architecture</th>
+    </tr>
+    {% for mock_chroot in copr.mock_chroots %}
+      {% if loop.index < copr.mock_chroots|length %}
+        {% if mock_chroot.os_release != copr.mock_chroots[loop.index].os_release or
+              mock_chroot.os_version != copr.mock_chroots[loop.index].os_version %}
+          {# next release is different => release-end #}
+          <tr class="release-end">
+        {% else %}
+          <tr>
+        {% endif %}
+      {% else %}{# last line => release-end for sure #}
+        <tr class="release-end">
+      {% endif %}
+        {% if mock_chroot.os_release != copr.mock_chroots[loop.index0 - 1].os_release or
+            mock_chroot.os_version != copr.mock_chroots[loop.index0 - 1].os_version %}
+          <td>{{ mock_chroot.os_release|capitalize }} {{ mock_chroot.os_version }}</td>
+        {% else %}
+          <td></td>
+        {% endif %}
+      <td>{{ mock_chroot.arch }}</td>
+      </tr>
+    {% else %}
+      <tr colspan="2"><td>No active releases</td></tr>
+    {% endfor %}
+  </table>
+  {% if copr.repos_list %}
+    <h2>Repository List</h2>
+    <ul class=repos-list>
+      {% for repo in copr.repos_list %}
+        <li><a href="{{ repo }}">{{ repo }}</a></li>
+      {% endfor %}
+    </ul>  
+  {% endif %}
+{% endblock %}
diff --git a/coprs_frontend/coprs/templates/coprs/detail/permissions.html b/coprs_frontend/coprs/templates/coprs/detail/permissions.html
new file mode 100644
index 0000000..2b2ad6d
--- /dev/null
+++ b/coprs_frontend/coprs/templates/coprs/detail/permissions.html
@@ -0,0 +1,9 @@
+{% extends "coprs/detail.html" %}
+{% from "coprs/detail/_permissions_table.html" import permissions_table with context%}
+
+{% block detail_body %}
+  {% if (g.user and g.user != copr.owner) or permissions %}
+    {# the table is displayed only if there are some permissions or a non-owner is viewing the page (then display at least his applier form #}
+    {{ permissions_table(permissions, current_user_permissions, copr, permissions_applier_form, permissions_form) }}
+  {% endif %}
+{% endblock %}



More information about the copr-devel mailing list