Merge branch 'ui-improvements-backup' into 'main'
UI improvements: collapsible schedule menu and fix double extensions See merge request engineering/unturf/upload.unturf.com!9
This commit is contained in:
commit
9a6734186c
3 changed files with 38 additions and 14 deletions
18
CLAUDE.md
Normal file
18
CLAUDE.md
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
# Project Instructions for Claude
|
||||||
|
|
||||||
|
## Commit Message Format
|
||||||
|
|
||||||
|
Never include Claude attribution in commit messages. Always end commit messages with:
|
||||||
|
|
||||||
|
russell@unturf.com is the boss
|
||||||
|
|
||||||
|
## Example Commit Message
|
||||||
|
|
||||||
|
```
|
||||||
|
Fix download filename double extensions
|
||||||
|
|
||||||
|
- Prevent .zip.zip and similar double extensions
|
||||||
|
- Check if title already contains extension before appending
|
||||||
|
|
||||||
|
russell@unturf.com is the boss
|
||||||
|
```
|
||||||
4
app.py
4
app.py
|
|
@ -1816,9 +1816,13 @@ def view_media_view(request):
|
||||||
if media.title:
|
if media.title:
|
||||||
file_extension = os.path.splitext(media.filename)[1]
|
file_extension = os.path.splitext(media.filename)[1]
|
||||||
raw_title = media.title
|
raw_title = media.title
|
||||||
|
# Check if title already ends with the file extension to avoid doubling
|
||||||
|
if file_extension and not raw_title.lower().endswith(file_extension.lower()):
|
||||||
download_filename = sanitize_filename_for_http_header(
|
download_filename = sanitize_filename_for_http_header(
|
||||||
f"{raw_title}{file_extension}"
|
f"{raw_title}{file_extension}"
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
download_filename = sanitize_filename_for_http_header(raw_title)
|
||||||
else:
|
else:
|
||||||
download_filename = sanitize_filename_for_http_header(media.filename)
|
download_filename = sanitize_filename_for_http_header(media.filename)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,9 @@
|
||||||
</label>
|
</label>
|
||||||
</fieldset><br>
|
</fieldset><br>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Scheduled Actions (Optional)</summary>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Scheduled Actions (Optional)</legend>
|
|
||||||
<label for="scheduled_public">Schedule to become Public:</label>
|
<label for="scheduled_public">Schedule to become Public:</label>
|
||||||
<input type="datetime-local" name="scheduled_public"><br><br>
|
<input type="datetime-local" name="scheduled_public"><br><br>
|
||||||
|
|
||||||
|
|
@ -44,6 +45,7 @@
|
||||||
<label for="scheduled_delete">Schedule for Deletion:</label>
|
<label for="scheduled_delete">Schedule for Deletion:</label>
|
||||||
<input type="datetime-local" name="scheduled_delete"><br><br>
|
<input type="datetime-local" name="scheduled_delete"><br><br>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
</details>
|
||||||
|
|
||||||
<button type="submit">Upload</button>
|
<button type="submit">Upload</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue