fix compilation error

This commit is contained in:
Ben Harris 2018-07-11 19:16:13 -04:00
parent a146455416
commit 3b89797dea
Signed by: ben
GPG Key ID: 4E0AF802FFF7960C
6 changed files with 10 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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 ->

View File

@ -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

View File

@ -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>

View File

@ -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">