taggart

Simple golang tagging filesystem webapp
Log | Files | Refs

bulk-tag.html (3563B)


      1 {{template "_header" .}}
      2 
      3 
      4         <h1>{{.Title}}</h1>
      5 
      6         {{if .Data.Error}}
      7         <div class="alert alert-danger">
      8             <strong>Error:</strong> {{.Data.Error}}
      9         </div>
     10         {{end}}
     11 
     12         {{if .Data.Success}}
     13         <div class="alert alert-success">
     14             <strong>Success:</strong> {{.Data.Success}}
     15         </div>
     16         {{end}}
     17 
     18         <form method="POST">
     19             <div class="form-section">
     20                 <h3>Select Files</h3>
     21 
     22                 <div class="form-group">
     23                     <label for="file_range">File ID Range:</label>
     24                     <input type="text" id="file_range" name="file_range"
     25                            placeholder="e.g., 1-5,8,10-12" value="{{.Data.FormData.FileRange}}" required>
     26                     <div class="help-text">
     27                         Specify file IDs to tag. Use ranges (1-5) and individual IDs (8) separated by commas.
     28                     </div>
     29                 </div>
     30             </div>
     31 
     32             <div class="form-section">
     33                 <h3>Tag Operation</h3>
     34 
     35                 <div class="form-group">
     36                     <label for="category">Category:</label>
     37                     <input type="text" id="category" name="category" list="categories" value="{{.Data.FormData.Category}}" required>
     38                     <datalist id="categories">
     39                         {{range .Data.Categories}}
     40                         <option value="{{.}}">
     41                         {{end}}
     42                     </datalist>
     43                     <div class="help-text">Choose an existing category or create a new one.</div>
     44                 </div>
     45 
     46                 <div class="form-group">
     47                     <label for="value">Value:</label>
     48                     <input type="text" id="value" name="value" value="{{.Data.FormData.Value}}">
     49                     <div class="help-text">
     50                         The tag value to add or remove. <strong>Leave empty when removing to delete all values in the category.</strong>
     51                     </div>
     52                 </div>
     53 
     54                 <div class="form-group">
     55                     <label>Operation:</label>
     56                     <div class="radio-group">
     57                         <label>
     58                             <input type="radio" name="operation" value="add" {{if eq .Data.FormData.Operation "add"}}checked{{end}}>
     59                             Add tag to selected files
     60                         </label>
     61                         <label>
     62                             <input type="radio" name="operation" value="remove" {{if eq .Data.FormData.Operation "remove"}}checked{{end}}>
     63                             Remove tag(s) from selected files
     64                         </label>
     65                     </div>
     66                     <div class="help-text">
     67                         When removing: specify a value to remove just that tag, or leave value empty to remove all tags in the category.
     68                     </div>
     69                 </div>
     70             </div>
     71 
     72             <button type="submit" class="btn">Apply Tags</button>
     73         </form>
     74 
     75 		<br>
     76 		<details><summary>Recent Files (for reference)</summary>
     77                 {{range .Data.RecentFiles}}
     78                 <div class="file-item">
     79                     <span class="file-id">ID {{.ID}}:</span> <a href="/file/{{.ID}}" title="{{.Filename}}">{{.Filename}}</a>
     80                 </div>
     81                 {{else}}
     82                 <div class="file-item">No files found</div>
     83                 {{end}}
     84 		</details>
     85 
     86     <script src="/static/bulk-tag.js" defer></script>
     87 {{template "_footer"}}