Merge branch 'Update_news_display' into '3.2.5'

Update Message UI in Admin Dashboard

See merge request TheGamecraft/c-cms!98
This commit is contained in:
Mathieu Lagace
2020-06-21 16:39:12 +00:00
12 changed files with 86 additions and 101 deletions

View File

@@ -4,15 +4,25 @@ services:
- mysql:5.7 - mysql:5.7
variables: variables:
MYSQL_DATABASE: homestead MYSQL_DATABASE: ddb
MYSQL_ROOT_PASSWORD: secret MYSQL_ROOT_PASSWORD: password
DB_HOST: mysql DB_HOST: mysql
DB_USERNAME: root DB_USERNAME: root
stages: stages:
- build - build
- test
- deploy - deploy
- deploy
unit_test:
stage: test
script:
- cp .env.example .env
- composer install
- php artisan key:generate
- php artisan migrate
- php artisan db:seed
- vendor/bin/phpunit
build: build:
stage: build stage: build

View File

@@ -1 +1 @@
C:30:"PHPUnit\Runner\TestResultCache":187:{a:2:{s:7:"defects";a:1:{s:32:"Tests\Browser\UserTest::testUser";i:3;}s:5:"times";a:2:{s:34:"Tests\Browser\LoginTest::testLogin";d:5.605;s:32:"Tests\Browser\UserTest::testUser";d:14.139;}}} C:37:"PHPUnit\Runner\DefaultTestResultCache":273:{a:2:{s:7:"defects";a:2:{s:32:"Tests\Feature\AdminTest::testUrl";i:3;s:30:"Tests\Feature\ECCTest::testUrl";i:3;}s:5:"times";a:3:{s:32:"Tests\Feature\AdminTest::testUrl";d:0.099;s:30:"Tests\Feature\ECCTest::testUrl";d:0.014;s:33:"Tests\Feature\PublicTest::testUrl";d:0.031;}}}

View File

@@ -1,5 +1,5 @@
# Set the base image for subsequent instructions # Set the base image for subsequent instructions
FROM php:7.3 FROM php:7.4
# Update packages # Update packages
RUN apt-get update RUN apt-get update

View File

@@ -41,6 +41,7 @@
clone_repository_dev clone_repository_dev
run_composer_dev run_composer_dev
update_symlinks_dev update_symlinks_dev
remove_old_release_dev
@endstory @endstory
@story('deploy_227') @story('deploy_227')
@@ -160,6 +161,11 @@
@endtask @endtask
@task('remove_old_release_dev')
cd {{ $releases_dir_dev@ }}
rm -fr $(ls -t1 | tail -n +3)
@endtask
@task('clone_repository_227') @task('clone_repository_227')
echo 'Cloning repository' echo 'Cloning repository'
[ -d {{ $releases_dir_227 }} ] || mkdir {{ $releases_dir_227 }} [ -d {{ $releases_dir_227 }} ] || mkdir {{ $releases_dir_227 }}

View File

