Commit graph

92 commits

Author SHA1 Message Date
Ana Gelez
5f8d6b8e0e Rust 2018! (#726) 2020-01-21 07:02:03 +01:00
Violet White
e53574970c Fix issue #705 (#708)
* Fix issue #705

* Add canonical links to blogs too
2019-12-16 22:55:02 +01:00
fdb-hiroshima
dd6d39135e re-add empty strings in translation (#682) 2019-10-24 16:44:14 +02:00
Violet white
028c4fdbc6 Fix that bug :D 2019-10-24 12:05:13 +02:00
Ana Gelez
309e1200d0 Make a distinction between moderators and admins (#619)
* Make a distinction between moderators and admins

And rework the user list in the moderation interface, to be able to run the same action on many users,
and to have a huge list of actions whithout loosing space.

* Make user's role an enum + make it impossible for a moderator to escalate privileges

With the help of diesel-derive-enum (maybe it could be used in other places too?)

Also, moderators are still able to grant or revoke moderation rights to other people, but maybe only admins should be able to do it?

* Cargo fmt

* copy/pasting is bad

* Remove diesel-derive-enum and use an integer instead

It was not compatible with both Postgres and SQlite, because for one it generated a schema
with the "User_role" type, but for the other it was "Text"…

* Reset translations

* Use an enum to avoid magic numbers + fix the tests

* Reset translations

* Fix down.sql
2019-09-13 12:28:36 +02:00
Ana Gelez
8ab690001d Replace the input! macro with an Input builder (#646)
* Replace the input! macro with an Input builder

* Use a BTreeMap instead of an HashMap

Followinf @fdb-hiroshima's advice

* Rename Input::to_html to Input::html

To make clippy happy

* Wrap error messages in red paragraphs
2019-08-27 16:50:24 +02:00
Ana Gelez
a6c84daa1a
Theming (#624)
* Theming

- Custom CSS for blogs
- Custom themes for instance
- New dark theme
- UI to choose your instance theme
- Option to disable blog themes if you prefer to only have the instance theme
- UI to choose a blog theme
2019-08-21 00:42:04 +02:00
fdb-hiroshima
773fbfe7c8 cache local instance (#572)
* cache local instance

fix #564

* don't use local instance cache for plm

* use instance cache for plm, but initialize it

* cargo fmt
2019-05-10 21:59:34 +01:00
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
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
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
2d12524cd1 English source strings corrected (#510)
Requires .po/.pot files to be rebuilt

This resolves #508
2019-04-01 19:09:29 +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
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
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
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
Marek Ľach
e2d5a5057c Update edit.rs.html string (#389) 2018-12-26 13:05:06 +01:00
Marek Ľach
aa6c1ffd64 Change title from Edit account to Create account (#376) 2018-12-24 19:03:54 +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
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
Baptiste Gelez
57cf55fecc Fix RSS feed icon
Closes #289
2018-10-31 18:17:13 +01:00
Bat
d8ca1d70b7 Fix CSRF issues
GET routes are not protected against CSRF. This commit changes the needed URLs to
POST and replace simple links with forms.

Thanks @fdb-hiroshima for noticing it!
2018-09-19 18:13:07 +01:00
Bat
10da8f31b6 Hide articles on public pages
Only show them in the dashboard
2018-09-10 20:06:00 +01:00
Bat
fcdd3d4c1a Don't compress avatars
Fixes #210
2018-09-09 21:41:55 +01:00
Bat
de3707983a Account deletion
Fixes #182
2018-09-09 20:49:24 +01:00
Bat
775162559e Improve user page on small screens
Center avatar's alt text, since the only fix to display them on a single line would
break valid avatars
2018-09-08 09:55:59 +01:00
Bat
99f04893bb Add tabs to the user profile 2018-09-05 16:41:31 +01:00
Bat
ac631627ab Make it possible to disable registrations
Fix #41
2018-09-03 17:05:45 +01:00
Bat
431bc41cb5 Improve user header 2018-09-03 15:03:25 +01:00
Bat
3013eec579 Redesign menu items 2018-09-03 14:59:02 +01:00
Bat
95ba99a6be Add a link to the media gallery 2018-09-03 12:24:34 +01:00
Bat
aa5fa11218 Add support for avatars, and fetch remote ones 2018-09-03 12:17:59 +01:00
Dominik Pataky
1fc89e8aeb Merge branch 'master' of https://github.com/Plume-org/Plume into feature/reshare_to_boost 2018-09-03 10:41:37 +02:00
Bat
52860efa85 Add a link for Atom feeds 2018-09-01 21:16:38 +01:00
Dominik Pataky
001eb99091 Rename 'reshare' to 'boost' in templates and PO
For now it might be enough to only reword 'reshare' to 'boost' in the
frontend. The code can continue to use 'reshare'.

Includes the most recent German translation.

Fixes #74
2018-08-19 00:52:28 +02:00
Bat
ddcb49ce28 Fix #141 2018-08-18 12:49:06 +02:00
Bat
74ec59e77c Add some configuration options for instance admins 2018-07-27 19:05:36 +02:00
Bat
b42030e831 Try to use only "absolute" links to avoid trailing-slash bugs 2018-07-26 19:00:23 +02:00
Bat
84974897ed Display FQN on user profiles
Fix #130
2018-07-26 18:36:38 +02:00
Bat
7af1faf206 Make the "Open on remote instance" button open a new tab 2018-07-26 18:27:02 +02:00
Bat
5980c7b299 Simplify the logic to fallback to the FQN when no display name is available 2018-07-26 16:36:19 +02:00