first commit symfony 6

This commit is contained in:
2022-07-21 16:15:47 +02:00
parent d9bfbb6b3c
commit 5c4961748b
282 changed files with 37482 additions and 0 deletions

View File

@ -0,0 +1,18 @@
{% extends "base.html.twig" %}
{% block localstyle %}
<style>
body{margin:0px !important;}
.title{
font-family: var(--fonttitle) !important;
}
.swagger-ui .info hgroup.main {margin:0px !important;}
#swagger-ui.api-platform .info {
max-width:100% !important;
padding: 10px !important;
}
</style>
{% endblock %}
{% block body %}
{{ render(path("app_swagger_ui")) }}
{% endblock %}

View File

@ -0,0 +1,82 @@
{% extends "base.html.twig" %}
{% block body %}
{% if app.user %}
<button class="btn btn-primary" onClick="send()">Send</button>
<div id="chat"></div>
{% endif %}
{% endblock %}
{% block localscript %}
{% if app.user %}
<script>
function connect() {
channel="chat";
id=1;
const eventSource = new EventSource("{{ mercure('chat-1')|escape('js') }}");
eventSource.onopen = function(e) {
console.log("== ONOPEN");
sendMessage(channel,id,{command: "alive"});
};
eventSource.onclose = function(e) {
console.log("== ONCLOSE");
sendMessage(channel,id,{command: "dead"});
setTimeout(function() { connect(); }, 1000);
};
eventSource.onmessage = event => {
data=JSON.parse(event.data);
ret=data.ret;
console.log("== ONMESSAGE = "+ret.command);
console.log(ret);
switch (ret.command) {
case "alive":
sendMessage(channel,id,{command: "meto"});
break;
case "meto":
break;
case "dead":
break;
case "push":
$("#chat").prepend('<div class="card mt-3"><div class="card-body">'+ret.message+'</div></div>');
break;
}
}
$(window).on("beforeunload", function() {
sendMessage(channel,id,{command: "dead"});
})
}
connect();
function sendMessage(channel,id,msg) {
url="{{path("app_publish",{channel:'xxx',id:'yyy'})}}";
url=url.replace('xxx',channel);
url=url.replace('yyy',id);
$.ajax({
method: "POST",
url: url,
data: {
msg: msg
},
success: function(data, dataType)
{
},
});
}
function send() {
sendMessage('chat',1,{command: "push", message:"pouet"});
}
</script>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,36 @@
{% extends "base.html.twig" %}
{% block localstyle %}
<style>
label {
color: var(--colorftbodylight);
}
</style>
{% endblock %}
{% block body %}
<div style="text-align:center">
<img src="{{ appAlias }}uploads/logo/{{ app.session.get('logolight') }}" style="height:120px;margin-top:10px;margin-bottom:20px;">
<h1 style="border:none">{{appName}}</h1>
{{ form_start(form, {'action': path('app_loginldapcheck'), 'method': 'POST'}) }}
<div class="card homecard mb-3" style="width:400px; margin:auto; text-align: left;">
<div class="card-body">
{{ form_row(form.username) }}
{{ form_row(form.password) }}
{{ form_row(form.submit) }}
</div>
</div>
{% if appMasteridentity == "SQL"%}
<a href="{{path("app_resetpwd01")}}" class="mt-3">Mot de passe oublié ?</a>
{% endif %}
{{ form_end(form) }}
</div>
{% endblock %}
{% block localscript %}
<script>
$(document).ready(function() {
$("#login_username").focus();
});
</script>
{% endblock %}

View File

@ -0,0 +1,46 @@
{% extends "base.html.twig" %}
{% block localstyle %}
<style>
label {
color: var(--colorftbodylight);
}
</style>
{% endblock %}
{% block body %}
<div style="text-align:center">
<img src="{{ appAlias }}uploads/logo/{{ app.session.get('logolight') }}" style="height:120px;margin-top:10px;margin-bottom:20px;">
<h1 style="border:none">{{appName}}</h1>
<form action="{{ path('app_login') }}" method="post">
<div class="card homecard mb-3" style="width:400px; margin:auto">
<div class="card-body">
{% if error %}
<div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %}
<label for="username">Login</label>
<input type="text" id="username" name="_username" value="{{ last_username }}" class="form-control" style="margin-bottom:15px;" />
<label for="password">Password</label>
<input type="password" id="password" name="_password" class="form-control" style="margin-bottom:15px;" />
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
<input type="submit" name="login" class="btn btn-success form-control" />
</div>
</div>
{% if appMasteridentity == "SQL"%}
<a href="{{path("app_resetpwd01")}}" class="mt-3">Mot de passe oublié ?</a>
{% endif %}
</form>
</div>
{% endblock %}
{% block localscript %}
<script>
$(document).ready(function() {
$("#username").focus();
});
</script>
{% endblock %}

View File

@ -0,0 +1,9 @@
{% block subject %}
{{ subject }}
{% endblock %}
{% block body %}
{% autoescape %}
<p>{{ body|raw }}</p>
{% endautoescape %}
{% endblock %}