Commit graph

150 commits

Author SHA1 Message Date
Dan McGee
1ceeda8ab5 Specify explicit joins for package search
Refactor the query to use explicit LEFT JOINs, which appears to be handled
by MySQL in a saner fashion than the previous implicit join syntax. This is
part two in a slight fixup for observed slow queries in the production
environment. With the new indexes and this fixup, a particular iteration of
this query will examine only 13346 rows instead of 272060.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-06-18 01:47:17 -04:00
Dan McGee
55da4d4e0d Don't hit the database twice per comment on package
It's performance improvement day today. For non-superusers, we were hitting
the database twice per comment on a package- once to get the UID, and once
to check the owner of the comment. The best part is we already knew the
owner of the comment, and we only need to get our own UID once.

For viewing a package like yaourt, this cuts a single pageview from over 700
queries to around 18, which is still not great but a pretty big improvement.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-04-13 10:07:46 -04:00
Loui Chang
9c98047f86 Fix search output if no results are found.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-03-03 13:22:53 -05:00
Loui Chang
3c1b84bc7e Go to details page when a search returns one result.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-03-03 12:55:14 -05:00
Loui Chang
c949296a08 pkgfuncs.inc: Fix indentation.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-03-03 12:11:49 -05:00
Loui Chang
bbc05414cf Update cleanup script to remove non-unsupported files.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-03-03 11:21:08 -05:00
Loui Chang
402c6d0933 Fix the comment poop bug.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-02-20 20:59:07 -05:00
Andrea Scarpino
84f08cf82b Add 'Out of Date' detail in search form
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-02-18 09:31:20 -05:00
Loui Chang
354c86b6c6 Move package comment form into a new template.
Feature the form on the package details page.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-01-25 13:17:54 -05:00
Loui Chang
b31b4ec03e Add package details template (pkg_details.php)
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-01-24 01:22:19 -05:00
Loui Chang
ff3a29ea07 Move actions form into template.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-01-23 18:25:41 -05:00
Loui Chang
2ee3276348 Use new conglomerated translation files.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-01-19 16:29:45 -05:00
Loui Chang
36b44f371b Move package comments to a template.
Change layout in the process.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-01-05 15:59:59 -05:00
Dan McGee
207b565f1c Minimize calls to uid_from_sid()
Just like the previous patch for account_from_sid() over-usage.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-01-04 14:28:24 -05:00
Dan McGee
8f97330100 Store account type in local var when possible
No need to call this function way too often, especially when on the package
list page where it could be called up to once per row.

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2009-01-04 14:09:53 -05:00
Callan Barrett
a16f4c77b3 Make search page use mkurl function, change variables around
Changed all the normal variables to their $_GET counterparts so everything is destructively changing the original variables, there should be no issue with this. If there I guess we need to consider making mkurl use a custom array of variables rather than $_GET

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-29 17:33:19 -05:00
Callan Barrett
b4a62c4915 Move package search results to a template
Logic is separated from html as much as possible, all html in a template

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-21 12:44:31 -05:00
Loui Chang
78c2b5c67f Introduce function include_lang for translations.
This includes only the requested language for each page and
makes top level language include files obsolete.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-21 18:03:27 +09:00
Loui Chang
cfeb080dcd Make all web paths relative.
The site no longer needs to be hosted from the
root of a domain, or virtual host.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-12-21 15:24:57 +09:00
Callan Barrett
e12a8ad3da Remove success messages after package functions
Just displays message at the top of the page of what happened (errors or not) and goes back to the same page

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-20 18:33:45 -05:00
Callan Barrett
cde524e175 Change behaviour of package functions to accept normal arrays
Package functions use a normal array of pkgids now and packages.php has been changed to accomodate for it

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-20 16:58:30 -05:00
Nathan Jones
3de0a2ade3 Rename 'Un-Vote' and 'Unflag' buttons.
This is to be consistent with 'UnNotify'.

Signed-off-by: Nathan Jones <nathanj@insightbb.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-12-19 22:18:09 -05:00
Loui Chang
3ec9ecc84e Remove remaining instances of do_Details
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-11-26 01:36:34 -05:00
Callan Barrett
ac8b080e43 Clean up packages.php and document new package functions
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-11-23 13:23:33 -05:00
Loui Chang
2ac75bd812 Move package notification into a function.
Also modify the way notification is done. Instead of toggling
notification, users can explicitly notify or unnotify.

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-11-13 15:19:20 -05:00
Callan Barrett
132fd7cfc7 Convert package voting to a function
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-10-30 10:45:31 -04:00
Callan Barrett
5d4303d0b6 Convert package adoption/disowning to a function
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-10-27 20:40:37 -04:00
Callan Barrett
a447281d4f Convert package deletion to a function
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-10-16 22:27:45 -04:00
Callan Barrett
8f5882e68d Convert package flagging to a function
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-10-14 19:36:04 -04:00
Callan Barrett
df39cded09 Sort required by list in package details page.
This closes FS#11420.

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-09-28 13:17:09 -04:00
Andrea Scarpino
52fb8550a2 doesn't show disown package when already disowned
Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-08-27 21:34:24 +08:00
Loui Chang
3a42725601 Remove all vim mode lines. Add HACKING file.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
2008-06-17 01:38:01 -04:00
Callan Barrett
bf5029ad8a Don't show None on pacckage info page
Just cuts out the table of deps/sources if none exist instead of
displaying "None"

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-06-07 18:20:00 +08:00
Callan Barrett
8867ad0372 Fix CVS and package links
Patch by Andrea Scarpino <bash.lnx@gmail.com>

