Wykres commitów

1229 Commity (63955031e5e3382acf0295c15ea3cd179996e679)

Autor SHA1 Wiadomość Data
Marnanel Thurman 63955031e5 static/ added to .gitignore 2021-02-02 20:10:36 +00:00
Marnanel Thurman 30f445aa3b trilby_api/views.py split out into several modules in trilby_api/views/.
Tests all pass.

Verify_Credentials renamed to VerifyCredentials for consistency.

This is to make things easier when fixing issue #68.
2021-02-02 20:08:32 +00:00
Marnanel Thurman 60b70f9cee "/home" served, but with nothing very interesting on it 2021-01-10 21:46:38 +00:00
Marnanel Thurman 98a5bde0b2 Display username in the navbar, and logout link, if you're logged in 2021-01-05 21:59:18 +00:00
Marnanel Thurman 4ef96ea6db LOGOUT_REDIRECT_URL 2021-01-05 21:56:26 +00:00
Marnanel Thurman 7e763ed4bf LOGIN_REDIRECT_URL set 2021-01-05 21:47:37 +00:00
Marnanel Thurman 99981e3baf login stuff moved to /accounts/login (from /login) so we can use auth's urls.py in a separate subdir 2021-01-05 21:45:34 +00:00
Marnanel Thurman 2198350394 INSTANCE_BLURB. Closes issue #66. 2021-01-04 02:57:17 +00:00
Marnanel Thurman eb4ec809bb Version bump to 0.7 (%shine) 2020-11-25 20:26:45 +00:00
Marnanel Thurman 757132aa36 Status contents and user bios are returned as HTML.
I've implemented this with *_as_html accessors on the objects,
rather than doing it in the serialisers, so that we can easily
make them read/write if we need to.

Tests updated.

Closes issue #36, and I think we're done with %shine.
2020-11-25 20:23:11 +00:00
Marnanel Thurman e65450b9e7 trilby's find_local_view() can see through view_for_mimetype views.
Tests updated.
2020-11-25 20:22:20 +00:00
Marnanel Thurman 2e794e2a8a bowler's tests gain BowlerClient, a subclass of django.test.Client
which will set the Accept param correctly on get requests.

Used throughout test_views instead of d.t.Client.
2020-11-25 20:20:55 +00:00
Marnanel Thurman 7b37822d8d As a special case, view_for_mimetype returns the view list if the request param is None.
Tests updated.
2020-11-25 20:20:00 +00:00
Marnanel Thurman e0517f6688 test_headers supplies correct Accept header.
Class name changed to Tests per coding standard.
2020-11-25 19:40:53 +00:00
Marnanel Thurman ac9fb3d2bf sombrero's fake HttpRequest for ACTIVITY_GET requests supplies an Accept header.
Otherwise it doesn't get routed to the right view now that we route based on Accept.
2020-11-25 19:36:48 +00:00
Marnanel Thurman 0b98be76c4 fix logging statement 2020-11-25 19:34:28 +00:00
Marnanel Thurman 0e15db00da User page is HTML or JSON depending on Accept header.
Closes issue #48.
2020-11-25 18:46:31 +00:00
Marnanel Thurman 5e6a4a1721 Templates for previous commits which I forgot to stage 2020-11-25 18:46:15 +00:00
Marnanel Thurman a0fe164ae1 tophat gains UserPage view.
Slight tidying of StatusPage view.
2020-11-25 18:44:57 +00:00
Marnanel Thurman 6f033b7928 Status pages are HTML or JSON depending on Accept header. 2020-11-25 18:36:07 +00:00
Marnanel Thurman bfb7874d16 tophat StatusPage view. Very basic. 2020-11-25 18:35:52 +00:00
Marnanel Thurman 03c8c701ec view_for_mimetype() passes *args and **kwargs through to the view.
Tests updated, and tidied a bit.
2020-11-25 18:31:31 +00:00
Marnanel Thurman 3d3ce9b0f8 Add docstring to view_for_mimetype 2020-11-23 21:30:51 +00:00
Marnanel Thurman 29e6fffb1a Apparatus for choosing a Django view based on the incoming MIME type.
Not currently connected up.

Partly based on https://gist.github.com/samuraisam/2714195 ,
which is public domain.

Tests updated.
2020-11-23 21:25:03 +00:00
Marnanel Thurman df7d4c5357 bowler's StatusView gains a _render_object method so get() works 2020-11-22 20:01:42 +00:00
Marnanel Thurman 2e82f842e3 RemotePerson.followers and RemotePerson.following both implemented in terms of the same helper function.
LocalPerson.followers moved to Person.followers, where it should always have been.
RemotePerson.followers overrides this, just as RemotePerson.following overrides Person.following.

