Skip to content

Commit 35bd806

Browse files
committed
fix all elixir warnings
1 parent 4e8ad9d commit 35bd806

File tree

14 files changed

+20
-24
lines changed

14 files changed

+20
-24
lines changed
138 KB
Binary file not shown.

config/config.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ config :listudy, :pow,
4747
cache_store_backend: Pow.Store.Backend.MnesiaCache,
4848
messages_backend: ListudyWeb.Pow.Messages
4949

50-
config :mnesia, dir: 'priv/mnesia'
50+
config :mnesia, dir: ~c"priv/mnesia"
5151

5252
config :gettext, :default_locale, "en"
5353

lib/listudy/users/user.ex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ defmodule Listudy.Users.User do
2828
end
2929

3030
def admin_changeset(user_or_changeset, attrs) do
31-
import Ecto.Changeset
32-
3331
user_or_changeset
3432
|> Ecto.Changeset.cast(attrs, [:username, :email])
3533
end

lib/listudy_web/controllers/page_controller.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ defmodule ListudyWeb.PageController do
33
alias Listudy.Books
44
alias Listudy.Content
55

6-
@languages Application.get_env(:listudy, :languages)[:translations]
6+
@languages Application.compile_env(:listudy, [:languages, :translations])
77
@pages [
88
"privacy",
99
"terms-of-service",

lib/listudy_web/plugs/locale.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
defmodule ListudyWeb.Plugs.Locale do
22
import Plug.Conn
33

4-
@locales Application.get_env(:listudy, :languages)[:translations]
5-
@default Application.get_env(:listudy, :languages)[:default]
4+
@locales Application.compile_env(:listudy, [:languages, :translations])
5+
@default Application.compile_env(:listudy, [:languages, :default])
66

77
def init(default), do: default
88

lib/listudy_web/router.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ defmodule ListudyWeb.Router do
5555
post "/blog", PostController, :create
5656
put "/blog/:id", PostController, :update
5757
delete "/blog/:id", PostController, :delete
58-
get "/", PageController, :index
5958

6059
get "/update-email/:username", UserAdministrationController, :email
6160
put "/update-email/:username", UserAdministrationController, :update_email

lib/listudy_web/templates/iframe/custom_tactic.html.eex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
<input type="text" id="last_move" value="">
4040
</form>
4141
<script <%= raw ListudyWeb.Plugs.CSP.put_nonce(@conn) %>>
42-
<%# CAREFUL! the hash is user supplies and its values can only be used in %>
43-
<%# save javascript functions! %>
42+
<%!-- CAREFUL! the hash is user supplies and its values can only be used in --%>
43+
<%!-- save javascript functions! --%>
4444
function clean_input(i) {
4545
if (i == undefined) {
4646
return "";

lib/listudy_web/templates/layout/_head.html.eex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535

3636
<script defer type="text/javascript" src="<%= Routes.static_path(@conn, "/js/app.js") %>"></script>
3737
<script <%= raw ListudyWeb.Plugs.CSP.put_nonce(@conn) %>>
38-
<%# This is here to stop the default white theme to flash on load %>
39-
<%# In the defered app.js script it would only switch after the page is loaded %>
38+
<%!-- This is here to stop the default white theme to flash on load --%>
39+
<%!-- In the defered app.js script it would only switch after the page is loaded --%>
4040
let theme = localStorage.getItem("data-theme") || "light";
4141
localStorage.setItem("data-theme", theme);
4242
document.documentElement.setAttribute('data-theme', theme);
@@ -56,12 +56,12 @@
5656

5757
</script>
5858

59-
<%# Favicon start, generated with https://realfavicongenerator.net/%>
59+
<%!-- Favicon start, generated with https://realfavicongenerator.net/ --%>
6060
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
6161
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
6262
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
6363
<link rel="manifest" href="/site.webmanifest">
6464
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
6565
<meta name="msapplication-TileColor" content="#2b5797">
6666
<meta name="theme-color" content="#ffffff">
67-
<%# Favicon end %>
67+
<%!-- Favicon end --%>

lib/listudy_web/templates/post/show.html.eex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<% end %>
77
</p>
88

9-
<%# required by PgnViewerJS, has to be set before the include of pgnv.js %>
9+
<%!-- required by PgnViewerJS, has to be set before the include of pgnv.js --%>
1010
<script <%= raw ListudyWeb.Plugs.CSP.put_nonce(@conn) %>>__globalCustomDomain = '/js/pgnviewer/';</script>
1111

1212
<%= raw ListudyWeb.EexMarkdown.as_html(@post.body, @conn)%>

lib/listudy_web/templates/study/show.html.eex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<%= if !@study.favorites do %>
3434
<%= link dgettext("study", "Favorite study"), to: Routes.study_path(@conn, :favorite_study, @study.slug), method: :post, class: "icon", "data-icon": "#" %>
3535
<% else %>
36-
<%= link dgettext("study" ,"Unfavorite study"), to: Routes.study_path(@conn, :unfavorite_study, @study.slug), method: :post, class: "icon", "data-icon": '"' %>
36+
<%= link dgettext("study" ,"Unfavorite study"), to: Routes.study_path(@conn, :unfavorite_study, @study.slug), method: :post, class: "icon", "data-icon": "\"" %>
3737
<% end %>
3838
</div>
3939
<div class="option_item">

0 commit comments

Comments
 (0)