Commit Graph

699 Commits

Author SHA1 Message Date
Dan McGee
5ca2cea388 reporead: revamp database parsing code
This needed a little sprucing up as it has grown quite organically over the
life of this script. Make things a bit more pythonic through the use of
iterators rather than collection indexing, and try to generalize the special
cases of things a bit.

Also catch encoding problems early and fail gracefully rather than blow up
the entire package parser. A failed decode of a file should cause us to just
skip it rather than stop the entire parser.  Worst case, this leaves that
package out of the web interface.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-12 12:32:13 -05:00
Dan McGee
51fca0c98d Check for correct permission when creating users
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-12 10:20:00 -05:00
Dan McGee
fa4f5c15c8 Restore flagged package count by maintainer in dashboard
We need to do a little dropping into SQL to accomplish this, but it isn't
all that bad to actually do and we can do the whole thing in one query.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-10 18:27:18 -05:00
Dan McGee
d6f29d5031 reporead: allow traceback on USR1 signal as well
When I have caught reporead behaving badly on the production box, I haven't
been able to successfully get a traceback without killing the process.
Hopefully using a different signal will allow me to actually capture some
data.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-10 10:23:17 -05:00
Dan McGee
2470fb92e9 Remove SomethingFishyException
Just use a plain Exception instead since we don't get any added value by
subclassing.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-10 10:11:14 -05:00
Dan McGee
eaa76ae758 Improve todo list view page
Add total package count and incomplete package count columns. Also reduce
the number of total queries by killing the query per row that was happening
before.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-09 13:36:41 -05:00
Dan McGee
ffdf7fec99 Remove redundant text from groups package count column
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-09 13:35:48 -05:00
Dan McGee
6dece4b18b After moving models, update content type table
The one thing that people forget to mention when moving models from one
Django app to another. I was fooled here.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-09 06:46:25 -05:00
Dan McGee
1e4a9e159c Hide multilib by default
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-09 06:30:19 -05:00
Dan McGee
601b63ad10 Update arch fixture with new column
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 11:14:33 -05:00
Dan McGee
04da5f03b2 Use arch.agnostic flag everywhere
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 11:12:43 -05:00
Dan McGee
5c78ad7469 Add metadata to Arch table
Add a column flagging whether this architecture is agnostic (e.g. 'any') or
not. This will remove the hardcoded name checks we have all over the place
and replace it with a boolean.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 10:50:55 -05:00
Dan McGee
e0bf193c55 Fix download links to work with package pools
With package pooling we don't put things in the '/any/' folder anymore under
each repository; they only show up in the actual architectures. Use a 'real'
architecture as part of the download link to rectify this. Fixes FS#20779.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 10:42:44 -05:00
Dan McGee
6ca71c355d Add links to arch differences page
Hopefully finishes FS#20416.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 10:31:41 -05:00
Dan McGee
5ea7b4c732 Developer dashboard fixes
As reported by Thomas, the dashboard JS dies when we try to apply table
sorting to a table with no entries (those in the top section). Use some
selector magic to only apply tablesorting if the table actually has rows
worth sorting.

