Commit Graph

17 Commits (5885cb5b098905af09a71bdef0bd01c163e8fd53)

Author SHA1 Message Date
Ana Gelez 5f8d6b8e0e Rust 2018! (#726) 4 years ago
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
5 years ago
Baptiste Gelez ad3a8b92d1
Theme update (#553)
* Start to update the theme

- Ligther colors
- No more border radius
- Buttons are now always colored
- Start to redesign the post page (according to the Figma mockups)

* Fix build script: it now recompiles everytime a scss file changed

* Make sure the article illustrations are not too big

* Make articles wider (70 characters)

* Better contrast between gray shades

* Various improvements

* Better mobile style

* New style for the footer

* Improve comment style

* Better responsiveness again

* Limit the size of the article cover

* Last details?

- Improve buttons on the media page
- Improve lists

* Pin the stdweb version that we use

It changed because I removed Cargo.lock to handle a merge conflict

I could have updated cargo web too, but it mean I should have re-built
the CI docker image and it was taking forever.

* Better contrast for links in the header of the article

* Add a basic privacy policy

* Remove "also"

* Fix a few issues

- Don't watch static/css in build.rs
- Another shade of white
- Remove useless margin rule for error messages
5 years ago
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
5 years ago
Marek Ľach 2d12524cd1 English source strings corrected (#510)
Requires .po/.pot files to be rebuilt

This resolves #508
5 years ago
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.
5 years ago
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
5 years ago
Baptiste Gelez 7eef4643c8
Update rocket_i18n and add gettext_macros (#431)
Internationalization now uses proc-macros that generate the .pot file
automatically.
5 years ago
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)
6 years ago
Marek Ľach 040a3b8688 Media upload strings update (#383) 6 years ago
Marek Ľach b5ddca2f64 Media details small strings correction (#384) 6 years ago
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
6 years ago
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
6 years ago
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!
6 years ago
Bat 8ac6b8307a I18n for media pages 6 years ago
Bat a357dae45d Add Markdown code to copy/paste for medias 6 years ago
Bat f44b6fffa3 Media upload 6 years ago