91 lines
2.6 KiB
HTML
91 lines
2.6 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Markdown Viewer</title>
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/digitallytailored/classless@latest/classless.min.css">
|
|
<style>
|
|
.file-list {
|
|
margin: 2em 0;
|
|
}
|
|
.file-item {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 0.75em;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
.file-item:hover {
|
|
background-color: #f9f9f9;
|
|
}
|
|
.file-link {
|
|
font-weight: bold;
|
|
text-decoration: none;
|
|
}
|
|
.file-uri {
|
|
color: #666;
|
|
font-size: 0.9em;
|
|
}
|
|
.copy-button {
|
|
background: #f0f0f0;
|
|
border: 1px solid #ddd;
|
|
padding: 0.25em 0.5em;
|
|
border-radius: 4px;
|
|
cursor: pointer;
|
|
font-size: 0.8em;
|
|
}
|
|
.empty-state {
|
|
text-align: center;
|
|
padding: 3em;
|
|
background-color: #f9f9f9;
|
|
border-radius: 4px;
|
|
margin: 2em 0;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Markdown Viewer</h1>
|
|
|
|
<div class="actions">
|
|
<a href="{{ url_for('main.upload_file') }}" class="button">Upload New Document</a>
|
|
</div>
|
|
|
|
{% if documents %}
|
|
<div class="file-list">
|
|
<h2>Available Documents</h2>
|
|
|
|
{% for doc in documents %}
|
|
<div class="file-item">
|
|
<div>
|
|
<a href="{{ url_for('main.view_file', uri=doc.uri) }}" class="file-link">
|
|
{{ doc.filename }}
|
|
</a>
|
|
<span class="file-uri">URI: {{ doc.uri }}</span>
|
|
</div>
|
|
<div>
|
|
<a href="{{ url_for('main.view_file', uri=doc.uri) }}" class="button">View</a>
|
|
<button class="copy-button" onclick="copyToClipboard('{{ url_for('main.view_file', uri=doc.uri, _external=True) }}')">
|
|
Copy Link
|
|
</button>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<div class="empty-state">
|
|
<h3>No documents available</h3>
|
|
<p>Upload a markdown file to get started!</p>
|
|
<a href="{{ url_for('main.upload_file') }}" class="button">Upload Now</a>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<script>
|
|
function copyToClipboard(text) {
|
|
navigator.clipboard.writeText(text).then(function() {
|
|
alert('Link copied to clipboard!');
|
|
}, function() {
|
|
alert('Failed to copy link');
|
|
});
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|