Skip to content

Commit

Permalink
change default day
Browse files Browse the repository at this point in the history
  • Loading branch information
suazi committed Jun 23, 2019
1 parent 23f7321 commit 81cbc47
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
22 changes: 11 additions & 11 deletions lib/barcamp/people.ex
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,15 @@ defmodule Barcamp.People do
end
end

def convert_photos do
Speaker
|> Repo.all()
|> Enum.map(fn speaker ->
hash = 32 |> :crypto.strong_rand_bytes() |> Base.url_encode64() |> binary_part(0, 32)
base = ~r/base64,(.*?)$/ |> Regex.run(speaker.photo) |> List.last()
File.write!(Path.expand("priv/static/images/#{hash}"), Base.decode64!(base))

update_speaker(speaker, %{photo: hash})
end)
end
# def convert_photos do
# Speaker
# |> Repo.all()
# |> Enum.map(fn speaker ->
# hash = 32 |> :crypto.strong_rand_bytes() |> Base.url_encode64() |> binary_part(0, 32)
# base = ~r/base64,(.*?)$/ |> Regex.run(speaker.photo) |> List.last()
# File.write!(Path.expand("priv/static/images/#{hash}"), Base.decode64!(base))

# update_speaker(speaker, %{photo: hash})
# end)
# end
end
2 changes: 1 addition & 1 deletion lib/barcamp_web/controllers/page_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defmodule BarcampWeb.PageController do
if day = conn.params["day"] do
Enum.filter(Schedule.list_talks(), &(&1.day == String.to_integer(day)))
else
Enum.filter(Schedule.list_talks(), &(&1.day == 22))
Enum.filter(Schedule.list_talks(), &(&1.day == 23))
end
|> Enum.sort(&(Time.compare(&1.time_from, &2.time_from) == :lt))

Expand Down
4 changes: 2 additions & 2 deletions lib/barcamp_web/templates/page/index.html.eex
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<h2 class="mb-0 ml-sm-1 text-uppercase font-weight-bold" style="<%= "#{if BarcampWeb.LayoutView.current_locale?(@conn, "am"), do: "font-size: 20px;"}" %>"><%= gettext("Timetable") %></h2>
<div class="timetable-buttons d-flex align-items-center text-uppercase font-weight-bold">
<div><%= gettext("Jun") %></div>
<a href="?day=22#timetable" class="<%= if @conn.params["day"] != "23", do: "current" %>">22</a>
<a href="?day=23#timetable" class="<%= if @conn.params["day"] == "23", do: "current" %>">23</a>
<a href="?day=22#timetable" class="<%= if @conn.params["day"] == "22", do: "current" %>">22</a>
<a href="?day=23#timetable" class="<%= if @conn.params["day"] != "22", do: "current" %>">23</a>
<div class="border-left-0">10:00-18:00</div>
</div>
</div>
Expand Down

0 comments on commit 81cbc47

Please sign in to comment.