Commit Graph

66 Commits

Author SHA1 Message Date
Dan McGee
49bf498879 Ensure only active mirror URLs are listed
This fixes things up on the download page as well as the individual
mirror details page.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-06-01 14:53:17 -05:00
Dan McGee
b7b2474064 Various minor code cleanups and fixes
Most of these were suggested by PyCharm, and include everything from
little syntax issues and other bad smells to dead or bad code.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-04-16 22:12:01 -05:00
Dan McGee
23ef118ac1 Don't redefine mirror_url function every call
If we pull this out and define it at the top level once, we save the
interpreter a fair amount of work.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-19 10:37:16 -06:00
Dan McGee
cba22a378b Don't pull and sort mirror URLs unless we have to
On the download page, the explicit sorted() call was forcing evaluation
of the Django queryset, even if we never actually needed the results
because the template fragment was cached. Wrap it all in a callable
function which looks the same to the template, but saves us the cost of
evaluation every single page view.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-18 20:01:22 -06:00
Dan McGee
6f0ae6746b Drop country column from mirror table
We now always look for this information at the URL level, not the mirror
level. This simplifies quite a bit of code in and around the mirror
views.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-14 01:05:54 -06:00
Dan McGee
66850026ca Use content_type and not mimetype on HttpResponse()
Bug #16519 in Django deprecates mimetype, so update our code
accordingly.

Signed-off-by: Dan McGee <dan@archlinux.org>
2013-01-13 22:34:33 -06:00
Dan McGee
e7c331d361 Fix master key signing total counts
Commit 4c69911982 had an inadvertent side effect here; we need to
explicitly disable ordering for the annotate() to work correctly.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-12-27 22:51:20 -06:00
Dan McGee
f7331a0eca Add Release model to releng
This should prevent the need for monthly template updates from Pierre
and Thomas; best to just let them enter the data themselves and have it
show up on the website.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-11-20 19:16:25 -06:00
Dan McGee
6dd4d54bb0 Use Python 2.7 dictionary comprehension syntax
Rather than the old idiom of dict((k, v) for <> in <>).

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-11-16 16:37:52 -06:00
Dan McGee
45d81a9578 Move JSON keys view to public/ app
This seems like a more appropriate place, and now the visualization is
done here anyway so we should move the data backing it.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-11-13 10:21:02 -06:00
Dan McGee
67fef06fe8 Only show staging feeds to logged-in users
This doesn't prevent unauthenticated users from accessing the feeds, but
it should reduce clutter and confusion on the feeds index page for users
unlikely to need these feeds.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-25 00:49:54 -05:00
Dan McGee
3eed426027 Add structured data to developer listing pages
Signed-off-by: Dan McGee <dan@archlinux.org>
2012-09-25 00:30:05 -05:00
Dan McGee
3f0c024754 PGP key handling updates
* Import signatures for all known keys, not just active developers
* Ensure we are only showing and accounting for active developers on the
  master keys page
* Add a new table showing signatures between developers

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-31 18:37:30 -05:00
Dan McGee
0cc369e985 Update several bits and pieces for staging packages
This will prevent [staging] packages from cluttering normal user's view
on the website, but allow us to still import everything from this
repository for developer use.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-31 00:09:28 -05:00
Dan McGee
76c37ce3ac Replace deprecated direct_to_template() with render() shortcut
Now that Django actually provides a concise way to use a RequestContext
object without instantiating it, we can use that rather than the old
function-based generic view that worked well to do the same.
Additionally, these function-based generic views will be gone in Django
1.5, so might as well make the move now.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-07-24 19:57:20 -05:00
Dan McGee
640e0f5864 Finish django countries implementation
* Add a migration to drop the old countries field.
* Update all templates/views/utility methods to point at the new country
  field and dereference it as necessary.
* Add the flags images to a few views where it makes sense.
* Cleanup the download page layout quite a bit.
* Bump the mirror status JSON version to 3; add country_code attribute.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-25 01:51:58 -05:00
Dan McGee
116751e4ba Rename mirror country fields to country_old in prep for normalization
We're going to move to using ISO 2 character codes via django countries,
so start by moving the old data out of the way first.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-04-25 00:00:36 -05:00
Dan McGee
ef88f3d5ef Add developer status table to master keys page
This shows the cross-product of each master key with each developer key
so you can see who has been signed, where signatures are missing, etc.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-29 11:37:07 -05:00
Dan McGee
7d8580b4b1 Add number of keys signed to master keys page
This really just makes me look bad, but an interesting fact none the
less for people to look at.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-21 15:52:40 -05:00
Dan McGee
749b044728 Ensure users only show up once on the Fellows page
If a user was in both Developer and TU groups, they would show up twice.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-03-09 11:26:00 -06:00
Dan McGee
9ddbe26e4c Add a few cache headers and minor feed caching back in
Now that we aren't using the middleware, add cache headers on our
primary pages so we can prevent some repeat traffic, and cache all feeds
for five minutes.