@@ -169,7 +169,7 @@
} }
.news-tags { .news-tags {
height: 1.5rem; height: 2.8rem;
} }
.news-body-small { .news-body-small {

View File

@@ -169,7 +169,7 @@
} }
.news-tags { .news-tags {
height: 1.5rem; height: 2.8rem;
} }
.news-body-small { .news-body-small {

View File

@@ -36,6 +36,9 @@
@endif @endif
@endforeach @endforeach
@endif @endif
@if($n->files != [""] && isset($n->files))
<span class="badge badge-pill badge-secondary">Fichier joint</span>
@endif
</div> </div>
@if($n->publish == 0) <span class="badge badge-warning float-right">Brouillon</span> @endif</p> @if($n->publish == 0) <span class="badge badge-warning float-right">Brouillon</span> @endif</p>
</div> </div>
@@ -44,6 +47,11 @@
</div> </div>
<div class="card-footer"> <div class="card-footer">
<div class="btn-group"> <div class="btn-group">
@if(!isset($n->event_id))
<a href="/news/{{$n->id}}" type="button" class="btn btn-secondary" target="_blank"><i class="fa fa-external-link-alt"></i>&nbsp; Afficher</a>
@else
<a href="/news/{{$n->event_id}}?type=msg" type="button" class="btn btn-secondary" target="_blank"><i class="fa fa-external-link-alt"></i>&nbsp; Afficher</a>
@endif
@if(\Auth::user()->p('news_edit') == 1 && !isset($n->event_id)) @if(\Auth::user()->p('news_edit') == 1 && !isset($n->event_id))
<a href="/admin/news/edit/{{$n->id}}" type="button" class="btn btn-secondary"><i class="fa fa-cog"></i>&nbsp; Modifier</a> <a href="/admin/news/edit/{{$n->id}}" type="button" class="btn btn-secondary"><i class="fa fa-cog"></i>&nbsp; Modifier</a>
@else @else

View File

@@ -22,6 +22,9 @@
@endif @endif
@endforeach @endforeach
@endif @endif
@if($new->files != [""] && isset($new->files))
<span class="badge badge-pill badge-secondary">Fichier joint</span>
@endif
</div> </div>
<a name="news" id="news" class="btn btn-block btn-secondary mt-2" <a name="news" id="news" class="btn btn-block btn-secondary mt-2"
@if(isset($new->event_id)) @if(isset($new->event_id))

View File

@@ -37,6 +37,9 @@
@endif @endif
@endforeach @endforeach
@endif @endif
@if($new->files != [""])
<span class="badge badge-pill badge-secondary">Fichier joint</span>
@endif
</div> </div>
<a name="news" id="news" class="btn btn-block btn-secondary mt-2" role="button" <a name="news" id="news" class="btn btn-block btn-secondary mt-2" role="button"
@if(isset($new->event_id)) @if(isset($new->event_id))

View File

@@ -1,16 +1,18 @@
@extends('layouts.public.main') @extends('layouts.public.main')
@section('content') @section('content')
<div class="row" style="height: 45vh; width: 100vw"> <div class="profile-page sidebar-collapse">
<div class="col-12 text-center m-auto"> <div class="page-header header-filter" data-parallax="true" style="background-image: url({{'"'.\App\Config::getData('public_index_img_url').'"'}}); transform: translate3d(0px, 0px, 0px);background-position: center"></div>
<h2 class="news-title text-white">{{ $new->title }}</h2>
</div>
</div>
<div class="main main-raised"> <div class="main main-raised">
<div class="profile-content">
<div class="container"> <div class="container">
<div class="section">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-6 ml-auto mr-auto">
<div class="profile">
<h2 class="text-white" style="margin-top: -8rem">{{ $new->title }}</h2>
</div>
</div>
<div class="col-md-12 mt-5">
<div class="row gtr-50 gtr-uniform"> <div class="row gtr-50 gtr-uniform">
@foreach ($new->pictures as $picture) @foreach ($new->pictures as $picture)
<div @if ($loop->first) <div @if ($loop->first)
@@ -36,16 +38,23 @@
@endif @endif
@endforeach @endforeach
@endif @endif
@if($new->files != [""] && isset($new->files))
<span class="badge badge-pill badge-secondary">Fichier joint</span>
@endif
</div> </div>
<div class="col-12 mt-3"> <div class="col-12 mt-3">
@if($new->files != [""] && isset($new->files))
@foreach($new->files as $file) @foreach($new->files as $file)
<a href="{{\App\GoogleDriveFile::getDownloadURL('.Systeme/.Fichier/.MessageDeLaSemaine',$file)}}" class="btn btn-outline-primary btn-round"><div class="d-inline-flex" style="max-width: 10rem;overflow: hidden">{{$file}}</div><i class="fas fa-cloud-download-alt ml-2"></i></a> <a href="{{\App\GoogleDriveFile::getDownloadURL('.Systeme/.Fichier/.MessageDeLaSemaine',$file)}}" class="btn btn-outline-primary btn-round"><div class="d-inline-flex" style="max-width: 10rem;overflow: hidden">{{$file}}</div><i class="fas fa-cloud-download-alt ml-2"></i></a>
@endforeach @endforeach
@endif
</div> </div>
</div> </div>
</div> </div>
<a href="/" class="btn button primary">Retour</a> <a href="/" class="btn button primary">Retour</a>
</div> </div>
</div> </div>
</div>
</div>
@endsection @endsection

View File

@@ -19,7 +19,7 @@ class AdminTest extends TestCase
$urls = [ $urls = [
'admin', 'admin',
'admin/calendar', 'admin/schedule',
'admin/message', 'admin/message',
'admin/message/add', 'admin/message/add',
'admin/inventory', 'admin/inventory',

View File

@@ -1,54 +0,0 @@
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
class ECCTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testUrl()
{
$appURL = "dev.c-cms.cf";
$urls = [
'ecc',
'ecc/calendar',
'ecc/messages',
'ecc/guide',
'ecc/update'
];
echo PHP_EOL;
foreach ($urls as $url) {
$response = $this->get($url);
if((int)$response->status() === 404){
echo $appURL . $url . ' (FAILED) return a 404.';
$this->assertTrue(false);
} else {
echo $appURL . $url . ' (SUCCESS)';
$this->assertTrue(true);
}
echo PHP_EOL;
}
foreach ($urls as $url) {
$response = $this->get($url);
if((int)$response->status() === 500){
echo $appURL . $url . ' (FAILED) return a 500.';
$this->assertTrue(false);
} else {
echo $appURL . $url . ' (SUCCESS)';
$this->assertTrue(true);
}
echo PHP_EOL;
}
}
}