Skip to content

Commit 26b6e60

Browse files
authored
option to hide admin footer
#252 The :admin_footer can be specified in app config
2 parents fc54f1c + 7581c45 commit 26b6e60

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Diff for: lib/kaffy/utils.ex

+8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ defmodule Kaffy.Utils do
99
env(:admin_title, "Kaffy")
1010
end
1111

12+
@doc """
13+
Returns the :admin_footer config if present, otherwise returns default copyright.
14+
"""
15+
@spec footer() :: String.t() | {:safe, String.t()}
16+
def footer() do
17+
env(:admin_footer, "Copyright © 2022 Kaffy. All rights reserved.")
18+
end
19+
1220
@doc """
1321
Returns the static path to the asset.
1422
"""

Diff for: lib/kaffy_web/templates/layout/app.html.eex

+3-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@
155155

156156
<footer class="footer">
157157
<div class="d-sm-flex justify-content-center justify-content-sm-between">
158-
<span class="text-muted text-center text-sm-left d-block d-sm-inline-block">Copyright © 2022 Kaffy. All rights reserved.</span>
158+
<%= if copyright = Kaffy.Utils.footer() do %>
159+
<span class="text-muted text-center text-sm-left d-block d-sm-inline-block"><%= copyright %></span>
160+
<% end %>
159161
</div>
160162
</footer>
161163

0 commit comments

Comments
 (0)