Commit Graph

46 Commits

Author SHA1 Message Date
4920f460aa Don't include /devel/ docs in sitemap
This conflicts with what we had in robots.txt, and generates many
thousands of warnings by Google (and possibly others).
2016-05-31 15:25:45 +02:00
7fc34e9eaf Replace login_required decorator with a validating one
This one will validate that the url is under /accounts/, which is
the only part we are going to be excluding from caching once we
move the website to https-only.
2016-05-24 21:14:34 +02:00
3c089cd09a Remove SSL decorators and middleware
The site is now served regardless of SSL, and assumes that the webserver
or web cache ensures that things rae always SSL.
2016-05-24 21:13:00 +02:00
2952b39754 Replace interactive docs with docs bug reporting
Per discussion from a long time ago, interactive docs aren't really
working out. The majority of submissions are either support questions
(which then get rejected because they cannot be answered in this
context) or pointing out docs incorrectnesses (which should be submitted
as a docs bug instead, so they can actually be fixed in the main
documentation).

Old references to /interactive/ will get redirected to /static/
automatically, and we expect to keep doing that for a long time (since
there are many links to them around the net).
2016-05-19 10:42:44 -04:00
a8500c3853 Add migrations for all existing models
When migrating on existing installations, run the

python manage.py migrate --fake-initial

command.
2016-05-14 19:49:12 +02:00
217f9ef62a Fix model warnings and deprecations
1. ForeignKey with unique -> OneToOneField
2. IPAddressField -> GenericIPAddressField
3. Fix fields with default=datetime.now() which gives server start time,
   not the insert time (clearly this default was never used, and the
   field was always explicitly set, but it should still not be incorrectly
   defined)
2016-05-14 19:49:12 +02:00
350b936e58 Prefix cross-application imports with pgweb
As required by the new project layout.
2016-05-14 19:49:12 +02:00
8058accee0 Get rid of PgModel, replacing it with simple signals
We were already using signals for everything except delete, and even
in our old version of django the delete signal exists (it didn't exist
when this code was first written).

Django doesn't really like models to be OOP like this, so keeping PgModel
would cause issues with upcoming changes in django 1.8. Using simple functions
is easier, and the actual functionality is replicated straight off.
2016-03-07 21:41:45 +01:00
21f6071417 Include links to beta documentation under manuals 2014-07-24 11:46:00 +02:00
8c4898e988 Give a 404 error when trying to load docs version 0.0
Noted by Josh Kupershmidt
2014-05-28 19:52:03 +02:00
94e3b79dce Replace wildcard imports with explicit ones 2014-01-01 16:33:52 +01:00
756aa6ffbe Clean up imports
Remove unused imports and some other completely unused code.
2014-01-01 15:42:30 +01:00
48410d04fa Enable cache-busting URLs for CSS and JS
This will allow us to increase the cache times in the browser for our
CSS, which almost never changes.

Enables a new value to be used in templates, {{gitrev}}, which can be
used to bust pretty much any URL. We could do this for all the images
in the templates as well, but since most of them almost never change,
we'll just enable it manually for each individual image as it becomes
necessray - or just use a ?1, ?2 etc for those.

Enabled by default for CSS and JavaScript links, since those are much
more likely to be changed without having the URL changed.

Cache times aren't increased yet - we'll do that later one we're sure
that all existing caches are expired first.
2014-01-01 15:24:51 +01:00
f31c58ddaa Fix beta versioning to be more generic test versioning
This allows us to specify both beta and rc versions.

Requires SQL:

ALTER TABLE core_version RENAME COLUMN beta TO testing;
ALTER TABLE core_version ALTER COLUMN testing TYPE integer USING CASE WHEN testing THEN 2 ELSE 0 END;
2013-08-22 14:45:33 +02:00
8c21b3bd34 Fix strange float casting problems in python 2013-08-17 17:48:28 +02:00
ce499f4f0a Fix links to frontpage of documentation for old versions
I forgot that old versions have strange names for their homepage, and
we only switched to index.html in 7.2.
2013-08-17 17:43:09 +02:00
bc020e460f Oops, we're not supposed to include supported versions in the archive 2013-08-17 17:38:27 +02:00
d2d110290a Move docs templates into the docs/ app, now that they are not plain pages 2013-08-17 17:32:36 +02:00
fdd1404f37 Get the list of documentation versions out of the database
Instead of having to update this list manually in multiple places when
releasing new versions, just take the information out of the database
where it has to be anyway.

Fixes #90
Closes #93

Also make the code automatically pick up wich PDF files exist in the
static checkout, and auto-detect their size, both A4 and US sizes. This
removes yet one more manual step, yay!

Fixes #163
2013-08-17 17:28:36 +02:00
8e458731cb Make an actual foreign key between docs versions and core versions
This was originally not done because we had a lot of old legacy data
that didn't have entries in both tables. This is no longer the case,
and the docloads script already enforced that it couldn't happen again.

Requires SQL:
ALTER TABLE core_version ADD CONSTRAINT version_unique_tree UNIQUE(tree);
ALTER TABLE docs ADD CONSTRAINT docs_version_fkey FOREIGN KEY (version) REFERENCES core_version(tree);
2013-08-17 16:48:03 +02:00
beaa87f162 Don't generate broken links to /docs/0.0/ in the sitemap
Generate proper /devel/ URLs, and then exclude them again in robots.txt
so we don't include them in google results, but we do include them in
our own.
2013-08-17 16:32:37 +02:00
6e378231c1 Include development and beta versions in search indexes
This includes both the sitemap used by google and friends and our own
site index, which uses the sitemap to decide which URLs to crawl.

