(add) stakes / validators section base routing and files

pull/1704/head
Gabriel Rodriguez Alsina 6 years ago
parent 8e01d9b9f8
commit 77a66e5a19
  1. 14
      apps/block_scout_web/lib/block_scout_web/controllers/stakes_controller.ex
  2. 7
      apps/block_scout_web/lib/block_scout_web/router.ex
  3. 17
      apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex
  4. 1
      apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_top.html.eex
  5. 8
      apps/block_scout_web/lib/block_scout_web/templates/stakes/index.html.eex
  6. 3
      apps/block_scout_web/lib/block_scout_web/views/stakes_view.ex

@ -0,0 +1,14 @@
defmodule BlockScoutWeb.StakesController do
use BlockScoutWeb, :controller
alias BlockScoutWeb.StakesView
def index(conn, params) do
[]
|> handle_render(conn, params)
end
defp handle_render(full_options, conn, _params) do
render(conn, "index.html")
end
end

@ -71,7 +71,10 @@ defmodule BlockScoutWeb.Router do
resources("/", ChainController, only: [:show], singleton: true, as: :chain)
resources("/market_history_chart", Chain.MarketHistoryChartController, only: [:show], singleton: true)
resources("/market_history_chart", Chain.MarketHistoryChartController,
only: [:show],
singleton: true
)
resources "/blocks", BlockController, only: [:index, :show], param: "hash_or_number" do
resources("/transactions", BlockTransactionController, only: [:index], as: :transaction)
@ -81,6 +84,8 @@ defmodule BlockScoutWeb.Router do
get("/uncles", BlockController, :uncle, as: :uncle)
resources("/stakes", StakesController, only: [:index])
resources("/pending_transactions", PendingTransactionController, only: [:index])
resources("/recent_transactions", RecentTransactionsController, only: [:index])

@ -85,15 +85,20 @@
</a>
<div class="dropdown-menu" aria-labeledby="navbarTransactionsDropdown">
<%= link(
gettext("Item 1"),
gettext("Validators"),
class: "dropdown-item",
to: "/#"
to: stakes_path(@conn, :index)
) %>
<%= link(
gettext("Item 2"),
class: "dropdown-item",
to: "/#"
) %>
gettext("Active Pools"),
class: "dropdown-item",
to: stakes_path(@conn, :index)
) %>
<%= link(
gettext("Inactive Pools"),
class: "dropdown-item",
to: stakes_path(@conn, :index)
) %>
</div>
</li>
<li class="nav-item dropdown">

@ -0,0 +1,8 @@
<%= render BlockScoutWeb.StakesView, "_stakes_top.html" %>
<section class="container">
<div class="card">
<div class="card-body">
card body
</div>
</div>
</section>

@ -0,0 +1,3 @@
defmodule BlockScoutWeb.StakesView do
use BlockScoutWeb, :view
end
Loading…
Cancel
Save