Merge pull request #4 from YegorSan/frontend-tasks

latest PR Closed. Merging updates.
pull/2673/head
Yegor 5 years ago committed by GitHub
commit 28407e9bea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 21
      apps/block_scout_web/assets/css/app.scss
  2. 8
      apps/block_scout_web/assets/css/components/_custom_tooltips_block_details.scss
  3. 8
      apps/block_scout_web/assets/css/components/_dashboard-banner.scss
  4. 10
      apps/block_scout_web/assets/css/components/_erc721_token_image_container.scss
  5. 83
      apps/block_scout_web/assets/css/components/_transaction.scss
  6. 43
      apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex
  7. 2
      apps/block_scout_web/lib/block_scout_web/templates/tokens/overview/_details.html.eex
  8. 6
      apps/block_scout_web/lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex
  9. 34
      apps/block_scout_web/priv/gettext/default.pot
  10. 34
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po

@ -1,12 +1,10 @@
@import "./mixins";
/* Phoenix flash messages */
.alert:empty {
display: none;
display: none;
}
/* This file is for your main application css. */
// Font Awesome
@ -109,18 +107,15 @@ $fa-font-path: "~@fortawesome/fontawesome-free/webfonts";
@import "components/radio_big";
@import "components/btn_no_border";
@import "components/custom_tooltips_block_details";
@import "components/_erc721_token_image_container";
@import "theme/dark-theme";
:export {
dashboardBannerChartAxisFontColor: $dashboard-banner-chart-axis-font-color;
dashboardLineColorMarket: $dashboard-line-color-market;
dashboardLineColorPrice: $dashboard-line-color-price;
primary: $primary;
secondary: $secondary;
darkprimary: $dark-primary;
darksecondary: $dark-secondary;
dashboardBannerChartAxisFontColor: $dashboard-banner-chart-axis-font-color;
dashboardLineColorMarket: $dashboard-line-color-market;
dashboardLineColorPrice: $dashboard-line-color-price;
primary: $primary;
secondary: $secondary;
darkprimary: $dark-primary;
darksecondary: $dark-secondary;
}

@ -10,7 +10,7 @@
position: absolute;
width: 50%;
background-color: white;
color: #5c34a2;
color: black;
text-align: center;
border-radius: 6px;
left: 25%;
@ -22,7 +22,7 @@
margin-bottom: 15px;
opacity: 0;
transition: opacity 0.5s;
@include media-breakpoint-down(sm) {
@include media-breakpoint-down(lg) {
left: 60%;
}
}
@ -60,9 +60,9 @@
margin-bottom: 15px;
opacity: 0;
transition: opacity 0.5s;
@include media-breakpoint-down(sm) {
padding: 9px 10px;
@include media-breakpoint-down(lg) {
bottom: 100%;
padding: 9px 10px;
}
}

@ -24,7 +24,6 @@ $dashboard-banner-chart-axis-font-color: $dashboard-stats-item-value-color !defa
height: auto;
}
}
.dashboard-banner {
display: flex;
justify-content: space-between;
@ -34,7 +33,6 @@ $dashboard-banner-chart-axis-font-color: $dashboard-stats-item-value-color !defa
flex-direction: column;
}
}
.dashboard-banner-network-graph {
flex-grow: 1;
padding: 15px 0 0 0;
@ -44,7 +42,6 @@ $dashboard-banner-chart-axis-font-color: $dashboard-stats-item-value-color !defa
padding-top: 20px;
}
}
.dashboard-banner-chart {
flex-grow: 1;
margin: 0 0 35px 0;
@ -62,7 +59,6 @@ $dashboard-banner-chart-axis-font-color: $dashboard-stats-item-value-color !defa
width: 100%;
}
}
.dashboard-banner-chart-legend {
display: flex;
/* grid-template-columns: 1fr 1fr; */
@ -121,7 +117,6 @@ $dashboard-banner-chart-axis-font-color: $dashboard-stats-item-value-color !defa
line-height: 1.2;
}
}
.dashboard-banner-network-plain-container {
align-items: center;
align-self: flex-end;
@ -169,7 +164,6 @@ $dashboard-banner-chart-axis-font-color: $dashboard-stats-item-value-color !defa
}
}
}
.dashboard-banner-network-stats {
column-gap: 25px;
display: grid;
@ -198,4 +192,4 @@ $dashboard-banner-chart-axis-font-color: $dashboard-stats-item-value-color !defa
font-size: 0.9rem;
}
}
}
}

@ -1,10 +0,0 @@
/* ERC721 image block */
.erc721-image {
display: flex;
justify-content: center;
}
.erc721-image img {
height: 80px;
}
/* ERC721 image block end */

