Packages

Csv2SqlDashboard is a blazing fast fully automated tool to load huge CSV files into a RDBMS.

Current section

Files

Jump to
csv2sqldashboard lib dashboard_web live helpers.ex
Raw

lib/dashboard_web/live/helpers.ex

defmodule DashboardWeb.LiveHelpers do
# import Phoenix.LiveView
# import Phoenix.LiveView.Helpers
# alias Phoenix.LiveView.JS
def get_nav_item_attrs(%{page: page}, curr_page) when page == curr_page,
do: %{class: "nav-link active", "aria-current": "page"}
def get_nav_item_attrs(_assigns, _curr_page), do: %{class: "nav-link bg-light-grey"}
def get_config_item_attrs(status) when status not in [:working, :imported, :validating],
do: %{"phx-click" => "page-change", "phx-value-page" => "config"}
def get_config_item_attrs(_status), do: %{}
end