Also move the package todo lists table down in the dashboard as the other
two tables are more relevant for the individual developer.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 09:57:34 -05:00
Dan McGee
5062870c1b Remove leftover console.log
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 09:57:22 -05:00
Dan McGee
3491a02282 Remove explicit ordering from admin specs
The default ordering from the model itself will apply so no need to specify
it here as well.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 09:34:32 -05:00
Dan McGee
5464ec5556 Re-ID sponsors div so it skirts adblock
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 09:33:32 -05:00
Dan McGee
f8b5f0c4ae Show news in admin
And be able to do filtering/sorting/etc. with it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 08:07:33 -05:00
Dan McGee
8117e9b877 Paginate the news list view
This view was getting huge with ~500 items on it, and most people are not
really interested in seeing every single news item. Use the drop in
pagination and add some controls that still allow browsing to any page of
the list.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 00:46:08 -05:00
Dan McGee
f637a1eb67 Move news model to an appropriate place
Never would have guessed it should actually be in news/models.py.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 00:23:55 -05:00
Dan McGee
4e193afcea Put news under south control
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 00:15:30 -05:00
Dan McGee
16198ad23b Add 'for' attributes to search form labels
And also add the new style class we will need so the search form retains the
prior look, now that we are using this style elsewhere.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 00:11:05 -05:00
Dan McGee
9df541f95f Implement package difference filtering
This is done as client-side JS which makes the page nice and fast. Minor
versions can be excluded, as can packages in [multilib]. In addition,
architecture filtering is in place so you can limit the subset of shown
packages to those in any, both, one or the other.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-08 00:09:13 -05:00
Dan McGee
f498ceca1d Split and update the pip requirements file
Add a second file for use in production environments where we know we
use memcached and MySQL, and for those that want to replicate the
production environment as close as possible. Slim down the primary file
to those requirements the app directly needs rather than how it is
installed. Also bump the version of South to the newer point release.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-07 17:12:41 -05:00
Dan McGee
21c9ba2e63 Use flagged style on versions in package differences
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-07 16:21:13 -05:00
Dan McGee
5ddf2e2839 Make flagged style class apply to all tables
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-07 16:20:46 -05:00
Dan McGee
7dba848eaf Move mirror models out of main app
South actually makes this relatively painless if you get everything right,
so might as well start getting these out of the legacy main application to
eventually eliminate models being separate from their views.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-06 12:01:46 -05:00
Dan McGee
fae6667931 Put mirrors app under South control
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-06 11:44:22 -05:00
Dan McGee
fa882b7c28 Remove unnecessary comments
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-06 11:42:35 -05:00
Dan McGee
872af225a9 Use direct_to_template in all remaining possible places
Rather than the need to include RequestContext() calls directly, we can
just use direct_to_template to do all the work for us.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-03 13:45:13 -05:00
Dan McGee
7c7f57f6ac Use direct_to_template in public views
Saves the hassle of needing to wrap everything in RequestContext()
manually.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-03 13:16:18 -05:00
Dan McGee
45a14b3cbc Enable template fragment caching on package details page
We can't cache most of the package actions links stuff because we look at
the user there, but we can cache everything on the left and the content of
the bottom boxes.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-03 01:04:03 -05:00
Dan McGee
2dc0cafbb4 Add links to 'Versions Elsewhere' on package details page
This will allow clicking through to a few more associated packages from a
given package, including those for the other architecture and potentially in
other repositories. The box floats to the right with the package actions,
which have also been restyled slightly so the whole area is a bit more
styled and set off from the rest of the page.

This should allow us to close the current oldest bug open in the Arch bug
tracker, FS#7787. I remember the days when every bug was a four-digit
number...

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-03 00:51:00 -05:00
Dan McGee
8bd2838504 Add ability to get versions of a package elsewhere
E.g. if we are looking at one version for a particular architecture, I want
to see all versions for all architectures in all repositories.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-03 00:47:50 -05:00
Dan McGee
519460c7e2 Add pkgcount sort helper to count column on groups page
Forgot it here when adding it to all of the tables on the devel dashboard.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-02 20:07:09 -05:00
Dan McGee
0141ae3b8b Ensure long package descriptions wrap
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-01 08:02:41 -05:00
Dan McGee
0181177f86 Dev dashboard: enable sorting by package count
Add another custom parser to the mix here so we can sort by package count,
which just involves extracting the digits from the table cell contents and
ignoring the text.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-01 07:50:50 -05:00
Dan McGee
d7854ed8f1 Make sort work on developer todo list status
Because it was a link, the sort didn't properly sort on the
complete/incomplete status when viewing a todo list. Add a custom parser to
fix it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-01 07:39:57 -05:00
Dan McGee
d57696c801 PyLint suggested cleanups
We had a bunch of extra imports, non-conventional variable names, spacing
issues, etc. that were relatively low-hanging fruit to clean up. Fix them
and make the code a bit cleaner in the process.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-28 11:41:19 -05:00
Dan McGee
7dcdb0a315 Mark todo desc as safe on dev dashboard
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-28 11:34:19 -05:00
Dan McGee
2750b94345 Move package utility functions
We now have a few of them, so move them to their own file like we do in the
other applications.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-28 10:53:27 -05:00
Dan McGee
4c3100ab90 Move differences into it's own function
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-28 10:43:39 -05:00
Dan McGee
971e9faf90 Add package groups to front page and cache results
Make it more visible to the public, and cache the results of the group
information function since it was designed and made separate for that
purpose and the results can safely be reused without needing to worry too
much about it being stale.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-27 17:32:52 -05:00
Dan McGee
e595665abd Add a package groups sitemap
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-27 17:25:46 -05:00
Dan McGee
d21de73592 Add last updated column to package groups view
Just another annotation to the queryset to get this data, and a little more
manipulation in the group data function. This will help when adding a
sitemap in a subsequent commit.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-27 17:24:08 -05:00
Dan McGee
ddc4b974fe Add a package group overview page
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-27 17:06:07 -05:00
Dan McGee
f2b3bcc4a1 Link to the package group view from package details
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-27 17:05:42 -05:00
Dan McGee
e0674de776 Add a group details view
This makes the support asked for in FS#19801 a lot more useful since we
actually have an overview page for the entire group.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-27 17:05:07 -05:00
Dan McGee
1cfcf13e1b Remove an unnecessary iexact
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-27 16:10:48 -05:00