Commit Graph

606 Commits

Author SHA1 Message Date
Dan McGee
6b4c8e63b3 Make the cache_function key a bit more descriptive
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-10 16:23:36 -05:00
Dan McGee
7ca91098fa Turn off L10N and I18N
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-10 10:07:49 -05:00
Dan McGee
65e37349d3 Enable template fragment caching on main page
The left and right sidebars are the same for everyone, so cache both pieces
as template fragments so we aren't constantly re-rendering them. Due to
cookies being present in the 'Vary:' header, this at least allows some
benefit of caching at a lower level than the middleware can handle.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-06 20:52:21 -05:00
Dan McGee
907a316883 Add a requirements.txt file for pip
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-06 20:33:16 -05:00
Dan McGee
7b73c0ff8c Get news markdown formatting working everywhere
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-06 20:33:03 -05:00
Dan McGee
ad162d74db Format all news items using markdown
Implements FS#13741. A preview function is also added so working with news
items is easier to make sure you get the formatting right.

This will result in some older news items looking a bit weird if they didn't
put linebreaks in all the right places, we can fix a few of these as we
notice them.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-06 20:16:10 -05:00
Dan McGee
5b2861f1f0 Make package search box look better with wider fonts
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-06 20:02:59 -05:00
Dan McGee
2d7bc3f322 Add note to package when version is in testing
And the package has been flagged out of date. Should make people relax a
bit.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-06 18:53:46 -05:00
Dan McGee
b6fb5e02e5 Add helper method to package to find self in testing repo
This will be useful in templates getting touched in an upcoming commit.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-06 18:53:03 -05:00
Dan McGee
edfdc2e38b Remove old needupdate column
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-06 18:37:28 -05:00
Dan McGee
fba1d29c1b Update code to use new flag_date column
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-06 18:36:50 -05:00
Dan McGee
145b80d0c6 Make flag column on packages a date
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-06 18:36:17 -05:00
Dan McGee
845838190d Set font color for package search box
Since we explicitly set a background color for this text input, we should
set a foreground font color as well so those with dark themes don't see
white text on a white background. Addresses FS#19290.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-05 22:33:38 -05:00
Dan McGee
85807311ca Show incomplete todo list packages in dev dashboard
Implements FS#20081.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-05 22:22:19 -05:00
Dan McGee
cb9c74eff8 Add absolute URL method for todo lists
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-05 22:20:28 -05:00
Dan McGee
41a5d1d566 Defer loading news content when listing news items
No need to pull back some 500 news articles when we just want the basics of
title, date, and author. Speaking of author, we might as well load that at
the same time too.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-02 20:37:06 -05:00
Dan McGee
357e8fa050 Add styling to errorlist class
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-02 20:19:28 -05:00
Dan McGee
70b03d3ef7 Default country selection to Any
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-02 20:11:48 -05:00
Dan McGee
3279d4b165 Add mirrorlist link to main page
Not terribly thrilled with the location, but it will have to do for now. If
we get a better idea later it can definitely be moved.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-02 20:07:54 -05:00
Dan McGee
2d407d9c1b mirrorlist: allow filtering by protocol
And add some more "static" URLs to access the non-country filtered lists.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-02 20:02:26 -05:00
Dan McGee
67159fed20 Link to the mirrorlist page from downloads
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-02 19:27:20 -05:00
Dan McGee
d29d23ecf3 Get mirrorlist view ready for general use
Make the page much more flexible- allow multiple countries to be selected
rather than just one in the form. Also add a lot more text to the page, and
move the 'all' option out into its own subheading rather than being in the
same form.

Both GET and POST requests are now allowed for ease of use from non-browser
scenarios or those that wish to update their mirrorlist automatically and
submit parameters to the URL.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-02 19:24:54 -05:00
Dan McGee
1a945dd137 Add mirror protocols fixture
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-02 18:59:39 -05:00
Dan McGee
e5bd769432 Remove arch from mirrorlist generation
With pacman 3.4.0, we can now use the $arch variable so we don't need
architecture-specific mirrorlists.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-02 18:34:09 -05:00
Dan McGee
4676d4474b Add some text when no packages could be found
This text also includes a link to search the AUR for the same keywords. This
implements FS#19904.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-02 17:48:05 -05:00
Dan McGee
345b38898a Only use cached template loader in production
Otherwise it is really confusing when you make template changes during
development and they don't show up immediately.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-07-02 17:47:27 -05:00
Evangelos Foutras
86d503af5a Mark the todolists' flag view as never_cache
Also remove the @vary_on_headers('X-Requested-With') since it's
irrelevant now.

Dan: remove now unnecessary import.