@ -1,46 +1,53 @@
.transaction-bottom-panel {
display: flex;
flex-direction: column;
@media (min-width: 768px) {
flex-direction: row;
justify-content: space-between;
align-items: flex-end;
}
display: flex;
flex-direction: column;
@media (min-width: 768px) {
flex-direction: row;
justify-content: space-between;
align-items: flex-end;
}
}
.transaction-bottom-panel {
display: flex;
flex-direction: column;
@media (min-width: 768px) {
flex-direction: row;
justify-content: space-between;
align-items: flex-end;
}
display: flex;
flex-direction: column;
@media (min-width: 768px) {
flex-direction: row;
justify-content: space-between;
align-items: flex-end;
}
}
.download-all-transactions {
text-align: center;
color: #a3a9b5;
font-size: 13px;
margin-top: 10px;
@media (min-width: 768px) {
margin-top: 30px;
}
.download-all-transactions-link {
display: inline-flex;
align-items: center;
text-decoration: none;
svg {
position: relative;
margin-left: 2px;
top: -3px;
left: 3px;
path {
fill: $primary;
}
}
&:hover {
text-decoration: underline;
}
}
text-align: center;
color: #a3a9b5;
font-size: 13px;
margin-top: 10px;
@media (min-width: 768px) {
margin-top: 30px;
}
.download-all-transactions-link {
display: inline-flex;
align-items: center;
text-decoration: none;
svg {
position: relative;
margin-left: 2px;
top: -3px;
left: 3px;
path {
fill: $primary;
}
}
&:hover {
text-decoration: underline;
}
}
}
.block-detail-number {
width: 25%;
@include media-breakpoint-down(sm) {
width: 60%;
}
}

@ -4,50 +4,35 @@
<!-- Block Details -->
<div class="card card-mr-50-md">
<div class="card-body">
<h1 class="card-title" data-test="detail_type" >
<h1 class="card-title" data-test="detail_type">
<%= gettext("%{block_type} Details", block_type: block_type(@block)) %>
</h1>
<!-- Block Height -->
<h3 data-test="block_detail_number" style="width: 25%;" data-toggle="tooltip" data-placement="top" title="" data-original-title="The block number in which transactions were recorded.">
<%= if block_type(@block) == "Block" do %>
<!-- Block Height -->
<h3 class="block-detail-number" data-test="block_detail_number" data-toggle="tooltip" data-placement="top" title="" data-original-title="The block number in which transactions were recorded.">
<%= if block_type(@block) == "Block" do %>
<%= gettext("Block Height: %{height}", height: @block.number) %> <%= if @block.number == 0, do: "- " <> gettext("Genesis Block")%>
<% else %>
<%= gettext("%{block_type} Height:", block_type: block_type(@block)) %>
<%= link(@block, to: block_path(BlockScoutWeb.Endpoint, :show, @block.number)) %>
<% end %>
<% end %>
</h3>
<div class="d-flex justify-content-start text-muted block-details-row">
<!-- # of Transactions -->
<span class="mr-4 block-detail-el"> <%= gettext "%{count} Transactions", count: @block_transaction_count %> </span>
<%= if @block.size do %>
<!-- Block Size -->
<span class="mr-4 block-detail-el"> <%= Cldr.Unit.new(:byte, @block.size) |> cldr_unit_to_string!() %> </span>
<% end %>
<!-- Block Age -->
<span class="mr-4 block-detail-el" data-from-now="<%= @block.timestamp %>"></span>
</div>
<hr>
<!-- Block details description list -->
<!-- Block Hash -->
<dl class="row">
<dt class="col-sm-3 text-muted"><%= gettext "Hash" %></dt>
<dl class="row">
<dt class="col-sm-3 text-muted"><%= gettext "Hash" %></dt>
<dd class="col-sm-9"><a class="transaction__link" data-toggle="tooltip" data-placement="top" title="" data-original-title="The SHA256 hash of the block."><%= to_string(@block.hash) %></a></dd>
</dl>
<%= unless @block.number == 0 do %>
<!-- Parent Hash -->
@ -95,6 +80,9 @@
<%= link(
gettext("Position %{index}", index: index),
class: "transaction__link",
"data-toggle": "tooltip",
"data-placement": "top" ,
"data-original-title": "Index position(s) of referenced stale blocks." ,
"data-test": "uncle_link",
"data-uncle-hash": to_string(relation.uncle_hash),
to: block_path(@conn, :show, relation.uncle_hash)
@ -103,14 +91,13 @@
</dd>
</dl>
<% end %>
<!-- Otherwise it will be displayed in its own block -->
<%= if show_reward?(@block.rewards) do %>
<dl class="row" >
<dl class="row">
<dt class="col-sm-3 text-muted"><%= gettext "Gas Used" %></dt>
<dd class="col-sm-9">
<span><%= @block.gas_used |> BlockScoutWeb.Cldr.Number.to_string! %></span>
<span class="text-muted" data-toggle="tooltip" data-placement="top" title="" data-original-title="Total gas used by all transactions in this block (% used / limit).">(<%= (Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit)) |> BlockScoutWeb.Cldr.Number.to_string!(format: "#.#%") %>)</span>
<span data-toggle="tooltip" data-placement="top" title="" data-original-title="Total gas used by all transactions in this block (limit)."><%= @block.gas_used |> BlockScoutWeb.Cldr.Number.to_string! %></span>
<span class="text-muted" data-toggle="tooltip" data-placement="top" title="" data-original-title="Total gas used by all transactions in this block (% used).">(<%= (Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit)) |> BlockScoutWeb.Cldr.Number.to_string!(format: "#.#%") %>)</span>
</dt>
</dl>
<dl class="row mb-0">
@ -153,8 +140,8 @@
<%= if show_reward?(@block.rewards) do %>
<h2 class="card-title balance-card-title"><%= gettext "Block Rewards" %></h2>
<div class="text-right tooltipCustom">
<span class="tooltiptextTopR"> Amount of distributed reward. Miners receive a static block reward + Tx fees + uncle fees. </span>
<div class="text-right" style="margin-left: 50%;" data-toggle="tooltip" data-placement="top" title="" data-original-title="Amount of distributed reward. Miners receive a static block reward + Tx fees + uncle fees.">
<%= for block_reward <- @block.rewards do %>
<p class="address-current-balance "><%= block_reward_text(block_reward) %> <span class="text-muted"><%= format_wei_value(block_reward.reward, :ether) %></span></p>

