Commit graph

13113 commits

Author SHA1 Message Date
Vincent Ambo
ce18cfa2d6 refactor: Add a message!-macro to reduce message boilerplate 2018-04-15 21:31:14 +02:00
Vincent Ambo
d9d1a3313f refactor(render): Pass serializable structs to Tera directly
No need to go the intermediate step via `Context::new()`
2018-04-15 21:18:27 +02:00
Vincent Ambo
ec712cc4c0 refactor(templates/render): Add generic post editing template
Adds a generic template that can be used for submitting, responding to
and editing posts.
2018-04-15 21:13:20 +02:00
Daniel Høyer Iversen
9c238e1717
Merge pull request #178 from lordneon/master
Fixed a bug within the SP2 class.
2018-04-15 19:04:05 +02:00
Vincent Ambo
4c0e6552e8 refactor(main): Split enormous main() into smaller methods
A little bit of logical grouping of things has never hurt anyone.
2018-04-15 13:16:49 +02:00
Vincent Ambo
aeaa497a62 fix(handlers): Trim leading/trailing whitespace from new threads 2018-04-15 13:01:06 +02:00
Vincent Ambo
ee4b690d22 refactor(templates): Restyle thread view using flex layout 2018-04-15 12:38:33 +02:00
Vincent Ambo
9cee48f2da feat(handlers): Determine whether current user can edit a post 2018-04-15 12:38:12 +02:00
lordneon
e8421343e3 Merge branch 'master' of https://github.com/lordneon/python-broadlink 2018-04-15 10:22:42 +00:00
lordneon
e724aec007 Fixed a bug within the SP2 class.
check_power and check_nightlight did not check to see if the payload was already an int before calling ord.
2018-04-15 10:22:19 +00:00
lordneon
90af3b7437 Fixed a bug within the SP2 class.
check_power and check_nightlight did not check to see if the payload was already an int before calling ord.
2018-04-15 10:19:05 +00:00
Vincent Ambo
02a466a28b style(templates): Minor fixes to search & index layouts 2018-04-15 00:41:17 +02:00
Vincent Ambo
ba33efd772 refactor(handlers): Receive search terms via query parameters
There are several reasons for this, but one important one is that
people expect to be able to share search links.
2018-04-14 23:28:34 +02:00
Vincent Ambo
e0b1bc2627 fix(render): Escape post bodies
... derp.

Well, the CSP prevented script executions already.
2018-04-14 22:33:35 +02:00
Vincent Ambo
8057b8849e feat(templates): Add 'sticky' badge to sticky threads 2018-04-14 22:33:35 +02:00
Vincent Ambo
06f7f23bab fix(migrations): Change weighting of title vs. body
After thinking for a little while I actually think the body of a post
may be more relevant when searching for posts than the thread title.

Right now this is just a hunch and we'll have to find out how it
actually ends up working in real life.
2018-04-14 22:21:55 +02:00
Vincent Ambo
4132869277 feat: Implement search result view & enable search
Implements a very simple and currently kinda broken-looking search
result view.
2018-04-14 22:21:55 +02:00
Vincent Ambo
dae97fdaf5 chore(db): Arbitrarily limit search result size
... until pagination is in place.
2018-04-14 22:21:55 +02:00
Vincent Ambo
39d1cd64bc feat(main/db): Schedule regular search view refresh
Schedules refreshes of the database view used for search at one-minute
intervals.
2018-04-14 22:21:55 +02:00
Vincent Ambo
3e5b1098c6 refactor(schema): Unify integer type usage across tables 2018-04-14 22:21:55 +02:00
Vincent Ambo
ea68bac427 refactor(handlers): Improve error handling in post creation 2018-04-14 22:21:55 +02:00
Vincent Ambo
31b0a550f2 feat(db): Implement handling of 'SearchPosts' message
Adds support for executing full-text search across a forum instance by
sending the `SearchPosts` message with a search query to the DB actor.

The struct used for results is mapped manually to the expected query
result as the query is embedded via raw SQL.
2018-04-14 22:21:55 +02:00
Vincent Ambo
2d8db52010 feat(migrations): Add materialized view & index for full text search
Adds a materialized view to be used for full-text searches that
indexes the tsvector documents for each post.
2018-04-14 22:21:55 +02:00
Vincent Ambo
529da884da fix(templates): Fluidly scale all images 2018-04-14 18:12:24 +02:00
Vincent Ambo
324778c7e0 fix(templates): Set CSPs on templates 2018-04-14 17:59:52 +02:00
Vincent Ambo
b684320a73 docs(todo): Stickies are done! 2018-04-14 17:56:36 +02:00
Vincent Ambo
c6995fcab3 feat(templates): Highlight stickied threads in index 2018-04-14 17:55:57 +02:00
Vincent Ambo
d1c45159b9 feat(db): Add support for stickies in database
Adds a 'sticky' column to threads and rewrites the thread index to
take sticky markings into account when ordering threads.

