Current section
Files
Jump to
Current section
Files
priv/templates/mandarin.install/layout.html.eex
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<%%= csrf_meta_tag() %>
<title><%%= dgettext("mandarin.<%= install.context_underscore %>", "<%= install.web_module %>") %></title>
<%# Tell the browser to be responsive to screen width %>
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.0/css/bootstrap.min.css">
<%# Font Awesome %>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<%# Google Font %>
<link rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
</head>
<body class="bg-light">
<%##
The default layout has the following structure:
+-----------------------------------------------+
| Navbar |
+-- Sidebar ----|-------------------------------+
| Link 1 | (maybe empty) flash messages |
| Link 2 |-------------------------------|
| ... | Main content |
|---------------| |
| | |
| | |
+---------------+-------------------------------+
| Footer |
+-----------------------------------------------+
You are of course free to change it as you see fit.
User-visible text should be wrapped in a `dgettext()` call so that it can be easily translated.
Any user-visible text that is *not* wrapped in such a call is a bug that should be reported.
%>
<nav class="navbar navbar-expand-sm navbar-dark bg-dark">
<!-- Links -->
<a class="navbar-brand" href="#"><%= install.web_module %></a>
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="/"><%%= dgettext("mandarin.<%= install.context_underscore %>", "Home") %></a>
</li>
</ul>
</nav>
<div class="container-fluid py-3">
<div class="row">
<%## The to the left %>
<div class="col-sm-2">
<%%= render <%= install.web_module %>.<%= install.layout_view_camel_case %>, "sidebar.html", assigns %>
</div>
<%## A place to display flash messages (e.g. "Object created", "Object deleted") %>
<div class="col-sm-10">
<%%
info = get_flash(@conn, :info)
error = get_flash(@conn, :error)
%>
<%%= if info do %>
<div class="alert alert-info" role="alert"><%%= info %></div>
<%% end %>
<%%= if error do %>
<div class="alert alert-danger" role="alert"><%%= error %></div>
<%% end %>
<%## The main content of the view %>
<div class="card">
<div class="card-body">
<%%= @inner_content %>
</div>
</div>
</div>
</div>
<%## Footer with Copyright information plus some optional links which won't lead anywhere by default %>
<footer class="my-5 pt-5 text-muted text-center text-small">
<p class="mb-1">
<%%= raw(
dgettext("mandarin.<%= install.context_underscore %>", """
<strong>Copyright © <%= DateTime.utc_now() |> Map.fetch!(:year) %> <a href="#"><%= install.web_module %></a>.</strong> All rights reserved.
""")) %>
</p>
<ul class="list-inline">
<%## Make it so that this link leads somewhere or delete it %>
<li class="list-inline-item">
<a href="#"><%%= dgettext("mandarin.<%= install.context_underscore %>", "Privacy") %></a>
</li>
<%## Make it so that this link leads somewhere or delete it %>
<li class="list-inline-item">
<a href="#"><%%= dgettext("mandarin.<%= install.context_underscore %>", "Terms") %></a>
</li>
<%## Make it so that this link leads somewhere or delete it %>
<li class="list-inline-item">
<a href="#"><%%= dgettext("mandarin.<%= install.context_underscore %>", "Support") %></a>
</li>
</ul>
</footer>
</div>
<%%# Your app's Javascrip + Phoenix specific Javascript %>
<script src='<%%= Routes.static_path(@conn, "/js/app.js") %>'></script>
<%%# Forage-specific utilities (loads JQuery by default) %>
<%%# - Imports the necessary javascript for the select widget to work at all %>
<%%= ForageWeb.Assets.forage_select_assets() %>
<%%# - Runs the necessary javascript so that the select widget plays nice with Forage %>
<%%= ForageWeb.Assets.activate_forage_select() %>
</body>
</html>