redirect to newly created/edit page directly, start cms dashboard layout

This commit is contained in:
Alex 2026-06-10 14:27:30 -07:00
parent 5e99686b5c
commit 41c985fcab
10 changed files with 54 additions and 10 deletions

View file

@ -1,5 +1,5 @@
import './styles/brain.css';
//import './stimulus_bootstrap.js';
import './stimulus_bootstrap.js';
const init = () => {
menu();

View file

@ -1 +1 @@
.page{max-width:800px;width:100%;margin:0 auto}.page h2{margin:0}.page .row{display:block;padding:1rem 0}.page .row label{display:block}.page .row input{height:30px;width:300px}.page .row #post_published{width:30px;height:30px}.page .row #post_save{width:100px;height:30px;background-color:green;border:none;color:#fff}#brain-wrapper header .level-1{display:flex;justify-content:center;align-items:flex-start;position:relative;list-style-type:none}#brain-wrapper header .level-1--item{padding:1rem 2rem}#brain-wrapper header .level-1 .level-2{display:none;margin:0;padding:0}#brain-wrapper header .level-1 .level-2.open{display:block;position:absolute}#brain-wrapper header .level-1 .level-2--item{padding:1rem 0}body{background-color:#d3d3d3}
.actions{padding-bottom:1rem}.actions .list{display:flex;gap:2rem;list-style:none;margin:0;padding:0}.page{max-width:800px;width:100%;margin:0 auto}.page h2{margin:0}.page .row{display:block;padding:1rem 0}.page .row label{display:block}.page .row input{height:30px;width:300px}.page .row #post_published{width:30px;height:30px}.page .row #post_save{width:100px;height:30px;background-color:green;border:none;color:#fff}#brain-wrapper header .level-1{display:flex;justify-content:center;align-items:flex-start;position:relative;list-style-type:none}#brain-wrapper header .level-1--item{padding:1rem 2rem}#brain-wrapper header .level-1 .level-2{display:none;margin:0;padding:0}#brain-wrapper header .level-1 .level-2.open{display:block;position:absolute}#brain-wrapper header .level-1 .level-2--item{padding:1rem 0}#brain-wrapper a{color:#171a21}body{background-color:#d3d3d3}

View file

@ -1,3 +1,4 @@
@use './brain/actions';
@use './brain/form';
@use './brain/layout';

View file

@ -0,0 +1,11 @@
.actions {
padding-bottom: 1rem;
.list {
display: flex;
gap: 2rem;
list-style: none;
margin: 0;
padding: 0;
}
}

View file

@ -1,3 +1,5 @@
@use '../shared/colors' as colors;
#brain-wrapper {
header {
.level-1 {
@ -30,4 +32,8 @@
}
}
}
a {
color: colors.$inkBlack;
}
}

View file

@ -51,7 +51,7 @@ final class BrainPageController extends AbstractController
$entityManager->flush();
return $this->redirectToRoute('brain_page_list');
return $this->redirectToRoute('front_end_page', ['url' => $data->getUrl()]);
}
return $this->render('brain/page/create.html.twig', [
@ -86,7 +86,7 @@ final class BrainPageController extends AbstractController
$entityManager->flush();
return $this->redirectToRoute('brain_page_list');
return $this->redirectToRoute('front_end_page', ['url' => $data->getUrl()]);
}
return $this->render('brain/page/create.html.twig', [

View file

@ -83,7 +83,7 @@ final class BrainPhotosController extends AbstractController
$entityManager->flush();
return $this->redirectToRoute('brain_photos_list');
return $this->redirectToRoute('front_end_photos_detail', ['url' => $data->getUrl()]);
}
return $this->render('brain/photos/create.html.twig', [
@ -128,7 +128,7 @@ final class BrainPhotosController extends AbstractController
$entityManager->flush();
return $this->redirectToRoute('brain_photos_list');
return $this->redirectToRoute('front_end_photos_detail', ['url' => $data->getUrl()]);
}
return $this->render('brain/photos/create.html.twig', [

View file

@ -78,7 +78,7 @@ final class BrainPostController extends AbstractController
$entityManager->flush();
return $this->redirectToRoute('brain_post_list');
return $this->redirectToRoute('front_end_post_detail', ['url' => $data->getUrl()]);
}
return $this->render('brain/post/create.html.twig', [
@ -134,7 +134,7 @@ final class BrainPostController extends AbstractController
$entityManager->flush();
return $this->redirectToRoute('brain_post_list');
return $this->redirectToRoute('front_end_post_detail', ['url' => $data->getUrl()]);
}
return $this->render('brain/post/create.html.twig', [
'action' => 'edit',

View file

@ -7,9 +7,32 @@
{% endblock %}
{% block actions %}
this will be some global admin actions
<div class="actions">
<ul class="list">
<li><a href="/brain/post/new">Add New Post</a></li>
<li><a href="/brain/photos/new">Add New Photo Album</a></li>
<li><a href="/brain/page/new">Add New Page</a></li>
<li><a href="/brain/category/new">Add New Category</a></li>
<li><a href="/brain/tag/new">Add New Tag</a></li>
</ul>
</div>
{% endblock %}
{% block admin %}
<p>This will be a dashboard of sorts</p>
<div class="dashboard">
<h2>Dashboard</h2>
<p>To Do</p>
<ul>
<li>Add file upload functionality for non photo albums</li>
<li>Fix tall photo layouts</li>
<li>Make this dashboard useful</li>
<li>Project content type</li>
<li>Make landing page exist in the db</li>
<ul>
<li>Render it as a static file instead of relying on db queries</li>
</ul>
<li>Self-host git and create a list page</li>
</ul>
</div>
{% endblock %}

View file

@ -18,6 +18,9 @@
<p class="intro">A truly random smattering of thoughts and feelings. Things may not always be relevant, but they will always be irreverant.</p>
<div class="list">
<h3>Recent</h3>
{% if app.user %}
<br><a href="/brain/post/new">Add New Post</a>
{% endif %}
<ul>
{% for post in posts %}
<li>