Closes issue #64.
2020-11-16 02:19:03 +00:00
Marnanel Thurman 4f5325fb5c rm broken import 2020-11-14 01:19:25 +00:00
Marnanel Thurman b3da6e0756 base.html: <html> gets the lang tag, defaulting to "en".
HTML output now passes validation.
2020-11-12 19:51:01 +00:00
Marnanel Thurman 228626cc6e Turn relative links to absolute in base.html.
In the same file, "powered by kepi" becomes a link by itself
which fixes the bootstrap formatting there.

navbar.html and base.html links to "/index.html" replaced
by links to "/".

navbar.html gains link to "/login/".

.gitignore ignores kepi/static but not just any dir called static.
This allows us to check in kepi/tophat_ui/static.
Checking in the two existing files in that directory, plus
loads of new bootstrap static files.

Closes issue #50.
2020-11-12 19:43:08 +00:00
Marnanel Thurman 2513abcf7e Login page says "login" 2020-11-12 19:17:58 +00:00
Marnanel Thurman 12d2452aaf login takes you to the root page 2020-11-12 19:16:16 +00:00
Marnanel Thurman 1d9c630f11 move login.html from trilby to tophat, and add our template includes 2020-11-12 17:46:51 +00:00
Marnanel Thurman 0403dbacc9 Rename RootPageView to RootPage. Add django.contrib.auth.views.LoginView to urls.conf. 2020-11-12 17:46:20 +00:00
Marnanel Thurman 6f97a4ee08 Relative paths to absolute 2020-11-12 17:45:29 +00:00
Marnanel Thurman 5e1dc37a99 basic framework for the front page. Still needs the login box etc.
Part of issue #50.
2020-11-09 22:28:05 +00:00
Marnanel Thurman dffc8ff532 FollowingView and FollowersView rewritten as subclasses of CollectionView.
They actually work now. Tests updated. Closes issue 38.

The tests are in test_collections, which has just been renamed from
test_read_from_outbox.
2020-10-31 17:44:39 +00:00
Marnanel Thurman dae5017e3d LocalPerson gains get_followers_collection() and get_following_collection(),
which are aliases for the followers and following properties.

This isn't elegant, but it makes the views easier. When we fix
issue 64, we should return to the question of these accessors
for Persons in general.
2020-10-31 17:42:51 +00:00
Marnanel Thurman 46e55a740a Added @skip back in to all the remaining NotImplementedError stub tests.
I'm doing this because otherwise this branch becomes impossible to
merge with main until it's completely ready.
2020-10-30 23:05:25 +00:00
Marnanel Thurman 8e3f23ac92 Not implementing /peers or /activity instance methods any time soon tbh 2020-10-30 22:53:46 +00:00
Marnanel Thurman 622fc69df9 test_account: added @skips back in again for block/muting because those aren't yet written; deleted some test stubs of obscure purpose. 2020-10-29 23:19:37 +00:00
Marnanel Thurman 4903af61fc Drop sombrero's test_send. The idea is flawed and nothing in it works anyway. 2020-10-29 23:08:18 +00:00
Marnanel Thurman 287a3dc3f1 oops, left diff mark in code 2020-10-29 18:01:56 +00:00
Marnanel Thurman 949cd70f1b Merge branch 'mentions' into issue-47 2020-10-29 17:59:30 +00:00
Marnanel Thurman 731cb3e21e trilby doesn't need to return mentions, at least not for now 2020-10-29 17:58:50 +00:00
Marnanel Thurman 96155bf840 StatusActivitySerializer serialises the status object with StatusObjectSerializer
instead of attempting to do it in-house.
2020-10-29 16:44:09 +00:00
Marnanel Thurman 38eac12111 Status gains to and cc properties, both currently stubs 2020-10-29 16:43:54 +00:00
Marnanel Thurman b193096666 Status.tags() returns a list, not a QuerySet 2020-10-29 16:31:15 +00:00
Marnanel Thurman 3db8b2a43f Merge branch 'mentions' into issue-47 2020-10-29 04:23:06 +00:00
Marnanel Thurman c61afd585e create() can read the "tag" field of an Actor and create Mention objects as appropriate.
Tests updated and passing.
2020-10-29 04:20:58 +00:00
Marnanel Thurman 297d3cbf56 Status returns mentions correctly 2020-10-29 04:17:35 +00:00