Adapt manual message upload to vue

This commit is contained in:
2025-05-12 19:48:49 +02:00
parent ea14a1ef3e
commit b9a4bd6d2d
7 changed files with 60 additions and 38 deletions

21
composer.lock generated
View File

@@ -12,7 +12,7 @@
"dist": { "dist": {
"type": "path", "type": "path",
"url": "../objects", "url": "../objects",
"reference": "a9f8601384a0078cf8531576768e2c5bad4bbf95" "reference": "bcae723140735b1432caaf3070ef4e29ecb73a76"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@@ -27,16 +27,16 @@
}, },
{ {
"name": "phpmailer/phpmailer", "name": "phpmailer/phpmailer",
"version": "v6.8.1", "version": "v6.10.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git", "url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "e88da8d679acc3824ff231fdc553565b802ac016" "reference": "bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e88da8d679acc3824ff231fdc553565b802ac016", "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144",
"reference": "e88da8d679acc3824ff231fdc553565b802ac016", "reference": "bf74d75a1fde6beaa34a0ddae2ec5fce0f72a144",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -56,6 +56,7 @@
"yoast/phpunit-polyfills": "^1.0.4" "yoast/phpunit-polyfills": "^1.0.4"
}, },
"suggest": { "suggest": {
"decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication",
"ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
"ext-openssl": "Needed for secure SMTP sending and DKIM signing", "ext-openssl": "Needed for secure SMTP sending and DKIM signing",
"greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication",
@@ -95,7 +96,7 @@
"description": "PHPMailer is a full-featured email creation and transfer class for PHP", "description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"support": { "support": {
"issues": "https://github.com/PHPMailer/PHPMailer/issues", "issues": "https://github.com/PHPMailer/PHPMailer/issues",
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.8.1" "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.10.0"
}, },
"funding": [ "funding": [
{ {
@@ -103,7 +104,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-08-29T08:26:30+00:00" "time": "2025-04-24T15:19:31+00:00"
} }
], ],
"packages-dev": [], "packages-dev": [],
@@ -114,7 +115,7 @@
}, },
"prefer-stable": false, "prefer-stable": false,
"prefer-lowest": false, "prefer-lowest": false,
"platform": [], "platform": {},
"platform-dev": [], "platform-dev": {},
"plugin-api-version": "2.3.0" "plugin-api-version": "2.6.0"
} }

View File

@@ -24,6 +24,7 @@ upload_title = Picture & Video Uploads
upload_mode_archived= Project "$0" is archived. No upload allowed upload_mode_archived= Project "$0" is archived. No upload allowed
upload_success = $0 uploaded successfully upload_success = $0 uploaded successfully
upload_media_exist = Picture $0 already exists upload_media_exist = Picture $0 already exists
new_position = New Position
post_message = Message post_message = Message
post_name = Name post_name = Name

View File

@@ -24,6 +24,7 @@ upload_title = Cargar fotos y videos
upload_mode_archived= El proyecto "$0" esta archivado. No se puede cargar upload_mode_archived= El proyecto "$0" esta archivado. No se puede cargar
upload_success = $0 ha sido subido upload_success = $0 ha sido subido
upload_media_exist = La imagen $0 ya existe upload_media_exist = La imagen $0 ya existe
new_position = Nueva posición
post_message = Mensaje post_message = Mensaje
post_name = Nombre post_name = Nombre

View File

@@ -24,6 +24,7 @@ upload_title = Uploader photos & vidéos
upload_mode_archived= Le projet "$0" a été archivé. Aucun upload possible upload_mode_archived= Le projet "$0" a été archivé. Aucun upload possible
upload_success = $0 a été uploadé upload_success = $0 a été uploadé
upload_media_exist = l'image $0 existe déjà upload_media_exist = l'image $0 existe déjà
new_position = Nouvelle position
post_message = Message post_message = Message
post_name = Nom post_name = Nom

View File