Signed-off-by: Dan McGee <dan@archlinux.org>
2012-01-03 15:00:49 -06:00
Dan McGee
a60801bb7d PyLint suggested cleanups
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-11 19:52:27 -06:00
Thomas Bächler
c9d51d08c9 download: add a link to the new netboot environment
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-12-05 17:46:18 -06:00
Dan McGee
025042ef0d Master keys: reduce query count, add default ordering
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-30 14:45:05 -06:00
Dan McGee
6b8ef446bc Add master key overview page
And a bunch of text that may suck, but is better than nothing.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-30 13:55:36 -06:00
Dan McGee
85657db05d Better support for non-latin full names
Add a 'latin_name' field to the user profile so we can better support
those developers with names in non-Latin scripts, and yet still show a
Latin name as necessary on the developer profile page. This field only
shows up if populated.

Also, use consistent sorting everywhere- rather than using username,
always use first_name and last_name fields.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-11-21 10:08:23 -06:00
Dan McGee
71e57570c2 Pylint suggested and other cleanups
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-11 19:29:15 -05:00
Thomas Bächler
6b15298483 download: add link to the ISO snapshots
Dan: use relative links if possible, use releng link from settings, fix
HTML closing tags.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-19 12:55:50 -05:00
Olivier Keun
a4895f0668 News frontpage layout changes
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-16 15:58:40 -05:00
Dan McGee
5cd223680e Slight refactor of user list views
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-27 11:52:27 -06:00
Dan McGee
1fe833e18d Screen Fellows based on group membership as well
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-02-27 11:42:27 -06:00
Dan McGee
82eb9de993 Make user profile a OneToOneField
We had this set up as a unique ForeignKey before, which adds some
indirection due to the RelatedManager object being there. By making it a
OneToOneField, we can get the profile object directly, enforce uniqueness,
and also use it in select_related() calls to make our profiles page a bit
more efficient.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-04 17:44:40 -05:00
Dan McGee
e847030d83 Switch another query to use is_download
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-04 17:40:38 -05:00
Dan McGee
11f0db759b Add some select_related() magic
Made obvious when poking around with the Django debug toolbar.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-04 17:37:39 -05:00
Dan McGee
77f65bdc0c Allow donors to be invisible
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-10-01 13:05:22 -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
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
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
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
661b5e6b63 Add missing RequestContext in feeds view
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-08-27 09:41:28 -05:00
Dan McGee
c426fbebb7 Highlight 'Packages' in navbar when browsing packages
Get this working by doing some class business with CSS in order to highlight
the correct tab. I had to add some stuff to a variety of pages but it should
be working correctly now. Addresses FS#19591.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-26 09:59:37 -05:00
Dan McGee
8116500afc Make group membership use Django groups
Rather than our home-baked roles field, which is free text so we really
shouldn't be checking against anyway. It also prevents people from being
both a developer and a TU.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-17 10:38:44 -05:00
Dan McGee
e7a58b9d57 Donor page rework for list formatting
Instead of doing slicing and ugly table-based layout, move to a CSS-based
organization of the donor list. Shoot for 4 columns but should degrade
gracefully to fewer, and will look just fine with no CSS at all (one big
tall list).

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-17 10:19:24 -05:00
Dan McGee
a3dc482016 Ensure protocol order is stable on download page
Sometimes http was first, other times ftp was first. Add an order by clause
to ensure it is the same for all mirrors.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-16 14:02:09 -05:00
Dan McGee
ec59440262 Remove Arch-Based Projects
Add a link to the wiki instead. Also remove ExternalProject model and
associated dealings.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-18 23:27:27 -05:00
Dan McGee
1709def7f1 Remove International Communities
Add link to wiki instead. Also remove AltForum model and associated
dealings.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-04-18 23:14:53 -05:00
Dan McGee
d709604102 Remove archweb prefix from all imports
Unnecessary, and lets us standardize on not using it everywhere.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-02-10 00:29:27 -06:00
Dan McGee
b2f33457f6 Make recent updates group multiple architectures
It isn't the most elegant operation in the world, but attempt to only show
one line per package, grouping by architecture if multiple were updated in
the same go. This makes the recent packages view a bit more useful as a
heads up view. Implements FS#17304.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-02-05 17:03:35 -06:00
Dan McGee
6fe8aec0ab feeds: add per arch, per repo feed ability
Make the feed framework a lot more flexible and give the possibility to have
a feed for each architecture. You can drill down even more than also get a
feed for a particular repo; some might find this helpful for something like
tracking [testing]. Implements FS#12939.

I also bumped up the number of items available in each of these feeds; since
it is full of a bunch of small items it might be more helpful to have more
available and it should also prevent fewer ones from being missed.

The UI isn't exactly spectacular, but I figured some sort of page is better
than none listing all the various feeds you can pull from.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-02-04 19:03:32 -06:00
Dan McGee
31b38b49c3 Spruce up the developer view pages
Quite a few changes here. Unify the developer view pages into one actual
django view and template, and use different dispatches from urls.py to set
up the three different queries for who to display and what message and group
name to show.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-01-31 22:55:49 -06:00