bulk-tag.html (5047B)
1 {{template "_header" .}} 2 <h1>{{.Title}}</h1> 3 {{if .Data.Error}} 4 <div class="alert alert-danger"> 5 <strong>Error:</strong> {{.Data.Error}} 6 </div> 7 {{end}} 8 {{if .Data.Success}} 9 <div class="alert alert-success"> 10 <strong>Success:</strong> {{.Data.Success}} 11 </div> 12 {{end}} 13 14 <div style="display: flex; gap: 30px; align-items: flex-start;"> 15 16 <div style="flex: 0 0 auto;"> 17 18 <form method="POST"> 19 <div class="form-section"> 20 <h3>Select Files</h3> 21 <div class="form-group"> 22 <label>Selection Method:</label> 23 <div class="radio-group"> 24 <label> 25 <input type="radio" name="selection_mode" value="range" 26 {{if or (eq .Data.FormData.SelectionMode "range") (eq .Data.FormData.SelectionMode "")}}checked{{end}} 27 onchange="toggleSelectionMode()"> 28 By File ID Range 29 </label><br> 30 <label> 31 <input type="radio" name="selection_mode" value="tags" 32 {{if eq .Data.FormData.SelectionMode "tags"}}checked{{end}} 33 onchange="toggleSelectionMode()"> 34 By Tag Query 35 </label> 36 </div> 37 </div> 38 39 <div id="range-selection" class="form-group"> 40 <label for="file_range">File ID Range:</label> 41 <input type="text" id="file_range" name="file_range" 42 placeholder="e.g., 1-5,8,10-12" value="{{.Data.FormData.FileRange}}"> 43 <div class="help-text"> 44 Specify file IDs to tag. Use ranges (1-5) and individual IDs (8) separated by commas. 45 </div> 46 </div> 47 48 <div id="tag-selection" class="form-group" style="display: none;"> 49 <label for="tag_query">Tag Query:</label> 50 <input type="text" id="tag_query" name="tag_query" 51 placeholder="e.g., colour:blue or colour:blue,size:large" value="{{.Data.FormData.TagQuery}}"> 52 <div class="help-text"> 53 <strong>Examples:</strong><br> 54 • <code>colour:blue</code> - Files with this exact tag<br> 55 • <code>colour:blue,size:large</code> - Files with BOTH tags (AND)<br> 56 • <code>colour:blue OR colour:red</code> - Files with EITHER tag (OR) 57 </div> 58 </div> 59 </div> 60 61 <div class="form-section"> 62 <h3>Tag Operation</h3> 63 <div class="form-group"> 64 <label for="category">Category:</label> 65 <input type="text" id="category" name="category" list="categories" value="{{.Data.FormData.Category}}" required> 66 <datalist id="categories"> 67 {{range .Data.Categories}} 68 <option value="{{.}}"> 69 {{end}} 70 </datalist> 71 <div class="help-text">Choose an existing category or create a new one.</div> 72 </div> 73 <div class="form-group"> 74 <label for="value">Value:</label> 75 <input type="text" id="value" name="value" value="{{.Data.FormData.Value}}"> 76 <div class="help-text"> 77 The tag value to add or remove. <strong>Leave empty when removing to delete all values in the category.</strong> 78 </div> 79 </div> 80 <div class="form-group"> 81 <label>Operation:</label> 82 <div class="radio-group"> 83 <label> 84 <input type="radio" name="operation" value="add" {{if eq .Data.FormData.Operation "add"}}checked{{end}}> 85 Add tag to selected files 86 </label><br> 87 <label> 88 <input type="radio" name="operation" value="remove" {{if eq .Data.FormData.Operation "remove"}}checked{{end}}> 89 Remove tag(s) from selected files 90 </label> 91 </div> 92 <div class="help-text"> 93 When removing: specify a value to remove just that tag, or leave value empty to remove all tags in the category. 94 </div> 95 </div> 96 </div> 97 <button type="submit" class="text-button">Apply Tags</button> 98 </form> 99 100 </div> 101 102 {{template "_recent" .}} 103 104 <script src="/static/bulk-tag.js" defer></script> 105 106 </div> 107 108 {{template "_footer"}}