From fd1b3d73597cfa5dcaf729f6f992acb85bad3d61 Mon Sep 17 00:00:00 2001 From: Gabriel Rodriguez Alsina Date: Mon, 3 Jun 2019 16:41:41 -0300 Subject: [PATCH 1/4] (add) question status modal --- .../assets/css/components/_modal_status.scss | 20 +++++++++++++ apps/block_scout_web/assets/js/lib/modals.js | 5 ++++ .../_icon_question_modal.html.eex | 29 +++++++++++++++++++ .../common_components/_modal_status.html.eex | 22 ++++++++++++-- .../templates/layout/_footer.html.eex | 5 ++++ 5 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 apps/block_scout_web/lib/block_scout_web/templates/common_components/_icon_question_modal.html.eex diff --git a/apps/block_scout_web/assets/css/components/_modal_status.scss b/apps/block_scout_web/assets/css/components/_modal_status.scss index 9c32b05c72..92856250fc 100644 --- a/apps/block_scout_web/assets/css/components/_modal_status.scss +++ b/apps/block_scout_web/assets/css/components/_modal_status.scss @@ -1,6 +1,7 @@ $modal-status-graph-error: #ff0d51 !default; $modal-status-graph-warning: #ff8502 !default; $modal-status-graph-success: $primary !default; +$modal-status-graph-question: #329ae9 !default; .modal-status { max-width: 100%; @@ -32,6 +33,10 @@ $modal-status-graph-success: $primary !default; background-color: $modal-status-graph-success; } + &-question { + background-color: $modal-status-graph-question; + } + svg { margin-top: 15px; } @@ -62,3 +67,18 @@ $modal-status-graph-success: $primary !default; margin: 0 0 25px; text-align: center; } + +.modal-status-button-wrapper { + display: flex; + justify-content: space-between; + width: 100%; + + .btn-line { + flex-grow: 1; + margin-right: 20px; + + &:last-child { + margin-right: 0; + } + } +} \ No newline at end of file diff --git a/apps/block_scout_web/assets/js/lib/modals.js b/apps/block_scout_web/assets/js/lib/modals.js index fb19532540..95a54af405 100644 --- a/apps/block_scout_web/assets/js/lib/modals.js +++ b/apps/block_scout_web/assets/js/lib/modals.js @@ -22,6 +22,11 @@ $(function () { $('#successStatusModal').modal() }) + // TODO: Remove this + $(window).on('load', function () { + $('#questionStatusModal').modal() + }) + $('.js-stake-stake').on('click', function () { const modal = '#stakeModal' const progress = parseInt($(`${modal} .js-stakes-progress-data-progress`).text()) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/common_components/_icon_question_modal.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/common_components/_icon_question_modal.html.eex new file mode 100644 index 0000000000..14c50899c0 --- /dev/null +++ b/apps/block_scout_web/lib/block_scout_web/templates/common_components/_icon_question_modal.html.eex @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/block_scout_web/lib/block_scout_web/templates/common_components/_modal_status.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/common_components/_modal_status.html.eex index c3bd4752e1..71e192ee62 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/common_components/_modal_status.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/common_components/_modal_status.html.eex @@ -17,6 +17,11 @@ render BlockScoutWeb.CommonComponentsView, "_icon_warning_modal.html" end %> + <%= + if @status == "question" do + render BlockScoutWeb.CommonComponentsView, "_icon_question_modal.html" + end + %> <%= render BlockScoutWeb.CommonComponentsView, "_modal_close_button.html" %> diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex index ed22191b1f..8d8e8f423a 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex @@ -85,3 +85,8 @@ <% end %> + +<%= + render BlockScoutWeb.CommonComponentsView, "_modal_status.html", status: "question", title: "Lorem Ipsum", text: "Lorem ipsum dolor sit amet, consectetur +adipiscing elit, sed do eiusmod tempor." +%> \ No newline at end of file From 1ca8f6a9bbe9ee0d1acfc4bc9267eba5be6dabd4 Mon Sep 17 00:00:00 2001 From: Gabriel Rodriguez Alsina Date: Mon, 3 Jun 2019 16:47:24 -0300 Subject: [PATCH 2/4] (update) changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f94e33f2b7..05961a267c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## Current ### Features +- [#2091](https://github.com/poanetwork/blockscout/pull/2091) - Added "Question" modal. - [#1726](https://github.com/poanetwork/blockscout/pull/2071) - Updated styles for the new smart contract page. - [#2081](https://github.com/poanetwork/blockscout/pull/2081) - Tooltip for 'more' button, explorers logos added - [#1963](https://github.com/poanetwork/blockscout/pull/1963), [#1959](https://github.com/poanetwork/blockscout/pull/1959), [#1948](https://github.com/poanetwork/blockscout/pull/1948), [#1936](https://github.com/poanetwork/blockscout/pull/1936), [#1925](https://github.com/poanetwork/blockscout/pull/1925), [#1922](https://github.com/poanetwork/blockscout/pull/1922), [#1903](https://github.com/poanetwork/blockscout/pull/1903), [#1874](https://github.com/poanetwork/blockscout/pull/1874), [#1895](https://github.com/poanetwork/blockscout/pull/1895), [#2031](https://github.com/poanetwork/blockscout/pull/2031), [#2073](https://github.com/poanetwork/blockscout/pull/2073), [#2074](https://github.com/poanetwork/blockscout/pull/2074), - added new themes and logos for poa, eth, rinkeby, goerli, ropsten, kovan, sokol, xdai, etc, rsk and default theme From 8b9148229dfaf4e655096288ea5c944f4ea17b3c Mon Sep 17 00:00:00 2001 From: Gabriel Rodriguez Alsina Date: Tue, 4 Jun 2019 11:36:17 -0300 Subject: [PATCH 3/4] (add) css classes for easier js event handling --- .../templates/common_components/_modal_status.html.eex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/common_components/_modal_status.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/common_components/_modal_status.html.eex index 71e192ee62..f6328b8f1b 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/common_components/_modal_status.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/common_components/_modal_status.html.eex @@ -37,10 +37,10 @@ Ok <% else %> - - <% end %> From 62d30735deb3f450837ce8ca8bd879ccf57f7618 Mon Sep 17 00:00:00 2001 From: Gabriel Rodriguez Alsina Date: Tue, 4 Jun 2019 15:06:10 -0300 Subject: [PATCH 4/4] (remove) demo modal --- apps/block_scout_web/assets/js/lib/modals.js | 5 ----- .../lib/block_scout_web/templates/layout/_footer.html.eex | 7 +------ 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/apps/block_scout_web/assets/js/lib/modals.js b/apps/block_scout_web/assets/js/lib/modals.js index 95a54af405..fb19532540 100644 --- a/apps/block_scout_web/assets/js/lib/modals.js +++ b/apps/block_scout_web/assets/js/lib/modals.js @@ -22,11 +22,6 @@ $(function () { $('#successStatusModal').modal() }) - // TODO: Remove this - $(window).on('load', function () { - $('#questionStatusModal').modal() - }) - $('.js-stake-stake').on('click', function () { const modal = '#stakeModal' const progress = parseInt($(`${modal} .js-stakes-progress-data-progress`).text()) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex index 8d8e8f423a..1058654d49 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_footer.html.eex @@ -84,9 +84,4 @@ <% end %> - - -<%= - render BlockScoutWeb.CommonComponentsView, "_modal_status.html", status: "question", title: "Lorem Ipsum", text: "Lorem ipsum dolor sit amet, consectetur -adipiscing elit, sed do eiusmod tempor." -%> \ No newline at end of file + \ No newline at end of file