Closed Bug 491407 Opened 14 years ago Closed 14 years ago

Directory page for collections containing an extension

Categories

(addons.mozilla.org Graveyard :: Collector Extension, defect, P2)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: fligtar, Assigned: wenzel)

References

Details

Attachments

(1 file)

We should have a view of the collection directory that lists the collections that contain a particular add-on that's linked to from each add-on's display page, as indicated in bug 456139. We don't need a tab or anything special for this page, it should look just like the other directory pages but with a heading of "Collections containing [Add-on name]"
Priority: -- → P3
Moving P3s to 5.0.7 for priority reevaluation in the next milestone.
Target Milestone: 5.0.6 → 5.0.7
Duplicate of this bug: 496442
Assignee: nobody → fwenzel
Priority: P3 → P1
Priority: P1 → P2
Blocks: 496442
Attached patch Patch, rev. 1Splinter Review
This adds a page like: collections/addon/1865 showing all collections an add-on is contained in.
Attachment #383767 - Flags: review?(jbalogh)
Status: NEW → ASSIGNED
Comment on attachment 383767 [details] [diff] [review]
Patch, rev. 1

>diff --git a/site/app/controllers/collections_controller.php b/site/app/controllers/collections_controller.php

>@@ -166,6 +168,29 @@ class CollectionsController extends AppController
>         $this->_listing($collections);
>     }
> 
>+    function addon($id) {
>+        if (!$id || !is_numeric($id)) {
>+            $this->flash(sprintf(_('error_missing_argument'), 'addon_id'), '/', 3);
>+            return;
>+        }
>+        $addon = $this->Addon->getAddon($id);
>+        $collections = $this->Collection->execute(
>+            "SELECT Collection.id
>+            FROM collections AS Collection JOIN addons_collections AS ac
>+            ON Collection.id = ac.collection_id
>+            WHERE ac.addon_id = " . $id);

You could use AddonCollection->getPopularCollectionsForAddon() instead of repeating the query.

>diff --git a/site/app/views/collections/listing.thtml b/site/app/views/collections/listing.thtml

>@@ -62,6 +66,7 @@ $this->layout = 'amo2009';
>     <?php endif; ?>
>     <div class="featured listing">
>       <div class="featured-inner">
>+        <?php if (empty($hide_listing_header)): ?>
>         <div class="listing-header">
>           <ul>
>             <?php foreach ($tabs as $tab): ?>
>@@ -75,6 +80,7 @@ $this->layout = 'amo2009';
>           </ul>
>           <?=$this->renderElement('amo2009/collections_sort_form')?>
>         </div> <!-- listing-header -->
>+        <?php endif; ?>
>         <script type="text/javascript">
>           <?=$this->renderElement('amo2009/collections_js_init')?>
>         </script>

r+ if you reindent everything in the if block.
Attachment #383767 - Flags: review?(jbalogh) → review+
Code: r27968, some indentation: r27969.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Keywords: push-needed
Resolution: --- → FIXED
Verified FIXED on https://preview.addons.mozilla.org/en-US/firefox/collections/addon/1865; from where is this linked, though?
Status: RESOLVED → VERIFIED
That's a legitimate question! The link, for some reason, is bug 496442.
Component: Collections → Collector Extension
QA Contact: collections → collector-extension
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.