From 3e4e1bd2d6e5c0a261edacdc6dbd86f2d888b11d Mon Sep 17 00:00:00 2001 From: YegorSan Date: Tue, 8 Oct 2019 16:49:50 +0300 Subject: [PATCH 1/3] 422 page created --- .../static/images/errors-img/pic-404.svg | 27 +++++++++++++++++++ .../templates/422_page/index.html.eex | 13 +++++++++ 2 files changed, 40 insertions(+) create mode 100644 apps/block_scout_web/assets/static/images/errors-img/pic-404.svg create mode 100644 apps/block_scout_web/lib/block_scout_web/templates/422_page/index.html.eex diff --git a/apps/block_scout_web/assets/static/images/errors-img/pic-404.svg b/apps/block_scout_web/assets/static/images/errors-img/pic-404.svg new file mode 100644 index 0000000000..0b4e8a594c --- /dev/null +++ b/apps/block_scout_web/assets/static/images/errors-img/pic-404.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/block_scout_web/lib/block_scout_web/templates/422_page/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/422_page/index.html.eex new file mode 100644 index 0000000000..4acd9e0125 --- /dev/null +++ b/apps/block_scout_web/lib/block_scout_web/templates/422_page/index.html.eex @@ -0,0 +1,13 @@ +
+
+
+ Page Not Found +
+
+

Lorem Ipsum Dolor

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit, + sed do eiusmod tempor incididunt ut labore et dolore magna aliqua

+ Back Home +
+
+
\ No newline at end of file From 21e3f0e57690f62c5d4b3f4dd79757c68989a7d7 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 28 Oct 2019 14:02:25 +0300 Subject: [PATCH 2/3] 422 page --- apps/block_scout_web/lib/block_scout_web/controller.ex | 5 +++-- .../templates/{422_page => error422}/index.html.eex | 5 ++--- apps/block_scout_web/lib/block_scout_web/views/error_422.ex | 5 +++++ 3 files changed, 10 insertions(+), 5 deletions(-) rename apps/block_scout_web/lib/block_scout_web/templates/{422_page => error422}/index.html.eex (55%) create mode 100644 apps/block_scout_web/lib/block_scout_web/views/error_422.ex diff --git a/apps/block_scout_web/lib/block_scout_web/controller.ex b/apps/block_scout_web/lib/block_scout_web/controller.ex index cf545f5260..38f28be0c6 100644 --- a/apps/block_scout_web/lib/block_scout_web/controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controller.ex @@ -20,8 +20,9 @@ defmodule BlockScoutWeb.Controller do def unprocessable_entity(conn) do conn |> put_status(:unprocessable_entity) - |> put_view(BlockScoutWeb.ErrorView) - |> render("422.html") + |> put_view(BlockScoutWeb.Error422View) + |> render(:index) + |> halt() end @doc """ diff --git a/apps/block_scout_web/lib/block_scout_web/templates/422_page/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/error422/index.html.eex similarity index 55% rename from apps/block_scout_web/lib/block_scout_web/templates/422_page/index.html.eex rename to apps/block_scout_web/lib/block_scout_web/templates/error422/index.html.eex index 4acd9e0125..bbf314d4bb 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/422_page/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/error422/index.html.eex @@ -4,9 +4,8 @@ Page Not Found
-

Lorem Ipsum Dolor

-

Lorem ipsum dolor sit amet, consectetur adipiscing elit, - sed do eiusmod tempor incididunt ut labore et dolore magna aliqua

+

Unprocessable Entity

+

The request was well-formed but was unable to be followed due to semantic errors. Maybe, you mistype a hash of tx/block/address?

Back Home
diff --git a/apps/block_scout_web/lib/block_scout_web/views/error_422.ex b/apps/block_scout_web/lib/block_scout_web/views/error_422.ex new file mode 100644 index 0000000000..b813dc9383 --- /dev/null +++ b/apps/block_scout_web/lib/block_scout_web/views/error_422.ex @@ -0,0 +1,5 @@ +defmodule BlockScoutWeb.Error422View do + use BlockScoutWeb, :view + + @dialyzer :no_match +end From 1171096dbba23ad3b0d458eb3ea175dab2010148 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 28 Oct 2019 14:07:42 +0300 Subject: [PATCH 3/3] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e75b77e04..9c45eee1cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ### Fixes ### Chore +- [#2807](https://github.com/poanetwork/blockscout/pull/2807) - 422 page ## 2.1.0-beta