@ -71,7 +71,7 @@
<%= if total_supply?(@token) do %>
<div class="card-section col-md-12 col-lg-4 pl-0-md">
<div class="card card-background-1">
<div class="card-body">
<div class="card-body">
<h2 class="card-title balance-card-title"><%= gettext "Total Supply" %></h2>
<div class="text-right">
<h3 class="text-uppercase">

@ -23,10 +23,4 @@
<%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %>
</div>
</div>
</section>

@ -23,7 +23,7 @@ msgid "%{block_type} Details"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:19
#: lib/block_scout_web/templates/block/overview.html.eex:15
msgid "%{block_type} Height:"
msgstr ""
@ -33,7 +33,7 @@ msgid "%{block_type}s"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:27
#: lib/block_scout_web/templates/block/overview.html.eex:21
#: lib/block_scout_web/templates/chain/_block.html.eex:11
msgid "%{count} Transactions"
msgstr ""
@ -152,7 +152,7 @@ msgid "Block Confirmations"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:17
#: lib/block_scout_web/templates/block/overview.html.eex:13
msgid "Block Height: %{height}"
msgstr ""
@ -349,7 +349,7 @@ msgid "Details"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:70
#: lib/block_scout_web/templates/block/overview.html.eex:55
msgid "Difficulty"
msgstr ""
@ -422,15 +422,15 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/_tile.html.eex:56
#: lib/block_scout_web/templates/block/overview.html.eex:117
#: lib/block_scout_web/templates/block/overview.html.eex:171
#: lib/block_scout_web/templates/block/overview.html.eex:104
#: lib/block_scout_web/templates/block/overview.html.eex:158
msgid "Gas Limit"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/_tile.html.eex:61
#: lib/block_scout_web/templates/block/overview.html.eex:110
#: lib/block_scout_web/templates/block/overview.html.eex:165
#: lib/block_scout_web/templates/block/overview.html.eex:97
#: lib/block_scout_web/templates/block/overview.html.eex:152
msgid "Gas Used"
msgstr ""
@ -446,7 +446,7 @@ msgid "Gwei"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:45
#: lib/block_scout_web/templates/block/overview.html.eex:33
msgid "Hash"
msgstr ""
@ -524,7 +524,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/_tile.html.eex:38
#: lib/block_scout_web/templates/block/overview.html.eex:133
#: lib/block_scout_web/templates/block/overview.html.eex:120
#: lib/block_scout_web/templates/chain/_block.html.eex:15
msgid "Miner"
msgstr ""
@ -574,7 +574,7 @@ msgid "No"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:85
#: lib/block_scout_web/templates/block/overview.html.eex:70
#: lib/block_scout_web/templates/transaction/overview.html.eex:79
msgid "Nonce"
msgstr ""
@ -608,7 +608,7 @@ msgid "Parameters"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:55
#: lib/block_scout_web/templates/block/overview.html.eex:40
msgid "Parent Hash"
msgstr ""
@ -625,7 +625,7 @@ msgid "Pending Transactions"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:96
#: lib/block_scout_web/templates/block/overview.html.eex:81
msgid "Position %{index}"
msgstr ""
@ -838,7 +838,7 @@ msgid "Top Accounts - %{subnetwork} Explorer"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:79
#: lib/block_scout_web/templates/block/overview.html.eex:64
msgid "Total Difficulty"
msgstr ""
@ -901,7 +901,7 @@ msgid "Twitter"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:92
#: lib/block_scout_web/templates/block/overview.html.eex:77
#: lib/block_scout_web/templates/layout/_topnav.html.eex:38
msgid "Uncles"
msgstr ""
@ -1274,7 +1274,7 @@ msgid "Validator Info"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:155
#: lib/block_scout_web/templates/block/overview.html.eex:142
msgid "Block Rewards"
msgstr ""
@ -1386,7 +1386,7 @@ msgid "Copy Source Code"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:17
#: lib/block_scout_web/templates/block/overview.html.eex:13
msgid "Genesis Block"
msgstr ""

