diff options
author | Guillermo Ramos | 2023-11-04 11:52:01 +0100 |
---|---|---|
committer | Guillermo Ramos | 2023-11-04 11:52:01 +0100 |
commit | 13e34af4b700127507298a489f25ad8c2fae6a42 (patch) | |
tree | a5a02bc6939a3dd41ea9b1c0b833534ab994b88d /lib | |
parent | a7f60df110052d2d84da2a375fe5dc2cf672066d (diff) | |
download | waev-13e34af4b700127507298a489f25ad8c2fae6a42.tar.gz |
ITV pasada
Diffstat (limited to 'lib')
-rw-r--r-- | lib/waev/application.ex | 1 | ||||
-rw-r--r-- | lib/waev/export.ex | 21 | ||||
-rw-r--r-- | lib/waev_web/templates/layout/app.html.eex | 6 |
3 files changed, 14 insertions, 14 deletions
diff --git a/lib/waev/application.ex b/lib/waev/application.ex index d9d37f2..f2f8e96 100644 --- a/lib/waev/application.ex +++ b/lib/waev/application.ex @@ -8,6 +8,7 @@ defmodule Waev.Application do def start(_type, _args) do # List all child processes to be supervised children = [ + {Phoenix.PubSub, [name: Waev.PubSub, adapter: Phoenix.PubSub.PG2]}, # Start the endpoint when the application starts WaevWeb.Endpoint # Starts a worker by calling: Waev.Worker.start_link(arg) diff --git a/lib/waev/export.ex b/lib/waev/export.ex index 72ed00d..61ddf5a 100644 --- a/lib/waev/export.ex +++ b/lib/waev/export.ex @@ -124,17 +124,16 @@ defmodule Waev.Export do end end) - pagination = - {:ok, - %{ - e - | messages: - e.messages - |> Enum.reverse() - |> Enum.drop((page - 1) * size) - |> Enum.take(size), - pagination: %{page: page, size: size, pages: ceil(Enum.count(e.messages) / size)} - }} + {:ok, + %{ + e + | messages: + e.messages + |> Enum.reverse() + |> Enum.drop((page - 1) * size) + |> Enum.take(size), + pagination: %{page: page, size: size, pages: ceil(Enum.count(e.messages) / size)} + }} false -> :error diff --git a/lib/waev_web/templates/layout/app.html.eex b/lib/waev_web/templates/layout/app.html.eex index 72e0142..bd7804e 100644 --- a/lib/waev_web/templates/layout/app.html.eex +++ b/lib/waev_web/templates/layout/app.html.eex @@ -17,9 +17,9 @@ </section> </header> --> <main role="main" class="container"> - <p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p> - <p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p> - <%= render @view_module, @view_template, assigns %> + <p class="alert alert-info" role="alert"><%= Phoenix.Flash.get(@flash, :info) %></p> + <p class="alert alert-danger" role="alert"><%= Phoenix.Flash.get(@flash, :error) %></p> + <%= @inner_content %> </main> <script type="text/javascript" src="<%= Routes.static_path(@conn, "/js/app.js") %>"></script> </body> |