@@ -1,9 +1,11 @@
<script> <script>
import SpotIcon from './spotIcon.vue';
import SpotButton from './spotButton.vue'; import SpotButton from './spotButton.vue';
import AdminInput from './adminInput.vue'; import AdminInput from './adminInput.vue';
export default { export default {
components: { components: {
SpotIcon,
SpotButton, SpotButton,
AdminInput AdminInput
}, },
@@ -117,7 +119,7 @@ export default {
</script> </script>
<template> <template>
<div id="admin"> <div id="admin">
<a name="back" class="button" href="#project"><i class="fa fa-back push"></i>{{ l('nav_back') }}</a> <a name="back" class="button" href="#project"><SpotIcon :icon="'back'" :text="l('nav_back')" /></a>
<h1>{{ l('projects') }}</h1> <h1>{{ l('projects') }}</h1>
<div id="project_section"> <div id="project_section">
<table> <table>

View File

@@ -1,4 +1,5 @@
<script> <script>
import SpotIcon from './spotIcon.vue';
import SpotButton from './spotButton.vue'; import SpotButton from './spotButton.vue';
import "blueimp-file-upload/js/vendor/jquery.ui.widget.js"; import "blueimp-file-upload/js/vendor/jquery.ui.widget.js";
import "blueimp-file-upload/js/jquery.iframe-transport.js"; import "blueimp-file-upload/js/jquery.iframe-transport.js";
@@ -6,7 +7,7 @@ import "blueimp-file-upload/js/jquery.fileupload.js";
export default { export default {
name: 'upload', name: 'upload',
components: { SpotButton }, components: { SpotButton, SpotIcon },
inject: ['spot', 'projects', 'consts', 'user'], inject: ['spot', 'projects', 'consts', 'user'],
data() { data() {
return { return {
@@ -49,20 +50,39 @@ export default {
this.spot.get2('add_comment', {id: oFile.id, content: oFile.content}) this.spot.get2('add_comment', {id: oFile.id, content: oFile.content})
.then((asData) => {this.logs.push(this.spot.lang('media_comment_update', asData.filename));}) .then((asData) => {this.logs.push(this.spot.lang('media_comment_update', asData.filename));})
.catch((sMsgId) => {this.logs.push(this.spot.lang(sMsgId));}); .catch((sMsgId) => {this.logs.push(this.spot.lang(sMsgId));});
},
addPosition() {
if(navigator.geolocation) {
this.logs.push('Determining position...');
navigator.geolocation.getCurrentPosition(
(position) => {
this.logs.push('Sending position...');
this.spot.get2('add_position', {'latitude':position.coords.latitude, 'longitude':position.coords.longitude, 'timestamp':Math.round(position.timestamp / 1000)})
.then((asData) => {this.logs.push('Position sent');})
.catch((sMsgId) => {this.logs.push(self.lang(sMsgId));});
},
(error) => {
this.logs.push(error.message);
}
);
}
else this.logs.push('This browser does not support geolocation');
} }
} }
} }
</script> </script>
<template> <template>
<div id="upload"> <div id="upload">
<a name="back" class="button" href="#project"><i class="fa fa-back push"></i>{{ spot.lang('nav_back') }}</a> <a name="back" class="button" href="#project"><SpotIcon :icon="'back'" :text="spot.lang('nav_back')" /></a>
<h1>{{ spot.lang('upload_title') }}</h1> <h1>{{ spot.lang('upload_title') }}</h1>
<h2>{{ this.project.name }}</h2> <h2>{{ this.project.name }}</h2>
<input v-if="project.editable" id="fileupload" type="file" name="files[]" :data-url="this.spot.getActionLink('upload')" multiple> <div class="section" v-if="project.editable">
<div class="progress" v-if="progress > 0"> <input id="fileupload" type="file" name="files[]" :data-url="this.spot.getActionLink('upload')" multiple />
</div>
<div class="section progress" v-if="progress > 0">
<div class="bar" :style="{width:progress+'%'}"></div> <div class="bar" :style="{width:progress+'%'}"></div>
</div> </div>
<div class="comment" v-for="file in files"> <div class="section comment" v-for="file in files">
<img class="thumb" :src="file.thumbnail" /> <img class="thumb" :src="file.thumbnail" />
<div class="form"> <div class="form">
<input class="content" name="content" type="text" v-model="file.content" /> <input class="content" name="content" type="text" v-model="file.content" />
@@ -70,7 +90,10 @@ export default {
<SpotButton :classes="'save'" :icon="'save'" :text="spot.lang('save')" @click="addComment(file)" /> <SpotButton :classes="'save'" :icon="'save'" :text="spot.lang('save')" @click="addComment(file)" />
</div> </div>
</div> </div>
<div class="logs" v-if="logs.length > 0"> <div class="section location">
<SpotButton :icon="'message'" :text="spot.lang('new_position')" @click="addPosition()" />
</div>
<div class="section logs" v-if="logs.length > 0">
<p class="log" v-for="log in logs">{{ log }}.</p> <p class="log" v-for="log in logs">{{ log }}.</p>
</div> </div>
</div> </div>

View File

@@ -1,16 +1,14 @@
#upload { #upload {
padding: 1em; padding: 1em;
input[type="file"] { .section {
border: 1px solid #333;
border-radius: 3px; border-radius: 3px;
} margin-top: 1rem;
padding: 0 1rem 1rem 1rem;
border-bottom: 1px solid #EEE;
}
.progress { .progress {
margin: 1rem 0;
border: 1px solid #333;
border-radius: 3px;
.bar { .bar {
height: 18px; height: 18px;
background: green; background: green;
@@ -18,8 +16,6 @@
} }
.comment { .comment {
margin-top: 1em;
.thumb { .thumb {
width: 30%; width: 30%;
max-width: 100px; max-width: 100px;
@@ -27,30 +23,27 @@
.form { .form {
display: inline-block; display: inline-block;
width: calc(70% - 1em); width: calc(70% - 2rem);
min-width: calc(100% - 100px - 1em); min-width: calc(100% - 100px - 2rem);
margin-left: 1em; padding: 1rem;
vertical-align: top; vertical-align: top;
box-sizing: border-box;
.content { .content {
width: 100%; width: calc(100% - 2rem);
box-sizing: border-box; box-sizing: border-box;
padding: 0.5em; padding: 0.5em;
border: 1px solid #333; background: #EEE;
border-radius: 3px;
} }
.save { .save {
margin-top: 1em; margin-top: 1rem;
padding: 0.5em; padding: 0.5em;
} }
} }
} }
.logs { .logs {
border: 1px solid #333;
border-radius: 3px;
margin-top: 1rem;
padding: 1rem; padding: 1rem;
p.log { p.log {