Signed-off-by: Evangelos Foutras <foutrelis@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-28 06:51:43 -05:00
Dan McGee
0fb770442e Mark a few more pages as never cache
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-24 17:09:41 -05:00
Dan McGee
e361a1e873 Get unit tests up and running again
We had some dependency issues between migrations that needed to be
explicitly defined in order to get things fully moving, and do to some
braindeadness in Django tests not including the project url config, we need
to do some clever business when using the url tag in the base template so
tests don't doe with a NoReverseMatch exception.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-24 17:08:00 -05:00
Dan McGee
081ed6c866 Add 'never_cache' decorator in a bunch of places
Now that we cache everything, we need to ensure anyone doing edits and
such gets the live data and not some cached version that was already
updated and is now stale. Add the never_cache decorator to any of the
CUD screens as well as a few others that might benefit from always being
regenerated.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-22 12:09:22 -05:00
Dan McGee
4c96b53f2e Cache results of get_depends() and get_requiredby()
Do it in our actual cache rather than an object-level, single request cache.
300 seconds is good enough resolution to have this data right; if it is
updated everyone will see the results 5 minutes late at the most.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-21 01:00:18 -05:00
Dan McGee
da9a1ecbf8 Cache the recent updates list
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-21 00:51:39 -05:00
Dan McGee
8ba6ad8521 Add utility cache_function
This allows caching the results of an arbitrary function and its arguments
in the Django-managed cache, e.g. memcached in production.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-21 00:50:19 -05:00
Dan McGee
03ccd8ad8c Use the cached template loader
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-21 00:20:42 -05:00
Dan McGee
7025316808 Cache everything, not just anonymous only
We should be well-protected by the "Vary: Cookie" header, and if we aren't
then we need to fix those pages that matter. This is the final step in
getting at least the heaviest hit part of our site to be served without any
Vary headers at all- the feeds.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-21 00:19:31 -05:00
Dan McGee
d767658deb Get a more accurate count of adopted packages
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-20 23:59:18 -05:00
Dan McGee
f123348c7d Update to the new messages framework
This is also another step in making sure we don't unnecessarily access the
Django session object and thus add a Vary cache control header we don't
want.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-20 23:56:03 -05:00
Dan McGee
67f6bc546e Remove AutoUserMiddleware
This was having some serious effects on caching as we would always have to
access the user in the session, marking every page with a "Vary: Cookie"
header. This is the start of stamping that out. The way we get the user for
news item creation is now more similar to that from the todo lists, but not
quite. That should be adjusted to be more like the news item creation.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-20 23:31:34 -05:00
Dan McGee
b6efa3443e Fix template syntax error
Whoops, forgot the closing tag when I was playing with autoescape.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-20 21:52:50 -05:00
Dan McGee
0a3b943416 Move scripts to bottom of package search
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-20 21:26:38 -05:00
Dan McGee
4aea408397 Fix missing calendar icon
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-20 18:55:47 -05:00
Dan McGee
a0794a25d0 Update fixtures
We have added some repos and some fields to these guys, so update them with
what we have in production at the moment.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-16 22:47:45 -05:00
Dan McGee
24acac3f18 Super quick updates to README 2010-06-16 22:42:14 -05:00
Dan McGee
0251885a8d Fix autoescape in plain text emails
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-16 22:40:43 -05:00
Dan McGee
b3059dd3e8 Remove action when submitting to same URL
It looks like the `action="."` business was screwing up some browsers,
notably lynx and links. We don't need it as the default is to submit to the
same page anyway, so kill this gunk and see if it fixes a login CSRF issue.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-11 17:29:46 -05:00
Dan McGee
408288719e Enhance base package listing in package details
Add two methods to the package class, base_package() and split_packages(),
that allow us to grab other related packages to one we are interested in.
This allows us to list the Base Package on the package details page as a
link.

With the split_packages() method, we can also now list and link all
sub-packages on the package details page; e.g. for 'kernel26' we can now
link through to 'kernel26-firmware' and 'kernel26-headers'.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-09 16:16:45 -05:00
Dan McGee
d199ac33b2 Add silhouette image
We don't serve this directly from here but we can at least put it in version
control. It is the default image for devs if one isn't available elsewhere.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-08 10:54:27 -05:00
Dan McGee
89cae2bcb5 Update feeds to new 1.2 framework
Feeds are now views-based and don't need the dictionary anymore.
get_object() now takes named arguments as well making it a bit more
understandable when reading the code.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-08 10:52:53 -05:00
Dan McGee
8bf0bfeac7 Use Sites framework instead of hardcoded domain name
Instead of putting 'www.archlinux.org' all over the place, use the Django
sites framework to pull the site name out of the database. Now these
amazing things will work if you are running locally and decide to change the
site!

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-08 08:35:58 -05:00
Dan McGee
bad2825fab Updates for CSRF protection in Django 1.2.X
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-05 12:58:31 -05:00