Fixes up the links to the archlinux.org package search and to the CVS viewer

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-06-06 02:46:40 +08:00
Callan Barrett
94a8053210 Disable user package deletion
Users can no longer delete packages if they own them, only TUs and devs

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-06-06 02:10:59 +08:00
Loui Chang
ab023f4ccf Move search form to web/template/pkg_search_form.php
Nothing fancy here, just cut & paste

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Signed-off-by: Simo Leone <simo@archlinux.org>
2008-04-25 11:10:01 -05:00
Callan Barrett
04dae8d94f Remove references to AURMaintainerUID
This (should) get rid of anything to do with the unused column AURMaintainerUID
in the scripts and schema files

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Simo Leone <simo@archlinux.org>
2008-03-27 02:34:35 -05:00
Simo Leone
99e65b28d8 Revamped pkg_search_page()
- Reduced database hits
- Improved speed
- Improved sanity (slightly)
- Fixed searches,buttons,gizmos

Signed-off-by: Simo Leone <simo@archlinux.org>
2008-03-23 03:07:22 -05:00
Loui Chang
b1fe84d397 Fixed bug where search resets when browsing orphans
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Signed-off-by: Simo Leone <simo@archlinux.org>
2008-03-23 03:04:17 -05:00
Callan Barrett
172dbf696b Fixed broken search results
Quick fix for my friggin crazy more and less link patch that was swapping the
search results order every click and not remembering how to sort, my bad

This could probably use improvement but it means the search actually works now

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Simo Leone <simo@archlinux.org>
2008-03-23 03:04:16 -05:00
Callan Barrett
e7bb7a220d Turn more and less buttons into links
This is to (at least) fix the more and less buttons which weren't working
because of the drop down menu for actions

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-02-18 22:31:56 -06:00
eliott
aedf2ab6a3 Fix for 'More' and 'Less' paging breakage.
Fix for 'More' and 'Less' paging breakage.
Takes into account PerPage and Category retention.
2008-02-18 17:54:28 -06:00
Callan Barrett
d14def92ff Turn action bar into drop box
Moves the action bar down to the bottom right of the search results and turns it
into a drop-down selection box.

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Simo Leone <simo@archlinux.org>
2008-01-20 03:18:16 -06:00
Callan Barrett
14ecbf5fd5 Add search result information
This adds search results numbers to the bottom of pages when searching based on
tardo's repository, ex. Showing results 1 - 42 of 42

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-01-20 00:21:21 -06:00
Callan Barrett
8ab823728c More cleanup, add TU link to header
Cleans up links on front page, adds a TU link to the header to the voting
application, fixes some titles and styling for logged in text

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-01-20 00:21:21 -06:00
Callan Barrett
379e16eebd Support for verbose page titles
Verbose page titles again

Adds support for more verbose page titles based on current
page and action by user and removes sort by options from
search form as they're obsolete by column links.

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-01-20 00:21:20 -06:00
Callan Barrett
d4b07f2b33 Tweaks of various page layouts and handling of data
This is a patch that fixes a lot of little things:
* We no longer have pkgsearch or pkgdetails link functions and all
references to them are gone, that's what a back button is for and if
we really need it we can come up with something better
* No longer have do_Details variable, this means links on the package
search are simply ?ID=foo
* On the pkgdetails pages when there are either no deps, deps by,
sources or comments for a package the list for each will display
"None" instead of nothing at all (ruining the layout)
* Fixed a bug where if a package had no sources or no deps
pkgsubmit.php would submit an empty one
* Translation of the word "Search'" has been changed to "Search"

Most of these relate to each other.

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-01-20 00:21:20 -06:00
Callan Barrett
8c94552042 Add notify column in search results and notify button
Adds a column to search results showing if a package has comment
notification enabled and adds support for toggling notify for
multiple packages from search

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-01-20 00:21:19 -06:00
Callan Barrett
9a83e56b69 Adds support for TUs and devs to disown packages they do not own
This is to add support for either devs or TUs to disown packages
whether they own them or not. I know of countless times where I or
another TU have been asked to orphan packages for someone and end up
having to adopt the package first and then disown it, this gets really
tedious for more than one package. As far as I can tell there's no
other way to disown packages you don't own and if there is at least
this is a more obvious way, pretty sure I didn't leave anything out in
the patch.

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
2008-01-20 00:21:19 -06:00
eliott
f4bfe44876 Comments are listed in reverse order (latest first)
So it makes sense to have the "add comment" at the top..where it is already.
Removed duplicate "add comment" box.
2008-01-20 00:21:18 -06:00