Current section

Files

Jump to
plato lib plato_web components layouts root.html.heex
Raw

lib/plato_web/components/layouts/root.html.heex

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Plato - CMS</title>
<style><%= raw """
:root {
--base-spacing: 3px;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family:
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
Arial, sans-serif;
line-height: 1.6;
color: #333;
background-color: #f5f5f5;
}
.main-nav {
background-color: #2c3e50;
color: white;
padding: 0;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.nav-container {
max-width: 1200px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 20px;
}
.nav-logo {
font-size: 1.5em;
font-weight: bold;
color: white;
text-decoration: none;
padding: 15px 0;
}
.nav-links {
display: flex;
gap: 20px;
}
.nav-link {
color: white;
text-decoration: none;
padding: 15px 10px;
display: block;
transition: background-color 0.3s;
}
.nav-link:hover {
background-color: #34495e;
}
.container {
max-width: 600px;
margin: 50px auto;
padding: 20px;
background-color: white;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
h1 {
color: #2c3e50;
margin-bottom: 30px;
}
.form-group {
margin-bottom: 20px;
}
label {
display: block;
margin-bottom: 5px;
font-weight: bold;
color: #555;
}
input[type="text"] {
width: 100%;
padding: 10px;
font-size: 16px;
border: 1px solid #ccc;
border-radius: 4px;
}
input[type="text"]:focus {
outline: none;
border-color: #4caf50;
}
button {
padding: 10px 20px;
font-size: 16px;
background-color: #4caf50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s;
}
button:hover {
background-color: #45a049;
}
.flash {
padding: 10px;
margin: 10px;
border-radius: 4px;
}
.flash.info {
background-color: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
}
.flash.error {
background-color: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
}
.schemas-list {
margin-top: 40px;
padding-top: 30px;
border-top: 2px solid #e0e0e0;
}
.schemas-list h2 {
color: #2c3e50;
margin-bottom: 20px;
font-size: 1.5em;
}
.schemas-list ul {
list-style: none;
}
.schemas-list li {
padding: 15px;
margin-bottom: 10px;
background-color: #f9f9f9;
border-radius: 4px;
border-left: 4px solid #4caf50;
display: flex;
justify-content: space-between;
align-items: center;
}
.schema-name {
font-weight: bold;
color: #2c3e50;
font-size: 1.1em;
}
.schema-date {
color: #777;
font-size: 0.9em;
}
.empty-state {
color: #999;
font-style: italic;
text-align: center;
padding: 30px;
}
.schema-link {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
text-decoration: none;
color: inherit;
transition: opacity 0.2s;
}
.schema-link:hover {
opacity: 0.8;
}
.schemas-list li:hover {
background-color: #f0f0f0;
}
.schema-detail {
padding: 20px 0;
}
.schema-detail h1 {
margin-bottom: 30px;
color: #2c3e50;
}
.schema-info {
background-color: #f9f9f9;
border-radius: 4px;
padding: 20px;
margin-bottom: 30px;
}
.info-row {
display: flex;
padding: 10px 0;
border-bottom: 1px solid #e0e0e0;
}
.info-row:last-child {
border-bottom: none;
}
.info-row .label {
font-weight: bold;
color: #555;
width: 120px;
}
.info-row .value {
color: #2c3e50;
}
.actions {
display: flex;
gap: 10px;
}
.btn-secondary {
padding: 10px 20px;
font-size: 16px;
background-color: #6c757d;
color: white;
border: none;
border-radius: 4px;
text-decoration: none;
display: inline-block;
cursor: pointer;
transition: background-color 0.3s;
}
.btn-secondary:hover {
background-color: #5a6268;
}
.btn-primary {
padding: 10px 20px;
font-size: 16px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
text-decoration: none;
display: inline-block;
cursor: pointer;
transition: background-color 0.3s;
}
.btn-primary:hover {
background-color: #0056b3;
}
.fields-section {
margin-top: 40px;
padding-top: 30px;
border-top: 2px solid #e0e0e0;
}
.fields-section h2 {
color: #2c3e50;
margin-bottom: 20px;
font-size: 1.5em;
}
.add-field-form {
margin-bottom: 20px;
}
.form-group-inline {
display: flex;
gap: 10px;
}
.form-group-inline input[type="text"] {
flex: 1;
}
.fields-list {
list-style: none;
}
.fields-list li {
padding: 15px;
margin-bottom: 10px;
background-color: #f9f9f9;
border-radius: 4px;
border-left: 4px solid #007bff;
display: flex;
justify-content: space-between;
align-items: center;
}
.field-name {
font-weight: bold;
color: #2c3e50;
font-size: 1.1em;
}
.field-type {
color: #777;
font-size: 0.9em;
background-color: #e9ecef;
padding: 4px 12px;
border-radius: 12px;
}
.field-type.reference {
background-color: #d1ecf1;
color: #0c5460;
font-weight: 500;
}
select {
width: 100%;
padding: 10px;
font-size: 16px;
border: 1px solid #ccc;
border-radius: 4px;
background-color: white;
}
select:focus {
outline: none;
border-color: #4caf50;
}
.reference-icon {
margin-right: 5px;
}
.fields-list a {
color: #007bff;
text-decoration: none;
}
.fields-list a:hover {
text-decoration: underline;
}
.schema-cards {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 20px;
margin-top: 20px;
}
.schema-card {
background-color: white;
border: 2px solid #e0e0e0;
border-radius: 8px;
padding: 20px;
text-decoration: none;
color: inherit;
transition: all 0.3s;
cursor: pointer;
}
.schema-card:hover {
border-color: #4caf50;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
transform: translateY(-2px);
}
.schema-card h3 {
color: #2c3e50;
margin-bottom: 10px;
}
.schema-card p {
color: #777;
font-size: 0.9em;
}
.content-list-section {
margin-top: 40px;
padding-top: 30px;
border-top: 2px solid #e0e0e0;
}
.content-list {
list-style: none;
}
.content-list li {
margin-bottom: 10px;
}
.content-link {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px;
background-color: white;
border-radius: 4px;
border-left: 4px solid #007bff;
text-decoration: none;
color: inherit;
transition: all 0.3s;
}
.content-link:hover {
background-color: #f0f0f0;
transform: translateX(5px);
}
.content-schema {
font-weight: bold;
color: #2c3e50;
font-size: 1.1em;
}
.content-date {
color: #777;
font-size: 0.9em;
}
.content-form {
background-color: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.field-values {
background-color: white;
border-radius: 8px;
margin-top: 20px;
}
.field-values h2 {
margin-bottom: 20px;
color: #2c3e50;
}
.field-value-row {
display: flex;
padding: 15px;
border-bottom: 1px solid #e0e0e0;
gap: 20px;
}
.field-value-row:last-child {
border-bottom: none;
}
.field-label {
font-weight: bold;
color: #555;
min-width: 150px;
}
.field-value {
color: #2c3e50;
flex: 1;
}
.field-value a {
color: #007bff;
text-decoration: none;
}
.field-value a:hover {
text-decoration: underline;
}
.form-group-checkbox {
margin-bottom: 20px;
}
.form-group-checkbox label {
display: flex;
align-items: center;
gap: 10px;
cursor: pointer;
font-weight: normal;
}
.form-group-checkbox input[type="checkbox"] {
width: auto;
cursor: pointer;
}
.badge {
display: inline-block;
padding: 4px 12px;
border-radius: 12px;
font-size: 0.85em;
font-weight: 500;
}
.badge.unique {
background-color: #fff3cd;
color: #856404;
}
.badge.multiple {
background-color: #d1ecf1;
color: #0c5460;
}
.badge-small {
display: inline-block;
padding: 2px 8px;
border-radius: 8px;
font-size: 0.75em;
font-weight: 500;
margin-left: 8px;
}
.badge-small.unique {
background-color: #fff3cd;
color: #856404;
}
.schema-card.disabled {
opacity: 0.6;
cursor: not-allowed;
border-color: #ccc;
}
.schema-card.disabled:hover {
border-color: #ccc;
box-shadow: none;
transform: none;
}
.schema-card.disabled p {
color: #28a745;
font-weight: 500;
}
.fields-list li {
display: flex;
justify-content: space-between;
align-items: center;
}
.field-info {
display: flex;
align-items: center;
gap: 10px;
flex: 1;
}
.btn-delete,
a.btn-delete {
padding: 6px 12px;
font-size: 0.9em;
background-color: #dc3545;
color: white;
border: none;
border-radius: 4px;
text-decoration: none;
cursor: pointer;
transition: background-color 0.3s;
}
.btn-delete:hover {
background-color: #c82333;
}
.delete-confirmation {
max-width: 800px;
margin: 0 auto;
}
.warning-box,
.info-box,
.danger-box {
padding: 20px;
border-radius: 8px;
margin: 20px 0;
}
.warning-box {
background-color: #fff3cd;
border: 2px solid #ffc107;
}
.warning-box h2 {
color: #856404;
margin-bottom: 10px;
}
.info-box {
background-color: #d1ecf1;
border: 2px solid #17a2b8;
}
.info-box h3 {
color: #0c5460;
margin-bottom: 10px;
}
.danger-box {
background-color: #f8d7da;
border: 2px solid #dc3545;
}
.danger-box h3 {
color: #721c24;
margin-bottom: 10px;
}
.affected-content-list {
list-style: none;
margin-top: 15px;
}
.affected-content-list li {
padding: 10px;
background-color: white;
margin-bottom: 8px;
border-radius: 4px;
display: flex;
flex-direction: column;
gap: 5px;
}
.affected-content-list a {
color: #007bff;
text-decoration: none;
font-weight: 500;
}
.affected-content-list a:hover {
text-decoration: underline;
}
.field-value-preview {
color: #666;
font-size: 0.9em;
}
.confirmation-actions {
display: flex;
gap: 10px;
margin-top: 30px;
}
.btn-danger {
padding: 12px 24px;
font-size: 16px;
background-color: #dc3545;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s;
font-weight: 500;
}
.btn-danger:hover {
background-color: #c82333;
}
""" %></style>
</head>
<body>
<nav class="main-nav">
<div class="nav-container">
<a href={@base_path} class="nav-logo">Plato</a>
<div class="nav-links">
<a href={@base_path} class="nav-link">Schemas</a>
<a href={"#{@base_path}/content"} class="nav-link">Content</a>
</div>
</div>
</nav>
<%= if Phoenix.Flash.get(@flash, :info) do %>
<div class="flash info">
<%= Phoenix.Flash.get(@flash, :info) %>
</div>
<% end %>
<%= if Phoenix.Flash.get(@flash, :error) do %>
<div class="flash error">
<%= Phoenix.Flash.get(@flash, :error) %>
</div>
<% end %>
<%= @inner_content %>
</body>
</html>