@ -23,7 +23,7 @@ msgid "%{block_type} Details"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:19
#: lib/block_scout_web/templates/block/overview.html.eex:15
msgid "%{block_type} Height:"
msgstr ""
@ -33,7 +33,7 @@ msgid "%{block_type}s"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:27
#: lib/block_scout_web/templates/block/overview.html.eex:21
#: lib/block_scout_web/templates/chain/_block.html.eex:11
msgid "%{count} Transactions"
msgstr ""
@ -152,7 +152,7 @@ msgid "Block Confirmations"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:17
#: lib/block_scout_web/templates/block/overview.html.eex:13
msgid "Block Height: %{height}"
msgstr ""
@ -349,7 +349,7 @@ msgid "Details"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:70
#: lib/block_scout_web/templates/block/overview.html.eex:55
msgid "Difficulty"
msgstr ""
@ -422,15 +422,15 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/_tile.html.eex:56
#: lib/block_scout_web/templates/block/overview.html.eex:117
#: lib/block_scout_web/templates/block/overview.html.eex:171
#: lib/block_scout_web/templates/block/overview.html.eex:104
#: lib/block_scout_web/templates/block/overview.html.eex:158
msgid "Gas Limit"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/_tile.html.eex:61
#: lib/block_scout_web/templates/block/overview.html.eex:110
#: lib/block_scout_web/templates/block/overview.html.eex:165
#: lib/block_scout_web/templates/block/overview.html.eex:97
#: lib/block_scout_web/templates/block/overview.html.eex:152
msgid "Gas Used"
msgstr ""
@ -446,7 +446,7 @@ msgid "Gwei"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:45
#: lib/block_scout_web/templates/block/overview.html.eex:33
msgid "Hash"
msgstr ""
@ -524,7 +524,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/_tile.html.eex:38
#: lib/block_scout_web/templates/block/overview.html.eex:133
#: lib/block_scout_web/templates/block/overview.html.eex:120
#: lib/block_scout_web/templates/chain/_block.html.eex:15
msgid "Miner"
msgstr ""
@ -574,7 +574,7 @@ msgid "No"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:85
#: lib/block_scout_web/templates/block/overview.html.eex:70
#: lib/block_scout_web/templates/transaction/overview.html.eex:79
msgid "Nonce"
msgstr ""
@ -608,7 +608,7 @@ msgid "Parameters"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:55
#: lib/block_scout_web/templates/block/overview.html.eex:40
msgid "Parent Hash"
msgstr ""
@ -625,7 +625,7 @@ msgid "Pending Transactions"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:96
#: lib/block_scout_web/templates/block/overview.html.eex:81
msgid "Position %{index}"
msgstr ""
@ -838,7 +838,7 @@ msgid "Top Accounts - %{subnetwork} Explorer"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:79
#: lib/block_scout_web/templates/block/overview.html.eex:64
msgid "Total Difficulty"
msgstr ""
@ -901,7 +901,7 @@ msgid "Twitter"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:92
#: lib/block_scout_web/templates/block/overview.html.eex:77
#: lib/block_scout_web/templates/layout/_topnav.html.eex:38
msgid "Uncles"
msgstr ""
@ -1275,7 +1275,7 @@ msgid "Validator Info"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:155
#: lib/block_scout_web/templates/block/overview.html.eex:142
msgid "Block Rewards"
msgstr ""
@ -1387,7 +1387,7 @@ msgid "Copy Source Code"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:17
#: lib/block_scout_web/templates/block/overview.html.eex:13
msgid "Genesis Block"
msgstr ""

Loading…
Cancel
Save