fix compilation error
This commit is contained in:
parent
a146455416
commit
3b89797dea
|
@ -5,6 +5,8 @@ defmodule Forum.Auth do
|
|||
plug(Tesla.Middleware.FormUrlencoded)
|
||||
|
||||
def authenticate(user, pw) do
|
||||
post("/", %{user: user, pw: pw})
|
||||
{:ok , response} = post("/", %{user: user, pw: pw})
|
||||
IO.inspect(response)
|
||||
Jason.decode!(response.body)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -49,7 +49,7 @@ defmodule Forum.Util do
|
|||
def pp_time(time) do
|
||||
time
|
||||
|> Timex.local()
|
||||
|> Timex.Format.DateTime.Formatter.format!("%a %b %e, %Y ~ %I:%M %P", :strftime)
|
||||
|> Timex.Format.DateTime.Formatter.format!("%b %e, %Y ~ %I:%M %P", :strftime)
|
||||
|> String.downcase()
|
||||
end
|
||||
|
||||
|
|
|
@ -10,9 +10,7 @@ defmodule ForumWeb.LoginController do
|
|||
end
|
||||
|
||||
def authenticate(conn, %{"username" => username, "password" => pw}) do
|
||||
{:ok, response} = Auth.authenticate(username, pw)
|
||||
|
||||
resp = Jason.decode!(response.body)
|
||||
resp = Auth.authenticate(username, pw)
|
||||
|
||||
case resp["authenticated"] do
|
||||
false ->
|
||||
|
|
|
@ -24,7 +24,6 @@ defmodule ForumWeb.ThreadController do
|
|||
|> Repo.paginate(params)
|
||||
|
||||
{:ok, response} = Tesla.get("https://tilde.team/~ben/api/")
|
||||
tagline = response.body
|
||||
|
||||
render(
|
||||
conn,
|
||||
|
@ -32,7 +31,7 @@ defmodule ForumWeb.ThreadController do
|
|||
stickies: stickies,
|
||||
threads: threads,
|
||||
kerosene: kerosene,
|
||||
tagline: tagline
|
||||
tagline: response.body
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
<footer class="navbar-default navbar-fixed-bottom">
|
||||
<div class="container-fluid">
|
||||
<div class="text-center">
|
||||
<span><a href="https://tilde.team/">tilde.team</a> ~ <a href="https://github.com/tilde-team/forum">source on github</a></span>
|
||||
<span><a href="https://tilde.team/">tilde.team</a> ~ <a href="https://git.tilde.team/meta/forum">forum source</a></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
<div class="panel-footer">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-8">
|
||||
by: <a href="<%= user_path(@conn, :show, @thread.user.name) %>"><em>~<%= @thread.user.name %></em></a> // <small>created <%= @thread.inserted_at |> Util.pp_time %></small>
|
||||
by: <a href="<%= user_path(@conn, :show, @thread.user.name) %>"><em>~<%= @thread.user.name %></em></a>
|
||||
// <small>created <%= @thread.inserted_at |> Util.pp_time %></small>
|
||||
<!-- // <small>latest post by <%#= @thread.latest_post.user.name %> at <%#= @thread.latest_post.inserted_at |> Util.pp_time</small> %>-->
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-4 text-right">
|
||||
|
|
Reference in New Issue