Fixes #171
Closes #172
2013-08-17 16:16:52 +02:00
845c133d0b Explicitly list beta and development versions in docs as "devel"
Previously we listed both those as unsupported, which confused some users
particularly with new beta releases. While they are technically not supported
yet, it gave off the image that specific features would not be in newer
versions anymore, since they got listed as unsupported.

In passing, fix the style of the links in case they only exist in old
versions, which would put an extra | character in the version list.
2013-08-17 15:55:30 +02:00
8be717d99d Use a proper database field for beta releases
This replaces the previous ugly hack where beta versions had a negative number
as latestminor, giving a much cleaner model.

Requires SQL:
ALTER TABLE core_version ADD COLUMN beta boolean NOT NULL DEFAULT 'f';
ALTER TABLE core_version ALTER COLUMN beta DROP DEFAULT;

(Yes, we really need to move to something that can do automatic migrations)
2013-08-17 15:37:45 +02:00
1917a5cf72 Allow doc comment filtering by approval status 2013-01-30 11:45:31 +01:00
f49f53acfa Allow batch approval of doc comments 2013-01-30 11:45:11 +01:00
7979342924 Redirect interactive devel docs to static instead of giving error
Per suggestion from Josh Kupershmidt
2012-06-13 09:00:36 +02:00
9a37d893e8 Show links to other versions of docs
Main patch from Marti Raudsepp, but with some fairly extensive changes
2012-06-05 12:24:06 +02:00
721744087f Exclude beta version docs from sitemap.xml
Currently showed up as the highest priority - oops....

Spotted by Stefan
2012-05-16 13:35:35 -04:00
17ffc371b9 Assign better priorities to docs pages for searching, and include older docs
Instead of just including supported versions, include older versions of
the docs as well, and properly assign priorities by:

* For current docs, always assign priority 1.0
* For any other docs, start at 0.8 for the latest and decrease priority
  by 0.1 for each version, until we reach 0.1.

This should restore the ability to search for old versions of the
documentation (they still get proper priorities when searching for
suburls, which currently returns no hits at all) while maintaining
a strong priority for the newer versions.
2012-02-07 12:12:05 +01:00
78ab264578 Include last modified date in sitemap 2012-01-14 16:55:53 +01:00
1ea8ecd12a Include docs load timestamp in developer docs
This makes it possible to figure out when the docs were actually
loaded, since developer docs don't carry a version number. This is
actually going to be the docs *load* timestamp, and not build timestamp,
but they should be close enough together that it shouldn't matter.

Fixes #108
2011-12-04 15:14:54 +01:00
37d7c02ae3 Fix docs index filename for old versions
It hasn't always been called index.html, annoyingly enough...

Fixes #109
2011-12-04 14:23:45 +01:00
9424c84e15 Use Decimal(0) instead of Decimal(0.0) to support older version of Python 2011-11-22 21:33:04 +01:00
7e9742c678 Allow loading and serving of developer docs on the main website 2011-11-22 20:58:29 +01:00
9ffd26ca5d Correcly handle old versions of the docs, where the file extension is .htm 2011-07-12 14:16:46 +01:00
f136a665fe Add concept of supported versions
Also, only index docs for supported versions...
2011-07-12 14:15:20 +01:00
121b336792 Remove print statement that cannot be used when running under a server 2011-06-14 19:51:00 +02:00
f92709d2a6 Implement basic varnish purging
This allows all models inherited from PgModel to specify which
URLs to purge by either setting a field or defining a function
called purge_urls, at which point they will be purged whenever
the save signal is fired.

Also implements a form under /admin/purge/ that allows for manual
purging. This should probably be extended in the future to show
the status of the pgq slaves, but that will come later.

Includes a SQL function that posts the expires to a pgq queue. For
a local deployment, this can be replaced with a simple void function
to turn off varnish purging.
2011-06-14 19:48:48 +02:00
22f5578c29 Add support for generating sitemap.
Each module now contains a struct.py file that will return all
the URLs that it can generate (yes, this is a small break of the
abstraction of url.py, but we've broken that elsewhere as well),
and also which search-engine-weight (0.1-1.0) that this URL should
be given.
2010-09-28 16:12:13 +02:00
34023288b8 Add redirects as required to deal with legacy urls, for all the stuff
that was in .htaccess files on the old site.
2010-06-22 11:17:49 +02:00
c80daa4b4e Add string output for doc comment 2010-03-21 18:24:12 +01:00
e3d8eae0ce Add the concept of a "current version", and use this when determining
which version to map /current/ to in the docs section.
2010-02-26 13:14:03 +01:00
e82022eb1d Add support for docs comments 2010-01-16 20:02:07 +01:00
4e9c4ef7fc Properly render docs pages with missing index.html in the path. 2010-01-11 17:25:47 +01:00
90b758c247 A first very basic import.
Contains basic functionality, and an import of most of the static content
from the old site.

There is still plenty more to do...
2009-09-14 14:39:25 +02:00