Commit graph

263 commits

Author SHA1 Message Date
Marek Ľach 85aa0883c8 Update follow_remote.rs.html grammar (#548)
* Update follow_remote.rs.html

* Update follow_remote.rs.html
2019-04-26 18:31:43 +01:00
Baptiste Gelez 29e11f552f
Remove r (#535)
I don't know why it was here 🤷‍♀️
2019-04-19 19:13:11 +01:00
Baptiste Gelez b572a1bd74
Fix #504 (#532)
- Add the `spaced` class to some article cards, to make them wider even on desktop
- Fix the CSS to always have a small margin for cards on mobile
2019-04-19 15:49:22 +01:00
fdb-hiroshima 0d708e1639 Add support for remote interact (#519)
Add support for remote interaction ([this thing](https://eldritch.cafe/users/Barmaid/remote_follow) in mastodon)

- [x] create the endpoint dispatching remote interactions to local pages
- [x] add this endpoint to web-finger
- [x] propose remote interaction when following and not connected
- [x] propose remote interaction when liking/sharing and not connected
- [x] propose remote interaction when commenting and not connected
- [x] fetch posts/comments we don't know but remote interaction was requested for ?
2019-04-17 21:09:07 +01:00
fdb-hiroshima c19c094e0c
add diverse links and meta to head (#522) 2019-04-09 15:33:34 +02:00
Baptiste Gelez d7de09ab81 Fix Atom feed link on user page (#518) 2019-04-07 05:53:38 +02:00
Baptiste Gelez 7645fdbf35
Fix tabs on user page (#516)
The "Articles" tab was always selected.
2019-04-06 19:03:00 +01:00
Baptiste Gelez 1f7ff62c19
Editor improvements (#486)
- Make it possible to insert new paragraphs in the article body
- Make it impossible to copy formatted HTML (to make media insertion from markdown code work correctly)

TODO:

- [x] make it possible to escape draft mode
- [x] display errors from the server
- [x] button to go back to the "normal" editor
- [x] Avoid publishing placeholders
2019-04-06 14:20:12 +01:00
Marek Ľach 38701c8a40 Corrected grammar pointed out by translators (#514)
The user 'UniqueActive' pointed these issues out on Crowdin.

Thank you!
2019-04-04 20:06:37 +01:00
Marek Ľach 723d2c4600 Grammar corrections followup to #510 (#512)
A very small commit, but let's do all the string corrections while I am already at it :-)

Wraps up #510
2019-04-02 14:08:07 +01:00
Marek Ľach 2d12524cd1 English source strings corrected (#510)
Requires .po/.pot files to be rebuilt

This resolves #508
2019-04-01 19:09:29 +01:00
Hugh a674df3a77 Some corrections to English UI text (#506)
* Update some UI strings for more natural English

* Correct message text

* Correct message text

* Update the strings everywhere

Because they are also used as base messages for other languages
2019-03-29 20:12:21 +01:00
Jean Lucas e93b8f4444 Change "Welcome on" to "Welcome to" (#501)
"Welcome on [noun]" is not grammatically correct as an introduction in
English. Let's fix that.
2019-03-25 08:57:26 +01:00
Baptiste Gelez bdfad844d7
Edit blogs, and add blog icons and banners (#460)
Also adds a parameter to `md_to_html` to only render inline elements (so that we don't have titles or images in blog descriptions). And moves the delete button for the blog on the edition page.

I still have to update the SQLite migration once others PRs with migrations will be merged.

Also, there will be a problem when you edit a blog while not owning its banner or icon: when validating they will be reset to their default values… I don't see a good solution to this until we have a better way to handle uploads with Rocket (the same is probably happening for articles btw).

And the icon/banner are not federated yet, I don't know if I should add it to this PR or if it can come after?

![image](https://user-images.githubusercontent.com/16254623/53894510-7d853300-4030-11e9-8a2c-f5c0b0c7f512.png)
![image](https://user-images.githubusercontent.com/16254623/53894539-8b3ab880-4030-11e9-8113-685a27be8d7c.png)

Fixes #453
Fixes #454
2019-03-22 19:51:36 +01:00
fdb-hiroshima ace6181c99
Allow to change logo from .env (#497)
Fix #273
2019-03-21 11:51:41 +01:00
Igor Galić 732f514da7 Refactor with the help of Clippy (#462)
We add clippy as our build — also rectifying the missing `plume-cli` build!

In the next step we follow clippy's advise and fix some of the "simple" mistakes in our code, such as style or map usage.

Finally, we refactor some hard bits that need extraction of new types, or refactoring of function call-types, especially those that thread thru macros, and, of course functions with ~15 parameters should probably be rethought.
2019-03-19 14:37:56 +01:00
fdb-hiroshima 570d7fe2d0
Add markdown support for summary (#482)
* Add markdown support for summary

* Save both md and html summary
2019-03-17 20:11:29 +01:00
fdb-hiroshima 191eb89958
Display error message when signin up with unmatching password (#484)
Fix #329
2019-03-17 20:10:45 +01:00
fdb-hiroshima a2b2e37aa0
Caching (#480)
* add basic caching support

* Use hash of static dir instead of rand

* Add support for ETag
2019-03-16 15:33:28 +01:00
Baptiste Gelez 9076dbaadc
New editor (#458)
With this PR, when JS is activated and WASM supported, the article editor will be dynamically replaced with `contenteditable`s elements. This makes the editing interface simpler and less like a regular form. It will also allow us to easily add visual formatting with native browser APIs (and to insert images or videos directly). Here is a little demo:

![peek 05-03-2019 16-12](https://user-images.githubusercontent.com/16254623/53815536-1dc05680-3f62-11e9-94d3-b363ed84eb97.gif)

There is still a lot to do, but it is a good first step.

Fixes #255
2019-03-15 16:06:10 +01:00
Baptiste Gelez fe6e69d7c4
Add a fqn field to blogs and users (#457)
Fixes #319
2019-03-06 18:28:10 +01:00
Baptiste Gelez eff2698664
Slightly improve the media experience (#452)
* Slightly improve the media experience

- Use a grid to display the list of media
- Add icons for non-image media preview
- Paginate the gallery
- Add links to the gallery in the editor and in the profile settings to make it more discoverable when you need it

Fixes #432

* Allow video and audio tags in SafeString

Otherwise we can't display their preview, nor show them in articles

Also show controls by default for these two elements

* Show fallback images for audio and unknown files, to make them more visible

* Add a new constructor to SafeString when the input is trusted and doesn't need to be escaped.

And use it to generate media previews.

* Make it possible to insert video/audio in articles
2019-03-06 14:11:36 +01:00
Baptiste Gelez a2b9d7ec44
Password reset (#448)
* Password reset

* Various improvements and fixes for password reset

- Reorganize src/mail.rs to make it  cleaner
- add a build_mail function
- only make the requests invalid after 2 hours
- avoid infintely-growing list of requests by deleting them once completed, or after 24 hours
- avoid sending many requests for the same user
- validate the password reset form

* Avoid locking so many times

Fix durations

* Remove old requests even if the current one is not valid

* Remove unused feature

* Also remove the custom_derive and plugin features while we are at it

* Forgot a 0 è_é

* Avoid panicking while owning a request lock

* Use master branch of lettre so that we can build with the latest OpenSSL

* Fix the debug mailer
2019-02-27 13:29:26 +01:00
Baptiste Gelez e28371bbe4
Add a page listing people someone follows (#444)
Nothing exceptional, the layout is the same as the followers page.

Fixes #325
2019-02-26 13:13:00 +01:00
Baptiste Gelez 7eef4643c8
Update rocket_i18n and add gettext_macros (#431)
Internationalization now uses proc-macros that generate the .pot file
automatically.
2019-02-02 15:23:50 +01:00
Baptiste Gelez 5880dc1957
Improve search UI (#375) 2019-01-28 13:12:56 +01:00
fdb-hiroshima e77e4d86e8
Better big form handling (#430)
* Allow customizing max form size from env vars

* Add error page for unprocessable entities

And change default http port to 7878

* Improve char counter: under the editor, more discrete, and give it a default value
2019-01-27 10:55:22 +01:00
Marek Ľach 3128e6a3b9 Tags grammar and admin string corrections (#397) 2018-12-29 17:40:11 +01:00
Baptiste Gelez 80a4dae8bd
Avoid panics (#392)
- Use `Result` as much as possible
- Display errors instead of panicking

TODO (maybe in another PR? this one is already quite big):
- Find a way to merge Ructe/ErrorPage types, so that we can have routes returning `Result<X, ErrorPage>` instead of panicking when we have an `Error`
- Display more details about the error, to make it easier to debug

(sorry, this isn't going to be fun to review, the diff is huge, but it is always the same changes)
2018-12-29 09:36:07 +01:00
Marek Ľach e2d5a5057c Update edit.rs.html string (#389) 2018-12-26 13:05:06 +01:00
Marek Ľach 07ecbde93c Small changes to text strings (#379) 2018-12-25 15:59:54 +01:00
Marek Ľach fefb189056 Expanded search text strings (#380) 2018-12-25 15:56:30 +01:00
Marek Ľach ec4b9d5067 Text strings for articles (#381) 2018-12-25 15:55:48 +01:00
Marek Ľach 8f6333029d Article detail text strings update (#382) 2018-12-25 15:55:18 +01:00
Marek Ľach 040a3b8688 Media upload strings update (#383) 2018-12-25 15:54:35 +01:00
Marek Ľach b5ddca2f64 Media details small strings correction (#384) 2018-12-25 15:54:08 +01:00
Baptiste Gelez 3fce5d6a14
Use Rust for the front-end too (#374)
Rust can compile to WASM, so let's use it for front-end code as well.

To compile the front-end:

```
cargo install cargo-web
cargo web deploy -p plume-front
```
2018-12-25 11:51:40 +01:00
Marek Ľach aa6c1ffd64 Change title from Edit account to Create account (#376) 2018-12-24 19:03:54 +01:00
fdb-hiroshima fdfeeed6d9 Comment visibility (#364)
Add some support for comment visibility, fix #217 

This add a new column to comment, denoting if they are public or not, and a new table linking private comments to those allowed to read them. There is currently no way to write a private comment from Plume.
Git is having a hard time what happened in Comment::from_activity, but most of it is just re-indentation because a new block was needed to please the borrow checker. I've marked with comments where things actually changed.
At this point only mentioned users can see private comments, even when posted as "follower only" or equivalent.

What should we do when someone isn't allowed to see a comment? Hide the whole thread, or just the comment? If hiding just the comment, should we mark there is a comment one can't see, but answers they can, or put other comments like if they answered to the same comment the hidden one do?
2018-12-24 11:23:04 +01:00
fdb-hiroshima 5c5cf36b0d
Allow for comment deletion (#363)
* Allow for comment deletion

Receive and emit deletion activity
Add button to delete comment

* Remove debug print and fix copy-past typo

* Improve style of comment deletion button
2018-12-23 11:13:36 +01:00
Baptiste Gelez 38302203f4
Count items in database as much as possible (#344)
* Count items in database as much as possible

* Fix the tests

* Remove two useless queries

* Run pragma directive before each sqlite connection

* Pragma for tests too

* Remove debug messages
2018-12-14 23:16:18 +01:00
Baptiste Gelez b0089e59b7
Remove useless pagination routes (#351)
Rocket 0.4 let us have routes with optional query parameter
2018-12-13 22:20:19 +01:00
Trinity Pointard fcbaf6eee3 Allow to keep query params in paginate
Fix #349
2018-12-12 00:52:26 +01:00
Kristof De Jaeger 144f5966dd Add a space between u-url class and href (#347)
There's a missing space, which probably causes the h-feed not to parse.
You can always use http://xray.p3k.io/ to validate the microformats on a page.

e.g. http://xray.p3k.io/parse?url=https%3A%2F%2Fbaptiste.gelez.xyz%2F%7E%2FFederationTesting%2Fplume-and-the-indie-web&pretty=true is fine, so that's good!

However, the h-feed isn't parsing right - http://xray.p3k.io/parse?expect=feed&url=https%3A%2F%2Fbaptiste.gelez.xyz%2F%40%2F0x1C3B00DA&pretty=true (you can always add 'expect=feed' to the get params if you are really sure it needs to be a feed)
2018-12-11 12:30:23 +01:00
Baptiste Gelez b73fbd3768
License federation (#343)
* Federate license

* Make it possible to use no license
2018-12-09 18:43:34 +01:00
fdb-hiroshima e9f2f769be Add microformat tags (#341)
Close #229 
Adding `<div>` might have broken the layout in some places. I've tried to fix it, tell me if I missed it somewhere
2018-12-08 21:52:46 +01:00
Trinity Pointard b4e4b497ee Works on template
Use uri! to generate links instead of hardcoded urls
Fix #110
Fix invalid links needing to be POST forms
Translate login message for boost and like directly from template
Put js for search in its own file
2018-12-07 12:10:03 +01:00
Baptiste Gelez 70af57c6e1
Use Ructe (#327)
All the template are now compiled at compile-time with the `ructe` crate.

I preferred to use it instead of askama because it allows more complex Rust expressions, where askama only supports a small subset of expressions and doesn't allow them everywhere (for instance, `{{ macro!() | filter }}` would result in a parsing error).

The diff is quite huge, but there is normally no changes in functionality.

Fixes #161 and unblocks #110 and #273
2018-12-06 18:54:16 +01:00
fdb-hiroshima 449641d158
Add a search engine into Plume (#324)
* Add search engine to the model

Add a Tantivy based search engine to the model
Implement most required functions for it

* Implement indexing and plm subcommands

Implement indexation on insert, update and delete
Modify func args to get the indexer where required
Add subcommand to initialize, refill and unlock search db

* Move to a new threadpool engine allowing scheduling

* Autocommit search index every half an hour

* Implement front part of search

Add default fields for search
Add new routes and templates for search and result
Implement FromFormValue for Page to reuse it on search result pagination
Add optional query parameters to paginate template's macro
Update to newer rocket_csrf, don't get csrf token on GET forms

* Handle process termination to release lock

Handle process termination
Add tests to search

* Add proper support for advanced search

Add an advanced search form to /search, in template and route
Modify Tantivy schema, add new tokenizer for some properties
Create new String query parser
Create Tantivy query AST from our own

* Split search.rs, add comment and tests

Split search.rs into multiple submodules
Add comments and tests for Query
Make user@domain be treated as one could assume
2018-12-02 17:37:51 +01:00
Baptiste Gelez a64c4912cf
Add support for CW in comments (#308)
All the backend/federation code was already, I just added the UI 🤷‍♀️ 

Fixes #253
2018-11-07 15:57:31 +01:00