mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 10:49:10 -04:00
Merge remote-tracking branch 'origin/3.2.4' into 3.2.5
This commit is contained in:
@@ -129,4 +129,21 @@ class ConfigController extends Controller
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function showfilesConfig()
|
||||
{
|
||||
return view('admin.configs.file',['configs' => Config::all()]);
|
||||
}
|
||||
|
||||
public function editfilesConfig()
|
||||
{
|
||||
$config = \App\Config::all()->where('name','cadet_list')->first();
|
||||
|
||||
$config->data = [\request('cadet_list')];
|
||||
|
||||
$config->save();
|
||||
|
||||
clog('edit','success','a modifié la configuration');
|
||||
return redirect('/admin/config/files')->with('success','Modification sauvegarder avec succès !');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,6 +226,11 @@ class ConfigsTableSeeder extends Seeder
|
||||
'name' => 'default_weekly_msg',
|
||||
'state' => 0,
|
||||
'data' => "[\"<strong>/* Nom de l'évènement */</strong><br>Heure (Cadets):<br>Lieu:<br>Tenue:<br>Matériel:<br>/* Commentaire */\"]"
|
||||
],
|
||||
[
|
||||
'name' => 'cadet_list',
|
||||
'state' => 0,
|
||||
'data' => '["#"]'
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
69
resources/views/admin/configs/file.blade.php
Normal file
69
resources/views/admin/configs/file.blade.php
Normal file
@@ -0,0 +1,69 @@
|
||||
@extends('layouts.admin.main')
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header card-header-primary">
|
||||
<h4>Configuration Générale</h4>
|
||||
</div>
|
||||
<div class="card-body mt-5">
|
||||
<form action="/admin/config/files" method="POST">
|
||||
@csrf
|
||||
<div class="row ml-2">
|
||||
<div class="col-md-6 p-2">
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">Liste nominative des cadets</label>
|
||||
<input type="text" class="form-control" id="cadet_list" name="cadet_list" aria-describedby="emailHelp" value="{{\App\Config::getData('cadet_list')}}">
|
||||
<small id="emailHelp" class="form-text text-muted">Url vers la liste nominative des cadets</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 p-2">
|
||||
<button type="submit" class="btn btn-primary">Sauvegarder</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('breadcrumb')
|
||||
<div class="breadcrumbs">
|
||||
<div class="col-sm-4">
|
||||
<div class="page-header float-left">
|
||||
<div class="page-title">
|
||||
<h1>Configuration des fichiers</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div class="page-header float-right">
|
||||
<div class="page-title">
|
||||
<ol class="breadcrumb text-right">
|
||||
<li class="active">Configuration/Fichier</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('custom_scripts')
|
||||
<script>
|
||||
function saveChange(pPerm) {
|
||||
(function($) {
|
||||
var myswitch = document.getElementById(pPerm);
|
||||
$.post('/api/config/general/save?api_token='+api_token, { value: myswitch.checked,perm: pPerm } , function(data) {
|
||||
swal({
|
||||
title: 'Modification enregistré !',
|
||||
type: 'success',
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
});
|
||||
})(jQuery);
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
@@ -119,6 +119,11 @@
|
||||
<td>Divers</td>
|
||||
<td><a class="btn btn-primary btn-block" href="https://drive.google.com/uc?export=download&id=16lT4YzNjGWd2SFmgSbmj1LcPG9cDkkyo">Télécharger</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Liste nominal des cadets</td>
|
||||
<td>Divers</td>
|
||||
<td><a class="btn btn-primary btn-block" href="{{\App\Config::getData('cadet_list')}}">Télécharger</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -252,6 +252,12 @@
|
||||
<span class="sidebar-normal"> Général </span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item ">
|
||||
<a class="nav-link" href="/admin/config/files">
|
||||
<span class="sidebar-mini"> <i class="fas fa-folder"></i> </span>
|
||||
<span class="sidebar-normal"> Fichier </span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item ">
|
||||
<a class="nav-link" href="/admin/config/schedule">
|
||||
<span class="sidebar-mini"> <i class="fas fa-calendar"></i></span>
|
||||
|
||||
@@ -87,7 +87,10 @@ Route::middleware(['auth'])->group(function () {
|
||||
Route::get('/admin/config/jobs/{id}','JobController@edit')->middleware('perm:config_edit');
|
||||
Route::post('/admin/config/jobs/{id}','JobController@update')->middleware('perm:config_edit');
|
||||
|
||||
/** Public page */
|
||||
Route::get('/admin/config/files' , 'ConfigController@showfilesConfig')->middleware('perm:config_edit');
|
||||
Route::post('/admin/config/files' , 'ConfigController@editfilesConfig')->middleware('perm:config_edit');
|
||||
|
||||
/** Public page */
|
||||
Route::get('/admin/public/edit/{config}', 'PublicController@edit')->middleware('perm:config_edit');
|
||||
Route::post('/admin/public/edit/{config}', 'PublicController@update')->middleware('perm:config_edit');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user