Commit Graph

582 Commits

Author SHA1 Message Date
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
Dan McGee
7646f8ea7c Fix some validation issues
We had a few issues with unescaped ampersands and extra or missing tags.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-02 10:58:57 -05:00
Dan McGee
32f6f7a4da Rename todolist email template
More in line with our other templates that have .txt extensions.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-06-02 10:44:02 -05:00
Dan McGee
f4fd8ceea1 Fix flagged styling in package search results
We had 'style=' instead of 'class=' here, making the highlight disappear.
Fix it and things will work again. Fixes FS#19652.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-31 15:24:17 -05:00
Dan McGee
48a935d8ed Make some small color changes
After feedback from the recent redesign.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-29 17:24:26 -05:00
Dan McGee
debec14b73 Add ability to download package from web interface
After adding filename to the database, this is a rather simple request (see
FS#19546). Right now the "randomly" chosen mirror happens to always be
mirrors.kernel.org as it is the only one filed under the 'Any' country which
is what we screen on. Perhaps this logic could be improved in the future but
I don't see these links being all that high traffic anyway.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-26 10:50:03 -05:00
Dan McGee
5866498603 Have reporead populate filename column
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-26 10:50:02 -05:00
Dan McGee
4740c39603 Add filename column to package model
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-26 10:11:59 -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
277117ba34 Move package flagging URLs below the package
We were still using the user-facing package IDs here which we have
eliminated everywhere else Change it to use the same user-friendly URL
pattern we are using elsewhere.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-26 09:30:43 -05:00
Dan McGee
8f11dd9065 Fix missing version in checksums on download page
Forgot to move the 'endwith' tag a bit further down the page below the last
version reference. Fixes FS#19584.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-26 08:52:40 -05:00
Dan McGee
eee4d67ce7 Make testing italics style work
Package names are now spans and not links

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-25 14:42:57 -05:00
Dan McGee
da67c4a736 Fix some link title issues
We can't wrap inside the title attribute on links, so fix all the places
where this was happening. The following command helped:

    $ grep -R --color 'title="[^"]*$' templates/

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-25 14:25:05 -05:00
Dan McGee
e817efad53 Merge branch 'redesign'
Conflicts:
	templates/public/download.html
2010-05-24 21:13:46 -05:00
Dan McGee
b3e8354cdf reporead: use the DB package we already have
Rather than go to the database for every single package on something like a
files update, use the one we already have. Duh.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-24 11:29:35 -05:00
Dan McGee
5adceb6586 Fix null field issues exposed by Django 1.1.2
Apparently Django 1.1.1 let null fields pass right through but this now
causes reporead to blow up in 1.1.2. Fix the issue and get things working
again by allowing nulls where it probably makes sense and including a
migration to fix the issue, which for the real database will be a no-op.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-24 10:57:17 -05:00
Dan McGee
a1f7520b8c Change link to new dev site location
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-24 10:39:26 -05:00
Dan McGee
d797eac372 Fix undefined variable issue
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-21 15:48:32 -05:00
Dan McGee
a24e503a63 Fix navbar links
They were still set up for the redesign development environment. Obviously
we need a better way to do these, that will be coming down the road.

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-17 23:16:24 -05:00
Dan McGee
025133014a Styling touchups and temp style removal
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-17 16:57:37 -05:00
Dan McGee
b2af7365c0 Add universal archnavbar resources
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-17 16:57:12 -05:00
Dan McGee
779a2077f0 Remove old media resources
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-17 16:44:16 -05:00
Dan McGee
bf7f97ec03 Front page refinements
Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-17 16:43:07 -05:00
Thayer Williams
f5ac1bf3ae Redesigned Dashboard
* descriptive semantics
* proper django cell cycling
* link titles throughout

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-17 15:55:39 -05:00
Thayer Williams
3a39352883 Redesigned flagged page
* indentation
* consistent semantics

Signed-off-by: Dan McGee <dan@archlinux.org>
2010-05-17 15:55:38 -05:00