Spaces:
Running
Running
t
Claude Opus 4.6
commited on
Commit
·
579fd4f
1
Parent(s):
a90d76a
fix: drive copy link uses download URL, exclude neetprep when tags selected
Browse files- Fix createFileRow JS function to set rawLink for API files
- When tags are selected in NeetPrep quiz, exclude untagged NeetPrep questions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- neetprep.py +2 -1
- templates/drive_browser.html +6 -2
neetprep.py
CHANGED
|
@@ -338,7 +338,8 @@ def generate_neetprep_pdf():
|
|
| 338 |
conn = get_db_connection()
|
| 339 |
all_questions = []
|
| 340 |
|
| 341 |
-
|
|
|
|
| 342 |
include_classified = source_filter in ['all', 'classified']
|
| 343 |
|
| 344 |
# Fetch NeetPrep questions if enabled and filter allows
|
|
|
|
| 338 |
conn = get_db_connection()
|
| 339 |
all_questions = []
|
| 340 |
|
| 341 |
+
# Don't include NeetPrep questions when tags are selected (they are untagged by default)
|
| 342 |
+
include_neetprep = source_filter in ['all', 'neetprep'] and current_user.neetprep_enabled and not filter_tags
|
| 343 |
include_classified = source_filter in ['all', 'classified']
|
| 344 |
|
| 345 |
# Fetch NeetPrep questions if enabled and filter allows
|
templates/drive_browser.html
CHANGED
|
@@ -745,6 +745,10 @@
|
|
| 745 |
|
| 746 |
if (CONFIG.isApi) {
|
| 747 |
link = item.type === 'folder' ? `/drive/api/browse/${item.path}` : `/drive/api/open/${item.path}`;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 748 |
if (item.type === 'slides') googleLink = `https://docs.google.com/presentation/d/${item.path}/edit`;
|
| 749 |
else if (item.type === 'sheet') googleLink = `https://docs.google.com/spreadsheets/d/${item.path}/edit`;
|
| 750 |
else if (item.type === 'doc') googleLink = `https://docs.google.com/document/d/${item.path}/edit`;
|
|
@@ -758,8 +762,8 @@
|
|
| 758 |
let actionsHtml = '';
|
| 759 |
if (item.type !== 'folder') {
|
| 760 |
actionsHtml = '<div class="file-actions">';
|
| 761 |
-
if (rawLink
|
| 762 |
-
actionsHtml += `<button class="action-btn-sm" onclick="event.stopPropagation(); copyFileLink('${rawLink
|
| 763 |
}
|
| 764 |
if (googleLink) {
|
| 765 |
actionsHtml += `<a href="${googleLink}" target="_blank" class="action-btn-sm google-btn" onclick="event.stopPropagation()" title="Open in Google"><i class="bi bi-google"></i></a>`;
|
|
|
|
| 745 |
|
| 746 |
if (CONFIG.isApi) {
|
| 747 |
link = item.type === 'folder' ? `/drive/api/browse/${item.path}` : `/drive/api/open/${item.path}`;
|
| 748 |
+
// For API files, use download endpoint for copy link
|
| 749 |
+
if (item.type !== 'folder' && !['slides', 'sheet', 'doc', 'video'].includes(item.type)) {
|
| 750 |
+
rawLink = `/drive/api/download/${item.path}`;
|
| 751 |
+
}
|
| 752 |
if (item.type === 'slides') googleLink = `https://docs.google.com/presentation/d/${item.path}/edit`;
|
| 753 |
else if (item.type === 'sheet') googleLink = `https://docs.google.com/spreadsheets/d/${item.path}/edit`;
|
| 754 |
else if (item.type === 'doc') googleLink = `https://docs.google.com/document/d/${item.path}/edit`;
|
|
|
|
| 762 |
let actionsHtml = '';
|
| 763 |
if (item.type !== 'folder') {
|
| 764 |
actionsHtml = '<div class="file-actions">';
|
| 765 |
+
if (rawLink) {
|
| 766 |
+
actionsHtml += `<button class="action-btn-sm" onclick="event.stopPropagation(); copyFileLink('${rawLink}', this)" title="Copy download link"><i class="bi bi-link-45deg"></i></button>`;
|
| 767 |
}
|
| 768 |
if (googleLink) {
|
| 769 |
actionsHtml += `<a href="${googleLink}" target="_blank" class="action-btn-sm google-btn" onclick="event.stopPropagation()" title="Open in Google"><i class="bi bi-google"></i></a>`;
|