Merge remote-tracking branch 'origin/ticket324' into develop
This commit is contained in:
commit
9c367ac43e
7 changed files with 35 additions and 34 deletions
|
|
@ -93,11 +93,14 @@ class MediaController extends Controller
|
|||
]);
|
||||
}
|
||||
|
||||
public function show(Request $request) {
|
||||
$uid = $request->uid;
|
||||
$media = Media::where('uid', $uid)->first();
|
||||
if (!$media)
|
||||
abort(404);
|
||||
/**
|
||||
* Show media
|
||||
*
|
||||
* @param Media $media
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function show(Media $media)
|
||||
{
|
||||
return redirect()->route('media_manager')->with('autoOpen', $media);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\Media;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
|
||||
|
|
@ -23,7 +24,9 @@ class RouteServiceProvider extends ServiceProvider
|
|||
*/
|
||||
public function boot()
|
||||
{
|
||||
//
|
||||
Route::bind('media', function ($value) {
|
||||
return Media::whereUid($value)->firstOrFail();
|
||||
});
|
||||
|
||||
parent::boot();
|
||||
}
|
||||
|
|
@ -36,10 +39,7 @@ class RouteServiceProvider extends ServiceProvider
|
|||
public function map()
|
||||
{
|
||||
$this->mapApiRoutes();
|
||||
|
||||
$this->mapWebRoutes();
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -56,12 +56,12 @@
|
|||
},
|
||||
mounted() {
|
||||
console.log('EditComponent Mounted.');
|
||||
// if (this.open !== undefined) { TODO : REMOVE ?
|
||||
// this.$store.commit({
|
||||
// type: 'updateMedia',
|
||||
// media: JSON.parse(this.open)
|
||||
// });
|
||||
// }
|
||||
if (this.open !== undefined) {
|
||||
this.$store.commit({
|
||||
type: 'updateMedia',
|
||||
media: JSON.parse(this.open)
|
||||
});
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
storeMedia () {
|
||||
|
|
@ -143,7 +143,6 @@
|
|||
});
|
||||
},
|
||||
close(){
|
||||
console.log('close click')
|
||||
this.$store.commit({
|
||||
type: 'updateMedia',
|
||||
media: { close: true, isModified: this.storeMedia.isModified }
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@
|
|||
class="is-locked">En attente de liaison Arcadia</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label>Sujet <span>*</span> : {{this.oMedia.sujet.libelle}}</label>
|
||||
<div class="row" v-if="oMedia.arcadia_id">
|
||||
<label>Sujet <span>*</span> : {{this.oMedia.sujet ? this.oMedia.sujet.libelle : '' }}</label>
|
||||
<label>Type de média <span>*</span> : {{this.oMedia.typemedia.libelle}}</label>
|
||||
<label>Date de création : {{this.oMedia.created_at}}</label>
|
||||
<label>Date de modification : {{this.oMedia.updated_at}}</label>
|
||||
|
|
|
|||
|
|
@ -45,7 +45,11 @@
|
|||
},
|
||||
watch: {
|
||||
storeMedia() {
|
||||
if (Object.keys(this.storeMedia).length > 0 && (this.storeMedia.history === undefined)){
|
||||
if (
|
||||
this.storeMedia.id &&
|
||||
Object.keys(this.storeMedia).length > 0 &&
|
||||
(this.storeMedia.history === undefined)
|
||||
){
|
||||
const _this2 = this;
|
||||
axios.post('/ajax/get-media-others-infos', {
|
||||
media_id: this.storeMedia.id
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
</td>
|
||||
<td class="ctas">
|
||||
<i class="fa fa-copy" v-clipboard="item.url"></i>
|
||||
<a :href="item.url" :download="storeMedia.libelle.replaceAll(' ', '_').replaceAll('.','') + '_' + item.largeur + 'x' + item.hauteur + 'px'"><i class="fas fa-arrow-circle-down"></i></a>
|
||||
<a v-if="storeMedia.libelle" :href="item.url" :download="storeMedia.libelle.replaceAll(' ', '_').replaceAll('.','') + '_' + item.largeur + 'x' + item.hauteur + 'px'"><i class="fas fa-arrow-circle-down"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
@ -52,7 +52,11 @@
|
|||
},
|
||||
watch: {
|
||||
storeMedia() {
|
||||
if (Object.keys(this.storeMedia).length > 0 && (this.storeMedia.vignettes === undefined)){
|
||||
if (
|
||||
this.storeMedia.id &&
|
||||
Object.keys(this.storeMedia).length > 0 &&
|
||||
(this.storeMedia.vignettes === undefined)
|
||||
){
|
||||
const _this2 = this;
|
||||
axios.post('/ajax/get-media-others-infos', {
|
||||
media_id: this.storeMedia.id
|
||||
|
|
|
|||
|
|
@ -1,24 +1,15 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Web Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register web routes for your application. These
|
||||
| routes are loaded by the RouteServiceProvider within a group which
|
||||
| contains the "web" middleware group. Now create something great!
|
||||
|
|
||||
*/
|
||||
|
||||
// TODO : Faire le tri des routes
|
||||
|
||||
use App\Http\Controllers\MediaController;
|
||||
|
||||
Route::group(['middleware' => ['auth']], function () {
|
||||
// Les pages Front
|
||||
Route::get('/', 'CommunController@index')->name('home');
|
||||
Route::get('/gestion-des-medias', 'MediaController@index')->name('media_manager');
|
||||
Route::get('/gestion-des-medias', [MediaController::class, 'index'])->name('media_manager');
|
||||
Route::get('/paniers', 'PanierController@index')->name('paniers');
|
||||
Route::get('/media/{uid}', 'MediaController@show')->name('media.show');
|
||||
Route::get('/media/{media}', [MediaController::class, 'show'])->name('media.show');
|
||||
|
||||
// Message de contact
|
||||
Route::post('/send-message', 'CommunController@sendMessage');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue