Big commit i'm sorry ...
This commit is contained in:
@@ -9,28 +9,40 @@
|
||||
<button class="btn btn-outline-success" onclick="printForm()">+</button>
|
||||
|
||||
<div class="formAddBloc" id="addBloc">
|
||||
<form action="/addBloc" method="POST" class="" >
|
||||
<form action="/addBloc" id="addBloc" method="POST" class="" >
|
||||
<input id="csrf_token" name="csrf_token" type="hidden" value="{{ csrf_token() }}">
|
||||
<h3>Créé un nouveau bloc</H3>
|
||||
<br>
|
||||
|
||||
<label for="nom"><b>Nom du bloc </b></label><br/>
|
||||
<input type="text" name="blocName" placeholder="Nom" id="blocName" required="">
|
||||
<label for="blocName">Nom du bloc (caractères sans accents uniquement) </label>
|
||||
<div class="input-group">
|
||||
<input type="text"
|
||||
name="blocName"
|
||||
class="form-control"
|
||||
id="blocName"
|
||||
placeholder="Bloc1"
|
||||
required>
|
||||
<div class="invalid-feedback">
|
||||
Entrez le nom du bloc sans espaces ni caractères spéciaux
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<label for="link"><b>Type de bloc</b></label>
|
||||
<br/>
|
||||
<select id="blocType" name="blocType" size="8">
|
||||
<option value="presentation">Présentation</option>
|
||||
<select id="blocType" name="blocType" size="8" required>
|
||||
<option value="presentation"> Ecran d'Accueil </option>
|
||||
<option value="presentation"> Image En-tête d'article </option>
|
||||
<option value="text">Texte libre</option>
|
||||
<option value="simple_article">Article Simple</option>
|
||||
<option value="gallery">Galerie</option>
|
||||
<option value="external_link">Lien externe</option>
|
||||
<option value="contact">Contact</option>
|
||||
</select>
|
||||
<br/>
|
||||
<button type="submit" class="btn btn-success"
|
||||
hx-post="/addBloc"
|
||||
hx-swap="outerHTML"
|
||||
hx-target="#myblocs"> Créer le bloc </button>
|
||||
onclick="valid_nameBloc()"
|
||||
hx-post="/addBloc"
|
||||
hx-swap="outerHTML"
|
||||
hx-target="#myblocs"> Créer le bloc </button>
|
||||
</form>
|
||||
</div>
|
||||
<hr/>
|
||||
@@ -39,9 +51,20 @@
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
function valid_nameBloc()
|
||||
{
|
||||
var blocName = document.getElementById("blocName");
|
||||
let name_field = blocName.value.trim();
|
||||
let Valid = /^[a-z0-9]+$/i.test(name_field);
|
||||
console.log(Valid);
|
||||
if (!Valid) {
|
||||
document.getElementById("blocName").setAttribute("class", "form-control is-invalid");
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
<form class="sortblocs" action="/sortblocs" method="POST" id="myblocs">
|
||||
<div id="myblocs" class="myblocs">
|
||||
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
||||
{% for item in myblocs.keys() %}
|
||||
|
||||
<div class="bloc" id="bloc-{{ item }}" style="margin-top: 10px;">
|
||||
<div class="bloc" id="bloc-{{ item }}" style="margin-top: 10px;">
|
||||
<button class="btn"> {{ item }} - {{ myblocs[item]['type'] }} </button>
|
||||
<input class="input-menu" id="bloc-{{ item }}" name="{{ item }}" value="" style="display:none;">
|
||||
<button class="btn btn-danger" onclick="deleteItem(this)"> x </button>
|
||||
@@ -29,5 +29,5 @@
|
||||
fallbackOnBody: true,
|
||||
swapThreshold: 0.65,
|
||||
})};
|
||||
|
||||
</script>
|
||||
|
||||
</script>
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{% for item in myblocs.keys() %}
|
||||
|
||||
<div class="bloc" id="bloc-{{ item }}" style="margin-top: 10px;">
|
||||
<button class="btn"> {{ item }} - {{ myblocs[item]['type'] }} </button>
|
||||
<input class="input-menu" id="bloc-{{ item }}" name="{{ item }}" value="" style="display:none;">
|
||||
<button class="btn btn-danger" onclick="deleteItem(this)"> x </button>
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
142
app/templates/admin/_menu-admin.html
Normal file
142
app/templates/admin/_menu-admin.html
Normal file
@@ -0,0 +1,142 @@
|
||||
<!-- Navigation -->
|
||||
|
||||
<nav class="navbar navbar-expand-lg navbar-light fixed-bottom navbar-skrink" id="toolNav">
|
||||
<div class="container">
|
||||
<button class="btn btn-primary"
|
||||
type="button"
|
||||
data-toggle="modal"
|
||||
data-target="#addBloc">
|
||||
Blocs de cette page
|
||||
</button>
|
||||
|
||||
<button class="btn btn-info nav-brand js-scroll-trigger"
|
||||
type="button"
|
||||
data-toggle="modal"
|
||||
data-target="#mymenu">
|
||||
Mon menu
|
||||
</button>
|
||||
|
||||
|
||||
<button class="btn btn-success nav-brand js-scroll-trigger"
|
||||
type="button"
|
||||
data-toggle="modal"
|
||||
data-target="#mypages">
|
||||
Mes pages
|
||||
</button>
|
||||
|
||||
<button class="btn btn-secondary"
|
||||
type="button"
|
||||
data-toggle="modal"
|
||||
data-target="#parameters">
|
||||
Paramètres de mon site
|
||||
</button>
|
||||
|
||||
|
||||
<a class="btn btn-warning nav-brand js-scroll-trigger" href="/edit/save">
|
||||
Publier mes modifications
|
||||
</a>
|
||||
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="modal" id="addBloc">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<!-- Modal Header -->
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title"> Mes blocs </h4>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
<div class="modal-body text-center">
|
||||
{% include 'admin/_bloc-edit.html' %}
|
||||
</div>
|
||||
<div class="modal-footer mx-auto">
|
||||
<a class="btn btn-danger" href="/" > Annuler </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="mymenu">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<!-- Modal Header -->
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title"> Mon menu </h4>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
<div class="modal-body text-center">
|
||||
{% include 'admin/_menu-edit.html' %}
|
||||
</div>
|
||||
<div class="modal-footer mx-auto">
|
||||
<a class="btn btn-danger" href="/" > Annuler </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="mypages">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<!-- Modal Header -->
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title"> Mes pages </h4>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
<div class="modal-body text-center">
|
||||
{% include 'admin/_pages-edit.html' %}
|
||||
</div>
|
||||
<div class="modal-footer mx-auto">
|
||||
<a class="btn btn-danger" href="/" > Annuler </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="modal" id="parameters">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<!-- Modal Header -->
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Paramètres </h4>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<ul class="nav nav-pills nav-justified">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill" href="#options"> Options </a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill" href="#publication"> Publication </a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Tab panes -->
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane container text-center fade" id="options">
|
||||
<br/>
|
||||
<h4> Mes réseaux sociaux </h4>
|
||||
</div>
|
||||
<div class="tab-pane container fade text-center" id="publication">
|
||||
<br/>
|
||||
<h4> Serveur(s) où publier mon site </h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal footer -->
|
||||
<div class="modal-footer mx-auto">
|
||||
<a class="btn btn-danger" href="/" > Annuler </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -52,7 +52,6 @@
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<script src="/static/vendors/Sortable/Sortable.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
|
||||
<!--
|
||||
<form class="sortblocs" action="/createpage" method="POST" id="mypages">
|
||||
<div id="myblocs" class="myblocs">
|
||||
|
||||
{% for item in mypages %}
|
||||
|
||||
<div class="page" id="page" style="margin-top: 10px;">
|
||||
<button class="btn"> {{ }} - {{ myblocs[item]['type'] }} </button>
|
||||
<input class="input-menu" id="bloc-{{ item }}" name="{{ item }}" value="" style="display:none;">
|
||||
<button class="btn btn-danger" onclick="deleteItem(this)"> x </button>
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
-->
|
||||
<script src="/static/vendors/Sortable/Sortable.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var elements = document.getElementsByClassName('page');
|
||||
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
|
||||
new Sortable(elements[i], {
|
||||
group: 'shared',
|
||||
animation: 150,
|
||||
invertSwap: true,
|
||||
fallbackOnBody: true,
|
||||
swapThreshold: 0.65,
|
||||
})};
|
||||
|
||||
</script>
|
||||
@@ -1,24 +1,47 @@
|
||||
<div id="mypages">
|
||||
<ul style="list-style:none;" id="mypages" class="mypages">
|
||||
<li><a href="/"> <button class="btn"> Page d'accueil </button> </a> </li>
|
||||
|
||||
<!--
|
||||
<form class="sortblocs" action="/createpage" method="POST" id="mypages">
|
||||
<div id="myblocs" class="myblocs">
|
||||
</div>
|
||||
</form>
|
||||
{% for item in pagesList %}
|
||||
|
||||
-->
|
||||
<script src="/static/vendors/Sortable/Sortable.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var elements = document.getElementsByClassName('page');
|
||||
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
|
||||
new Sortable(elements[i], {
|
||||
group: 'shared',
|
||||
animation: 150,
|
||||
invertSwap: true,
|
||||
fallbackOnBody: true,
|
||||
swapThreshold: 0.65,
|
||||
})};
|
||||
|
||||
</script>
|
||||
<li style="padding-top: 10px;">
|
||||
<a href="/{{ item }}/">
|
||||
<button class="btn"> {{ item }} </button>
|
||||
</a>
|
||||
<a href="/rmPage/{{ item }}"><button class="btn btn-danger"> X </button></a>
|
||||
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="formAddPage" id="addPage">
|
||||
<form action="/addPage" id="addPage" method="POST" class="" >
|
||||
<input id="csrf_token" name="csrf_token" type="hidden" value="{{ csrf_token() }}">
|
||||
<h3>Créé un nouveau bloc</H3>
|
||||
<br>
|
||||
<label for="blocName">Nom du bloc (caractères sans accents uniquement) </label>
|
||||
<div class="input-group">
|
||||
<input type="text"
|
||||
name="pageName"
|
||||
class="form-control"
|
||||
id="pageName"
|
||||
placeholder="Ma_Page"
|
||||
required>
|
||||
<div class="invalid-feedback">
|
||||
Entrez le nom de la page sans espaces ni caractères spéciaux
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<label for="link"><b>Type de bloc</b></label>
|
||||
<br/>
|
||||
<select id="pageType" name="pageType" size="8" required>
|
||||
<option value="article_image"> Article avec une image d'en tête </option>
|
||||
<option value="simple_article"> Page blanche Texte libre </option>
|
||||
</select>
|
||||
<br/>
|
||||
<button type="submit" class="btn btn-success"
|
||||
onclick="valid_nameBloc()"> Créer la page </button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user