Support /meeting path alongside /survey and root paths
This commit is contained in:
+3
-3
@@ -76,7 +76,7 @@ function renderEditor() {
|
||||
<input type="hidden" id="edit-survey-cert-template-path" value="${escapeHtml(currentSurvey.certificate_template || '')}">
|
||||
|
||||
<div id="cert-preview-wrapper" style="margin-top:12px; display:${currentSurvey.certificate_template ? 'block' : 'none'};">
|
||||
<img id="cert-template-preview" src="${currentSurvey.certificate_template ? (window.location.pathname.includes('/survey') ? '/survey/' : '/') + currentSurvey.certificate_template : ''}" style="max-height:140px; width:auto; border-radius:8px; border:1px solid var(--border-color); box-shadow:var(--shadow-sm);">
|
||||
<img id="cert-template-preview" src="${currentSurvey.certificate_template ? getAppBasePath() + '/' + currentSurvey.certificate_template : ''}" style="max-height:140px; width:auto; border-radius:8px; border:1px solid var(--border-color); box-shadow:var(--shadow-sm);">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -479,7 +479,7 @@ function closeEditor() {
|
||||
|
||||
function previewSurvey() {
|
||||
if (!currentSurvey) return;
|
||||
const basePath = window.location.pathname.includes('/survey') ? '/survey' : '';
|
||||
const basePath = getAppBasePath();
|
||||
window.open(`${basePath}/respond.php?link=${currentSurvey.unique_link}`, '_blank');
|
||||
}
|
||||
|
||||
@@ -519,7 +519,7 @@ async function uploadCertTemplate(input) {
|
||||
formData.append('template_image', file);
|
||||
|
||||
try {
|
||||
const basePath = window.location.pathname.includes('/survey') ? '/survey' : '';
|
||||
const basePath = getAppBasePath();
|
||||
const res = await fetch(`${basePath}/api/surveys.php?action=uploadTemplate`, {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
|
||||
Reference in New Issue
Block a user