Commit Graph

713 Commits

Author SHA1 Message Date
Dan McGee
1b6cf5261c Auto-populate slug on news item creation
And make sure it is unique through a few queries and some magic.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 09:10:02 -05:00
Dan McGee
41dc37c812 Update news views to use slug instead of ID
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 09:10:02 -05:00
Dan McGee
7c92ddbd3c Add migrations to populate the news slug and make it non-null
These should get us all set to have more useful URLs for the news items.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 09:10:02 -05:00
Dan McGee
190d0fc154 Add news slug field
Initially, this needs to allow null so that we can add in slugs for all of
our old news items.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-21 09:09:01 -05:00
Dan McGee
a288066faf Update news permission required string
When moving the news model and updating the content type, I forgot to update
these strings to reflect the new permission name. Whoops.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-20 10:33:31 -05:00
Dan McGee
7409e1155f Fix package differences pkgrel comparison
Using the right index in the array might help; we were comparing pkgver
again and not pkgrel at all.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-20 10:33:20 -05:00
Dan McGee
445bd7c80b Remove some leftover print statements
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-16 17:11:02 -05:00
Dan McGee
8a3bd1ad8a Spruce up news admin view
Add last modified date as a column, and fix up some other small display,
sorting, and ordering issues.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-15 09:04:00 -05:00
Dan McGee
b084936ad9 Ensure consistent date formatting everywhere
Set up a default DATE_FORMAT in settings.py and use it everywhere we do the
'|date' template filter rather than hardcoding the value in the template.
This also fixes a regression with news date/time now that we changed the
field to store both date and time.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-14 18:47:12 -05:00
Dan McGee
3394a94a40 Re-enable etags
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-14 18:41:29 -05:00
Dan McGee
5dc5688d97 Improve request handling for feeds that haven't changed
By using the condition decorator (in a slightly odd way because these are
class-based views), we can cut down a lot on the response time for returning
304 status code for feeds that haven't changed. The decorator means we no
longer have to completely render the view to see if we can return a 304
status code.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-14 17:42:12 -05:00
Dan McGee
6c54cdb9ca Reorder middleware to be more inline with Django defaults
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-14 17:41:46 -05:00
Dan McGee
1a18ca4771 Add last modified date to news
This will come in handy when determining whether resources are out of date,
such as our news RSS feed. Also bump the Date fields to DateTime fields for
sake of sorting and if we have more than one news item on the same date.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-14 17:39:17 -05:00
Dan McGee
2432227b66 Bump requirements for Django security release
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-09-12 19:15:35 -05:00
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