},
{
"name": "aws/aws-sdk-php",
- "version": "3.342.21",
+ "version": "3.342.33",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
- "reference": "f4d501414c553ddeea2efc9c77f72e58bd899823"
+ "reference": "ddd3747bd08f04159aec5d102a60c7d29906ee0b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/f4d501414c553ddeea2efc9c77f72e58bd899823",
- "reference": "f4d501414c553ddeea2efc9c77f72e58bd899823",
+ "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/ddd3747bd08f04159aec5d102a60c7d29906ee0b",
+ "reference": "ddd3747bd08f04159aec5d102a60c7d29906ee0b",
"shasum": ""
},
"require": {
"support": {
"forum": "https://github.com/aws/aws-sdk-php/discussions",
"issues": "https://github.com/aws/aws-sdk-php/issues",
- "source": "https://github.com/aws/aws-sdk-php/tree/3.342.21"
+ "source": "https://github.com/aws/aws-sdk-php/tree/3.342.33"
},
- "time": "2025-04-04T18:20:53+00:00"
+ "time": "2025-04-23T18:07:32+00:00"
},
{
"name": "biscolab/laravel-recaptcha",
"source": {
"type": "git",
"url": "git://git.cubedesigners.com/cubist_util.git",
- "reference": "384b10bfbbde94dc5e6c5a5243e13e2e09ce05ec"
+ "reference": "57a81a5b4bc8c548f9ee0b822114f3ae5930566e"
},
"dist": {
"type": "tar",
- "url": "https://composer.cubedesigners.com/dist/cubist/util/cubist-util-dev-master-7f60e6.tar",
- "reference": "384b10bfbbde94dc5e6c5a5243e13e2e09ce05ec",
- "shasum": "9afcfe19c9da616d24014dc93173326040d483dd"
+ "url": "https://composer.cubedesigners.com/dist/cubist/util/cubist-util-dev-master-bf6a2c.tar",
+ "reference": "57a81a5b4bc8c548f9ee0b822114f3ae5930566e",
+ "shasum": "e53a1e88c506dcf1bb0c280a1958edc6106100ce"
},
"require": {
"cubist/net": "dev-master",
}
],
"description": "Utilities class",
- "time": "2025-04-01T10:29:05+00:00"
+ "time": "2025-04-11T15:09:26+00:00"
},
{
"name": "dflydev/dot-access-data",
},
{
"name": "doctrine/deprecations",
- "version": "1.1.4",
+ "version": "1.1.5",
"source": {
"type": "git",
"url": "https://github.com/doctrine/deprecations.git",
- "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9"
+ "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9",
- "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9",
+ "url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
+ "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
+ "conflict": {
+ "phpunit/phpunit": "<=7.5 || >=13"
+ },
"require-dev": {
- "doctrine/coding-standard": "^9 || ^12",
- "phpstan/phpstan": "1.4.10 || 2.0.3",
+ "doctrine/coding-standard": "^9 || ^12 || ^13",
+ "phpstan/phpstan": "1.4.10 || 2.1.11",
"phpstan/phpstan-phpunit": "^1.0 || ^2",
- "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
+ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12",
"psr/log": "^1 || ^2 || ^3"
},
"suggest": {
"homepage": "https://www.doctrine-project.org/",
"support": {
"issues": "https://github.com/doctrine/deprecations/issues",
- "source": "https://github.com/doctrine/deprecations/tree/1.1.4"
+ "source": "https://github.com/doctrine/deprecations/tree/1.1.5"
},
- "time": "2024-12-07T21:18:45+00:00"
+ "time": "2025-04-07T20:06:18+00:00"
},
{
"name": "doctrine/event-manager",
},
{
"name": "firebase/php-jwt",
- "version": "v6.11.0",
+ "version": "v6.11.1",
"source": {
"type": "git",
"url": "https://github.com/firebase/php-jwt.git",
- "reference": "8f718f4dfc9c5d5f0c994cdfd103921b43592712"
+ "reference": "d1e91ecf8c598d073d0995afa8cd5c75c6e19e66"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/firebase/php-jwt/zipball/8f718f4dfc9c5d5f0c994cdfd103921b43592712",
- "reference": "8f718f4dfc9c5d5f0c994cdfd103921b43592712",
+ "url": "https://api.github.com/repos/firebase/php-jwt/zipball/d1e91ecf8c598d073d0995afa8cd5c75c6e19e66",
+ "reference": "d1e91ecf8c598d073d0995afa8cd5c75c6e19e66",
"shasum": ""
},
"require": {
],
"support": {
"issues": "https://github.com/firebase/php-jwt/issues",
- "source": "https://github.com/firebase/php-jwt/tree/v6.11.0"
+ "source": "https://github.com/firebase/php-jwt/tree/v6.11.1"
},
- "time": "2025-01-23T05:11:06+00:00"
+ "time": "2025-04-09T20:32:01+00:00"
},
{
"name": "fluidbook/toolboxapiclient",
"source": {
"type": "git",
"url": "git://git.cubedesigners.com/fluidbook_toolboxapiclient.git",
- "reference": "7d9108f6a6ff1e38218ae25dac59075ad013c60d"
+ "reference": "2545bf61c6ae339b1a13903c563e8fb196b1350e"
},
"dist": {
"type": "tar",
- "url": "https://composer.cubedesigners.com/dist/fluidbook/toolboxapiclient/fluidbook-toolboxapiclient-dev-master-807914.tar",
- "reference": "7d9108f6a6ff1e38218ae25dac59075ad013c60d",
- "shasum": "751b550a2348c1763acfe71f0a551abdb8f34b58"
+ "url": "https://composer.cubedesigners.com/dist/fluidbook/toolboxapiclient/fluidbook-toolboxapiclient-dev-master-876a1d.tar",
+ "reference": "2545bf61c6ae339b1a13903c563e8fb196b1350e",
+ "shasum": "15baeb9c721f81de265c06b7344846abb7f7ca8d"
},
"require": {
"ext-json": "*",
}
],
"description": "Fluidbook Toolbox API Client",
- "time": "2025-04-07T15:09:06+00:00"
+ "time": "2025-04-08T08:42:32+00:00"
},
{
"name": "fruitcake/laravel-cors",
},
{
"name": "google/apiclient",
- "version": "v2.18.2",
+ "version": "v2.18.3",
"source": {
"type": "git",
"url": "https://github.com/googleapis/google-api-php-client.git",
- "reference": "d8d201ba8a189a3cd7fb34e4da569f2ed440eee7"
+ "reference": "4eee42d201eff054428a4836ec132944d271f051"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/googleapis/google-api-php-client/zipball/d8d201ba8a189a3cd7fb34e4da569f2ed440eee7",
- "reference": "d8d201ba8a189a3cd7fb34e4da569f2ed440eee7",
+ "url": "https://api.github.com/repos/googleapis/google-api-php-client/zipball/4eee42d201eff054428a4836ec132944d271f051",
+ "reference": "4eee42d201eff054428a4836ec132944d271f051",
"shasum": ""
},
"require": {
],
"support": {
"issues": "https://github.com/googleapis/google-api-php-client/issues",
- "source": "https://github.com/googleapis/google-api-php-client/tree/v2.18.2"
+ "source": "https://github.com/googleapis/google-api-php-client/tree/v2.18.3"
},
- "time": "2024-12-16T22:52:40+00:00"
+ "time": "2025-04-08T21:59:36+00:00"
},
{
"name": "google/apiclient-services",
},
{
"name": "laravel/socialite",
- "version": "v5.19.0",
+ "version": "v5.20.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/socialite.git",
- "reference": "c40f843c5643fb6b089e46ce9794b8408bf08319"
+ "reference": "30972c12a41f71abeb418bc9ff157da8d9231519"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/laravel/socialite/zipball/c40f843c5643fb6b089e46ce9794b8408bf08319",
- "reference": "c40f843c5643fb6b089e46ce9794b8408bf08319",
+ "url": "https://api.github.com/repos/laravel/socialite/zipball/30972c12a41f71abeb418bc9ff157da8d9231519",
+ "reference": "30972c12a41f71abeb418bc9ff157da8d9231519",
"shasum": ""
},
"require": {
"issues": "https://github.com/laravel/socialite/issues",
"source": "https://github.com/laravel/socialite"
},
- "time": "2025-03-27T17:26:42+00:00"
+ "time": "2025-04-21T14:21:34+00:00"
},
{
"name": "laravel/tinker",
},
{
"name": "league/commonmark",
- "version": "2.6.1",
+ "version": "2.6.2",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/commonmark.git",
- "reference": "d990688c91cedfb69753ffc2512727ec646df2ad"
+ "reference": "06c3b0bf2540338094575612f4a1778d0d2d5e94"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/d990688c91cedfb69753ffc2512727ec646df2ad",
- "reference": "d990688c91cedfb69753ffc2512727ec646df2ad",
+ "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/06c3b0bf2540338094575612f4a1778d0d2d5e94",
+ "reference": "06c3b0bf2540338094575612f4a1778d0d2d5e94",
"shasum": ""
},
"require": {
"type": "tidelift"
}
],
- "time": "2024-12-29T14:10:59+00:00"
+ "time": "2025-04-18T21:09:27+00:00"
},
{
"name": "league/config",
<label for="recipients">Destinataires</label>
<select name="recipients" id="recipients" v-model="recipient_group" class="form-control">
- <option v-if="recipient_groups.count === 0" value="-1" selected="seleted">Chargement en cours...</option>
- <option v-for="recipient in recipient_groups" :value="recipient" >{{recipient.text}}</option>
- </select>
- </div>
- </div>
- <div class="col-8">
- <div class="form-group">
- <label for="file_collection">Collection *</label>
- <select class="form-control" id="file_collection" v-model="file_collection">
- <option v-for="collection in collections" :value="collection.id" v-text="collection.name"></option>
+ <option v-if="recipient_groups.count === 0" value="-1" selected="seleted">Chargement en
+ cours...
+ </option>
+ <option v-for="recipient in recipient_groups" :value="recipient">{{ recipient.text }}</option>
</select>
</div>
</div>
+ <!-- <div class="col-8">-->
+ <!-- <div class="form-group">-->
+ <!-- <label for="file_collection">Collection *</label>-->
+ <!-- <select class="form-control" id="file_collection" v-model="file_collection">-->
+ <!-- <option v-for="collection in collections" :value="collection.id" v-text="collection.name"></option>-->
+ <!-- </select>-->
+ <!-- </div>-->
+ <!-- </div>-->
+ <input type="hidden" name="file_collection" value="1"/>
<div class="col-4">
<div class="form-group">
<label for="file_ref">Numéro *</label>
- <input type="text" class="form-control is-valid" id="file_ref" :placeholder="nextRef" v-model="file_ref" required>
- </div>
- </div>
- <div class="col-12">
- <div class="form-group">
- <label for="file_tags">Mots-clés</label>
- <input type="text" id="file_tags" v-model="tags">
+ <input type="text" class="form-control is-valid" id="file_ref" v-model="file_ref" required>
</div>
</div>
+ <!-- <div class="col-12">-->
+ <!-- <div class="form-group">-->
+ <!-- <label for="file_tags">Mots-clés</label>-->
+ <!-- <input type="text" id="file_tags" v-model="tags">-->
+ <!-- </div>-->
+ <!-- </div>-->
<div class="col-12">
<div class="form-group">
<label for="headlines">Gros titres</label>
</div>
-
-
<div v-show="$refs.upload && $refs.upload.dropActive" class="drop-active">
<h3>Déposez votre fichier</h3>
</div>
<div v-if="files.length > 0" class="my-3 file-selected">
<div v-if="fileValid">
- <p class="mb-3"><strong>Fichier sélectionné : </strong> {{files[0].name}} </p>
+ <p class="mb-3"><strong>Fichier sélectionné : </strong> {{ files[0].name }} </p>
<!-- <button type="button" class="btn btn-default btn-danger" v-else @click.prevent="$refs.upload.active = false">-->
<div v-else class="alert alert-warning" role="alert">
<span class="font-bold">Fichier incorrect</span>
- <span>Le fichier {{uploadedFile.name}} n'est pas valide, veuillez choisir un fichier .pdf !</span>
+ <span>Le fichier {{ uploadedFile.name }} n'est pas valide, veuillez choisir un fichier .pdf !</span>
</div>
<div>
- <md-progress-bar :md-mode="progressMode" :md-value="parseFloat(uploadedFile.progress)"></md-progress-bar>
- <small class="text-center d-block">{{uploadedFile.progress + '%'}}</small>
+ <md-progress-bar :md-mode="progressMode"
+ :md-value="parseFloat(uploadedFile.progress)"></md-progress-bar>
+ <small class="text-center d-block">{{ uploadedFile.progress + '%' }}</small>
</div>
<div class="my-2" v-if="status === 'ready' && fileValid" @click.prevent="upload()">
- <div class="alert alert-danger" v-if="uploadedFile.size < 10e+5">
- Attention ! Ce fichier est très petit ({{fileSize}}), merci de vérifier qu'il soit correct !
- </div>
- <div class="alert alert-danger" v-if="uploadedFile.size > 10e+6">
- Attention ! Ce fichier est lourd ({{fileSize}}), merci de vérifier qu'il soit correct !
- </div>
+ <!-- <div class="alert alert-danger" v-if="uploadedFile.size < 10e+5">-->
+ <!-- Attention ! Ce fichier est très petit ({{ fileSize }}), merci de vérifier qu'il soit correct !-->
+ <!-- </div>-->
+ <!-- <div class="alert alert-danger" v-if="uploadedFile.size > 10e+6">-->
+ <!-- Attention ! Ce fichier est lourd ({{ fileSize }}), merci de vérifier qu'il soit correct !-->
+ <!-- </div>-->
<div class="alert alert-info mt-2 mb-5">
- Le fichier est prêt à être envoyé. Merci de vérifier toutes les informations avant de cliquer sur le bouton Envoyer !
+ Le fichier est prêt à être envoyé. Merci de vérifier toutes les informations avant de cliquer sur le
+ bouton Envoyer !
</div>
<button type="button" class="btn btn-default btn-primary d-block m-auto">
<i class="fa fa-arrow-up" aria-hidden="true"></i>
- Envoyer ({{fileSize}})
+ Envoyer ({{ fileSize }})
</button>
</div>
<div v-if="uploadedFile.error !== ''" class="alert alert-danger" role="alert">
<i class="fas fa-exclamation-triangle"></i>
- <span>Une erreur est survenue ({{uploadedFile.error}}).<br>Vérifiez que le numéro est entré et qu'il n'existe pas déjà.</span>
+ <span>Une erreur est survenue ({{ uploadedFile.error }}).<br>Vérifiez que le numéro est entré et qu'il n'existe pas déjà.</span>
</div>
<div v-if="status === 'processing'" class="alert-info alert" role="alert">
</div>
<div v-else-if="status === 'error'" class="alert-danger alert" role="alert">
- <i class="fas fa-exclamation-triangle"></i>
- <span><strong>Une erreur est survenue lors du traitement du fichier. </strong> ({{error}})</span>
+ <i class="fas fa-exclamation-triangle"></i>
+ <span><strong>Une erreur est survenue lors du traitement du fichier. </strong> ({{ error }})</span>
</div>
- <div v-if="status === 'done'" >
+ <div v-if="status === 'done'">
<div class="alert-success alert" role="alert">
<i class="fas fa-check"></i>
- <span><strong>{{collections.find(c => c.id === file_collection).name}}</strong> {{file_ref}} enregistré. Vous pouvez passer à l'étape suivante.</span>
+ <span><strong>{{ collections.find(c => c.id === file_collection).name }}</strong> {{ file_ref }} enregistré. Vous pouvez passer à l'étape suivante.</span>
</div>
<div class="row">
<div class="col-6">
- <img :src="$root.publishState.file.coverUrl" class="mx-auto my-3 d-block" style="width: 200px;" alt="">
+ <img :src="$root.publishState.file.coverUrl" class="mx-auto my-3 d-block" style="width: 200px;"
+ alt="">
</div>
<div class="col-6">
- <h3>{{links.length}} liens trouvés</h3>
+ <h3>{{ links.length }} liens trouvés</h3>
<ul>
- <li v-for="link in links">{{link}}</li>
+ <li v-for="link in links">{{ link }}</li>
</ul>
</div>
</div>
</div>
-
-
</div>
</div>
-
</template>
<script>
- import FileUpload from 'vue-upload-component';
- import ProgressBar from 'vue-simple-progress';
+import FileUpload from 'vue-upload-component';
+import ProgressBar from 'vue-simple-progress';
+
+export default {
+ components: {
+ FileUpload,
+ ProgressBar,
+ },
+ data() {
+ return {
+ files: [],
+ collections: [],
+ recipient_group: null,
+ recipient_groups: [],
+ //tags: [],
+ file_collection: 1,
+ file_ref: null,
+ progressMode: 'determinate',
+ csrf: document.querySelectorAll('meta[name="csrf-token"]')[0].content,
+ status: 'start',
+ error: '',
+ links: [],
+ file_ready: false,
+ repeaterFields: [
+ {
+ name: 'headline-repeater',
+ value: [{headline: 'L\'édition du jour'}],
+ }
+ ]
- export default {
- components: {
- FileUpload,
- ProgressBar,
+ }
+ },
+ computed: {
+ uploadedFile: function () {
+ return (this.files.length > 0) ? this.files[0] : null;
},
- data() {
- return {
- files: [],
- collections: [],
- recipient_group: null,
- recipient_groups: [],
- tags: [],
- file_collection: 1,
- file_ref: null,
- progressMode: 'determinate',
- csrf: document.querySelectorAll('meta[name="csrf-token"]')[0].content,
- status: 'start',
- error: '',
- links: [],
- file_ready: false,
- repeaterFields: [
- {
- name:'headline-repeater',
- value: ''
- }
- ]
- }
+ nextRef: function () {
+ return this.getNextRef(this.file_collection);
},
- computed: {
- uploadedFile: function(){
- return (this.files.length > 0) ? this.files[0] : null;
- },
- nextRef: function(){
- return this.getNextRef(this.file_collection);
- },
-
-
- fileValid: function() {
- if(this.files.length < 1)
- return;
-
- return this.checkFileValid(this.files[0]);
- },
- fileSize: function(){
- if(this.files.length < 1)
- return "No file";
- return this.humanFileSize(this.files[0].size)
- },
- file_data: function() {
- return {
- collection_id: this.file_collection,
- ref: this.file_ref,
- tags: this.tags,
- headlines: JSON.stringify(this.lodash.map(this.repeaterFields, 'value')),
- }
- }
- },
- watch: {
- file_ref: function(value){
- if(value.length > 0) {
- $('#file_ref').addClass('is-valid').removeClass('is-invalid')
- } else {
- this.status = "start";
- $('#file_ref').addClass('is-invalid').removeClass('is-valid')
- }
+ fileValid: function () {
+ if (this.files.length < 1)
+ return;
- },
- uploadedFile: function(file){
- if (file.success){
- this.progressMode = 'indeterminate';
+ return this.checkFileValid(this.files[0]);
+ },
+ fileSize: function () {
+ if (this.files.length < 1)
+ return "No file";
+ return this.humanFileSize(this.files[0].size)
+ },
+ file_data: function () {
+ return {
+ collection_id: this.file_collection,
+ ref: this.file_ref,
+ //tags: this.tags,
+ headlines: JSON.stringify(this.lodash.map(this.repeaterFields, 'value')),
+ }
+ }
+ },
+ watch: {
+ file_ref: function (value) {
+ if (value.length > 0) {
+ $('#file_ref').addClass('is-valid').removeClass('is-invalid')
+ } else {
+ this.status = "start";
+ $('#file_ref').addClass('is-invalid').removeClass('is-valid')
- }
- },
- file_collection: function(collection) {
- this.file_ref = this.getNextRef(collection);
+ }
- },
- recipient_group: function(val, old) {
- this.$root.publishState.recipient_group = val
- },
+ },
+ uploadedFile: function (file) {
+ if (file.success) {
+ this.progressMode = 'indeterminate';
+ }
},
- methods: {
- processStatusUpdate(e){
- e = e.data;
+ file_collection: function (collection) {
+ //this.file_ref = this.getNextRef(collection);
- if(e.status === 'done'){
- this.progressMode = 'determinate';
+ },
+ recipient_group: function (val, old) {
+ this.$root.publishState.recipient_group = val
+ },
- axios.get('/publish/file/'+e.data.file_id).then(data => {
+ },
+ methods: {
+ processStatusUpdate(e) {
+ e = e.data;
- this.$root.publishState.file = data.data.file;
- this.links = data.data.links;
- this.$root.publishState.file.coverUrl += "?v="+Date.now()
+ if (e.status === 'done') {
+ this.progressMode = 'determinate';
- this.status = 'done';
- this.$emit('can-continue', {value: true});
- })
+ axios.get('/publish/file/' + e.data.file_id).then(data => {
- }
+ this.$root.publishState.file = data.data.file;
+ this.links = data.data.links;
+ this.$root.publishState.file.coverUrl += "?v=" + Date.now()
- if(e.status === 'failed') {
- this.progressMode = 'determinate';
- this.status = 'error';
- this.error = e.data.error;
- console.error(e.data.error)
+ this.status = 'done';
+ this.$emit('can-continue', {value: true});
+ })
- }
+ }
+ if (e.status === 'failed') {
+ this.progressMode = 'determinate';
+ this.status = 'error';
+ this.error = e.data.error;
+ console.error(e.data.error)
- },
+ }
- getNextRef(collection_id) {
- let collection = this.collections.find(c => c.id === collection_id);
- if(collection === undefined)
- return null;
- let lastRef = (collection.files[0] === null) ?
- "0" :
- collection.files[0].ref;
+ },
- return lastRef.replace(/(\d+)+/g, function(match, number) {
- return parseInt(number)+1;
- });
+ getNextRef(collection_id) {
+ let collection = this.collections.find(c => c.id === collection_id);
+ if (collection === undefined)
+ return null;
- },
+ let lastRef = (collection.files[0] === null) ?
+ "0" :
+ collection.files[0].ref;
- checkFileValid(file) {
- return file.type === 'application/pdf';
- },
+ return lastRef.replace(/(\d+)+/g, function (match, number) {
+ return parseInt(number) + 1;
+ });
- inputFile(newFile, oldFile) {
- if (
- newFile &&
- (Boolean(newFile) !== Boolean(oldFile) || oldFile.error !== newFile.error)
- && !this.$refs.upload.active
- && this.checkFileValid(newFile)
- ) {
- this.status = 'ready';
- }
+ },
- if(newFile && newFile.success === true) {
- this.status = 'processing';
- }
- },
+ checkFileValid(file) {
+ return file.type === 'application/pdf';
+ },
- upload(){
- this.status = 'uploading';
- this.$refs.upload.active = true;
+ inputFile(newFile, oldFile) {
+ if (
+ newFile &&
+ (Boolean(newFile) !== Boolean(oldFile) || oldFile.error !== newFile.error)
+ && !this.$refs.upload.active
+ && this.checkFileValid(newFile)
+ ) {
+ this.status = 'ready';
+ }
- },
- humanFileSize(size) {
- if(size <= 0) {
- return 'Empty file';
- }
- let i = Math.floor( Math.log(size) / Math.log(1024) );
- return ( size / Math.pow(1024, i) ).toFixed(2) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i];
+ if (newFile && newFile.success === true) {
+ this.status = 'processing';
}
},
- mounted() {
- Echo.private(`fileProcessingStatus`)
- .listen('.status.update', this.processStatusUpdate)
-
- axios.get('/publish/collections').then(d => {
- this.collections = d.data.data;
- this.file_ref = this.getNextRef(1);
- });
-
- axios.get('/publish/recipient-groups').then(d => {
- this.recipient_groups = d.data
- this.recipient_group = this.recipient_groups.letter
- });
-
-
+ upload() {
+ this.status = 'uploading';
+ this.$refs.upload.active = true;
- axios.get('/publish/tags').then(d => {
- let tags = d.data.data;
-
- $("#file_tags").selectize({
- placeholder: 'Mots-clés pour la recherche',
- persist: false,
- createOnBlur: true,
- create: true,
- options: tags,
- plugins: ['remove_button'],
- onChange: (v) => this.tags = v
- });
-
- });
+ },
+ humanFileSize(size) {
+ if (size <= 0) {
+ return 'Empty file';
+ }
+ let i = Math.floor(Math.log(size) / Math.log(1024));
+ return (size / Math.pow(1024, i)).toFixed(2) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i];
}
+ },
+ mounted() {
+ Echo.private(`fileProcessingStatus`)
+ .listen('.status.update', this.processStatusUpdate)
+
+ axios.get('/publish/collections').then(d => {
+ this.collections = d.data.data;
+ //this.file_ref = this.getNextRef(1);
+ });
+
+ axios.get('/publish/recipient-groups').then(d => {
+ this.recipient_groups = d.data
+ this.recipient_group = this.recipient_groups.letter
+ });
+
+
+ // axios.get('/publish/tags').then(d => {
+ // let tags = d.data.data;
+ //
+ // $("#file_tags").selectize({
+ // placeholder: 'Mots-clés pour la recherche',
+ // persist: false,
+ // createOnBlur: true,
+ // create: true,
+ // options: tags,
+ // plugins: ['remove_button'],
+ // onChange: (v) => this.tags = v
+ // });
+ //
+ // });
}
+}
</script>
<style scoped>
- .repeater {
- margin-left: -18px;
- margin-right: -16px;
- margin-top: -20px;
- }
+.repeater {
+ margin-left: -18px;
+ margin-right: -16px;
+ margin-top: -20px;
+}
- a {
+a {
color: inherit !important;
- }
- a.btn {
- color: #fff !important;
- }
-
- .file-selected > div{
- margin-bottom: 2rem;
-
- }
- .file-upload label.btn {
- margin-bottom: 0;
- margin-right: 1rem;
- }
- .file-upload .drop-active {
- top: 0;
- bottom: 0;
- right: 0;
- left: 0;
- position: fixed;
- z-index: 9999;
- opacity: .6;
- text-align: center;
- background: #000;
- }
- .file-upload .drop-active h3 {
- margin: -.5em 0 0;
- position: absolute;
- top: 50%;
- left: 0;
- right: 0;
- -webkit-transform: translateY(-50%);
- -ms-transform: translateY(-50%);
- transform: translateY(-50%);
- font-size: 40px;
- color: #fff;
- padding: 0;
- }
-
+}
+
+a.btn {
+ color: #fff !important;
+}
+
+.file-selected > div {
+ margin-bottom: 2rem;
+
+}
+
+.file-upload label.btn {
+ margin-bottom: 0;
+ margin-right: 1rem;
+}
+
+.file-upload .drop-active {
+ top: 0;
+ bottom: 0;
+ right: 0;
+ left: 0;
+ position: fixed;
+ z-index: 9999;
+ opacity: .6;
+ text-align: center;
+ background: #000;
+}
+
+.file-upload .drop-active h3 {
+ margin: -.5em 0 0;
+ position: absolute;
+ top: 50%;
+ left: 0;
+ right: 0;
+ -webkit-transform: translateY(-50%);
+ -ms-transform: translateY(-50%);
+ transform: translateY(-50%);
+ font-size: 40px;
+ color: #fff;
+ padding: 0;
+}
</style>