public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [gentoo-commits] proj/gentoo-packages:master commit in: gpackages/apps/packages/, gpackages/static/js/, gpackages/templates/
@ 2012-06-30  0:22 99% Slava Bacherikov
  0 siblings, 0 replies; 1+ results
From: Slava Bacherikov @ 2012-06-30  0:22 UTC (permalink / raw
  To: gentoo-commits

commit:     352228c716b23c57f8b0e86e48c809550f5274fb
Author:     Slava Bacherikov <slava <AT> bacher09 <DOT> org>
AuthorDate: Fri Jun 29 23:04:17 2012 +0000
Commit:     Slava Bacherikov <slava <AT> bacherikov <DOT> org <DOT> ua>
CommitDate: Fri Jun 29 23:04:17 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-packages.git;a=commit;h=352228c7

Add details to package

---
 gpackages/apps/packages/views.py        |    2 +-
 gpackages/static/js/packages_details.js |   21 ++++++++++++++++
 gpackages/templates/base.html           |    1 +
 gpackages/templates/package_object.html |   40 ++++++++++++++++++++++++++++++-
 4 files changed, 62 insertions(+), 2 deletions(-)

diff --git a/gpackages/apps/packages/views.py b/gpackages/apps/packages/views.py
index 5d70510..d04acd3 100644
--- a/gpackages/apps/packages/views.py
+++ b/gpackages/apps/packages/views.py
@@ -81,7 +81,7 @@ class PackagesListsView(MultipleFilterListViewMixin, ContextListView):
     base_queryset = PackageModel.objects.all(). \
         select_related('virtual_package',
                        'virtual_package__category'). \
-        prefetch_related('repository'). \
+        prefetch_related('repository', 'herds', 'maintainers'). \
         prefetch_keywords(arches)
 
 class PackageDetailView(ContextView, DetailView):

diff --git a/gpackages/static/js/packages_details.js b/gpackages/static/js/packages_details.js
new file mode 100644
index 0000000..75cb070
--- /dev/null
+++ b/gpackages/static/js/packages_details.js
@@ -0,0 +1,21 @@
+!function ($){
+    $(function() {
+        $('.package a.trigger').click(function (e){
+            var self = $(e.target),
+            details = self.parent().next();
+            $('.trigger', this).text() == '+'
+                ? $('.trigger', this).text('-')
+                : $('.trigger', this).text('+');
+
+            if (details.hasClass('hide')){
+                details.removeClass('hide');
+                details.hide();
+                details.fadeIn(200);
+            }
+            else details.fadeToggle(200);
+
+            e.preventDefault();
+            return false;
+        });
+    });
+}(window.jQuery);

diff --git a/gpackages/templates/base.html b/gpackages/templates/base.html
index 69d5ff6..74b4797 100644
--- a/gpackages/templates/base.html
+++ b/gpackages/templates/base.html
@@ -160,6 +160,7 @@ Text
     <script src="{{ STATIC_URL }}js/bootstrap.js"></script>
     <script src="{{ STATIC_URL }}js/csrf.js"></script>
     <script src="{{ STATIC_URL }}js/language.js"></script>
+    <script src="{{ STATIC_URL }}js/packages_details.js"></script>
 {% endblock body %}
   </body>
 </html>

diff --git a/gpackages/templates/package_object.html b/gpackages/templates/package_object.html
index d713d4a..189d9bd 100644
--- a/gpackages/templates/package_object.html
+++ b/gpackages/templates/package_object.html
@@ -1,6 +1,6 @@
 {% load url from future %}
 {% load packages %}
-<div class="well package-well">
+<div class="well package-well package">
     <div class="package-name">
         <span><a href="{{ package.get_absolute_url }}">{{ package.cp }}</a>:: {{ package.repository.name }}</span>
         <span class="package_update_datetime">{{ package.updated_datetime }}</span>
@@ -9,4 +9,42 @@
         <div style="padding-bottom: 10px; margin 10px;">{{ package.description }}</div>
     {% endif %}
     {% render_keywords_table package arches %}
+
+    {% with herds=package.herds.all maintainers=package.maintainers.all %}
+    {% if herds or maintainers %}
+    <div style="padding-bottom: 10px; padding-top: 0px; margin-top: 0px;">
+    <a href="#" class="trigger"><span class="trigger">+</span>Details</a>
+    </div>
+    <div class="row-fluid details hide">
+        <table class="table table-striped table-hover">
+            <colgroup>
+                <col class="span1">
+                <col class="span1">
+            </colgroup>
+            <tbody>
+                {% if herds %}
+                <tr>
+                    <td>Herds:</td>
+                    <td>
+                        {% for herd in herds %}
+                        <a href="{% url 'packages' herd=herd.name %}">{{ herd.name }}</a>{% if not forloop.last %},{% endif %}
+                        {% endfor %}
+                    </td>
+                </tr>
+                {% endif %}
+                {% if maintainers %}
+                <tr>
+                    <td>Maintainers:</td>
+                    <td>
+                        {% for maintainer in maintainers %}
+                        <a href="{% url 'packages' maintainer=maintainer.pk %}">{{ maintainer.name }}</a>{% if not forloop.last %},{% endif %}
+                        {% endfor %}
+                    </td>
+                </tr>
+                {% endif %}
+            </tbody>
+        </table>
+    </div>
+    {% endif %}
+    {% endwith %}
 </div>



^ permalink raw reply related	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2012-06-30  0:22 99% [gentoo-commits] proj/gentoo-packages:master commit in: gpackages/apps/packages/, gpackages/static/js/, gpackages/templates/ Slava Bacherikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox