forked from jason/cpolis
		
	Allow uploading pictures when editing once rejected articles
This commit is contained in:
		@@ -18,8 +18,42 @@
 | 
			
		||||
        {{end}}
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div id="editor-images">
 | 
			
		||||
        <input name="article-image" type="file" hx-encoding="multipart/form-data" hx-post="/upload-image/"
 | 
			
		||||
            hx-swap="beforeend" hx-target="#editor-images" />
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <input type="submit" value="Senden" hx-post="/resubmit-article/" hx-target="#page-content" />
 | 
			
		||||
</form>
 | 
			
		||||
 | 
			
		||||
<button hx-get="/hub/" hx-target="#page-content">Zurück</button>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
    function copyToClipboard(text) {
 | 
			
		||||
        event.preventDefault(); // Get-Request verhindern
 | 
			
		||||
 | 
			
		||||
        var textarea = document.createElement("textarea");
 | 
			
		||||
        textarea.textContent = text;
 | 
			
		||||
        document.body.appendChild(textarea);
 | 
			
		||||
 | 
			
		||||
        textarea.select();
 | 
			
		||||
        try {
 | 
			
		||||
            document.execCommand('copy');
 | 
			
		||||
        } catch (err) {
 | 
			
		||||
            console.warn('Fehler beim Kopieren', err);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        document.body.removeChild(textarea);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
</script>
 | 
			
		||||
{{end}}
 | 
			
		||||
 | 
			
		||||
{{define "editor-images"}}
 | 
			
		||||
{{if gt (len .) 0}}
 | 
			
		||||
<div>
 | 
			
		||||
    {{.}}
 | 
			
		||||
    <button onclick="copyToClipboard('{{.}}')">Kopieren</button>
 | 
			
		||||
</div>
 | 
			
		||||
{{end}}
 | 
			
		||||
{{end}}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user