Stickies are not yet highlighted in any way in the forum overview.
2018-04-14 17:47:31 +02:00
Vincent Ambo
c136d34e79 docs(todo): Add note about stickies 2018-04-14 17:16:10 +02:00
Vincent Ambo
f10bd20276 feat(db): Add view for ordering thread index by most recent post
This implements the classic thread ordering expected by most forum
users (i.e. the thread with the most recent post is at the top).
2018-04-14 17:15:27 +02:00
Vincent Ambo
cf64826e4e feat(build): Configure Travis builds for Rust 2018-04-14 16:43:59 +02:00
Vincent Ambo
a326e1ea2e feat: License project under GPLv3 2018-04-14 16:40:56 +02:00
Vincent Ambo
d1acf4cfd7 docs(CODE_OF_CONDUCT): Add a reasonable code of conduct 2018-04-14 16:38:48 +02:00
Vincent Ambo
b0825f3850 docs(README): Add a very simple README file 2018-04-14 16:38:05 +02:00
Vincent Ambo
8c30ef92f6 refactor(db): Store thread body in the posts table
This is a simplification over the previous approach. The OP of a
thread is just a normal post like any other in this model, which
allows some code simplifications (and future query convenience).
2018-04-14 16:33:45 +02:00
Vincent Ambo
a90d1cc1a4 feat(migrations): Drop 'body' column from threads
As a data model simplification, the text of a thread's top post should
simply also go into the posts table.
2018-04-14 16:33:15 +02:00
Eelco Dolstra
d34fa2bcc3
Fix #1921 2018-04-13 15:42:35 +02:00
Eelco Dolstra
4fd28bee89
Fix broken DocBook 2018-04-13 15:12:58 +02:00
Shea Levy
3d748d3323
Merge pull request #2071 from sseefried-forked/clarify-glossary-and-garbage-collection
Add to glossary and clarify garbage collection
2018-04-12 06:12:38 -04:00
Sean Seefried
2ef8f0608c Add to glossary and clarify garbage collection
While trying to understand garbage collection it was not immediately
clear that only the runtime dependency closure of output paths
would be kept (instead of the build-time dependency closure).
This commit attempts to clarify this by expanding some of the
glossary definitions and extending the Garbage Collection
section.
2018-04-12 19:23:24 +10:00
Shea Levy
dc0a542c9f
initPlugins: Fix dlopen error message. 2018-04-11 21:02:50 -04:00
Vincent Ambo
bf02c70f74 feat(handlers/main): Add 'anonymous' mode for forum
Adds a `REQUIRE_LOGIN` environment variable which, if set to anything
other than true, will let users post anonymously on the forums.
2018-04-12 01:28:37 +02:00
Vincent Ambo
e7a54a5aff feat(handler): Perform basic input validation on new thread view 2018-04-12 01:07:25 +02:00
Vincent Ambo
f46f6f3c42 chore(cargo): Remove unused dependency 2018-04-12 00:32:06 +02:00
Vincent Ambo
0ec214423e fix(handlers): Fix chained error handling in actors
This took me some time to figure out so it's useful to document in the
commit message.

When chaining messages from actors, the result type of a message (i.e.
the actual `<M as Message>::Result`) is sometimes itself a
`Result<T, E>`.

In many cases this leads to a situation where the return type of a
message sending process is something like (simplified):

    Future<Item=Result<Foo, ConverseError>, Error=actix::MailboxError>

Due to the implementation of
`From<actix::MailboxError> for ConverseError` it is possible to use
`.from_err()` on these futures to convert the future's `Error` to
`ConverseError`.

The type `Result` apparently implements `IntoFuture`, which means that
due to some trait magic that's been applied somewhere in the futures
API a call to `flatten()` can "lift" the contained error if the error
types match and give us a "simple"

    Future<Item=Foo, Error=ConverseError>

From that point on chaining becomes easy.
2018-04-12 00:04:37 +02:00
Vincent Ambo
a9917d54a8 chore(handlers): Remove unused code 2018-04-11 23:34:49 +02:00
Vincent Ambo
b862e3dc79 chore(cargo): Use stable release of actix-web
The git version previously tracked by Converse has been released.
2018-04-11 21:21:21 +02:00
Abseil Team
a7e522daf1 - a0673e81da7ee7e322283e518331a4cdaeca837b Internal change by Abseil Team <absl-team@google.com>
- 537e863510a423968c2d319263dd1c100695a2e9 Add internal-only functionality to examine the stack, to ... by Derek Mauro <dmauro@google.com>
  - 1ded12406d8b8fd7be910c8dfe8c2a8edf66136e Explicitly suppress the default move constructor and assi... by Derek Mauro <dmauro@google.com>
  - 347d38447ebc38e5d33fec6b67988880eb3cd249 Move implementation detail do_mmap64 to a new file. by Greg Falcon <gfalcon@google.com>

GitOrigin-RevId: a0673e81da7ee7e322283e518331a4cdaeca837b
Change-Id: I5a347d34d5173082b3a78eb53432481b32c94b69
2018-04-11 13:39:23 -04:00
Griffin Smith
08340c223a refactor: Parametrize org-clubhouse-request
Make org-clubhouse-request a kv-function with an additional :params kv, for
supporting query params in requests
2018-04-11 10:50:38 -04:00
Vincent Ambo
918c2726b4 fix(templates/handlers): Fix post anchors
- ensure users are correctly linked to a post actor after replying
- ensure timestamps are clickable to get post IDs
2018-04-11 16:35:40 +02:00