Add capability to use custom footer HTML

This commit is contained in:
Mikko Ahlroth 2015-11-30 22:57:49 +02:00
parent 6f9915d34f
commit 9f17f21d6d
3 changed files with 33 additions and 19 deletions

View file

@ -50,6 +50,10 @@ config :mebe_web,
</script> </script>
""", """,
# Custom HTML for the footer of the site
# Set to nil to use default footer
custom_footer_html: nil,
# Custom templates # Custom templates
# Set to true for any view you want to use custom templates for. # Set to true for any view you want to use custom templates for.
# If using custom templates for a view, create a folder web/templates/custom/<viewname> # If using custom templates for a view, create a folder web/templates/custom/<viewname>

View file

@ -36,6 +36,10 @@
<div class="container"> <div class="container">
<%= @inner %> <%= @inner %>
<% footer = custom_footer_html %>
<%= if footer != nil do %>
<%= raw footer %>
<%= else %>
<div class="footer row"> <div class="footer row">
<div class="col-xs-12 col-sm-4"> <div class="col-xs-12 col-sm-4">
<p> <p>
@ -44,7 +48,7 @@
</div> </div>
<div class="col-xs-12 col-sm-4"> <div class="col-xs-12 col-sm-4">
<p> <p>
<a href="<%= page_path @conn, :page, "mebe" %>"> <a href="https://blog.nytsoi.net/mebe">
Powered by Elixir + Phoenix + Mebe Powered by Elixir + Phoenix + Mebe
</a> </a>
</p> </p>
@ -56,6 +60,7 @@
</p> </p>
</div> </div>
</div> </div>
<% end %>
</div> <!-- /container --> </div> <!-- /container -->
<script src="<%= static_path(@conn, "/js/app.js") %>"></script> <script src="<%= static_path(@conn, "/js/app.js") %>"></script>

View file

@ -24,6 +24,11 @@ defmodule MebeWeb.LayoutView do
""" """
def extra_html(), do: Utils.get_conf :extra_html def extra_html(), do: Utils.get_conf :extra_html
@doc """
Return the custom footer HTML defined in the config.
"""
def custom_footer_html(), do: Utils.get_conf :custom_footer_html
@doc """ @doc """
Calculate time taken for request so far. Calculate time taken for request so far.
""" """